yiisoft /
demo
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace App; |
||
| 6 | |||
| 7 | use OpenApi\Attributes as OA; |
||
|
0 ignored issues
–
show
|
|||
| 8 | use Psr\Http\Message\ResponseInterface; |
||
|
0 ignored issues
–
show
The type
Psr\Http\Message\ResponseInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 9 | use Yiisoft\DataResponse\DataResponseFactoryInterface; |
||
|
0 ignored issues
–
show
The type
Yiisoft\DataResponse\DataResponseFactoryInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 10 | |||
| 11 | #[OA\Info(version: '1.0', title: 'Yii API application')] |
||
| 12 | class InfoController |
||
| 13 | { |
||
| 14 | public function __construct(private VersionProvider $versionProvider) |
||
| 15 | { |
||
| 16 | } |
||
| 17 | |||
| 18 | #[OA\Get( |
||
| 19 | path: '/', |
||
| 20 | description: '', |
||
| 21 | summary: 'Returns info about the API', |
||
| 22 | responses: [ |
||
| 23 | new OA\Response( |
||
| 24 | response:'200', |
||
| 25 | description:'Success', |
||
| 26 | content: new OA\JsonContent( |
||
| 27 | allOf: [ |
||
| 28 | new OA\Schema(ref: '#/components/schemas/Response'), |
||
| 29 | new OA\Schema(properties: [ |
||
| 30 | new OA\Property(property: 'data', properties: [ |
||
| 31 | new OA\Property(property: 'version', type: 'string', example: '3.0'), |
||
| 32 | new OA\Property(property: 'author', type: 'string', example: 'yiisoft'), |
||
| 33 | ], type: 'object'), |
||
| 34 | ]), |
||
| 35 | ] |
||
| 36 | ), |
||
| 37 | ), |
||
| 38 | ] |
||
| 39 | )] |
||
| 40 | public function index(DataResponseFactoryInterface $responseFactory): ResponseInterface |
||
| 41 | { |
||
| 42 | return $responseFactory->createResponse(['version' => $this->versionProvider->version, 'author' => 'yiisoft']); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths