api-platform / core
Showing 67 of 83 files from the diff.

@@ -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 (self::DOCTRINE_INTEGER_TYPE === $type && null !== $value && false === filter_var($value, FILTER_VALIDATE_INT)) {
163 +
            if (self::DOCTRINE_INTEGER_TYPE === $type && null !== $value && false === filter_var($value, \FILTER_VALIDATE_INT)) {
164 164
                return false;
165 165
            }
166 166
        }

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

@@ -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;

@@ -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

@@ -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]);

@@ -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
        }

@@ -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
        }

@@ -50,7 +50,7 @@
Loading
50 50
            return;
51 51
        }
52 52
53 -
        @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);
53 +
        @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);
54 54
        if (\is_array($formatsProvider)) {
55 55
            $this->formats = $formatsProvider;
56 56

@@ -33,7 +33,7 @@
Loading
33 33
    {
34 34
        $matches = [];
35 35
        $identifiers = [];
36 -
        $num = preg_match_all('/(\w+)=(?<=\w=)(.*?)(?=;\w+=)|(\w+)=([^;]*);?$/', $identifier, $matches, PREG_SET_ORDER);
36 +
        $num = preg_match_all('/(\w+)=(?<=\w=)(.*?)(?=;\w+=)|(\w+)=([^;]*);?$/', $identifier, $matches, \PREG_SET_ORDER);
37 37
38 38
        foreach ($matches as $i => $match) {
39 39
            if ($i === $num - 1) {

@@ -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);

@@ -93,7 +93,7 @@
Loading
93 93
            return;
94 94
        }
95 95
96 -
        @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);
96 +
        @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);
97 97
        $this->formatsProvider = $formats;
98 98
    }
99 99

@@ -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;

@@ -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);

@@ -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);

@@ -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

@@ -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
            }

@@ -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

@@ -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
        }

@@ -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
    /**

@@ -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
        }

@@ -500,7 +500,7 @@
Loading
500 500
     */
501 501
    protected function createRelationSerializationContext(string $resourceClass, array $context): array
502 502
    {
503 -
        @trigger_error(sprintf('The method %s() is deprecated since 2.1 and will be removed in 3.0.', __METHOD__), E_USER_DEPRECATED);
503 +
        @trigger_error(sprintf('The method %s() is deprecated since 2.1 and will be removed in 3.0.', __METHOD__), \E_USER_DEPRECATED);
504 504
505 505
        return $context;
506 506
    }

@@ -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
    }

@@ -93,7 +93,7 @@
Loading
93 93
            $data['data'][] = $item['data'];
94 94
95 95
            if (isset($item['included'])) {
96 -
                $data['included'] = array_values(array_unique(array_merge($data['included'] ?? [], $item['included']), SORT_REGULAR));
96 +
                $data['included'] = array_values(array_unique(array_merge($data['included'] ?? [], $item['included']), \SORT_REGULAR));
97 97
            }
98 98
        }
99 99

@@ -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;

@@ -43,12 +43,12 @@
Loading
43 43
44 44
        if (\array_key_exists('accessControl', $values)) {
45 45
            $values['security'] = $values['accessControl'];
46 -
            @trigger_error('Attribute "accessControl" is deprecated in annotation since API Platform 2.5, prefer using "security" attribute instead', E_USER_DEPRECATED);
46 +
            @trigger_error('Attribute "accessControl" is deprecated in annotation since API Platform 2.5, prefer using "security" attribute instead', \E_USER_DEPRECATED);
47 47
            unset($values['accessControl']);
48 48
        }
49 49
        if (\array_key_exists('accessControlMessage', $values)) {
50 50
            $values['securityMessage'] = $values['accessControlMessage'];
51 -
            @trigger_error('Attribute "accessControlMessage" is deprecated in annotation since API Platform 2.5, prefer using "securityMessage" attribute instead', E_USER_DEPRECATED);
51 +
            @trigger_error('Attribute "accessControlMessage" is deprecated in annotation since API Platform 2.5, prefer using "securityMessage" attribute instead', \E_USER_DEPRECATED);
52 52
            unset($values['accessControlMessage']);
53 53
        }
54 54

@@ -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
            }
@@ -218,7 +218,7 @@
Loading
218 218
        }
219 219
220 220
        if ($clientEnabled) {
221 -
            return filter_var($this->getParameterFromContext($context, $this->options[$partial ? 'partial_parameter_name' : 'enabled_parameter_name'], $enabled), FILTER_VALIDATE_BOOLEAN);
221 +
            return filter_var($this->getParameterFromContext($context, $this->options[$partial ? 'partial_parameter_name' : 'enabled_parameter_name'], $enabled), \FILTER_VALIDATE_BOOLEAN);
222 222
        }
223 223
224 224
        return (bool) $enabled;

@@ -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
        }

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

@@ -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
        }

@@ -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
    /**

@@ -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;

@@ -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)) {

@@ -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
    }

@@ -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;

@@ -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
            }

@@ -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
        }

@@ -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;

@@ -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
    }

@@ -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)) {

@@ -61,7 +61,7 @@
Loading
61 61
        $this->resourceClassResolver = $resourceClassResolver;
62 62
63 63
        if (null === $identifiersExtractor) {
64 -
            @trigger_error(sprintf('Not injecting "%s" is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3', IdentifiersExtractorInterface::class), E_USER_DEPRECATED);
64 +
            @trigger_error(sprintf('Not injecting "%s" is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3', IdentifiersExtractorInterface::class), \E_USER_DEPRECATED);
65 65
            $this->identifiersExtractor = new IdentifiersExtractor($propertyNameCollectionFactory, $propertyMetadataFactory, $propertyAccessor ?? PropertyAccess::createPropertyAccessor());
66 66
        }
67 67
    }

@@ -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;

@@ -62,7 +62,7 @@
Loading
62 62
            $parameters[$pageParameterName] = $page;
63 63
        }
64 64
65 -
        $query = http_build_query($parameters, '', '&', PHP_QUERY_RFC3986);
65 +
        $query = http_build_query($parameters, '', '&', \PHP_QUERY_RFC3986);
66 66
        $parts['query'] = preg_replace('/%5B\d+%5D/', '%5B%5D', $query);
67 67
68 68
        $url = '';

@@ -280,7 +280,7 @@
Loading
280 280
     */
281 281
    public function isChildInherited(): ?string
282 282
    {
283 -
        @trigger_error(sprintf('The use of "%1$s::isChildInherited()" is deprecated since 2.4 and will be removed in 3.0. Use "%1$s::getChildInherited()" or "%1$s::hasChildInherited()" directly instead.', __CLASS__), E_USER_DEPRECATED);
283 +
        @trigger_error(sprintf('The use of "%1$s::isChildInherited()" is deprecated since 2.4 and will be removed in 3.0. Use "%1$s::getChildInherited()" or "%1$s::hasChildInherited()" directly instead.', __CLASS__), \E_USER_DEPRECATED);
284 284
285 285
        return $this->getChildInherited();
286 286
    }

@@ -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
    }

@@ -36,6 +36,8 @@
Loading
36 36
 */
37 37
final class PublishMercureUpdatesListener
38 38
{
39 +
    use DispatchTrait;
40 +
    use ResourceClassInfoTrait;
39 41
    private const ALLOWED_KEYS = [
40 42
        'topics' => true,
41 43
        'data' => true,
@@ -45,9 +47,6 @@
Loading
45 47
        'retry' => true,
46 48
    ];
47 49
48 -
    use DispatchTrait;
49 -
    use ResourceClassInfoTrait;
50 -
51 50
    private $iriConverter;
52 51
    private $serializer;
53 52
    private $publisher;
@@ -163,7 +162,7 @@
Loading
163 162
                    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');
164 163
                }
165 164
166 -
                @trigger_error('Targets do not exist anymore since Mercure 0.10. Mark the update as private instead.', E_USER_DEPRECATED);
165 +
                @trigger_error('Targets do not exist anymore since Mercure 0.10. Mark the update as private instead.', \E_USER_DEPRECATED);
167 166
                break;
168 167
            }
169 168

@@ -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
        }

@@ -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

@@ -108,7 +108,7 @@
Loading
108 108
    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])
109 109
    {
110 110
        if ($jsonSchemaTypeFactory instanceof OperationMethodResolverInterface) {
111 -
            @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);
111 +
            @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);
112 112
113 113
            $this->operationMethodResolver = $jsonSchemaTypeFactory;
114 114
            $this->jsonSchemaTypeFactory = new TypeFactory();
@@ -117,7 +117,7 @@
Loading
117 117
        }
118 118
119 119
        if ($jsonSchemaFactory instanceof ResourceClassResolverInterface) {
120 -
            @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);
120 +
            @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);
121 121
        }
122 122
123 123
        if (null === $jsonSchemaFactory || $jsonSchemaFactory instanceof ResourceClassResolverInterface) {
@@ -127,15 +127,15 @@
Loading
127 127
        $this->jsonSchemaFactory = $jsonSchemaFactory;
128 128
129 129
        if ($nameConverter) {
130 -
            @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);
130 +
            @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);
131 131
        }
132 132
133 133
        if ($urlGenerator) {
134 -
            @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);
134 +
            @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);
135 135
        }
136 136
137 137
        if ($formats instanceof FormatsProviderInterface) {
138 -
            @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);
138 +
            @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);
139 139
140 140
            $this->formatsProvider = $formats;
141 141
        } else {
@@ -384,7 +384,7 @@
Loading
384 384
385 385
                    $maxItemsPerPage = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'maximum_items_per_page', null, true);
386 386
                    if (null !== $maxItemsPerPage) {
387 -
                        @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);
387 +
                        @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);
388 388
                    }
389 389
                    $maxItemsPerPage = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'pagination_maximum_items_per_page', $maxItemsPerPage, true);
390 390
@@ -453,7 +453,7 @@
Loading
453 453
        // Avoid duplicates parameters when there is a filter on a subresource identifier
454 454
        $parametersMemory = [];
455 455
        $pathOperation['parameters'] = [];
456 -
        foreach ($subresourceOperation['identifiers'] as list($identifier, , $hasIdentifier)) {
456 +
        foreach ($subresourceOperation['identifiers'] as [$identifier, , $hasIdentifier]) {
457 457
            if (true === $hasIdentifier) {
458 458
                $parameter = ['name' => $identifier, 'in' => 'path', 'required' => true];
459 459
                $v3 ? $parameter['schema'] = ['type' => 'string'] : $parameter['type'] = 'string';
@@ -675,10 +675,10 @@
Loading
675 675
        }
676 676
677 677
        if ($v3) {
678 -
            if ($securityDefinitions && $security) {
678 +
            if ($securityDefinitions && $security) { // @phpstan-ignore-line false positive
679 679
                $docs['security'] = $security;
680 680
            }
681 -
        } elseif ($securityDefinitions && $security) {
681 +
        } elseif ($securityDefinitions && $security) { // @phpstan-ignore-line false positive
682 682
            $docs['securityDefinitions'] = $securityDefinitions;
683 683
            $docs['security'] = $security;
684 684
        }

@@ -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
        }

@@ -442,7 +442,7 @@
Loading
442 442
                                }
443 443
444 444
                                if (\defined($httpStatusCodeConstant = sprintf('%s::%s', Response::class, $httpStatusCode))) {
445 -
                                    @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);
445 +
                                    @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);
446 446
447 447
                                    $httpStatusCode = \constant($httpStatusCodeConstant);
448 448
                                }

@@ -67,7 +67,7 @@
Loading
67 67
    {
68 68
        /** @var ResolveInfo $info */
69 69
        $info = $context['info'];
70 -
        $fields = $info->getFieldSelection(PHP_INT_MAX);
70 +
        $fields = $info->getFieldSelection(\PHP_INT_MAX);
71 71
72 72
        $attributes = $this->replaceIdKeys($fields['edges']['node'] ?? $fields);
73 73

@@ -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;

@@ -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

@@ -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();
@@ -94,7 +94,7 @@
Loading
94 94
        $data = $this->normalizer->normalize($documentation, DocumentationNormalizer::FORMAT, ['spec_version' => (int) $version, ApiGatewayNormalizer::API_GATEWAY => $input->getOption('api-gateway')]);
95 95
        $content = $input->getOption('yaml')
96 96
            ? Yaml::dump($data, 10, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)
97 -
            : (json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ?: '');
97 +
            : (json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES) ?: '');
98 98
99 99
        if (!empty($filename = $input->getOption('output')) && \is_string($filename)) {
100 100
            file_put_contents($filename, $content);

@@ -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

@@ -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;

@@ -16,6 +16,7 @@
Loading
16 16
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
17 17
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
18 18
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
19 +
use Symfony\Component\Validator\ConstraintViolation;
19 20
use Symfony\Component\Validator\ConstraintViolationListInterface;
20 21
21 22
/**
@@ -65,7 +66,7 @@
Loading
65 66
                'message' => $violation->getMessage(),
66 67
            ];
67 68
68 -
            $constraint = $violation->getConstraint();
69 +
            $constraint = $violation instanceof ConstraintViolation ? $violation->getConstraint() : null;
69 70
            if (
70 71
                [] !== $this->serializePayloadFields &&
71 72
                $constraint &&

@@ -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;

@@ -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) {

@@ -203,7 +203,7 @@
Loading
203 203
204 204
        if (isset($operation['route_name'])) {
205 205
            if (!isset($operation['method'])) {
206 -
                @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);
206 +
                @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);
207 207
            }
208 208
209 209
            return;

@@ -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
    }

@@ -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
    }
Files Complexity Coverage
src 4,637 84.86%
Project Totals (313 files) 4637 84.86%
phpunit-php7.4
Build #503434603 -
phpunit
phpunit-php7.4
Build #503433335 -
phpunit
behat-php7.4
Build #503434603 -
behat
behat-php7.4
Build #503433335 -
behat

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