Skip to content

Commit 908dafa

Browse files
authored
Prepare release 2.5.10 (#3970)
1 parent 9cecfab commit 908dafa

File tree

83 files changed

+127
-127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+127
-127
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.5.10
4+
5+
* Hydra: only display hydra:next when the item total is strictly greater than the number of items per page (#3967)
6+
37
## 2.5.9
48

59
* Fix a warning when preloading the `AbstractPaginator` class (#3827)

phpstan.neon.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ parameters:
4141
message: '#Strict comparison using !== between .+ and .+ will always evaluate to false\.#'
4242
paths:
4343
- src/Bridge/Doctrine/Common/PropertyHelperTrait.php
44-
-
45-
message: '#Variable \$iri might not be defined\.#'
46-
path: src/JsonApi/Serializer/ItemNormalizer.php
4744
-
4845
message: '#Variable \$positionPm might not be defined\.#'
4946
path: src/Util/ClassInfoTrait.php

src/Annotation/AttributesHydratorTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ private function hydrateAttributes(array $values): void
4343

4444
if (\array_key_exists('accessControl', $values)) {
4545
$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);
4747
unset($values['accessControl']);
4848
}
4949
if (\array_key_exists('accessControlMessage', $values)) {
5050
$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);
5252
unset($values['accessControlMessage']);
5353
}
5454

src/Api/CachedIdentifiersExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(CacheItemPoolInterface $cacheItemPool, IdentifiersEx
4444
$this->resourceClassResolver = $resourceClassResolver;
4545

4646
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);
4848
}
4949
}
5050

src/Api/FilterCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class FilterCollection extends \ArrayObject
2626
{
2727
public function __construct($input = [], $flags = 0, $iterator_class = 'ArrayIterator')
2828
{
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);
3030

3131
parent::__construct($input, $flags, $iterator_class);
3232
}

src/Api/FilterLocatorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private function setFilterLocator($filterLocator, bool $allowNull = false): void
3636
{
3737
if ($filterLocator instanceof ContainerInterface || $filterLocator instanceof FilterCollection || (null === $filterLocator && $allowNull)) {
3838
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);
4040
}
4141

4242
$this->filterLocator = $filterLocator;

src/Api/FormatsProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class FormatsProvider implements FormatsProviderInterface, OperationAwareF
3030

3131
public function __construct(ResourceMetadataFactoryInterface $resourceMetadataFactory, array $configuredFormats)
3232
{
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);
3434

3535
$this->resourceMetadataFactory = $resourceMetadataFactory;
3636
$this->configuredFormats = $configuredFormats;

src/Api/IdentifiersExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(PropertyNameCollectionFactoryInterface $propertyName
4141
$this->resourceClassResolver = $resourceClassResolver;
4242

4343
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);
4545
}
4646
}
4747

src/Api/OperationTypeDeprecationHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class OperationTypeDeprecationHelper
3434
public static function getOperationType($operationType): string
3535
{
3636
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);
3838

3939
$operationType = $operationType ? OperationType::COLLECTION : OperationType::ITEM;
4040
}

src/Bridge/Doctrine/Common/Filter/ExistsFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private function normalizeValue($value, string $property): ?bool
7575
if (\is_array($value) && isset($value[self::QUERY_PARAMETER_KEY])) {
7676
@trigger_error(
7777
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
7979
);
8080
$value = $value[self::QUERY_PARAMETER_KEY];
8181
}

src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ protected function normalizeValues(array $values, string $property): ?array
160160
protected function hasValidValues(array $values, $type = null): bool
161161
{
162162
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)) {
164164
return false;
165165
}
166166
}

src/Bridge/Doctrine/Common/PropertyHelperTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function isPropertyNested(string $property/*, string $resourceClass*/)
5555
if (__CLASS__ !== static::class) {
5656
$r = new \ReflectionMethod($this, __FUNCTION__);
5757
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);
5959
}
6060
}
6161
$resourceClass = null;
@@ -94,7 +94,7 @@ protected function splitPropertyParts(string $property/*, string $resourceClass*
9494
} elseif (__CLASS__ !== static::class) {
9595
$r = new \ReflectionMethod($this, __FUNCTION__);
9696
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);
9898
}
9999
}
100100

src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
*/
3737
final class PublishMercureUpdatesListener
3838
{
39+
use DispatchTrait;
40+
use ResourceClassInfoTrait;
3941
private const ALLOWED_KEYS = [
4042
'topics' => true,
4143
'data' => true,
@@ -45,9 +47,6 @@ final class PublishMercureUpdatesListener
4547
'retry' => true,
4648
];
4749

48-
use DispatchTrait;
49-
use ResourceClassInfoTrait;
50-
5150
private $iriConverter;
5251
private $serializer;
5352
private $publisher;
@@ -163,7 +162,7 @@ private function storeEntityToPublish($entity, string $property): void
163162
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');
164163
}
165164

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);
167166
break;
168167
}
169168

src/Bridge/Doctrine/EventListener/WriteListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class WriteListener
3131

3232
public function __construct(ManagerRegistry $managerRegistry)
3333
{
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);
3535

3636
$this->managerRegistry = $managerRegistry;
3737
}

src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ final class EagerLoadingExtension implements ContextAwareQueryCollectionExtensio
5555
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)
5656
{
5757
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);
5959
}
6060
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);
6262
}
6363

6464
$this->propertyNameCollectionFactory = $propertyNameCollectionFactory;
@@ -178,7 +178,7 @@ private function joinRelations(QueryBuilder $queryBuilder, QueryNameGeneratorInt
178178
(null === $fetchEager = $propertyMetadata->getAttribute('fetch_eager')) &&
179179
(null !== $fetchEager = $propertyMetadata->getAttribute('fetchEager'))
180180
) {
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);
182182
}
183183

184184
if (false === $fetchEager) {

src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ final class PaginationExtension implements ContextAwareQueryResultCollectionExte
6868
public function __construct(ManagerRegistry $managerRegistry, /* ResourceMetadataFactoryInterface */ $resourceMetadataFactory, /* Pagination */ $pagination)
6969
{
7070
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);
7373

7474
$this->requestStack = $resourceMetadataFactory;
7575
$resourceMetadataFactory = $pagination;
@@ -92,7 +92,7 @@ public function __construct(ManagerRegistry $managerRegistry, /* ResourceMetadat
9292

9393
foreach ($legacyPaginationArgs as $pos => $arg) {
9494
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);
9696

9797
if (!((null === $arg['default'] && null === $args[$pos]) || \call_user_func("is_{$arg['type']}", $args[$pos]))) {
9898
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 @@ private function getPagination(QueryBuilder $queryBuilder, string $resourceClass
224224
$maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'maximum_items_per_page', null, true);
225225

226226
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);
228228
}
229229

230230
$maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_maximum_items_per_page', $maxItemsPerPage ?? $this->maximumItemPerPage, true);
@@ -274,7 +274,7 @@ private function isPartialPaginationEnabled(Request $request = null, ResourceMet
274274
}
275275

276276
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);
278278
}
279279

280280
return $enabled;
@@ -286,7 +286,7 @@ private function isPaginationEnabled(Request $request, ResourceMetadata $resourc
286286
$clientEnabled = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_client_enabled', $this->clientEnabled, true);
287287

288288
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);
290290
}
291291

292292
return $enabled;

0 commit comments

Comments
 (0)