Skip to content

Commit

Permalink
Merge pull request #10 from KentarouTakeda/remove-unused-named-parameter
Browse files Browse the repository at this point in the history
refactor: remove unused named parameters
  • Loading branch information
KentarouTakeda authored Jan 1, 2024
2 parents d9c129b + 23f1a9f commit 0891966
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getProviderNames(): array
$providers = $this->repository->get('openapi-validator.providers');

if (!is_array($providers)) {
throw new InvalidConfigException(message: 'openapi-validator.providers must be an array');
throw new InvalidConfigException('openapi-validator.providers must be an array');
}

return array_keys($providers);
Expand All @@ -34,7 +34,7 @@ public function getDefaultProviderName(): string
$defaultProviderName = $this->repository->get('openapi-validator.default');

if (!is_string($defaultProviderName)) {
throw new InvalidConfigException(message: 'openapi-validator.default_provider must be a string');
throw new InvalidConfigException('openapi-validator.default_provider must be a string');
}

return $defaultProviderName;
Expand All @@ -48,11 +48,11 @@ public function getProviderSettings(string $providerName): array
$provider = $this->repository->get("openapi-validator.providers.{$providerName}");

if (!$provider) {
throw new InvalidConfigException(message: "Provider {$providerName} is not defined");
throw new InvalidConfigException("Provider {$providerName} is not defined");
}

if (!is_array($provider)) {
throw new InvalidConfigException(message: "Provider {$providerName} must be an array");
throw new InvalidConfigException("Provider {$providerName} must be an array");
}

return $provider;
Expand All @@ -63,7 +63,7 @@ public function getCacheDirectory(): string
$cacheDirectory = $this->repository->get('openapi-validator.cache_directory');

if (!is_string($cacheDirectory)) {
throw new InvalidConfigException(message: 'openapi-validator.cache_directory must be a string');
throw new InvalidConfigException('openapi-validator.cache_directory must be a string');
}

return $cacheDirectory;
Expand Down Expand Up @@ -106,7 +106,7 @@ public function getNonValidatedResponseCodes(): array
$codes = $this->repository->get('openapi-validator.non_validated_response_codes');

if (!is_array($codes)) {
throw new InvalidConfigException(message: 'openapi-validator.non_validated_response_codes must be an array');
throw new InvalidConfigException('openapi-validator.non_validated_response_codes must be an array');
}

return $codes;
Expand Down Expand Up @@ -139,7 +139,7 @@ private function getLogLevelString(mixed $logLevel): string
LogLevel::INFO,
LogLevel::DEBUG,
], true)) {
throw new InvalidConfigException(message: 'openapi-validator.log_level must be a valid LogLevel');
throw new InvalidConfigException('openapi-validator.log_level must be a valid LogLevel');
}

return $logLevel;
Expand Down
2 changes: 1 addition & 1 deletion src/SchemaRepository/L5SwaggerResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(
private readonly Filesystem $filesystem,
) {
if (!class_exists(GeneratorFactory::class)) {
throw new LackOfDependenciesException(message: 'L5Swagger is not installed.', class: GeneratorFactory::class);
throw new LackOfDependenciesException('L5Swagger is not installed.', class: GeneratorFactory::class);
}

$this->generatorFactory = app()->make(GeneratorFactory::class);
Expand Down
2 changes: 1 addition & 1 deletion src/SchemaRepository/LaravelOpenApiResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LaravelOpenApiResolver implements ResolverInterface
public function __construct(
) {
if (!class_exists(Generator::class)) {
throw new LackOfDependenciesException(message: 'Laravel OpenAPI is not installed.', class: Generator::class);
throw new LackOfDependenciesException('Laravel OpenAPI is not installed.', class: Generator::class);
}

$this->generator = app()->make(Generator::class);
Expand Down

0 comments on commit 0891966

Please sign in to comment.