Skip to content

Commit

Permalink
refactor: Remove dead code
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Nov 13, 2024
1 parent f2c728c commit cedea35
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
12 changes: 5 additions & 7 deletions generate-spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@

$tagNames = [];
if ($useTags) {
foreach ($routes as $scope => $scopeRoutes) {
foreach ($routes as $scopeRoutes) {
foreach ($scopeRoutes as $route) {
foreach ($route->tags as $tag) {
if (!in_array($tag, $tagNames)) {
Expand Down Expand Up @@ -766,9 +766,7 @@
if ($useTags) {
$operation['tags'] = $route->tags;
}
if (count($security) > 0) {
$operation['security'] = $security;
}
$operation['security'] = $security;

if (count($bodyParameters) > 0) {
$requiredBodyParameters = [];
Expand Down Expand Up @@ -952,9 +950,9 @@
$openapiScope['components']['schemas'] = $schemas;
} else {
$usedSchemas = [];
foreach ($paths as $url => $urlRoutes) {
foreach ($urlRoutes as $httpMethod => $routeData) {
foreach ($routeData['responses'] as $statusCode => $responseData) {
foreach ($paths as $urlRoutes) {
foreach ($urlRoutes as $routeData) {
foreach ($routeData['responses'] as $responseData) {
if (isset($responseData['content']) && $responseData['content'] !== []) {
$usedSchemas[] = Helpers::collectUsedRefs($responseData['content']);
}
Expand Down
1 change: 1 addition & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
->withSkipPath(__DIR__ . '/vendor')
->withPhpSets()
->withPreparedSets(
deadCode: true,
typeDeclarations: true,
strictBooleans: true,
);
2 changes: 0 additions & 2 deletions src/ResponseType.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ public static function getAll(): array {
}

/**
* @param string $context
* @param TypeNode $obj
* @return list<ControllerMethodResponse|null>
* @throws Exception
*/
Expand Down
2 changes: 0 additions & 2 deletions src/StatusCodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

class StatusCodes {
/**
* @param string $context
* @param ConstTypeNode|UnionTypeNode|Arg $type
* @return int[]
* @throws Exception
*/
Expand Down

0 comments on commit cedea35

Please sign in to comment.