Issues (26)

docs/examples/serialize-simple.php (2 issues)

Labels
Severity
1
<?php
2
3
// Please change the path to your autoload
4
include __DIR__.'/../../vendor/autoload.php';
5
include __DIR__.'/People.php';
6
7
use JSONAPI\Resource\Serializer;
0 ignored issues
show
The type JSONAPI\Resource\Serializer 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
$people = new People(1, 'Pavel Z', 31);
0 ignored issues
show
The type People 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
$serializer = new Serializer();
11
$data = $serializer->serialize($people);
12
13
echo json_encode(['data' => $data], JSON_PRETTY_PRINT);
14