api-platform / core
Showing 81 of 101 files from the diff.

@@ -77,7 +77,7 @@
Loading
77 77
        $data = $this->normalizer->normalize($this->openApiFactory->__invoke(), 'json');
78 78
        $content = $input->getOption('yaml')
79 79
            ? Yaml::dump($data, 10, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)
80 -
            : (json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ?: '');
80 +
            : (json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES) ?: '');
81 81
82 82
        $filename = $input->getOption('output');
83 83
        if ($filename && \is_string($filename)) {

@@ -26,7 +26,7 @@
Loading
26 26
{
27 27
    public function __construct()
28 28
    {
29 -
        @trigger_error(sprintf('The use of %s is deprecated since 2.1. Please use %s instead.', __CLASS__, UnderscorePathSegmentNameGenerator::class), E_USER_DEPRECATED);
29 +
        @trigger_error(sprintf('The use of %s is deprecated since 2.1. Please use %s instead.', __CLASS__, UnderscorePathSegmentNameGenerator::class), \E_USER_DEPRECATED);
30 30
    }
31 31
32 32
    /**

@@ -72,7 +72,7 @@
Loading
72 72
        foreach (self::$deprecatedAttributes as $deprecatedAttribute => $options) {
73 73
            if (\array_key_exists($deprecatedAttribute, $values)) {
74 74
                $values[$options[0]] = $values[$deprecatedAttribute];
75 -
                @trigger_error(sprintf('Attribute "%s" is deprecated in annotation since API Platform %s, prefer using "%s" attribute instead', $deprecatedAttribute, $options[1], $options[0]), E_USER_DEPRECATED);
75 +
                @trigger_error(sprintf('Attribute "%s" is deprecated in annotation since API Platform %s, prefer using "%s" attribute instead', $deprecatedAttribute, $options[1], $options[0]), \E_USER_DEPRECATED);
76 76
                unset($values[$deprecatedAttribute]);
77 77
            }
78 78
        }

@@ -46,7 +46,7 @@
Loading
46 46
        $this->formats = $formats;
47 47
48 48
        if (!$resourceMetadataFactory instanceof ResourceMetadataFactoryInterface) {
49 -
            @trigger_error(sprintf('Passing an array or an instance of "%s" as 2nd parameter of the constructor of "%s" is deprecated since API Platform 2.5, pass an instance of "%s" instead', FormatsProviderInterface::class, __CLASS__, ResourceMetadataFactoryInterface::class), E_USER_DEPRECATED);
49 +
            @trigger_error(sprintf('Passing an array or an instance of "%s" as 2nd parameter of the constructor of "%s" is deprecated since API Platform 2.5, pass an instance of "%s" instead', FormatsProviderInterface::class, __CLASS__, ResourceMetadataFactoryInterface::class), \E_USER_DEPRECATED);
50 50
        }
51 51
52 52
        if (\is_array($resourceMetadataFactory)) {

@@ -44,7 +44,7 @@
Loading
44 44
        $this->resourceClassResolver = $resourceClassResolver;
45 45
46 46
        if (null === $this->resourceClassResolver) {
47 -
            @trigger_error(sprintf('Not injecting %s in the CachedIdentifiersExtractor might introduce cache issues with object identifiers.', ResourceClassResolverInterface::class), E_USER_DEPRECATED);
47 +
            @trigger_error(sprintf('Not injecting %s in the CachedIdentifiersExtractor might introduce cache issues with object identifiers.', ResourceClassResolverInterface::class), \E_USER_DEPRECATED);
48 48
        }
49 49
    }
50 50

@@ -33,7 +33,7 @@
Loading
33 33
 *     @Attribute("swaggerContext", type="array")
34 34
 * )
35 35
 */
36 -
#[\Attribute(\Attribute::TARGET_PROPERTY|\Attribute::TARGET_METHOD|\Attribute::TARGET_PARAMETER)]
36 +
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER)]
37 37
final class ApiProperty
38 38
{
39 39
    use AttributesHydratorTrait;

@@ -157,7 +157,7 @@
Loading
157 157
     */
158 158
    public static function hasOrderByOnToManyJoin(QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): bool
159 159
    {
160 -
        @trigger_error(sprintf('The use of "%s::hasOrderByOnToManyJoin()" is deprecated since 2.4 and will be removed in 3.0. Use "%1$s::hasOrderByOnFetchJoinedToManyAssociation()" instead.', __CLASS__), E_USER_DEPRECATED);
160 +
        @trigger_error(sprintf('The use of "%s::hasOrderByOnToManyJoin()" is deprecated since 2.4 and will be removed in 3.0. Use "%1$s::hasOrderByOnFetchJoinedToManyAssociation()" instead.', __CLASS__), \E_USER_DEPRECATED);
161 161
162 162
        return self::hasOrderByOnFetchJoinedToManyAssociation($queryBuilder, $managerRegistry);
163 163
    }

@@ -75,7 +75,7 @@
Loading
75 75
        } else {
76 76
            /** @var ResolveInfo $info */
77 77
            $info = $resolverContext['info'];
78 -
            $fields = $info->getFieldSelection(PHP_INT_MAX);
78 +
            $fields = $info->getFieldSelection(\PHP_INT_MAX);
79 79
        }
80 80
81 81
        $attributes = $this->replaceIdKeys($fields['edges']['node'] ?? $fields['collection'] ?? $fields, $resourceClass, $context);

@@ -31,7 +31,7 @@
Loading
31 31
32 32
    public function __construct(ManagerRegistry $managerRegistry)
33 33
    {
34 -
        @trigger_error(sprintf('The %s class is deprecated since version 2.2 and will be removed in 3.0. Use the %s class instead.', __CLASS__, BaseWriteListener::class), E_USER_DEPRECATED);
34 +
        @trigger_error(sprintf('The %s class is deprecated since version 2.2 and will be removed in 3.0. Use the %s class instead.', __CLASS__, BaseWriteListener::class), \E_USER_DEPRECATED);
35 35
36 36
        $this->managerRegistry = $managerRegistry;
37 37
    }

@@ -21,7 +21,7 @@
Loading
21 21
 * @Annotation
22 22
 * @Target({"METHOD", "PROPERTY"})
23 23
 */
24 -
#[\Attribute(\Attribute::TARGET_PROPERTY|\Attribute::TARGET_METHOD)]
24 +
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD)]
25 25
final class ApiSubresource
26 26
{
27 27
    /**

@@ -65,7 +65,7 @@
Loading
65 65
                $identifier = $id;
66 66
                if (!$dataProvider instanceof DenormalizedIdentifiersAwareItemDataProviderInterface && $identifier && \is_array($identifier)) {
67 67
                    if (\count($identifier) > 1) {
68 -
                        @trigger_error(sprintf('Receiving "$id" as non-array in an item data provider is deprecated in 2.3 in favor of implementing "%s".', DenormalizedIdentifiersAwareItemDataProviderInterface::class), E_USER_DEPRECATED);
68 +
                        @trigger_error(sprintf('Receiving "$id" as non-array in an item data provider is deprecated in 2.3 in favor of implementing "%s".', DenormalizedIdentifiersAwareItemDataProviderInterface::class), \E_USER_DEPRECATED);
69 69
                        $identifier = http_build_query($identifier, '', ';');
70 70
                    } else {
71 71
                        $identifier = current($identifier);
@@ -75,7 +75,7 @@
Loading
75 75
                $result = $dataProvider->getItem($resourceClass, $identifier, $operationName, $context);
76 76
                $this->providersResponse[\get_class($dataProvider)] = $match = true;
77 77
            } catch (ResourceClassNotSupportedException $e) {
78 -
                @trigger_error(sprintf('Throwing a "%s" is deprecated in favor of implementing "%s"', \get_class($e), RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
78 +
                @trigger_error(sprintf('Throwing a "%s" is deprecated in favor of implementing "%s"', \get_class($e), RestrictedDataProviderInterface::class), \E_USER_DEPRECATED);
79 79
                continue;
80 80
            }
81 81
        }

@@ -57,7 +57,7 @@
Loading
57 57
        $this->swaggerVersions = $swaggerVersions;
58 58
59 59
        if (null !== $apiFormats) {
60 -
            @trigger_error(sprintf('Passing a 6th parameter to the constructor of "%s" is deprecated since API Platform 2.5', __CLASS__), E_USER_DEPRECATED);
60 +
            @trigger_error(sprintf('Passing a 6th parameter to the constructor of "%s" is deprecated since API Platform 2.5', __CLASS__), \E_USER_DEPRECATED);
61 61
        }
62 62
63 63
        parent::__construct();
@@ -91,14 +91,14 @@
Loading
91 91
        }
92 92
93 93
        if (3 === (int) $version) {
94 -
            @trigger_error('The command "api:swagger:export" is deprecated for the spec version 3 use "api:openapi:export".', E_USER_DEPRECATED);
94 +
            @trigger_error('The command "api:swagger:export" is deprecated for the spec version 3 use "api:openapi:export".', \E_USER_DEPRECATED);
95 95
        }
96 96
97 97
        $documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->apiTitle, $this->apiDescription, $this->apiVersion, $this->apiFormats);
98 98
        $data = $this->normalizer->normalize($documentation, DocumentationNormalizer::FORMAT, ['spec_version' => (int) $version, ApiGatewayNormalizer::API_GATEWAY => $input->getOption('api-gateway')]);
99 99
        $content = $input->getOption('yaml')
100 100
            ? Yaml::dump($data, 10, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)
101 -
            : (json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ?: '');
101 +
            : (json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES) ?: '');
102 102
103 103
        if (!empty($filename = $input->getOption('output')) && \is_string($filename)) {
104 104
            file_put_contents($filename, $content);

@@ -36,7 +36,7 @@
Loading
36 36
    {
37 37
        if ($filterLocator instanceof ContainerInterface || $filterLocator instanceof FilterCollection || (null === $filterLocator && $allowNull)) {
38 38
            if ($filterLocator instanceof FilterCollection) {
39 -
                @trigger_error(sprintf('The %s class is deprecated since version 2.1 and will be removed in 3.0. Provide an implementation of %s instead.', FilterCollection::class, ContainerInterface::class), E_USER_DEPRECATED);
39 +
                @trigger_error(sprintf('The %s class is deprecated since version 2.1 and will be removed in 3.0. Provide an implementation of %s instead.', FilterCollection::class, ContainerInterface::class), \E_USER_DEPRECATED);
40 40
            }
41 41
42 42
            $this->filterLocator = $filterLocator;

@@ -55,10 +55,10 @@
Loading
55 55
    public function __construct(PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, ResourceMetadataFactoryInterface $resourceMetadataFactory, int $maxJoins = 30, bool $forceEager = true, RequestStack $requestStack = null, SerializerContextBuilderInterface $serializerContextBuilder = null, bool $fetchPartial = false, ClassMetadataFactoryInterface $classMetadataFactory = null)
56 56
    {
57 57
        if (null !== $this->requestStack) {
58 -
            @trigger_error(sprintf('Passing an instance of "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the data provider\'s context instead.', RequestStack::class), E_USER_DEPRECATED);
58 +
            @trigger_error(sprintf('Passing an instance of "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the data provider\'s context instead.', RequestStack::class), \E_USER_DEPRECATED);
59 59
        }
60 60
        if (null !== $this->serializerContextBuilder) {
61 -
            @trigger_error(sprintf('Passing an instance of "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the data provider\'s context instead.', SerializerContextBuilderInterface::class), E_USER_DEPRECATED);
61 +
            @trigger_error(sprintf('Passing an instance of "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the data provider\'s context instead.', SerializerContextBuilderInterface::class), \E_USER_DEPRECATED);
62 62
        }
63 63
64 64
        $this->propertyNameCollectionFactory = $propertyNameCollectionFactory;
@@ -178,7 +178,7 @@
Loading
178 178
                (null === $fetchEager = $propertyMetadata->getAttribute('fetch_eager')) &&
179 179
                (null !== $fetchEager = $propertyMetadata->getAttribute('fetchEager'))
180 180
            ) {
181 -
                @trigger_error('The "fetchEager" attribute is deprecated since 2.3. Please use "fetch_eager" instead.', E_USER_DEPRECATED);
181 +
                @trigger_error('The "fetchEager" attribute is deprecated since 2.3. Please use "fetch_eager" instead.', \E_USER_DEPRECATED);
182 182
            }
183 183
184 184
            if (false === $fetchEager) {

@@ -26,7 +26,7 @@
Loading
26 26
{
27 27
    public function __construct($input = [], $flags = 0, $iterator_class = 'ArrayIterator')
28 28
    {
29 -
        @trigger_error(sprintf('The %s class is deprecated since version 2.1 and will be removed in 3.0. Provide an implementation of %s instead.', self::class, ContainerInterface::class), E_USER_DEPRECATED);
29 +
        @trigger_error(sprintf('The %s class is deprecated since version 2.1 and will be removed in 3.0. Provide an implementation of %s instead.', self::class, ContainerInterface::class), \E_USER_DEPRECATED);
30 30
31 31
        parent::__construct($input, $flags, $iterator_class);
32 32
    }

@@ -48,7 +48,7 @@
Loading
48 48
            if (__CLASS__ !== static::class) {
49 49
                $r = new \ReflectionMethod($this, __FUNCTION__);
50 50
                if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
51 -
                    @trigger_error(sprintf('Method %s() will have a fifth `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), E_USER_DEPRECATED);
51 +
                    @trigger_error(sprintf('Method %s() will have a fifth `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), \E_USER_DEPRECATED);
52 52
                }
53 53
            }
54 54
            $resourceClass = null;
@@ -60,7 +60,7 @@
Loading
60 60
            if (__CLASS__ !== static::class) {
61 61
                $r = new \ReflectionMethod($this, __FUNCTION__);
62 62
                if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
63 -
                    @trigger_error(sprintf('Method %s() will have a sixth `$joinType` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.3.', __FUNCTION__), E_USER_DEPRECATED);
63 +
                    @trigger_error(sprintf('Method %s() will have a sixth `$joinType` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.3.', __FUNCTION__), \E_USER_DEPRECATED);
64 64
                }
65 65
            }
66 66
            $joinType = null;

@@ -93,11 +93,11 @@
Loading
93 93
            $resourceShortName = $resourceMetadata->getShortName();
94 94
95 95
            // Items needs to be parsed first to be able to reference the lines from the collection operation
96 -
            list($itemOperationLinks, $itemOperationSchemas) = $this->collectPaths($resourceMetadata, $resourceClass, OperationType::ITEM, $context, $paths, $links, $schemas);
96 +
            [$itemOperationLinks, $itemOperationSchemas] = $this->collectPaths($resourceMetadata, $resourceClass, OperationType::ITEM, $context, $paths, $links, $schemas);
97 97
            $schemas += $itemOperationSchemas;
98 -
            list($collectionOperationLinks, $collectionOperationSchemas) = $this->collectPaths($resourceMetadata, $resourceClass, OperationType::COLLECTION, $context, $paths, $links, $schemas);
98 +
            [$collectionOperationLinks, $collectionOperationSchemas] = $this->collectPaths($resourceMetadata, $resourceClass, OperationType::COLLECTION, $context, $paths, $links, $schemas);
99 99
100 -
            list($subresourceOperationLinks, $subresourceOperationSchemas) = $this->collectPaths($resourceMetadata, $resourceClass, OperationType::SUBRESOURCE, $context, $paths, $links, $schemas);
100 +
            [$subresourceOperationLinks, $subresourceOperationSchemas] = $this->collectPaths($resourceMetadata, $resourceClass, OperationType::SUBRESOURCE, $context, $paths, $links, $schemas);
101 101
            $schemas += $collectionOperationSchemas;
102 102
        }
103 103
@@ -146,7 +146,7 @@
Loading
146 146
            $resourceClass = $operation['resource_class'] ?? $rootResourceClass;
147 147
            $path = $this->getPath($resourceShortName, $operationName, $operation, $operationType);
148 148
            $method = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'method', 'GET');
149 -
            list($requestMimeTypes, $responseMimeTypes) = $this->getMimeTypes($resourceClass, $operationName, $operationType, $resourceMetadata);
149 +
            [$requestMimeTypes, $responseMimeTypes] = $this->getMimeTypes($resourceClass, $operationName, $operationType, $resourceMetadata);
150 150
            $operationId = $operation['openapi_context']['operationId'] ?? lcfirst($operationName).ucfirst($resourceShortName).ucfirst($operationType);
151 151
            $linkedOperationId = 'get'.ucfirst($resourceShortName).ucfirst(OperationType::ITEM);
152 152
            $pathItem = $paths->getPath($path) ?: new Model\PathItem();

@@ -127,7 +127,7 @@
Loading
127 127
            $identifierResourceClass = $context['identifiers'][$identifier][0];
128 128
            $previousAssociationProperty = $contextIdentifiers[$remainingIdentifiers] ?? $context['property'];
129 129
        } else {
130 -
            @trigger_error('Identifiers should match the convention introduced in ADR 0001-resource-identifiers, this behavior will be removed in 3.0.', E_USER_DEPRECATED);
130 +
            @trigger_error('Identifiers should match the convention introduced in ADR 0001-resource-identifiers, this behavior will be removed in 3.0.', \E_USER_DEPRECATED);
131 131
            [$identifier, $identifierResourceClass] = $context['identifiers'][$remainingIdentifiers - 1];
132 132
            $previousAssociationProperty = $context['identifiers'][$remainingIdentifiers][0] ?? $context['property'];
133 133
        }

@@ -63,7 +63,7 @@
Loading
63 63
                $result = $dataProvider->getSubresource($resourceClass, $identifiers, $context, $operationName);
64 64
                $this->providersResponse[\get_class($dataProvider)] = $match = true;
65 65
            } catch (ResourceClassNotSupportedException $e) {
66 -
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
66 +
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), \E_USER_DEPRECATED);
67 67
                continue;
68 68
            }
69 69
        }

@@ -35,7 +35,7 @@
Loading
35 35
    {
36 36
        $matches = [];
37 37
        $identifiers = [];
38 -
        $num = preg_match_all(self::COMPOSITE_IDENTIFIER_REGEXP, $identifier, $matches, PREG_SET_ORDER);
38 +
        $num = preg_match_all(self::COMPOSITE_IDENTIFIER_REGEXP, $identifier, $matches, \PREG_SET_ORDER);
39 39
40 40
        foreach ($matches as $i => $match) {
41 41
            if ($i === $num - 1) {

@@ -36,7 +36,7 @@
Loading
36 36
37 37
    public function __construct(ValidatorInterface $validator, ResourceMetadataFactoryInterface $resourceMetadataFactory, ContainerInterface $container = null)
38 38
    {
39 -
        @trigger_error(sprintf('Using "%s" is deprecated since API Platform 2.2 and will not be possible anymore in API Platform 3. Use "%s" instead.', __CLASS__, MainValidateListener::class), E_USER_DEPRECATED);
39 +
        @trigger_error(sprintf('Using "%s" is deprecated since API Platform 2.2 and will not be possible anymore in API Platform 3. Use "%s" instead.', __CLASS__, MainValidateListener::class), \E_USER_DEPRECATED);
40 40
41 41
        $this->validator = $validator;
42 42
        $this->resourceMetadataFactory = $resourceMetadataFactory;

@@ -51,7 +51,7 @@
Loading
51 51
        $this->resourceMetadataFactory = $resourceMetadataFactory instanceof ResourceMetadataFactoryInterface ? $resourceMetadataFactory : $legacyResourceMetadataFactory;
52 52
53 53
        if (!$resourceMetadataFactory instanceof ResourceMetadataFactoryInterface) {
54 -
            @trigger_error(sprintf('Passing an array or an instance of "%s" as 3rd parameter of the constructor of "%s" is deprecated since API Platform 2.5, pass an instance of "%s" instead', FormatsProviderInterface::class, __CLASS__, ResourceMetadataFactoryInterface::class), E_USER_DEPRECATED);
54 +
            @trigger_error(sprintf('Passing an array or an instance of "%s" as 3rd parameter of the constructor of "%s" is deprecated since API Platform 2.5, pass an instance of "%s" instead', FormatsProviderInterface::class, __CLASS__, ResourceMetadataFactoryInterface::class), \E_USER_DEPRECATED);
55 55
        }
56 56
57 57
        if (\is_array($resourceMetadataFactory)) {

@@ -51,7 +51,7 @@
Loading
51 51
52 52
                return $dataProvider->getCollection($resourceClass, $operationName, $context);
53 53
            } catch (ResourceClassNotSupportedException $e) {
54 -
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
54 +
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), \E_USER_DEPRECATED);
55 55
                continue;
56 56
            }
57 57
        }

@@ -119,7 +119,7 @@
Loading
119 119
     */
120 120
    protected function extractProperties(Request $request/*, string $resourceClass*/): array
121 121
    {
122 -
        @trigger_error(sprintf('The use of "%s::extractProperties()" is deprecated since 2.2. Use the "filters" key of the context instead.', __CLASS__), E_USER_DEPRECATED);
122 +
        @trigger_error(sprintf('The use of "%s::extractProperties()" is deprecated since 2.2. Use the "filters" key of the context instead.', __CLASS__), \E_USER_DEPRECATED);
123 123
124 124
        $properties = $request->query->all()[$this->orderParameterName] ?? null;
125 125

@@ -77,7 +77,7 @@
Loading
77 77
            if (__CLASS__ !== static::class) {
78 78
                $r = new \ReflectionMethod($this, __FUNCTION__);
79 79
                if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
80 -
                    @trigger_error(sprintf('Method %s() will have a seventh `$context` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.5.', __FUNCTION__), E_USER_DEPRECATED);
80 +
                    @trigger_error(sprintf('Method %s() will have a seventh `$context` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.5.', __FUNCTION__), \E_USER_DEPRECATED);
81 81
                }
82 82
            }
83 83
            $context = [];
@@ -202,7 +202,7 @@
Loading
202 202
            return parent::extractProperties($request, $resourceClass);
203 203
        }
204 204
205 -
        @trigger_error(sprintf('The use of "%s::extractProperties()" is deprecated since 2.2. Use the "filters" key of the context instead.', __CLASS__), E_USER_DEPRECATED);
205 +
        @trigger_error(sprintf('The use of "%s::extractProperties()" is deprecated since 2.2. Use the "filters" key of the context instead.', __CLASS__), \E_USER_DEPRECATED);
206 206
207 207
        $properties = $request->query->all()[$this->existsParameterName];
208 208

@@ -45,7 +45,7 @@
Loading
45 45
        if (\func_num_args() >= 4) {
46 46
            $operationName = (string) func_get_arg(3);
47 47
        } else {
48 -
            @trigger_error(sprintf('Method %s() will have a 4th `string $operationName` argument in version 3.0. Not defining it is deprecated since 2.1.', __METHOD__), E_USER_DEPRECATED);
48 +
            @trigger_error(sprintf('Method %s() will have a 4th `string $operationName` argument in version 3.0. Not defining it is deprecated since 2.1.', __METHOD__), \E_USER_DEPRECATED);
49 49
50 50
            $operationName = null;
51 51
        }

@@ -148,7 +148,7 @@
Loading
148 148
                            $filterArgsNew[] = sprintf('{%s: "%s"}', $filterArgName, $filterArgValue);
149 149
                        }
150 150
                        $deprecationMessage .= sprintf('%s}" is deprecated since API Platform 2.6, use the following syntax instead: "%s: [%s]".', implode(', ', $filterArgsOld), $name, implode(', ', $filterArgsNew));
151 -
                        @trigger_error($deprecationMessage, E_USER_DEPRECATED);
151 +
                        @trigger_error($deprecationMessage, \E_USER_DEPRECATED);
152 152
                    }
153 153
                    $value = array_merge(...$value);
154 154
                }

@@ -50,7 +50,7 @@
Loading
50 50
51 51
                return $dataProvider->getSubresource($resourceClass, $identifiers, $context, $operationName);
52 52
            } catch (ResourceClassNotSupportedException $e) {
53 -
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
53 +
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), \E_USER_DEPRECATED);
54 54
                continue;
55 55
            }
56 56
        }

@@ -47,7 +47,7 @@
Loading
47 47
    public function __construct(ManagerRegistry $managerRegistry, ?RequestStack $requestStack = null, LoggerInterface $logger = null, array $properties = null, NameConverterInterface $nameConverter = null)
48 48
    {
49 49
        if (null !== $requestStack) {
50 -
            @trigger_error(sprintf('Passing an instance of "%s" is deprecated since 2.2. Use "filters" context key instead.', RequestStack::class), E_USER_DEPRECATED);
50 +
            @trigger_error(sprintf('Passing an instance of "%s" is deprecated since 2.2. Use "filters" context key instead.', RequestStack::class), \E_USER_DEPRECATED);
51 51
        }
52 52
53 53
        $this->managerRegistry = $managerRegistry;
@@ -62,7 +62,7 @@
Loading
62 62
     */
63 63
    public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null/*, array $context = []*/)
64 64
    {
65 -
        @trigger_error(sprintf('Using "%s::apply()" is deprecated since 2.2. Use "%s::apply()" with the "filters" context key instead.', __CLASS__, AbstractContextAwareFilter::class), E_USER_DEPRECATED);
65 +
        @trigger_error(sprintf('Using "%s::apply()" is deprecated since 2.2. Use "%s::apply()" with the "filters" context key instead.', __CLASS__, AbstractContextAwareFilter::class), \E_USER_DEPRECATED);
66 66
67 67
        if (null === $this->requestStack || null === $request = $this->requestStack->getCurrentRequest()) {
68 68
            return;
@@ -104,7 +104,7 @@
Loading
104 104
            if (__CLASS__ !== static::class) {
105 105
                $r = new \ReflectionMethod($this, __FUNCTION__);
106 106
                if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
107 -
                    @trigger_error(sprintf('Method %s() will have a second `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), E_USER_DEPRECATED);
107 +
                    @trigger_error(sprintf('Method %s() will have a second `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), \E_USER_DEPRECATED);
108 108
                }
109 109
            }
110 110
            $resourceClass = null;
@@ -123,7 +123,7 @@
Loading
123 123
     */
124 124
    protected function extractProperties(Request $request/*, string $resourceClass*/): array
125 125
    {
126 -
        @trigger_error(sprintf('The use of "%s::extractProperties()" is deprecated since 2.2. Use the "filters" key of the context instead.', __CLASS__), E_USER_DEPRECATED);
126 +
        @trigger_error(sprintf('The use of "%s::extractProperties()" is deprecated since 2.2. Use the "filters" key of the context instead.', __CLASS__), \E_USER_DEPRECATED);
127 127
128 128
        $resourceClass = \func_num_args() > 1 ? (string) func_get_arg(1) : null;
129 129
        $needsFixing = false;

@@ -52,7 +52,7 @@
Loading
52 52
                $identifier = $id;
53 53
                if (!$dataProvider instanceof DenormalizedIdentifiersAwareItemDataProviderInterface && $identifier && \is_array($identifier)) {
54 54
                    if (\count($identifier) > 1) {
55 -
                        @trigger_error(sprintf('Receiving "$id" as non-array in an item data provider is deprecated in 2.3 in favor of implementing "%s".', DenormalizedIdentifiersAwareItemDataProviderInterface::class), E_USER_DEPRECATED);
55 +
                        @trigger_error(sprintf('Receiving "$id" as non-array in an item data provider is deprecated in 2.3 in favor of implementing "%s".', DenormalizedIdentifiersAwareItemDataProviderInterface::class), \E_USER_DEPRECATED);
56 56
                        $identifier = http_build_query($identifier, '', ';');
57 57
                    } else {
58 58
                        $identifier = current($identifier);
@@ -61,7 +61,7 @@
Loading
61 61
62 62
                return $dataProvider->getItem($resourceClass, $identifier, $operationName, $context);
63 63
            } catch (ResourceClassNotSupportedException $e) {
64 -
                @trigger_error(sprintf('Throwing a "%s" is deprecated in favor of implementing "%s"', \get_class($e), RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
64 +
                @trigger_error(sprintf('Throwing a "%s" is deprecated in favor of implementing "%s"', \get_class($e), RestrictedDataProviderInterface::class), \E_USER_DEPRECATED);
65 65
                continue;
66 66
            }
67 67
        }

@@ -122,7 +122,7 @@
Loading
122 122
                if ($supported) {
123 123
                    $operation['method'] = $upperOperationName;
124 124
                } else {
125 -
                    @trigger_error(sprintf('The "route_name" attribute will not be set automatically again in API Platform 3.0, set it for the %s operation "%s" of the class "%s".', $collection ? 'collection' : 'item', $operationName, $resourceClass), E_USER_DEPRECATED);
125 +
                    @trigger_error(sprintf('The "route_name" attribute will not be set automatically again in API Platform 3.0, set it for the %s operation "%s" of the class "%s".', $collection ? 'collection' : 'item', $operationName, $resourceClass), \E_USER_DEPRECATED);
126 126
                    $operation['route_name'] = $operationName;
127 127
                }
128 128
            }

@@ -39,7 +39,7 @@
Loading
39 39
            return;
40 40
        }
41 41
42 -
        @trigger_error(sprintf('Passing a 5th parameter to the constructor of "%s" is deprecated since API Platform 2.5', __CLASS__), E_USER_DEPRECATED);
42 +
        @trigger_error(sprintf('Passing a 5th parameter to the constructor of "%s" is deprecated since API Platform 2.5', __CLASS__), \E_USER_DEPRECATED);
43 43
44 44
        foreach ($formats as $mimeTypes) {
45 45
            foreach ($mimeTypes as $mimeType) {
@@ -50,7 +50,7 @@
Loading
50 50
51 51
    public function getMimeTypes(): array
52 52
    {
53 -
        @trigger_error(sprintf('The method "%s" is deprecated since API Platform 2.5, use the "formats" attribute instead', __METHOD__), E_USER_DEPRECATED);
53 +
        @trigger_error(sprintf('The method "%s" is deprecated since API Platform 2.5, use the "formats" attribute instead', __METHOD__), \E_USER_DEPRECATED);
54 54
55 55
        return $this->mimeTypes;
56 56
    }

@@ -26,7 +26,7 @@
Loading
26 26
{
27 27
    public function __construct()
28 28
    {
29 -
        @trigger_error(sprintf('The use of %s is deprecated since 2.1. Please use %s instead.', __CLASS__, DashPathSegmentNameGenerator::class), E_USER_DEPRECATED);
29 +
        @trigger_error(sprintf('The use of %s is deprecated since 2.1. Please use %s instead.', __CLASS__, DashPathSegmentNameGenerator::class), \E_USER_DEPRECATED);
30 30
    }
31 31
32 32
    /**

@@ -42,7 +42,7 @@
Loading
42 42
     */
43 43
    public static function getClassMetadataFromJoinAlias(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): ClassMetadata
44 44
    {
45 -
        @trigger_error(sprintf('The use of "%s::getClassMetadataFromJoinAlias()" is deprecated since 2.4 and will be removed in 3.0. Use "%s::getEntityClassByAlias()" instead.', __CLASS__, QueryBuilderHelper::class), E_USER_DEPRECATED);
45 +
        @trigger_error(sprintf('The use of "%s::getClassMetadataFromJoinAlias()" is deprecated since 2.4 and will be removed in 3.0. Use "%s::getEntityClassByAlias()" instead.', __CLASS__, QueryBuilderHelper::class), \E_USER_DEPRECATED);
46 46
47 47
        $entityClass = QueryBuilderHelper::getEntityClassByAlias($alias, $queryBuilder, $managerRegistry);
48 48
@@ -58,7 +58,7 @@
Loading
58 58
     */
59 59
    public static function getJoinRelationship(Join $join): string
60 60
    {
61 -
        @trigger_error(sprintf('The use of "%s::getJoinRelationship()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getJoin()" directly instead.', __CLASS__, Join::class), E_USER_DEPRECATED);
61 +
        @trigger_error(sprintf('The use of "%s::getJoinRelationship()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getJoin()" directly instead.', __CLASS__, Join::class), \E_USER_DEPRECATED);
62 62
63 63
        return $join->getJoin();
64 64
    }
@@ -70,7 +70,7 @@
Loading
70 70
     */
71 71
    public static function getJoinAlias(Join $join): string
72 72
    {
73 -
        @trigger_error(sprintf('The use of "%s::getJoinAlias()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getAlias()" directly instead.', __CLASS__, Join::class), E_USER_DEPRECATED);
73 +
        @trigger_error(sprintf('The use of "%s::getJoinAlias()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getAlias()" directly instead.', __CLASS__, Join::class), \E_USER_DEPRECATED);
74 74
75 75
        return $join->getAlias();
76 76
    }
@@ -84,7 +84,7 @@
Loading
84 84
     */
85 85
    public static function getOrderByParts(OrderBy $orderBy): array
86 86
    {
87 -
        @trigger_error(sprintf('The use of "%s::getOrderByParts()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getParts()" directly instead.', __CLASS__, OrderBy::class), E_USER_DEPRECATED);
87 +
        @trigger_error(sprintf('The use of "%s::getOrderByParts()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getParts()" directly instead.', __CLASS__, OrderBy::class), \E_USER_DEPRECATED);
88 88
89 89
        return $orderBy->getParts();
90 90
    }

@@ -160,7 +160,7 @@
Loading
160 160
    protected function hasValidValues(array $values, $type = null): bool
161 161
    {
162 162
        foreach ($values as $key => $value) {
163 -
            if (\in_array($type, (array) self::DOCTRINE_INTEGER_TYPE, true) && null !== $value && false === filter_var($value, FILTER_VALIDATE_INT)) {
163 +
            if (null !== $value && \in_array($type, (array) self::DOCTRINE_INTEGER_TYPE, true) && false === filter_var($value, \FILTER_VALIDATE_INT)) {
164 164
                return false;
165 165
            }
166 166
        }

@@ -110,7 +110,7 @@
Loading
110 110
            return 1;
111 111
        }
112 112
113 -
        $io->text((string) json_encode($schema, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
113 +
        $io->text((string) json_encode($schema, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
114 114
115 115
        return 0;
116 116
    }

@@ -40,7 +40,7 @@
Loading
40 40
        }
41 41
42 42
        // Encode <, >, ', &, and " characters in the JSON, making it also safe to be embedded into HTML.
43 -
        $jsonEncodeOptions = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE;
43 +
        $jsonEncodeOptions = \JSON_HEX_TAG | \JSON_HEX_APOS | \JSON_HEX_AMP | \JSON_HEX_QUOT | \JSON_UNESCAPED_UNICODE;
44 44
        if (interface_exists(AdvancedNameConverterInterface::class)) {
45 45
            $jsonEncode = new JsonEncode(['json_encode_options' => $jsonEncodeOptions]);
46 46
            $jsonDecode = new JsonDecode(['json_decode_associative' => true]);

@@ -103,7 +103,7 @@
Loading
103 103
            $data['data'][] = $item['data'];
104 104
105 105
            if (isset($item['included'])) {
106 -
                $data['included'] = array_values(array_unique(array_merge($data['included'] ?? [], $item['included']), SORT_REGULAR));
106 +
                $data['included'] = array_values(array_unique(array_merge($data['included'] ?? [], $item['included']), \SORT_REGULAR));
107 107
            }
108 108
        }
109 109

@@ -96,7 +96,7 @@
Loading
96 96
        $this->assetPackage = $assetPackage;
97 97
98 98
        if (null === $this->swaggerUiAction) {
99 -
            @trigger_error(sprintf('The use of "%s" is deprecated since API Platform 2.6, use "%s" instead.', __CLASS__, OpenApiSwaggerUiAction::class), E_USER_DEPRECATED);
99 +
            @trigger_error(sprintf('The use of "%s" is deprecated since API Platform 2.6, use "%s" instead.', __CLASS__, OpenApiSwaggerUiAction::class), \E_USER_DEPRECATED);
100 100
        }
101 101
102 102
        if (\is_array($formats)) {
@@ -105,7 +105,7 @@
Loading
105 105
            return;
106 106
        }
107 107
108 -
        @trigger_error(sprintf('Passing an array or an instance of "%s" as 5th parameter of the constructor of "%s" is deprecated since API Platform 2.5, pass an array instead', FormatsProviderInterface::class, __CLASS__), E_USER_DEPRECATED);
108 +
        @trigger_error(sprintf('Passing an array or an instance of "%s" as 5th parameter of the constructor of "%s" is deprecated since API Platform 2.5, pass an array instead', FormatsProviderInterface::class, __CLASS__), \E_USER_DEPRECATED);
109 109
        $this->formatsProvider = $formats;
110 110
    }
111 111

@@ -176,7 +176,7 @@
Loading
176 176
            if (
177 177
                null !== $value
178 178
                && Type::BUILTIN_TYPE_INT === $type->getBuiltinType()
179 -
                && false === filter_var($value, FILTER_VALIDATE_INT)
179 +
                && false === filter_var($value, \FILTER_VALIDATE_INT)
180 180
            ) {
181 181
                return false;
182 182
            }

@@ -45,7 +45,7 @@
Loading
45 45
        parent::__construct($managerRegistry, $requestStack, $logger, $properties, $nameConverter);
46 46
47 47
        if (null === $identifiersExtractor) {
48 -
            @trigger_error('Not injecting ItemIdentifiersExtractor is deprecated since API Platform 2.5 and can lead to unexpected behaviors, it will not be possible anymore in API Platform 3.0.', E_USER_DEPRECATED);
48 +
            @trigger_error('Not injecting ItemIdentifiersExtractor is deprecated since API Platform 2.5 and can lead to unexpected behaviors, it will not be possible anymore in API Platform 3.0.', \E_USER_DEPRECATED);
49 49
        }
50 50
51 51
        $this->iriConverter = $iriConverter;

@@ -38,7 +38,7 @@
Loading
38 38
    public function resolveOperationPath(string $resourceShortName, array $operation, $operationType/*, string $operationName = null*/): string
39 39
    {
40 40
        if (\func_num_args() < 4) {
41 -
            @trigger_error(sprintf('Method %s() will have a 4th `string $operationName` argument in version 3.0. Not defining it is deprecated since 2.1.', __METHOD__), E_USER_DEPRECATED);
41 +
            @trigger_error(sprintf('Method %s() will have a 4th `string $operationName` argument in version 3.0. Not defining it is deprecated since 2.1.', __METHOD__), \E_USER_DEPRECATED);
42 42
        }
43 43
44 44
        $operationType = OperationTypeDeprecationHelper::getOperationType($operationType);

@@ -139,7 +139,7 @@
Loading
139 139
                $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
140 140
                $maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'maximum_items_per_page', null, true);
141 141
                if (null !== $maxItemsPerPage) {
142 -
                    @trigger_error('The "maximum_items_per_page" option has been deprecated since API Platform 2.5 in favor of "pagination_maximum_items_per_page" and will be removed in API Platform 3.', E_USER_DEPRECATED);
142 +
                    @trigger_error('The "maximum_items_per_page" option has been deprecated since API Platform 2.5 in favor of "pagination_maximum_items_per_page" and will be removed in API Platform 3.', \E_USER_DEPRECATED);
143 143
                }
144 144
                $maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_maximum_items_per_page', $maxItemsPerPage ?? $this->options['maximum_items_per_page'], true);
145 145
            }
@@ -234,7 +234,7 @@
Loading
234 234
        }
235 235
236 236
        if ($clientEnabled) {
237 -
            return filter_var($this->getParameterFromContext($context, $this->options[$partial ? 'partial_parameter_name' : 'enabled_parameter_name'], $enabled), FILTER_VALIDATE_BOOLEAN);
237 +
            return filter_var($this->getParameterFromContext($context, $this->options[$partial ? 'partial_parameter_name' : 'enabled_parameter_name'], $enabled), \FILTER_VALIDATE_BOOLEAN);
238 238
        }
239 239
240 240
        return (bool) $enabled;

@@ -48,7 +48,7 @@
Loading
48 48
            // Backward compatibility
49 49
            $isGranted = $resourceMetadata->getGraphqlAttribute($operationName, 'access_control', null, true);
50 50
            if (null !== $isGranted) {
51 -
                @trigger_error('Attribute "access_control" is deprecated since API Platform 2.5, prefer using "security" attribute instead', E_USER_DEPRECATED);
51 +
                @trigger_error('Attribute "access_control" is deprecated since API Platform 2.5, prefer using "security" attribute instead', \E_USER_DEPRECATED);
52 52
            }
53 53
        }
54 54

@@ -26,7 +26,7 @@
Loading
26 26
27 27
    public function __construct(ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory, PropertyMetadataFactoryInterface $decorated = null)
28 28
    {
29 -
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), E_USER_DEPRECATED);
29 +
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), \E_USER_DEPRECATED);
30 30
31 31
        $this->resourceNameCollectionFactory = $resourceNameCollectionFactory;
32 32
        $this->decorated = $decorated;
@@ -37,7 +37,7 @@
Loading
37 37
     */
38 38
    public function create(string $resourceClass, string $property, array $options = []): PropertyMetadata
39 39
    {
40 -
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), E_USER_DEPRECATED);
40 +
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), \E_USER_DEPRECATED);
41 41
42 42
        $propertyMetadata = $this->decorated ? $this->decorated->create($resourceClass, $property, $options) : new PropertyMetadata();
43 43

@@ -53,7 +53,7 @@
Loading
53 53
    public function __construct(ResourceMetadataFactoryInterface $resourceMetadataFactory, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, ResourceClassResolverInterface $resourceClassResolver, OperationMethodResolverInterface $operationMethodResolver = null, UrlGeneratorInterface $urlGenerator, SubresourceOperationFactoryInterface $subresourceOperationFactory = null, NameConverterInterface $nameConverter = null)
54 54
    {
55 55
        if ($operationMethodResolver) {
56 -
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', OperationMethodResolverInterface::class, __METHOD__), E_USER_DEPRECATED);
56 +
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', OperationMethodResolverInterface::class, __METHOD__), \E_USER_DEPRECATED);
57 57
        }
58 58
59 59
        $this->resourceMetadataFactory = $resourceMetadataFactory;

@@ -57,7 +57,6 @@
Loading
57 57
        $this->itemDataProvider = $itemDataProvider;
58 58
        $this->routeNameResolver = $routeNameResolver;
59 59
        $this->router = $router;
60 -
        $this->identifiersExtractor = $identifiersExtractor;
61 60
        $this->subresourceDataProvider = $subresourceDataProvider;
62 61
        $this->identifierConverter = $identifierConverter;
63 62
        $this->resourceClassResolver = $resourceClassResolver;

@@ -35,7 +35,7 @@
Loading
35 35
36 36
    public function __construct(RouterInterface $router, ResourceMetadataFactoryInterface $resourceMetadataFactory)
37 37
    {
38 -
        @trigger_error(sprintf('The "%s" class is deprecated since API Platform 2.5, use the "method" attribute instead.', __CLASS__), E_USER_DEPRECATED);
38 +
        @trigger_error(sprintf('The "%s" class is deprecated since API Platform 2.5, use the "method" attribute instead.', __CLASS__), \E_USER_DEPRECATED);
39 39
40 40
        $this->router = $router;
41 41
        $this->resourceMetadataFactory = $resourceMetadataFactory;

@@ -64,11 +64,11 @@
Loading
64 64
        }
65 65
66 66
        if (\is_bool($urlGenerationStrategy)) {
67 -
            @trigger_error(sprintf('Passing a bool as 5th parameter to "%s::createIri()" is deprecated since API Platform 2.6. Pass an "%s" constant (int) instead.', __CLASS__, UrlGeneratorInterface::class), E_USER_DEPRECATED);
67 +
            @trigger_error(sprintf('Passing a bool as 5th parameter to "%s::createIri()" is deprecated since API Platform 2.6. Pass an "%s" constant (int) instead.', __CLASS__, UrlGeneratorInterface::class), \E_USER_DEPRECATED);
68 68
            $urlGenerationStrategy = $urlGenerationStrategy ? UrlGeneratorInterface::ABS_URL : UrlGeneratorInterface::ABS_PATH;
69 69
        }
70 70
71 -
        $query = http_build_query($parameters, '', '&', PHP_QUERY_RFC3986);
71 +
        $query = http_build_query($parameters, '', '&', \PHP_QUERY_RFC3986);
72 72
        $parts['query'] = preg_replace('/%5B\d+%5D/', '%5B%5D', $query);
73 73
74 74
        $url = '';

@@ -60,7 +60,7 @@
Loading
60 60
        $this->identifier = $identifier;
61 61
        $this->iri = $iri;
62 62
        if (null !== $childInherited) {
63 -
            @trigger_error(sprintf('Providing a non-null value for the 10th argument ($childInherited) of the "%s" constructor is deprecated since 2.6 and will not be supported in 3.0.', __CLASS__), E_USER_DEPRECATED);
63 +
            @trigger_error(sprintf('Providing a non-null value for the 10th argument ($childInherited) of the "%s" constructor is deprecated since 2.6 and will not be supported in 3.0.', __CLASS__), \E_USER_DEPRECATED);
64 64
        }
65 65
        $this->childInherited = $childInherited;
66 66
        $this->attributes = $attributes;
@@ -296,7 +296,7 @@
Loading
296 296
     */
297 297
    public function isChildInherited(): ?string
298 298
    {
299 -
        @trigger_error(sprintf('"%s::%s" is deprecated since 2.4 and will be removed in 3.0.', __CLASS__, __METHOD__), E_USER_DEPRECATED);
299 +
        @trigger_error(sprintf('"%s::%s" is deprecated since 2.4 and will be removed in 3.0.', __CLASS__, __METHOD__), \E_USER_DEPRECATED);
300 300
301 301
        return $this->getChildInherited();
302 302
    }
@@ -306,7 +306,7 @@
Loading
306 306
     */
307 307
    public function withChildInherited(string $childInherited): self
308 308
    {
309 -
        @trigger_error(sprintf('"%s::%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__, __METHOD__), E_USER_DEPRECATED);
309 +
        @trigger_error(sprintf('"%s::%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__, __METHOD__), \E_USER_DEPRECATED);
310 310
311 311
        $metadata = clone $this;
312 312
        $metadata->childInherited = $childInherited;

@@ -41,6 +41,8 @@
Loading
41 41
 */
42 42
final class PublishMercureUpdatesListener
43 43
{
44 +
    use DispatchTrait;
45 +
    use ResourceClassInfoTrait;
44 46
    private const ALLOWED_KEYS = [
45 47
        'topics' => true,
46 48
        'data' => true,
@@ -51,9 +53,6 @@
Loading
51 53
        'normalization_context' => true,
52 54
    ];
53 55
54 -
    use DispatchTrait;
55 -
    use ResourceClassInfoTrait;
56 -
57 56
    private $iriConverter;
58 57
    private $serializer;
59 58
    private $publisher;
@@ -182,7 +181,7 @@
Loading
182 181
                    throw new \InvalidArgumentException('Targets do not exist anymore since Mercure 0.10. Mark the update as private instead or downgrade the Mercure Component to version 0.3');
183 182
                }
184 183
185 -
                @trigger_error('Targets do not exist anymore since Mercure 0.10. Mark the update as private instead.', E_USER_DEPRECATED);
184 +
                @trigger_error('Targets do not exist anymore since Mercure 0.10. Mark the update as private instead.', \E_USER_DEPRECATED);
186 185
                break;
187 186
            }
188 187

@@ -34,7 +34,7 @@
Loading
34 34
    public static function getOperationType($operationType): string
35 35
    {
36 36
        if (\is_bool($operationType)) {
37 -
            @trigger_error('Using a boolean for the Operation Type is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3', E_USER_DEPRECATED);
37 +
            @trigger_error('Using a boolean for the Operation Type is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3', \E_USER_DEPRECATED);
38 38
39 39
            $operationType = $operationType ? OperationType::COLLECTION : OperationType::ITEM;
40 40
        }

@@ -522,7 +522,7 @@
Loading
522 522
                                }
523 523
524 524
                                if (\defined($httpStatusCodeConstant = sprintf('%s::%s', Response::class, $httpStatusCode))) {
525 -
                                    @trigger_error(sprintf('Using a string "%s" as a constant of the "%s" class is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3. Use the Symfony\'s custom YAML extension for PHP constants instead (i.e. "!php/const %s").', $httpStatusCode, Response::class, $httpStatusCodeConstant), E_USER_DEPRECATED);
525 +
                                    @trigger_error(sprintf('Using a string "%s" as a constant of the "%s" class is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3. Use the Symfony\'s custom YAML extension for PHP constants instead (i.e. "!php/const %s").', $httpStatusCode, Response::class, $httpStatusCodeConstant), \E_USER_DEPRECATED);
526 526
527 527
                                    $httpStatusCode = \constant($httpStatusCodeConstant);
528 528
                                }

@@ -25,7 +25,7 @@
Loading
25 25
        /**
26 26
         * {@inheritdoc}
27 27
         */
28 -
        public function parseLiteral(/*Node */$valueNode, array $variables = null)
28 +
        public function parseLiteral(/*Node */ $valueNode, array $variables = null)
29 29
        {
30 30
            throw new Error('`Upload` cannot be hardcoded in query, be sure to conform to GraphQL multipart request specification.', $valueNode);
31 31
        }

@@ -59,7 +59,7 @@
Loading
59 59
        $persistResult = $this->dataPersister->persist($data, $denormalizationContext);
60 60
61 61
        if (!\is_object($persistResult)) {
62 -
            @trigger_error(sprintf('Not returning an object from %s::persist() is deprecated since API Platform 2.3 and will not be supported in API Platform 3.', DataPersisterInterface::class), E_USER_DEPRECATED);
62 +
            @trigger_error(sprintf('Not returning an object from %s::persist() is deprecated since API Platform 2.3 and will not be supported in API Platform 3.', DataPersisterInterface::class), \E_USER_DEPRECATED);
63 63
            $persistResult = null;
64 64
        }
65 65

@@ -113,7 +113,7 @@
Loading
113 113
                $data['hydra:view']['hydra:previous'] = IriHelper::createIri($parsed['parts'], $parsed['parameters'], $this->pageParameterName, $currentPage - 1.);
114 114
            }
115 115
116 -
            if (null !== $lastPage && $currentPage < $lastPage || null === $lastPage && $pageTotalItems >= $itemsPerPage) {
116 +
            if (null !== $lastPage && $currentPage < $lastPage || null === $lastPage && $pageTotalItems > $itemsPerPage) {
117 117
                $data['hydra:view']['hydra:next'] = IriHelper::createIri($parsed['parts'], $parsed['parameters'], $this->pageParameterName, $currentPage + 1.);
118 118
            }
119 119
        }

@@ -209,7 +209,7 @@
Loading
209 209
210 210
        if (isset($operation['route_name'])) {
211 211
            if (!isset($operation['method'])) {
212 -
                @trigger_error(sprintf('Not setting the "method" attribute is deprecated and will not be supported anymore in API Platform 3.0, set it for the %s operation "%s" of the class "%s".', OperationType::COLLECTION === $operationType ? 'collection' : 'item', $operationName, $resourceClass), E_USER_DEPRECATED);
212 +
                @trigger_error(sprintf('Not setting the "method" attribute is deprecated and will not be supported anymore in API Platform 3.0, set it for the %s operation "%s" of the class "%s".', OperationType::COLLECTION === $operationType ? 'collection' : 'item', $operationName, $resourceClass), \E_USER_DEPRECATED);
213 213
            }
214 214
215 215
            return;

@@ -55,7 +55,7 @@
Loading
55 55
            if (__CLASS__ !== static::class) {
56 56
                $r = new \ReflectionMethod($this, __FUNCTION__);
57 57
                if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
58 -
                    @trigger_error(sprintf('Method %s() will have a second `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), E_USER_DEPRECATED);
58 +
                    @trigger_error(sprintf('Method %s() will have a second `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), \E_USER_DEPRECATED);
59 59
                }
60 60
            }
61 61
            $resourceClass = null;
@@ -94,7 +94,7 @@
Loading
94 94
        } elseif (__CLASS__ !== static::class) {
95 95
            $r = new \ReflectionMethod($this, __FUNCTION__);
96 96
            if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
97 -
                @trigger_error(sprintf('Method %s() will have a second `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), E_USER_DEPRECATED);
97 +
                @trigger_error(sprintf('Method %s() will have a second `$resourceClass` argument in version API Platform 3.0. Not defining it is deprecated since API Platform 2.1.', __FUNCTION__), \E_USER_DEPRECATED);
98 98
            }
99 99
        }
100 100

@@ -75,7 +75,7 @@
Loading
75 75
        if (\is_array($value) && isset($value[self::QUERY_PARAMETER_KEY])) {
76 76
            @trigger_error(
77 77
                sprintf('The ExistsFilter syntax "%s[exists]=true/false" is deprecated since 2.5. Use the syntax "%s[%s]=true/false" instead.', $property, $this->existsParameterName, $property),
78 -
                E_USER_DEPRECATED
78 +
                \E_USER_DEPRECATED
79 79
            );
80 80
            $value = $value[self::QUERY_PARAMETER_KEY];
81 81
        }

@@ -31,7 +31,7 @@
Loading
31 31
     */
32 32
    public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
33 33
    {
34 -
        @trigger_error('Using the ExpressionLanguage class directly is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Use the "api_platform.security.expression_language" service instead.', E_USER_DEPRECATED);
34 +
        @trigger_error('Using the ExpressionLanguage class directly is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Use the "api_platform.security.expression_language" service instead.', \E_USER_DEPRECATED);
35 35
36 36
        parent::__construct($cache, $providers);
37 37
    }

@@ -76,7 +76,7 @@
Loading
76 76
                $persistResult = $this->dataPersister->persist($controllerResult, $attributes);
77 77
78 78
                if (!\is_object($persistResult)) {
79 -
                    @trigger_error(sprintf('Not returning an object from %s::persist() is deprecated since API Platform 2.3 and will not be supported in API Platform 3.', DataPersisterInterface::class), E_USER_DEPRECATED);
79 +
                    @trigger_error(sprintf('Not returning an object from %s::persist() is deprecated since API Platform 2.3 and will not be supported in API Platform 3.', DataPersisterInterface::class), \E_USER_DEPRECATED);
80 80
                } else {
81 81
                    $controllerResult = $persistResult;
82 82
                    $event->setControllerResult($controllerResult);

@@ -136,7 +136,7 @@
Loading
136 136
            $identifierResourceClass = $context['identifiers'][$identifier][0];
137 137
            $previousAssociationProperty = $contextIdentifiers[$remainingIdentifiers] ?? $context['property'];
138 138
        } else {
139 -
            @trigger_error('Identifiers should match the convention introduced in ADR 0001-resource-identifiers, this behavior will be removed in 3.0.', E_USER_DEPRECATED);
139 +
            @trigger_error('Identifiers should match the convention introduced in ADR 0001-resource-identifiers, this behavior will be removed in 3.0.', \E_USER_DEPRECATED);
140 140
            [$identifier, $identifierResourceClass] = $context['identifiers'][$remainingIdentifiers - 1];
141 141
            $previousAssociationProperty = $context['identifiers'][$remainingIdentifiers][0] ?? $context['property'];
142 142
        }

@@ -542,7 +542,7 @@
Loading
542 542
     */
543 543
    protected function createRelationSerializationContext(string $resourceClass, array $context): array
544 544
    {
545 -
        @trigger_error(sprintf('The method %s() is deprecated since 2.1 and will be removed in 3.0.', __METHOD__), E_USER_DEPRECATED);
545 +
        @trigger_error(sprintf('The method %s() is deprecated since 2.1 and will be removed in 3.0.', __METHOD__), \E_USER_DEPRECATED);
546 546
547 547
        return $context;
548 548
    }

@@ -68,8 +68,8 @@
Loading
68 68
    public function __construct(ManagerRegistry $managerRegistry, /* ResourceMetadataFactoryInterface */ $resourceMetadataFactory, /* Pagination */ $pagination)
69 69
    {
70 70
        if ($resourceMetadataFactory instanceof RequestStack && $pagination instanceof ResourceMetadataFactoryInterface) {
71 -
            @trigger_error(sprintf('Passing an instance of "%s" as second argument of "%s" is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Pass an instance of "%s" instead.', RequestStack::class, self::class, ResourceMetadataFactoryInterface::class), E_USER_DEPRECATED);
72 -
            @trigger_error(sprintf('Passing an instance of "%s" as third argument of "%s" is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Pass an instance of "%s" instead.', ResourceMetadataFactoryInterface::class, self::class, Pagination::class), E_USER_DEPRECATED);
71 +
            @trigger_error(sprintf('Passing an instance of "%s" as second argument of "%s" is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Pass an instance of "%s" instead.', RequestStack::class, self::class, ResourceMetadataFactoryInterface::class), \E_USER_DEPRECATED);
72 +
            @trigger_error(sprintf('Passing an instance of "%s" as third argument of "%s" is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Pass an instance of "%s" instead.', ResourceMetadataFactoryInterface::class, self::class, Pagination::class), \E_USER_DEPRECATED);
73 73
74 74
            $this->requestStack = $resourceMetadataFactory;
75 75
            $resourceMetadataFactory = $pagination;
@@ -92,7 +92,7 @@
Loading
92 92
93 93
            foreach ($legacyPaginationArgs as $pos => $arg) {
94 94
                if (\array_key_exists($pos, $args)) {
95 -
                    @trigger_error(sprintf('Passing "$%s" arguments is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Pass an instance of "%s" as third argument instead.', implode('", "$', array_column($legacyPaginationArgs, 'arg_name')), Paginator::class), E_USER_DEPRECATED);
95 +
                    @trigger_error(sprintf('Passing "$%s" arguments is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Pass an instance of "%s" as third argument instead.', implode('", "$', array_column($legacyPaginationArgs, 'arg_name')), Paginator::class), \E_USER_DEPRECATED);
96 96
97 97
                    if (!((null === $arg['default'] && null === $args[$pos]) || \call_user_func("is_{$arg['type']}", $args[$pos]))) {
98 98
                        throw new InvalidArgumentException(sprintf('The "$%s" argument is expected to be a %s%s.', $arg['arg_name'], $arg['type'], null === $arg['default'] ? ' or null' : ''));
@@ -224,7 +224,7 @@
Loading
224 224
            $maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'maximum_items_per_page', null, true);
225 225
226 226
            if (null !== $maxItemsPerPage) {
227 -
                @trigger_error('The "maximum_items_per_page" option has been deprecated since API Platform 2.5 in favor of "pagination_maximum_items_per_page" and will be removed in API Platform 3.', E_USER_DEPRECATED);
227 +
                @trigger_error('The "maximum_items_per_page" option has been deprecated since API Platform 2.5 in favor of "pagination_maximum_items_per_page" and will be removed in API Platform 3.', \E_USER_DEPRECATED);
228 228
            }
229 229
230 230
            $maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_maximum_items_per_page', $maxItemsPerPage ?? $this->maximumItemPerPage, true);
@@ -274,7 +274,7 @@
Loading
274 274
        }
275 275
276 276
        if ($clientEnabled && $request) {
277 -
            $enabled = filter_var($this->getPaginationParameter($request, $this->partialParameterName, $enabled), FILTER_VALIDATE_BOOLEAN);
277 +
            $enabled = filter_var($this->getPaginationParameter($request, $this->partialParameterName, $enabled), \FILTER_VALIDATE_BOOLEAN);
278 278
        }
279 279
280 280
        return $enabled;
@@ -286,7 +286,7 @@
Loading
286 286
        $clientEnabled = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_client_enabled', $this->clientEnabled, true);
287 287
288 288
        if ($clientEnabled) {
289 -
            $enabled = filter_var($this->getPaginationParameter($request, $this->enabledParameterName, $enabled), FILTER_VALIDATE_BOOLEAN);
289 +
            $enabled = filter_var($this->getPaginationParameter($request, $this->enabledParameterName, $enabled), \FILTER_VALIDATE_BOOLEAN);
290 290
        }
291 291
292 292
        return $enabled;

@@ -24,7 +24,7 @@
Loading
24 24
 * @Annotation
25 25
 * @Target({"PROPERTY", "CLASS"})
26 26
 */
27 -
#[\Attribute(\Attribute::TARGET_PROPERTY|\Attribute::TARGET_CLASS|\Attribute::IS_REPEATABLE)]
27 +
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
28 28
final class ApiFilter
29 29
{
30 30
    /**

@@ -26,7 +26,7 @@
Loading
26 26
27 27
    public function __construct(ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory, PropertyNameCollectionFactoryInterface $decorated = null)
28 28
    {
29 -
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), E_USER_DEPRECATED);
29 +
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), \E_USER_DEPRECATED);
30 30
31 31
        $this->resourceNameCollectionFactory = $resourceNameCollectionFactory;
32 32
        $this->decorated = $decorated;
@@ -37,7 +37,7 @@
Loading
37 37
     */
38 38
    public function create(string $resourceClass, array $options = []): PropertyNameCollection
39 39
    {
40 -
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), E_USER_DEPRECATED);
40 +
        @trigger_error(sprintf('"%s" is deprecated since 2.6 and will be removed in 3.0.', __CLASS__), \E_USER_DEPRECATED);
41 41
42 42
        $propertyNames = [];
43 43

@@ -52,7 +52,7 @@
Loading
52 52
    {
53 53
        /** @var ResolveInfo $info */
54 54
        $info = $context['info'];
55 -
        $fields = $info->getFieldSelection(PHP_INT_MAX);
55 +
        $fields = $info->getFieldSelection(\PHP_INT_MAX);
56 56
        $this->arrayRecursiveSort($fields, 'ksort');
57 57
        $iri = $this->getIdentifierFromContext($context);
58 58
        if (null === $iri) {

@@ -37,7 +37,7 @@
Loading
37 37
        if (\func_num_args() >= 4) {
38 38
            $operationName = func_get_arg(3);
39 39
        } else {
40 -
            @trigger_error(sprintf('Method %s() will have a 4th `string $operationName` argument in version 3.0. Not defining it is deprecated since 2.1.', __METHOD__), E_USER_DEPRECATED);
40 +
            @trigger_error(sprintf('Method %s() will have a 4th `string $operationName` argument in version 3.0. Not defining it is deprecated since 2.1.', __METHOD__), \E_USER_DEPRECATED);
41 41
42 42
            $operationName = null;
43 43
        }

@@ -112,7 +112,7 @@
Loading
112 112
    public function __construct(ResourceMetadataFactoryInterface $resourceMetadataFactory, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, $jsonSchemaFactory = null, $jsonSchemaTypeFactory = null, OperationPathResolverInterface $operationPathResolver = null, UrlGeneratorInterface $urlGenerator = null, $filterLocator = null, NameConverterInterface $nameConverter = null, bool $oauthEnabled = false, string $oauthType = '', string $oauthFlow = '', string $oauthTokenUrl = '', string $oauthAuthorizationUrl = '', array $oauthScopes = [], array $apiKeys = [], SubresourceOperationFactoryInterface $subresourceOperationFactory = null, bool $paginationEnabled = true, string $paginationPageParameterName = 'page', bool $clientItemsPerPage = false, string $itemsPerPageParameterName = 'itemsPerPage', $formats = [], bool $paginationClientEnabled = false, string $paginationClientEnabledParameterName = 'pagination', array $defaultContext = [], array $swaggerVersions = [2, 3], IdentifiersExtractorInterface $identifiersExtractor = null)
113 113
    {
114 114
        if ($jsonSchemaTypeFactory instanceof OperationMethodResolverInterface) {
115 -
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', OperationMethodResolverInterface::class, __METHOD__), E_USER_DEPRECATED);
115 +
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', OperationMethodResolverInterface::class, __METHOD__), \E_USER_DEPRECATED);
116 116
117 117
            $this->operationMethodResolver = $jsonSchemaTypeFactory;
118 118
            $this->jsonSchemaTypeFactory = new TypeFactory();
@@ -121,7 +121,7 @@
Loading
121 121
        }
122 122
123 123
        if ($jsonSchemaFactory instanceof ResourceClassResolverInterface) {
124 -
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', ResourceClassResolverInterface::class, __METHOD__), E_USER_DEPRECATED);
124 +
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', ResourceClassResolverInterface::class, __METHOD__), \E_USER_DEPRECATED);
125 125
        }
126 126
127 127
        if (null === $jsonSchemaFactory || $jsonSchemaFactory instanceof ResourceClassResolverInterface) {
@@ -131,15 +131,15 @@
Loading
131 131
        $this->jsonSchemaFactory = $jsonSchemaFactory;
132 132
133 133
        if ($nameConverter) {
134 -
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', NameConverterInterface::class, __METHOD__), E_USER_DEPRECATED);
134 +
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0.', NameConverterInterface::class, __METHOD__), \E_USER_DEPRECATED);
135 135
        }
136 136
137 137
        if ($urlGenerator) {
138 -
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.1 and will be removed in 3.0.', UrlGeneratorInterface::class, __METHOD__), E_USER_DEPRECATED);
138 +
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.1 and will be removed in 3.0.', UrlGeneratorInterface::class, __METHOD__), \E_USER_DEPRECATED);
139 139
        }
140 140
141 141
        if ($formats instanceof FormatsProviderInterface) {
142 -
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0, pass an array instead.', FormatsProviderInterface::class, __METHOD__), E_USER_DEPRECATED);
142 +
            @trigger_error(sprintf('Passing an instance of %s to %s() is deprecated since version 2.5 and will be removed in 3.0, pass an array instead.', FormatsProviderInterface::class, __METHOD__), \E_USER_DEPRECATED);
143 143
144 144
            $this->formatsProvider = $formats;
145 145
        } else {
@@ -392,7 +392,7 @@
Loading
392 392
393 393
                    $maxItemsPerPage = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'maximum_items_per_page', null, true);
394 394
                    if (null !== $maxItemsPerPage) {
395 -
                        @trigger_error('The "maximum_items_per_page" option has been deprecated since API Platform 2.5 in favor of "pagination_maximum_items_per_page" and will be removed in API Platform 3.', E_USER_DEPRECATED);
395 +
                        @trigger_error('The "maximum_items_per_page" option has been deprecated since API Platform 2.5 in favor of "pagination_maximum_items_per_page" and will be removed in API Platform 3.', \E_USER_DEPRECATED);
396 396
                    }
397 397
                    $maxItemsPerPage = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'pagination_maximum_items_per_page', $maxItemsPerPage, true);
398 398
@@ -697,7 +697,7 @@
Loading
697 697
            $security[] = [$key => []];
698 698
        }
699 699
700 -
        if ($securityDefinitions && $security) { // @phpstan-ignore-line
700 +
        if ($securityDefinitions && $security) { // @phpstan-ignore-line false positive
701 701
            $docs['security'] = $security;
702 702
            if (!$v3) {
703 703
                $docs['securityDefinitions'] = $securityDefinitions;

@@ -68,7 +68,7 @@
Loading
68 68
                'code' => $violation->getCode(),
69 69
            ];
70 70
71 -
            $constraint = $violation->getConstraint();
71 +
            $constraint = $violation instanceof ConstraintViolation ? $violation->getConstraint() : null;
72 72
            if (
73 73
                [] !== $this->serializePayloadFields &&
74 74
                $constraint &&

@@ -30,7 +30,7 @@
Loading
30 30
31 31
    public function __construct(ResourceMetadataFactoryInterface $resourceMetadataFactory, array $configuredFormats)
32 32
    {
33 -
        @trigger_error(sprintf('The "%s" class is deprecated since API Platform 2.5, use the "formats" attribute instead.', __CLASS__), E_USER_DEPRECATED);
33 +
        @trigger_error(sprintf('The "%s" class is deprecated since API Platform 2.5, use the "formats" attribute instead.', __CLASS__), \E_USER_DEPRECATED);
34 34
35 35
        $this->resourceMetadataFactory = $resourceMetadataFactory;
36 36
        $this->configuredFormats = $configuredFormats;

@@ -34,7 +34,7 @@
Loading
34 34
         *
35 35
         * @param ObjectValueNode|ListValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|NullValueNode $valueNode
36 36
         */
37 -
        public function parseLiteral(/*Node */$valueNode, ?array $variables = null)
37 +
        public function parseLiteral(/*Node */ $valueNode, ?array $variables = null)
38 38
        {
39 39
            if ($valueNode instanceof ObjectValueNode || $valueNode instanceof ListValueNode) {
40 40
                return $this->parseIterableLiteral($valueNode);

@@ -51,7 +51,7 @@
Loading
51 51
    public function convert($data, string $class, array $context = []): array
52 52
    {
53 53
        if (!\is_array($data)) {
54 -
            @trigger_error(sprintf('Not using an array as the first argument of "%s->convert" is deprecated since API Platform 2.6 and will not be possible anymore in API Platform 3', self::class), E_USER_DEPRECATED);
54 +
            @trigger_error(sprintf('Not using an array as the first argument of "%s->convert" is deprecated since API Platform 2.6 and will not be possible anymore in API Platform 3', self::class), \E_USER_DEPRECATED);
55 55
            $data = ['id' => $data];
56 56
        }
57 57

@@ -51,7 +51,7 @@
Loading
51 51
                \is_callable($service)
52 52
            ) {
53 53
                if (!$service instanceof ValidationGroupsGeneratorInterface) {
54 -
                    @trigger_error(sprintf('Using a public validation groups generator service not implementing "%s" is deprecated since 2.6 and will be removed in 3.0.', ValidationGroupsGeneratorInterface::class), E_USER_DEPRECATED);
54 +
                    @trigger_error(sprintf('Using a public validation groups generator service not implementing "%s" is deprecated since 2.6 and will be removed in 3.0.', ValidationGroupsGeneratorInterface::class), \E_USER_DEPRECATED);
55 55
                }
56 56
57 57
                $validationGroups = $service($data);

@@ -41,7 +41,7 @@
Loading
41 41
        $this->resourceClassResolver = $resourceClassResolver;
42 42
43 43
        if (null === $this->resourceClassResolver) {
44 -
            @trigger_error(sprintf('Not injecting %s in the IdentifiersExtractor might introduce cache issues with object identifiers.', ResourceClassResolverInterface::class), E_USER_DEPRECATED);
44 +
            @trigger_error(sprintf('Not injecting %s in the IdentifiersExtractor might introduce cache issues with object identifiers.', ResourceClassResolverInterface::class), \E_USER_DEPRECATED);
45 45
        }
46 46
    }
47 47

@@ -50,12 +50,12 @@
Loading
50 50
        }
51 51
52 52
        $this->resourceAccessChecker = new ResourceAccessChecker($resourceAccessCheckerOrExpressionLanguage, $authenticationTrustResolver, $roleHierarchy, $tokenStorage, $authorizationChecker);
53 -
        @trigger_error(sprintf('Passing an instance of "%s" or null as second argument of "%s" is deprecated since API Platform 2.2 and will not be possible anymore in API Platform 3. Pass an instance of "%s" and no extra argument instead.', ExpressionLanguage::class, self::class, ResourceAccessCheckerInterface::class), E_USER_DEPRECATED);
53 +
        @trigger_error(sprintf('Passing an instance of "%s" or null as second argument of "%s" is deprecated since API Platform 2.2 and will not be possible anymore in API Platform 3. Pass an instance of "%s" and no extra argument instead.', ExpressionLanguage::class, self::class, ResourceAccessCheckerInterface::class), \E_USER_DEPRECATED);
54 54
    }
55 55
56 56
    public function onKernelRequest(RequestEvent $event): void
57 57
    {
58 -
        @trigger_error(sprintf('Method "%1$s::onKernelRequest" is deprecated since API Platform 2.4 and will not be available anymore in API Platform 3. Prefer calling "%1$s::onSecurity" instead.', self::class), E_USER_DEPRECATED);
58 +
        @trigger_error(sprintf('Method "%1$s::onKernelRequest" is deprecated since API Platform 2.4 and will not be available anymore in API Platform 3. Prefer calling "%1$s::onSecurity" instead.', self::class), \E_USER_DEPRECATED);
59 59
        $this->onSecurityPostDenormalize($event);
60 60
    }
61 61
@@ -88,7 +88,7 @@
Loading
88 88
            // Backward compatibility
89 89
            $isGranted = $resourceMetadata->getOperationAttribute($attributes, 'access_control', null, true);
90 90
            if (null !== $isGranted) {
91 -
                @trigger_error('Using "access_control" attribute is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Use "security" attribute instead.', E_USER_DEPRECATED);
91 +
                @trigger_error('Using "access_control" attribute is deprecated since API Platform 2.4 and will not be possible anymore in API Platform 3. Use "security" attribute instead.', \E_USER_DEPRECATED);
92 92
            }
93 93
        }
94 94

@@ -51,14 +51,14 @@
Loading
51 51
        $this->openApiFactory = $openApiFactory;
52 52
53 53
        if (null === $openApiFactory) {
54 -
            @trigger_error(sprintf('Not passing an instance of "%s" as 7th parameter of the constructor of "%s" is deprecated since API Platform 2.6', OpenApiFactoryInterface::class, __CLASS__), E_USER_DEPRECATED);
54 +
            @trigger_error(sprintf('Not passing an instance of "%s" as 7th parameter of the constructor of "%s" is deprecated since API Platform 2.6', OpenApiFactoryInterface::class, __CLASS__), \E_USER_DEPRECATED);
55 55
        }
56 56
57 57
        if (null === $formatsProvider) {
58 58
            return;
59 59
        }
60 60
61 -
        @trigger_error(sprintf('Passing an array or an instance of "%s" as 5th parameter of the constructor of "%s" is deprecated since API Platform 2.5', FormatsProviderInterface::class, __CLASS__), E_USER_DEPRECATED);
61 +
        @trigger_error(sprintf('Passing an array or an instance of "%s" as 5th parameter of the constructor of "%s" is deprecated since API Platform 2.5', FormatsProviderInterface::class, __CLASS__), \E_USER_DEPRECATED);
62 62
        if (\is_array($formatsProvider)) {
63 63
            $this->formats = $formatsProvider;
64 64

@@ -145,12 +145,12 @@
Loading
145 145
        }
146 146
147 147
        try {
148 -
            $content = json_decode($content, true, 512, JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? JSON_THROW_ON_ERROR : 0));
148 +
            $content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? \JSON_THROW_ON_ERROR : 0));
149 149
        } catch (\JsonException $e) {
150 150
            throw new JsonException($e->getMessage(), $e->getCode());
151 151
        }
152 152
153 -
        if (\PHP_VERSION_ID < 70300 && JSON_ERROR_NONE !== json_last_error()) {
153 +
        if (\PHP_VERSION_ID < 70300 && \JSON_ERROR_NONE !== json_last_error()) {
154 154
            throw new JsonException(json_last_error_msg(), json_last_error());
155 155
        }
156 156

@@ -27,12 +27,11 @@
Loading
27 27
 */
28 28
final class ErrorNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface
29 29
{
30 +
    use ErrorNormalizerTrait;
30 31
    public const FORMAT = 'jsonproblem';
31 32
    public const TYPE = 'type';
32 33
    public const TITLE = 'title';
33 34
34 -
    use ErrorNormalizerTrait;
35 -
36 35
    private $debug;
37 36
    private $defaultContext = [
38 37
        self::TYPE => 'https://tools.ietf.org/html/rfc2616#section-10',

@@ -65,7 +65,7 @@
Loading
65 65
                $results = $dataProvider->getCollection($resourceClass, $operationName, $context);
66 66
                $this->providersResponse[\get_class($dataProvider)] = $match = true;
67 67
            } catch (ResourceClassNotSupportedException $e) {
68 -
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), E_USER_DEPRECATED);
68 +
                @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), \E_USER_DEPRECATED);
69 69
                continue;
70 70
            }
71 71
        }

@@ -65,7 +65,7 @@
Loading
65 65
        if (!$graphql && $legacyOperations = $this->getAttributes($resource, $operationType)) {
66 66
            @trigger_error(
67 67
                sprintf('Configuring "%1$s" tags without using a parent "%1$ss" tag is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3', $operationType),
68 -
                E_USER_DEPRECATED
68 +
                \E_USER_DEPRECATED
69 69
            );
70 70
71 71
            return $legacyOperations;
Files Complexity Coverage
src 5,608 82.68%
Project Totals (371 files) 5608 82.68%
behat-php7.4
Build #503575025 -
behat
phpunit-php7.4
Build #503575025 -
phpunit

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading