PhpStan fixes.
This commit is contained in:
parent
a1a037e7ac
commit
fe3dd94e75
|
@ -16,6 +16,9 @@ parameters:
|
|||
bootstrapFiles:
|
||||
- ./util/phpstan.php
|
||||
|
||||
scanDirectories:
|
||||
- ./vendor/zircote/swagger-php/src/Annotations
|
||||
|
||||
universalObjectCratesClasses:
|
||||
- App\Session\NamespaceInterface
|
||||
- App\View
|
||||
|
|
|
@ -7,7 +7,6 @@ namespace App\Console\Command;
|
|||
use App\Console\Application;
|
||||
use App\Environment;
|
||||
use App\Version;
|
||||
use Monolog\Logger;
|
||||
use OpenApi\Annotations\OpenApi;
|
||||
use OpenApi\Generator;
|
||||
use OpenApi\Util;
|
||||
|
@ -27,7 +26,7 @@ class GenerateApiDocsCommand extends CommandAbstract
|
|||
|
||||
public function __invoke(SymfonyStyle $io): int
|
||||
{
|
||||
$yaml = $this->generate()->toYaml();
|
||||
$yaml = $this->generate()?->toYaml();
|
||||
$yaml_path = $this->environment->getBaseDirectory() . '/web/static/api/openapi.yml';
|
||||
|
||||
file_put_contents($yaml_path, $yaml);
|
||||
|
@ -39,7 +38,7 @@ class GenerateApiDocsCommand extends CommandAbstract
|
|||
public function generate(
|
||||
bool $useCurrentVersion = false,
|
||||
string $apiBaseUrl = 'https://demo.azuracast.com/api'
|
||||
): OpenApi {
|
||||
): ?OpenApi {
|
||||
define('AZURACAST_API_URL', $apiBaseUrl);
|
||||
define('AZURACAST_API_NAME', 'AzuraCast Public Demo Server');
|
||||
define(
|
||||
|
@ -61,7 +60,7 @@ class GenerateApiDocsCommand extends CommandAbstract
|
|||
);
|
||||
|
||||
return Generator::scan($finder, [
|
||||
'logger' => $this->logger
|
||||
'logger' => $this->logger,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ class OpenApiAction
|
|||
(string)$request->getRouter()->fromHere(absolute: true)
|
||||
);
|
||||
|
||||
$yaml = $apiDocsCommand->generate(true, $apiBaseUrl)->toYaml();
|
||||
$yaml = $apiDocsCommand->generate(true, $apiBaseUrl)?->toYaml();
|
||||
|
||||
$response->getBody()->write($yaml);
|
||||
$response->getBody()->write($yaml ?? '');
|
||||
return $response->withHeader('Content-Type', 'text/x-yaml');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ class ServicesController
|
|||
public function frontendAction(
|
||||
ServerRequest $request,
|
||||
Response $response,
|
||||
$do = 'restart'
|
||||
string $do = 'restart'
|
||||
): ResponseInterface {
|
||||
$station = $request->getStation();
|
||||
$frontend = $request->getStationFrontend();
|
||||
|
@ -156,7 +156,7 @@ class ServicesController
|
|||
ServerRequest $request,
|
||||
Response $response,
|
||||
AutoDJ $autodj,
|
||||
$do = 'restart'
|
||||
string $do = 'restart'
|
||||
): ResponseInterface {
|
||||
$station = $request->getStation();
|
||||
$backend = $request->getStationBackend();
|
||||
|
|
Loading…
Reference in New Issue