Skip to content

Commit

Permalink
remove util method
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Feb 14, 2025
1 parent a21d28f commit 4a9ea3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/Describer/SecurityDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public function __construct(array $securitySchemes)
public function describe(OA\OpenApi $api): void
{
foreach ($this->securitySchemes as $name => $securityScheme) {
Util::getSecuritySchema($api, $name, $securityScheme);
Util::getCollectionItem(
$api->components,
OA\SecurityScheme::class,
$securityScheme + ['securityScheme' => $name],
);
}
}
}
9 changes: 0 additions & 9 deletions src/OpenApiPhp/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,6 @@ public static function getSchema(OA\OpenApi $api, string $schema): OA\Schema
return self::getIndexedCollectionItem($api->components, OA\Schema::class, $schema);
}

public static function getSecuritySchema(OA\OpenApi $api, string $name, array $properties = []): OA\SecurityScheme
{
if (!$api->components instanceof OA\Components) {
$api->components = new OA\Components(['_context' => self::createWeakContext($api->_context)]);
}

return self::getCollectionItem($api->components, OA\SecurityScheme::class, [...$properties, 'securityScheme' => $name]);
}

/**
* Return an existing Property object from $schema->properties[]
* having its member property set to $property.
Expand Down

0 comments on commit 4a9ea3e

Please sign in to comment.