diff --git a/.php_cs.dist b/.php_cs.dist
index 97fd9615e2c..b561201b28f 100644
--- a/.php_cs.dist
+++ b/.php_cs.dist
@@ -6,11 +6,43 @@ $finder = PhpCsFixer\Finder::create()
;
return PhpCsFixer\Config::create()
+ ->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
+ '@Symfony:risky' => true,
+ 'array_syntax' => [
+ 'syntax' => 'short',
+ ],
+ 'braces' => [
+ 'allow_single_line_closure' => true,
+ ],
+ 'declare_strict_types' => true,
+ 'modernize_types_casting' => true,
+ // 'native_function_invocation' => true,
+ 'no_extra_consecutive_blank_lines' => [
+ 'break',
+ 'continue',
+ 'curly_brace_block',
+ 'extra',
+ 'parenthesis_brace_block',
+ 'return',
+ 'square_brace_block',
+ 'throw',
+ 'use',
+ ],
+ 'no_unreachable_default_argument_value' => true,
+ 'no_useless_else' => true,
+ 'no_useless_return' => true,
'ordered_imports' => true,
+ // 'phpdoc_add_missing_param_annotation' => [
+ // 'only_untyped' => false,
+ // ],
'phpdoc_order' => true,
- 'array_syntax' => array('syntax' => 'short'),
+ 'psr4' => true,
+ 'semicolon_after_instruction' => true,
+ 'strict_comparison' => true,
+ 'strict_param' => true,
+ 'ternary_to_null_coalescing' => true,
])
->setFinder($finder)
;
diff --git a/.travis.yml b/.travis.yml
index 14e90b45d3a..d5d2b4d3984 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,7 @@ before_install:
- if [[ $coverage = 1 ]]; then mkdir -p build/logs build/cov; fi
- if [[ $coverage = 1 ]]; then wget https://phar.phpunit.de/phpcov.phar; fi
- if [[ $coverage = 1 ]]; then wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar; fi
- - if [[ $lint = 1 ]]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.0.0/php-cs-fixer.phar; fi
+ - if [[ $lint = 1 ]]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.1.2/php-cs-fixer.phar; fi
- export PATH="$PATH:$HOME/.composer/vendor/bin"
install:
diff --git a/behat.yml b/behat.yml.dist
similarity index 96%
rename from behat.yml
rename to behat.yml.dist
index 7b174277de8..6f2076fbfb1 100644
--- a/behat.yml
+++ b/behat.yml.dist
@@ -20,7 +20,7 @@ default:
sessions:
default:
symfony2: ~
- 'Sanpi\Behatch\Extension': ~
+ 'Behatch\Extension': ~
coverage:
suites:
diff --git a/features/bootstrap/CoverageContext.php b/features/bootstrap/CoverageContext.php
index 84a203a640d..a9b0d2d60e5 100644
--- a/features/bootstrap/CoverageContext.php
+++ b/features/bootstrap/CoverageContext.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use SebastianBergmann\CodeCoverage\CodeCoverage;
diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php
index 39489768cb5..ed6c811db4d 100644
--- a/features/bootstrap/FeatureContext.php
+++ b/features/bootstrap/FeatureContext.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\CompositeItem;
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\CompositeLabel;
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\CompositeRelation;
diff --git a/features/bootstrap/HydraContext.php b/features/bootstrap/HydraContext.php
index 6423deaf3e6..d0c2c25662d 100644
--- a/features/bootstrap/HydraContext.php
+++ b/features/bootstrap/HydraContext.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
use Behat\Behat\Context\Context;
use Behat\Behat\Context\Environment\InitializedContextEnvironment;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
@@ -235,7 +237,7 @@ private function getOperations($className)
{
$classInfos = $this->getClassInfos($className);
- return isset($classInfos->{'hydra:supportedOperation'}) ? $classInfos->{'hydra:supportedOperation'} : [];
+ return $classInfos->{'hydra:supportedOperation'} ?? [];
}
/**
@@ -251,7 +253,7 @@ private function getProperties($className)
{
$classInfos = $this->getClassInfos($className);
- return isset($classInfos->{'hydra:supportedProperty'}) ? $classInfos->{'hydra:supportedProperty'} : [];
+ return $classInfos->{'hydra:supportedProperty'} ?? [];
}
/**
diff --git a/features/bootstrap/SwaggerContext.php b/features/bootstrap/SwaggerContext.php
index 786eba2de15..6ba956e10c4 100644
--- a/features/bootstrap/SwaggerContext.php
+++ b/features/bootstrap/SwaggerContext.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
use Behat\Behat\Context\Context;
use Behat\Behat\Context\Environment\InitializedContextEnvironment;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
@@ -132,7 +134,7 @@ public function assertPropertyExist($propertyName, $className)
public function assertPropertyIsRequired(string $propertyName, string $className)
{
$classInfo = $this->getClassInfos($className);
- if (!in_array($propertyName, $classInfo->required)) {
+ if (!in_array($propertyName, $classInfo->required, true)) {
throw new \Exception(sprintf('Property "%s" of class "%s" should be required', $propertyName, $className));
}
}
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index fd3f9f31ebe..da697182387 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -5,8 +5,11 @@
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.6/phpunit.xsd"
backupGlobals="false"
bootstrap="tests/Fixtures/app/bootstrap.php"
- colors="true">
+ colors="true"
+>
+
+
diff --git a/src/Action/EntrypointAction.php b/src/Action/EntrypointAction.php
index 48055064d6f..c1d72aad76c 100644
--- a/src/Action/EntrypointAction.php
+++ b/src/Action/EntrypointAction.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Action;
use ApiPlatform\Core\Api\Entrypoint;
diff --git a/src/Action/ExceptionAction.php b/src/Action/ExceptionAction.php
index 7f9bb6228ff..dc22c9747eb 100644
--- a/src/Action/ExceptionAction.php
+++ b/src/Action/ExceptionAction.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Action;
use ApiPlatform\Core\Util\ErrorFormatGuesser;
diff --git a/src/Action/PlaceholderAction.php b/src/Action/PlaceholderAction.php
index 081349bb57d..5ccc9a33616 100644
--- a/src/Action/PlaceholderAction.php
+++ b/src/Action/PlaceholderAction.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Action;
/**
diff --git a/src/Annotation/ApiProperty.php b/src/Annotation/ApiProperty.php
index d3278b047da..48de8d3f5b1 100644
--- a/src/Annotation/ApiProperty.php
+++ b/src/Annotation/ApiProperty.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Annotation;
/**
diff --git a/src/Annotation/ApiResource.php b/src/Annotation/ApiResource.php
index 6b582873a76..e5fc9133214 100644
--- a/src/Annotation/ApiResource.php
+++ b/src/Annotation/ApiResource.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Annotation;
/**
diff --git a/src/Api/Entrypoint.php b/src/Api/Entrypoint.php
index db6c7745156..d6b325f2af7 100644
--- a/src/Api/Entrypoint.php
+++ b/src/Api/Entrypoint.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
diff --git a/src/Api/FilterCollection.php b/src/Api/FilterCollection.php
index 2e2d9a7ccef..66bec766f95 100644
--- a/src/Api/FilterCollection.php
+++ b/src/Api/FilterCollection.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
/**
diff --git a/src/Api/FilterInterface.php b/src/Api/FilterInterface.php
index 1ba7d661ede..57223bc07ac 100644
--- a/src/Api/FilterInterface.php
+++ b/src/Api/FilterInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
/**
diff --git a/src/Api/IriConverterInterface.php b/src/Api/IriConverterInterface.php
index 919c7f8d990..b8a26159c47 100644
--- a/src/Api/IriConverterInterface.php
+++ b/src/Api/IriConverterInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Api/OperationMethodResolverInterface.php b/src/Api/OperationMethodResolverInterface.php
index f61c3300fb3..3efc60c176e 100644
--- a/src/Api/OperationMethodResolverInterface.php
+++ b/src/Api/OperationMethodResolverInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Api/ResourceClassResolver.php b/src/Api/ResourceClassResolver.php
index 2955b8f9713..14a23810a59 100644
--- a/src/Api/ResourceClassResolver.php
+++ b/src/Api/ResourceClassResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
use ApiPlatform\Core\DataProvider\PaginatorInterface;
diff --git a/src/Api/ResourceClassResolverInterface.php b/src/Api/ResourceClassResolverInterface.php
index bf4e40e5f36..a5c08754ec4 100644
--- a/src/Api/ResourceClassResolverInterface.php
+++ b/src/Api/ResourceClassResolverInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Api/UrlGeneratorInterface.php b/src/Api/UrlGeneratorInterface.php
index 5a23917ecc7..d4a7d1958cd 100644
--- a/src/Api/UrlGeneratorInterface.php
+++ b/src/Api/UrlGeneratorInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Api;
/**
diff --git a/src/Bridge/Doctrine/EventListener/WriteListener.php b/src/Bridge/Doctrine/EventListener/WriteListener.php
index d11c9b8f788..b8b79fae729 100644
--- a/src/Bridge/Doctrine/EventListener/WriteListener.php
+++ b/src/Bridge/Doctrine/EventListener/WriteListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\EventListener;
use Doctrine\Common\Persistence\ManagerRegistry;
@@ -58,7 +60,6 @@ public function onKernelView(GetResponseForControllerResultEvent $event)
case Request::METHOD_POST:
$objectManager->persist($controllerResult);
break;
-
case Request::METHOD_DELETE:
$objectManager->remove($controllerResult);
$event->setControllerResult(null);
diff --git a/src/Bridge/Doctrine/Orm/CollectionDataProvider.php b/src/Bridge/Doctrine/Orm/CollectionDataProvider.php
index 6fc366f6801..ffe4a775b17 100644
--- a/src/Bridge/Doctrine/Orm/CollectionDataProvider.php
+++ b/src/Bridge/Doctrine/Orm/CollectionDataProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryCollectionExtensionInterface;
diff --git a/src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php b/src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php
index 4657980d05e..8673af28f51 100644
--- a/src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php
+++ b/src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtension.php b/src/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtension.php
index 4dcae6898ba..cb100fce990 100644
--- a/src/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtension.php
+++ b/src/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtension.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Extension/FilterExtension.php b/src/Bridge/Doctrine/Orm/Extension/FilterExtension.php
index 479b3bfff1d..7a9f8b7d723 100644
--- a/src/Bridge/Doctrine/Orm/Extension/FilterExtension.php
+++ b/src/Bridge/Doctrine/Orm/Extension/FilterExtension.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use ApiPlatform\Core\Api\FilterCollection;
@@ -47,7 +49,7 @@ public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGenerator
}
foreach ($this->filters as $filterName => $filter) {
- if ($filter instanceof FilterInterface && in_array($filterName, $resourceFilters)) {
+ if ($filter instanceof FilterInterface && in_array($filterName, $resourceFilters, true)) {
$filter->apply($queryBuilder, $queryNameGenerator, $resourceClass, $operationName);
}
}
diff --git a/src/Bridge/Doctrine/Orm/Extension/OrderExtension.php b/src/Bridge/Doctrine/Orm/Extension/OrderExtension.php
index 5781490464f..7dec80e9f68 100644
--- a/src/Bridge/Doctrine/Orm/Extension/OrderExtension.php
+++ b/src/Bridge/Doctrine/Orm/Extension/OrderExtension.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php b/src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php
index 5fb8047236e..df77f67f6db 100644
--- a/src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php
+++ b/src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Paginator;
diff --git a/src/Bridge/Doctrine/Orm/Extension/QueryCollectionExtensionInterface.php b/src/Bridge/Doctrine/Orm/Extension/QueryCollectionExtensionInterface.php
index 9d239e53c80..6ee1b28a3fd 100644
--- a/src/Bridge/Doctrine/Orm/Extension/QueryCollectionExtensionInterface.php
+++ b/src/Bridge/Doctrine/Orm/Extension/QueryCollectionExtensionInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Extension/QueryItemExtensionInterface.php b/src/Bridge/Doctrine/Orm/Extension/QueryItemExtensionInterface.php
index ebb32fb5a2c..7d2d86e2f44 100644
--- a/src/Bridge/Doctrine/Orm/Extension/QueryItemExtensionInterface.php
+++ b/src/Bridge/Doctrine/Orm/Extension/QueryItemExtensionInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Extension/QueryResultCollectionExtensionInterface.php b/src/Bridge/Doctrine/Orm/Extension/QueryResultCollectionExtensionInterface.php
index 4c7ebd5586f..52d53b7da7e 100644
--- a/src/Bridge/Doctrine/Orm/Extension/QueryResultCollectionExtensionInterface.php
+++ b/src/Bridge/Doctrine/Orm/Extension/QueryResultCollectionExtensionInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use Doctrine\ORM\QueryBuilder;
diff --git a/src/Bridge/Doctrine/Orm/Extension/QueryResultItemExtensionInterface.php b/src/Bridge/Doctrine/Orm/Extension/QueryResultItemExtensionInterface.php
index 1b5cd6d9e03..07ba9ea893b 100644
--- a/src/Bridge/Doctrine/Orm/Extension/QueryResultItemExtensionInterface.php
+++ b/src/Bridge/Doctrine/Orm/Extension/QueryResultItemExtensionInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Extension;
use Doctrine\ORM\QueryBuilder;
diff --git a/src/Bridge/Doctrine/Orm/Filter/AbstractFilter.php b/src/Bridge/Doctrine/Orm/Filter/AbstractFilter.php
index 4b8420f98fb..847ee0eb8f4 100644
--- a/src/Bridge/Doctrine/Orm/Filter/AbstractFilter.php
+++ b/src/Bridge/Doctrine/Orm/Filter/AbstractFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Filter/BooleanFilter.php b/src/Bridge/Doctrine/Orm/Filter/BooleanFilter.php
index a2099854007..b27e78ec336 100644
--- a/src/Bridge/Doctrine/Orm/Filter/BooleanFilter.php
+++ b/src/Bridge/Doctrine/Orm/Filter/BooleanFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Filter/DateFilter.php b/src/Bridge/Doctrine/Orm/Filter/DateFilter.php
index b925183c08c..c6adb6cdd9c 100644
--- a/src/Bridge/Doctrine/Orm/Filter/DateFilter.php
+++ b/src/Bridge/Doctrine/Orm/Filter/DateFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Filter/FilterInterface.php b/src/Bridge/Doctrine/Orm/Filter/FilterInterface.php
index dcbaedd793d..582dcf415ab 100644
--- a/src/Bridge/Doctrine/Orm/Filter/FilterInterface.php
+++ b/src/Bridge/Doctrine/Orm/Filter/FilterInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Api\FilterInterface as BaseFilterInterface;
diff --git a/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php b/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php
index 93475921d7e..c628f368726 100644
--- a/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php
+++ b/src/Bridge/Doctrine/Orm/Filter/NumericFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Filter/OrderFilter.php b/src/Bridge/Doctrine/Orm/Filter/OrderFilter.php
index c681980c7fe..8e4ee9525a0 100644
--- a/src/Bridge/Doctrine/Orm/Filter/OrderFilter.php
+++ b/src/Bridge/Doctrine/Orm/Filter/OrderFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
@@ -87,7 +89,7 @@ protected function filterProperty(string $property, $direction, QueryBuilder $qu
}
$direction = strtoupper($direction);
- if (!in_array($direction, ['ASC', 'DESC'])) {
+ if (!in_array($direction, ['ASC', 'DESC'], true)) {
return;
}
diff --git a/src/Bridge/Doctrine/Orm/Filter/RangeFilter.php b/src/Bridge/Doctrine/Orm/Filter/RangeFilter.php
index 38a75473647..7a6d181a01b 100644
--- a/src/Bridge/Doctrine/Orm/Filter/RangeFilter.php
+++ b/src/Bridge/Doctrine/Orm/Filter/RangeFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
@@ -127,7 +129,6 @@ protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterf
->setParameter(sprintf('%s_2', $valueParameter), $rangeValue[1]);
break;
-
case self::PARAMETER_GREATER_THAN:
if (!is_numeric($value)) {
$this->logger->notice('Invalid filter ignored', [
@@ -142,7 +143,6 @@ protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterf
->setParameter($valueParameter, $value);
break;
-
case self::PARAMETER_GREATER_THAN_OR_EQUAL:
if (!is_numeric($value)) {
$this->logger->notice('Invalid filter ignored', [
@@ -157,7 +157,6 @@ protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterf
->setParameter($valueParameter, $value);
break;
-
case self::PARAMETER_LESS_THAN:
if (!is_numeric($value)) {
$this->logger->notice('Invalid filter ignored', [
@@ -172,7 +171,6 @@ protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterf
->setParameter($valueParameter, $value);
break;
-
case self::PARAMETER_LESS_THAN_OR_EQUAL:
if (!is_numeric($value)) {
$this->logger->notice('Invalid filter ignored', [
diff --git a/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php b/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php
index 31bc982ea88..08352f9286f 100644
--- a/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php
+++ b/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Filter;
use ApiPlatform\Core\Api\IriConverterInterface;
@@ -140,21 +142,17 @@ private function getType(string $doctrineType): string
switch ($doctrineType) {
case Type::TARRAY:
return 'array';
-
case Type::BIGINT:
case Type::INTEGER:
case Type::SMALLINT:
return 'int';
-
case Type::BOOLEAN:
return 'bool';
-
case Type::DATE:
case Type::TIME:
case Type::DATETIME:
case Type::DATETIMETZ:
return \DateTimeInterface::class;
-
case Type::FLOAT:
return 'float';
}
@@ -263,12 +261,12 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB
* @param QueryNameGeneratorInterface $queryNameGenerator
* @param string $alias
* @param string $field
- * @param string $value
+ * @param mixed $value
* @param bool $caseSensitive
*
* @throws InvalidArgumentException If strategy does not exist
*/
- protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, string $value, bool $caseSensitive)
+ protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, $value, bool $caseSensitive)
{
$wrapCase = $this->createWrapCase($caseSensitive);
$valueParameter = $queryNameGenerator->generateParameterName($field);
@@ -280,31 +278,26 @@ protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuild
->andWhere(sprintf($wrapCase('%s.%s').' = '.$wrapCase(':%s'), $alias, $field, $valueParameter))
->setParameter($valueParameter, $value);
break;
-
case self::STRATEGY_PARTIAL:
$queryBuilder
->andWhere(sprintf($wrapCase('%s.%s').' LIKE '.$wrapCase('CONCAT(\'%%\', :%s, \'%%\')'), $alias, $field, $valueParameter))
->setParameter($valueParameter, $value);
break;
-
case self::STRATEGY_START:
$queryBuilder
->andWhere(sprintf($wrapCase('%s.%s').' LIKE '.$wrapCase('CONCAT(:%s, \'%%\')'), $alias, $field, $valueParameter))
->setParameter($valueParameter, $value);
break;
-
case self::STRATEGY_END:
$queryBuilder
->andWhere(sprintf($wrapCase('%s.%s').' LIKE '.$wrapCase('CONCAT(\'%%\', :%s)'), $alias, $field, $valueParameter))
->setParameter($valueParameter, $value);
break;
-
case self::STRATEGY_WORD_START:
$queryBuilder
->andWhere(sprintf($wrapCase('%1$s.%2$s').' LIKE '.$wrapCase('CONCAT(:%3$s, \'%%\')').' OR '.$wrapCase('%1$s.%2$s').' LIKE '.$wrapCase('CONCAT(\'%% \', :%3$s, \'%%\')'), $alias, $field, $valueParameter))
->setParameter($valueParameter, $value);
break;
-
default:
throw new InvalidArgumentException(sprintf('strategy %s does not exist.', $strategy));
}
diff --git a/src/Bridge/Doctrine/Orm/ItemDataProvider.php b/src/Bridge/Doctrine/Orm/ItemDataProvider.php
index 0d820f9ac98..c72c268093f 100644
--- a/src/Bridge/Doctrine/Orm/ItemDataProvider.php
+++ b/src/Bridge/Doctrine/Orm/ItemDataProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
diff --git a/src/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactory.php b/src/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactory.php
index d5f9e99ff78..fb9c122844d 100644
--- a/src/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactory.php
+++ b/src/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property;
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
diff --git a/src/Bridge/Doctrine/Orm/Paginator.php b/src/Bridge/Doctrine/Orm/Paginator.php
index c9923b22b95..91b6ddf8156 100644
--- a/src/Bridge/Doctrine/Orm/Paginator.php
+++ b/src/Bridge/Doctrine/Orm/Paginator.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm;
use ApiPlatform\Core\DataProvider\PaginatorInterface;
diff --git a/src/Bridge/Doctrine/Orm/Util/QueryChecker.php b/src/Bridge/Doctrine/Orm/Util/QueryChecker.php
index 478df6a9461..c28adf448a0 100644
--- a/src/Bridge/Doctrine/Orm/Util/QueryChecker.php
+++ b/src/Bridge/Doctrine/Orm/Util/QueryChecker.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Util;
use Doctrine\Common\Persistence\ManagerRegistry;
diff --git a/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php b/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php
index 915b79f5251..2577bcbe3db 100644
--- a/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php
+++ b/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Util;
use Doctrine\Common\Persistence\ManagerRegistry;
@@ -78,7 +80,7 @@ public static function getClassMetadataFromJoinAlias(string $alias, QueryBuilder
}
}
- $rootEntity = $rootEntities[array_search($rootAlias, $rootAliases)];
+ $rootEntity = $rootEntities[array_search($rootAlias, $rootAliases, true)];
$rootMetadata = $managerRegistry
->getManagerForClass($rootEntity)
diff --git a/src/Bridge/Doctrine/Orm/Util/QueryNameGenerator.php b/src/Bridge/Doctrine/Orm/Util/QueryNameGenerator.php
index 70d8dc573a7..44f2eab03db 100644
--- a/src/Bridge/Doctrine/Orm/Util/QueryNameGenerator.php
+++ b/src/Bridge/Doctrine/Orm/Util/QueryNameGenerator.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Util;
/**
diff --git a/src/Bridge/Doctrine/Orm/Util/QueryNameGeneratorInterface.php b/src/Bridge/Doctrine/Orm/Util/QueryNameGeneratorInterface.php
index d3af1b17b19..b677ad403c3 100644
--- a/src/Bridge/Doctrine/Orm/Util/QueryNameGeneratorInterface.php
+++ b/src/Bridge/Doctrine/Orm/Util/QueryNameGeneratorInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Doctrine\Orm\Util;
/**
diff --git a/src/Bridge/FosUser/EventListener.php b/src/Bridge/FosUser/EventListener.php
index 53d67fad518..6f64ef7541e 100644
--- a/src/Bridge/FosUser/EventListener.php
+++ b/src/Bridge/FosUser/EventListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\FosUser;
use ApiPlatform\Core\Exception\RuntimeException;
@@ -57,7 +59,6 @@ public function onKernelView(GetResponseForControllerResultEvent $event)
$this->userManager->deleteUser($user);
$event->setControllerResult(null);
break;
-
default:
$this->userManager->updateUser($user);
break;
diff --git a/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php b/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php
index fe5fd859305..3c0f8c31ced 100644
--- a/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php
+++ b/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\NelmioApiDoc\Extractor\AnnotationsProvider;
use ApiPlatform\Core\Api\FilterCollection;
@@ -128,7 +130,7 @@ private function getApiDoc(bool $collection, string $resourceClass, ResourceMeta
$data['filters'] = [];
foreach ($this->filters as $filterName => $filter) {
- if (in_array($filterName, $resourceFilters)) {
+ if (in_array($filterName, $resourceFilters, true)) {
foreach ($filter->getDescription($resourceClass) as $name => $definition) {
$data['filters'][] = ['name' => $name] + $definition;
}
diff --git a/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php b/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php
index 6b500072c4e..9ff4c608c93 100644
--- a/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php
+++ b/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\NelmioApiDoc\Parser;
use ApiPlatform\Core\Exception\ResourceClassNotFoundException;
@@ -59,7 +61,7 @@ public function __construct(ResourceMetadataFactoryInterface $resourceMetadataFa
public function supports(array $item)
{
$data = explode(':', $item['class'], 3);
- if (!in_array($data[0], [self::IN_PREFIX, self::OUT_PREFIX])) {
+ if (!in_array($data[0], [self::IN_PREFIX, self::OUT_PREFIX], true)) {
return false;
}
if (!isset($data[1])) {
@@ -134,7 +136,7 @@ private function getGroupsContext(ResourceMetadata $resourceMetadata, string $op
return [
$groupsContext => [
- 'groups' => array_merge(isset($itemOperationAttribute) ? $itemOperationAttribute : [], isset($collectionOperationAttribute) ? $collectionOperationAttribute : []),
+ 'groups' => array_merge($itemOperationAttribute ?? [], $collectionOperationAttribute ?? []),
],
];
}
@@ -277,7 +279,7 @@ private function parseProperty(ResourceMetadata $resourceMetadata, PropertyMetad
$data['actualType'] = DataTypes::MODEL;
$data['subType'] = $className;
- $data['children'] = in_array($className, $visited) ? [] : $this->parseResource($resourceMetadata, $className, $io);
+ $data['children'] = in_array($className, $visited, true) ? [] : $this->parseResource($resourceMetadata, $className, $io);
return $data;
}
diff --git a/src/Bridge/Symfony/Bundle/Action/SwaggerUiAction.php b/src/Bridge/Symfony/Bundle/Action/SwaggerUiAction.php
index f1452e0265a..06ad0ae0569 100644
--- a/src/Bridge/Symfony/Bundle/Action/SwaggerUiAction.php
+++ b/src/Bridge/Symfony/Bundle/Action/SwaggerUiAction.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\Action;
use ApiPlatform\Core\Documentation\Documentation;
diff --git a/src/Bridge/Symfony/Bundle/ApiPlatformBundle.php b/src/Bridge/Symfony/Bundle/ApiPlatformBundle.php
index 31e3922bd17..79059eafa7a 100644
--- a/src/Bridge/Symfony/Bundle/ApiPlatformBundle.php
+++ b/src/Bridge/Symfony/Bundle/ApiPlatformBundle.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle;
use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\DataProviderPass;
diff --git a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php
index ed5e77cb12e..9de998068d0 100644
--- a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php
+++ b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\Command;
use ApiPlatform\Core\Documentation\Documentation;
diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php b/src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
index 95e1b17d01b..4d9ab000c8f 100644
--- a/src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
+++ b/src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection;
use Doctrine\ORM\Version;
diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DataProviderPass.php b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DataProviderPass.php
index 197dd1af282..b2878ef0aa0 100644
--- a/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DataProviderPass.php
+++ b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DataProviderPass.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPass.php b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPass.php
index 3add3fa0595..813a2793592 100644
--- a/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPass.php
+++ b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPass.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPass.php b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPass.php
index ccc22528507..091fe93d93a 100644
--- a/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPass.php
+++ b/src/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPass.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php b/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php
index 5e397db3ccf..143389503bf 100644
--- a/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php
+++ b/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Bridge/Symfony/Bundle/EventListener/SwaggerUiListener.php b/src/Bridge/Symfony/Bundle/EventListener/SwaggerUiListener.php
index d0d9f094443..94067ee972f 100644
--- a/src/Bridge/Symfony/Bundle/EventListener/SwaggerUiListener.php
+++ b/src/Bridge/Symfony/Bundle/EventListener/SwaggerUiListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
diff --git a/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyMetadataFactory.php b/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyMetadataFactory.php
index ab4e18a7370..d606943f546 100644
--- a/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyMetadataFactory.php
+++ b/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\PropertyInfo\Metadata\Property;
use ApiPlatform\Core\Exception\PropertyNotFoundException;
diff --git a/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyNameCollectionFactory.php b/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyNameCollectionFactory.php
index 39e51a78e70..f988850c080 100644
--- a/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyNameCollectionFactory.php
+++ b/src/Bridge/Symfony/PropertyInfo/Metadata/Property/PropertyInfoPropertyNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\PropertyInfo\Metadata\Property;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Bridge/Symfony/Routing/ApiLoader.php b/src/Bridge/Symfony/Routing/ApiLoader.php
index b9e31109813..1a13c76688d 100644
--- a/src/Bridge/Symfony/Routing/ApiLoader.php
+++ b/src/Bridge/Symfony/Routing/ApiLoader.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Exception\InvalidResourceException;
diff --git a/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php b/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php
index 269f743642c..f2e4b88af8c 100644
--- a/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php
+++ b/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use Psr\Cache\CacheException;
diff --git a/src/Bridge/Symfony/Routing/IriConverter.php b/src/Bridge/Symfony/Routing/IriConverter.php
index 100d044c066..69057834cef 100644
--- a/src/Bridge/Symfony/Routing/IriConverter.php
+++ b/src/Bridge/Symfony/Routing/IriConverter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Api\IriConverterInterface;
@@ -161,7 +163,7 @@ private function getIdentifiersFromItem($item): array
private function generateIdentifiersUrl(array $identifiers): array
{
if (1 === count($identifiers)) {
- return [rawurlencode(array_values($identifiers)[0])];
+ return [rawurlencode((string) array_values($identifiers)[0])];
}
foreach ($identifiers as $name => $value) {
diff --git a/src/Bridge/Symfony/Routing/OperationMethodResolver.php b/src/Bridge/Symfony/Routing/OperationMethodResolver.php
index a3ebdbbd84c..a5e99ac488f 100644
--- a/src/Bridge/Symfony/Routing/OperationMethodResolver.php
+++ b/src/Bridge/Symfony/Routing/OperationMethodResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Bridge/Symfony/Routing/OperationMethodResolverInterface.php b/src/Bridge/Symfony/Routing/OperationMethodResolverInterface.php
index edf14116019..13813b99268 100644
--- a/src/Bridge/Symfony/Routing/OperationMethodResolverInterface.php
+++ b/src/Bridge/Symfony/Routing/OperationMethodResolverInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Api\OperationMethodResolverInterface as BaseOperationMethodResolverInterface;
diff --git a/src/Bridge/Symfony/Routing/RouteNameResolver.php b/src/Bridge/Symfony/Routing/RouteNameResolver.php
index a369ecb6036..32148d01339 100644
--- a/src/Bridge/Symfony/Routing/RouteNameResolver.php
+++ b/src/Bridge/Symfony/Routing/RouteNameResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Exception\InvalidArgumentException;
@@ -40,7 +42,7 @@ public function getRouteName(string $resourceClass, bool $collection): string
$operation = $route->getDefault(sprintf('_api_%s_operation_name', $operationType));
$methods = $route->getMethods();
- if ($resourceClass === $currentResourceClass && null !== $operation && (empty($methods) || in_array('GET', $methods))) {
+ if ($resourceClass === $currentResourceClass && null !== $operation && (empty($methods) || in_array('GET', $methods, true))) {
return $routeName;
}
}
diff --git a/src/Bridge/Symfony/Routing/RouteNameResolverInterface.php b/src/Bridge/Symfony/Routing/RouteNameResolverInterface.php
index de1442a5ae7..573b7681763 100644
--- a/src/Bridge/Symfony/Routing/RouteNameResolverInterface.php
+++ b/src/Bridge/Symfony/Routing/RouteNameResolverInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Bridge/Symfony/Routing/Router.php b/src/Bridge/Symfony/Routing/Router.php
index 04b9db68220..0a846ea7786 100644
--- a/src/Bridge/Symfony/Routing/Router.php
+++ b/src/Bridge/Symfony/Routing/Router.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/src/Bridge/Symfony/Routing/RouterOperationPathResolver.php b/src/Bridge/Symfony/Routing/RouterOperationPathResolver.php
index 65f4d7d0dd2..6059e8df910 100644
--- a/src/Bridge/Symfony/Routing/RouterOperationPathResolver.php
+++ b/src/Bridge/Symfony/Routing/RouterOperationPathResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Routing;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Bridge/Symfony/Validator/EventListener/ValidateListener.php b/src/Bridge/Symfony/Validator/EventListener/ValidateListener.php
index d146946f7aa..d6ce02b1dfc 100644
--- a/src/Bridge/Symfony/Validator/EventListener/ValidateListener.php
+++ b/src/Bridge/Symfony/Validator/EventListener/ValidateListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Validator\EventListener;
use ApiPlatform\Core\Bridge\Symfony\Validator\Exception\ValidationException;
diff --git a/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php b/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php
index 07379e16b79..126a886a49c 100644
--- a/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php
+++ b/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Validator\EventListener;
use ApiPlatform\Core\Bridge\Symfony\Validator\Exception\ValidationException;
diff --git a/src/Bridge/Symfony/Validator/Exception/ValidationException.php b/src/Bridge/Symfony/Validator/Exception/ValidationException.php
index 2ba24b5e423..c0819e16f7a 100644
--- a/src/Bridge/Symfony/Validator/Exception/ValidationException.php
+++ b/src/Bridge/Symfony/Validator/Exception/ValidationException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Validator\Exception;
use Symfony\Component\Validator\ConstraintViolationListInterface;
diff --git a/src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php b/src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php
index 275c1724287..0922f9c853f 100644
--- a/src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php
+++ b/src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Bridge\Symfony\Validator\Metadata\Property;
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
diff --git a/src/DataProvider/ChainCollectionDataProvider.php b/src/DataProvider/ChainCollectionDataProvider.php
index d5b03870825..2cac56c5739 100644
--- a/src/DataProvider/ChainCollectionDataProvider.php
+++ b/src/DataProvider/ChainCollectionDataProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\DataProvider;
use ApiPlatform\Core\Exception\ResourceClassNotSupportedException;
diff --git a/src/DataProvider/ChainItemDataProvider.php b/src/DataProvider/ChainItemDataProvider.php
index edaa194ba81..eeb37be60d2 100644
--- a/src/DataProvider/ChainItemDataProvider.php
+++ b/src/DataProvider/ChainItemDataProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\DataProvider;
use ApiPlatform\Core\Exception\ResourceClassNotSupportedException;
diff --git a/src/DataProvider/CollectionDataProviderInterface.php b/src/DataProvider/CollectionDataProviderInterface.php
index cf576307a19..78899c18bfa 100644
--- a/src/DataProvider/CollectionDataProviderInterface.php
+++ b/src/DataProvider/CollectionDataProviderInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\DataProvider;
use ApiPlatform\Core\Exception\ResourceClassNotSupportedException;
diff --git a/src/DataProvider/ItemDataProviderInterface.php b/src/DataProvider/ItemDataProviderInterface.php
index 7de63c992c6..2c26778aff4 100644
--- a/src/DataProvider/ItemDataProviderInterface.php
+++ b/src/DataProvider/ItemDataProviderInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\DataProvider;
use ApiPlatform\Core\Exception\ResourceClassNotSupportedException;
diff --git a/src/DataProvider/PaginatorInterface.php b/src/DataProvider/PaginatorInterface.php
index fa99443585e..11e8760eb7d 100644
--- a/src/DataProvider/PaginatorInterface.php
+++ b/src/DataProvider/PaginatorInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\DataProvider;
/**
diff --git a/src/Documentation/Action/DocumentationAction.php b/src/Documentation/Action/DocumentationAction.php
index 744caf9a491..ff05d5dcbc3 100644
--- a/src/Documentation/Action/DocumentationAction.php
+++ b/src/Documentation/Action/DocumentationAction.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Documentation\Action;
use ApiPlatform\Core\Documentation\Documentation;
diff --git a/src/Documentation/Documentation.php b/src/Documentation/Documentation.php
index 08912e80b3c..f01dc557828 100644
--- a/src/Documentation/Documentation.php
+++ b/src/Documentation/Documentation.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Documentation;
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
diff --git a/src/EventListener/AddFormatListener.php b/src/EventListener/AddFormatListener.php
index e9096cf334d..d3478ae08a5 100644
--- a/src/EventListener/AddFormatListener.php
+++ b/src/EventListener/AddFormatListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\EventListener;
use Negotiation\Negotiator;
diff --git a/src/EventListener/DeserializeListener.php b/src/EventListener/DeserializeListener.php
index 06a275e4e29..f0fcd88e196 100644
--- a/src/EventListener/DeserializeListener.php
+++ b/src/EventListener/DeserializeListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\EventListener;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/EventListener/EventPriorities.php b/src/EventListener/EventPriorities.php
index 6c1f6ff79e3..b8677f4f5e0 100644
--- a/src/EventListener/EventPriorities.php
+++ b/src/EventListener/EventPriorities.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\EventListener;
/**
diff --git a/src/EventListener/ExceptionListener.php b/src/EventListener/ExceptionListener.php
index bd7c8fc5239..12d4ffaa211 100644
--- a/src/EventListener/ExceptionListener.php
+++ b/src/EventListener/ExceptionListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
diff --git a/src/EventListener/ReadListener.php b/src/EventListener/ReadListener.php
index e30db51d4de..c397da2c4d7 100644
--- a/src/EventListener/ReadListener.php
+++ b/src/EventListener/ReadListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\EventListener;
use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface;
diff --git a/src/EventListener/RespondListener.php b/src/EventListener/RespondListener.php
index 4b49b10b375..dcd3960e4cc 100644
--- a/src/EventListener/RespondListener.php
+++ b/src/EventListener/RespondListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\EventListener;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/EventListener/SerializeListener.php b/src/EventListener/SerializeListener.php
index 10110b611b1..d29075636b9 100644
--- a/src/EventListener/SerializeListener.php
+++ b/src/EventListener/SerializeListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\EventListener;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Exception/DeserializationException.php b/src/Exception/DeserializationException.php
index c1337bb16fa..61b79831c2f 100644
--- a/src/Exception/DeserializationException.php
+++ b/src/Exception/DeserializationException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
use Symfony\Component\Serializer\Exception\ExceptionInterface as SerializerExceptionInterface;
diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php
index 7419be51350..604c654605b 100644
--- a/src/Exception/ExceptionInterface.php
+++ b/src/Exception/ExceptionInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php
index 071fbef645a..35ab5f69c43 100644
--- a/src/Exception/InvalidArgumentException.php
+++ b/src/Exception/InvalidArgumentException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Exception/InvalidResourceException.php b/src/Exception/InvalidResourceException.php
index d06bf7482eb..2a9d65f0242 100644
--- a/src/Exception/InvalidResourceException.php
+++ b/src/Exception/InvalidResourceException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Exception/ItemNotFoundException.php b/src/Exception/ItemNotFoundException.php
index 9d9f65bb552..1288320f2d6 100644
--- a/src/Exception/ItemNotFoundException.php
+++ b/src/Exception/ItemNotFoundException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Exception/PropertyNotFoundException.php b/src/Exception/PropertyNotFoundException.php
index cf903fced6a..b9e71950864 100644
--- a/src/Exception/PropertyNotFoundException.php
+++ b/src/Exception/PropertyNotFoundException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Exception/ResourceClassNotFoundException.php b/src/Exception/ResourceClassNotFoundException.php
index 8bd9fa4e2d4..88ea7cf83e6 100644
--- a/src/Exception/ResourceClassNotFoundException.php
+++ b/src/Exception/ResourceClassNotFoundException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Exception/ResourceClassNotSupportedException.php b/src/Exception/ResourceClassNotSupportedException.php
index dc69ce6217c..2525b04e5fb 100644
--- a/src/Exception/ResourceClassNotSupportedException.php
+++ b/src/Exception/ResourceClassNotSupportedException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php
index f8a07803d00..f26cf66ae8c 100644
--- a/src/Exception/RuntimeException.php
+++ b/src/Exception/RuntimeException.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Exception;
/**
diff --git a/src/Hal/Serializer/CollectionNormalizer.php b/src/Hal/Serializer/CollectionNormalizer.php
index a418f3fd1cd..0b64921469d 100644
--- a/src/Hal/Serializer/CollectionNormalizer.php
+++ b/src/Hal/Serializer/CollectionNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hal\Serializer;
use ApiPlatform\Core\Api\ResourceClassResolverInterface;
diff --git a/src/Hal/Serializer/EntrypointNormalizer.php b/src/Hal/Serializer/EntrypointNormalizer.php
index e66af47ccdd..babedaf5039 100644
--- a/src/Hal/Serializer/EntrypointNormalizer.php
+++ b/src/Hal/Serializer/EntrypointNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hal\Serializer;
use ApiPlatform\Core\Api\Entrypoint;
diff --git a/src/Hal/Serializer/ItemNormalizer.php b/src/Hal/Serializer/ItemNormalizer.php
index d1398377eca..a06e99e6494 100644
--- a/src/Hal/Serializer/ItemNormalizer.php
+++ b/src/Hal/Serializer/ItemNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hal\Serializer;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Hydra/EventListener/AddLinkHeaderListener.php b/src/Hydra/EventListener/AddLinkHeaderListener.php
index 365c15182d3..ac947dce512 100644
--- a/src/Hydra/EventListener/AddLinkHeaderListener.php
+++ b/src/Hydra/EventListener/AddLinkHeaderListener.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\EventListener;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/src/Hydra/Serializer/CollectionFiltersNormalizer.php b/src/Hydra/Serializer/CollectionFiltersNormalizer.php
index b4f501cebd2..2525e27dd75 100644
--- a/src/Hydra/Serializer/CollectionFiltersNormalizer.php
+++ b/src/Hydra/Serializer/CollectionFiltersNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\Serializer;
use ApiPlatform\Core\Api\FilterCollection;
@@ -69,7 +71,7 @@ public function normalize($object, $format = null, array $context = [])
$resourceFilters = $resourceMetadata->getCollectionOperationAttribute($operationName, 'filters', [], true);
}
- if ([] === $resourceFilters) {
+ if (!$resourceFilters) {
return $data;
}
@@ -80,12 +82,12 @@ public function normalize($object, $format = null, array $context = [])
$currentFilters = [];
foreach ($this->filters as $filterName => $filter) {
- if (in_array($filterName, $resourceFilters)) {
+ if (in_array($filterName, $resourceFilters, true)) {
$currentFilters[] = $filter;
}
}
- if ([] !== $currentFilters) {
+ if ($currentFilters) {
$data['hydra:search'] = $this->getSearch($resourceClass, $requestParts, $currentFilters);
}
diff --git a/src/Hydra/Serializer/CollectionNormalizer.php b/src/Hydra/Serializer/CollectionNormalizer.php
index 6eeb687a7b0..7eee607be5e 100644
--- a/src/Hydra/Serializer/CollectionNormalizer.php
+++ b/src/Hydra/Serializer/CollectionNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/src/Hydra/Serializer/ConstraintViolationListNormalizer.php b/src/Hydra/Serializer/ConstraintViolationListNormalizer.php
index 683a87d2cf5..24c7a8e141f 100644
--- a/src/Hydra/Serializer/ConstraintViolationListNormalizer.php
+++ b/src/Hydra/Serializer/ConstraintViolationListNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\Serializer;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/src/Hydra/Serializer/DocumentationNormalizer.php b/src/Hydra/Serializer/DocumentationNormalizer.php
index 747269d12cd..d512fb26a53 100644
--- a/src/Hydra/Serializer/DocumentationNormalizer.php
+++ b/src/Hydra/Serializer/DocumentationNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\Serializer;
use ApiPlatform\Core\Api\OperationMethodResolverInterface;
@@ -298,16 +300,12 @@ private function getRange(PropertyMetadata $propertyMetadata)
switch ($type->getBuiltinType()) {
case Type::BUILTIN_TYPE_STRING:
return 'xmls:string';
-
case Type::BUILTIN_TYPE_INT:
return 'xmls:integer';
-
case Type::BUILTIN_TYPE_FLOAT:
return 'xmls:decimal';
-
case Type::BUILTIN_TYPE_BOOL:
return 'xmls:boolean';
-
case Type::BUILTIN_TYPE_OBJECT:
if (null === $className = $type->getClassName()) {
return;
diff --git a/src/Hydra/Serializer/EntrypointNormalizer.php b/src/Hydra/Serializer/EntrypointNormalizer.php
index 780ffd910bd..00a4b1ffe8e 100644
--- a/src/Hydra/Serializer/EntrypointNormalizer.php
+++ b/src/Hydra/Serializer/EntrypointNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\Serializer;
use ApiPlatform\Core\Api\Entrypoint;
diff --git a/src/Hydra/Serializer/ErrorNormalizer.php b/src/Hydra/Serializer/ErrorNormalizer.php
index 7abfc41cea1..4e27af1a530 100644
--- a/src/Hydra/Serializer/ErrorNormalizer.php
+++ b/src/Hydra/Serializer/ErrorNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\Serializer;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/src/Hydra/Serializer/PartialCollectionViewNormalizer.php b/src/Hydra/Serializer/PartialCollectionViewNormalizer.php
index ad2a7bdd15c..a8d531099e2 100644
--- a/src/Hydra/Serializer/PartialCollectionViewNormalizer.php
+++ b/src/Hydra/Serializer/PartialCollectionViewNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Hydra\Serializer;
use ApiPlatform\Core\DataProvider\PaginatorInterface;
@@ -62,7 +64,7 @@ public function normalize($object, $format = null, array $context = [])
$appliedFilters = $parsed['parameters'];
unset($appliedFilters[$this->enabledParameterName]);
- if ([] === $appliedFilters && !$paginated) {
+ if (!$appliedFilters && !$paginated) {
return $data;
}
diff --git a/src/JsonLd/Action/ContextAction.php b/src/JsonLd/Action/ContextAction.php
index b1215e25b26..6c10d3cc9e1 100644
--- a/src/JsonLd/Action/ContextAction.php
+++ b/src/JsonLd/Action/ContextAction.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\JsonLd\Action;
use ApiPlatform\Core\JsonLd\ContextBuilderInterface;
diff --git a/src/JsonLd/ContextBuilder.php b/src/JsonLd/ContextBuilder.php
index 3872787eca1..e387b1fc1aa 100644
--- a/src/JsonLd/ContextBuilder.php
+++ b/src/JsonLd/ContextBuilder.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\JsonLd;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/src/JsonLd/ContextBuilderInterface.php b/src/JsonLd/ContextBuilderInterface.php
index a3114d51bda..f39e718bca1 100644
--- a/src/JsonLd/ContextBuilderInterface.php
+++ b/src/JsonLd/ContextBuilderInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\JsonLd;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/src/JsonLd/Serializer/ItemNormalizer.php b/src/JsonLd/Serializer/ItemNormalizer.php
index e1865041b0c..5a828882430 100644
--- a/src/JsonLd/Serializer/ItemNormalizer.php
+++ b/src/JsonLd/Serializer/ItemNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\JsonLd\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/src/JsonLd/Serializer/JsonLdContextTrait.php b/src/JsonLd/Serializer/JsonLdContextTrait.php
index 9e3f6eb4bb7..7e51a861c83 100644
--- a/src/JsonLd/Serializer/JsonLdContextTrait.php
+++ b/src/JsonLd/Serializer/JsonLdContextTrait.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\JsonLd\Serializer;
use ApiPlatform\Core\JsonLd\ContextBuilderInterface;
diff --git a/src/Metadata/Extractor/AbstractExtractor.php b/src/Metadata/Extractor/AbstractExtractor.php
index 61c86825847..8344d204a42 100644
--- a/src/Metadata/Extractor/AbstractExtractor.php
+++ b/src/Metadata/Extractor/AbstractExtractor.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Extractor;
/**
diff --git a/src/Metadata/Extractor/ExtractorInterface.php b/src/Metadata/Extractor/ExtractorInterface.php
index 76799e6d2d6..b383e3d083d 100644
--- a/src/Metadata/Extractor/ExtractorInterface.php
+++ b/src/Metadata/Extractor/ExtractorInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Extractor;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Metadata/Extractor/XmlExtractor.php b/src/Metadata/Extractor/XmlExtractor.php
index df0653a301b..fbcbeb34c82 100644
--- a/src/Metadata/Extractor/XmlExtractor.php
+++ b/src/Metadata/Extractor/XmlExtractor.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Extractor;
use ApiPlatform\Core\Exception\InvalidArgumentException;
@@ -124,7 +126,6 @@ private function phpize(\SimpleXMLElement $array, string $key, string $type)
switch ($type) {
case 'string':
return (string) $array[$key];
-
case 'bool':
return (bool) XmlUtils::phpize($array[$key]);
}
diff --git a/src/Metadata/Extractor/YamlExtractor.php b/src/Metadata/Extractor/YamlExtractor.php
index f5ba597d215..1bb50adaf43 100644
--- a/src/Metadata/Extractor/YamlExtractor.php
+++ b/src/Metadata/Extractor/YamlExtractor.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Extractor;
use ApiPlatform\Core\Exception\InvalidArgumentException;
@@ -132,7 +134,6 @@ private function phpize(array $array, string $key, string $type)
return $array[$key];
}
break;
-
case 'string':
if (is_string($array[$key])) {
return $array[$key];
diff --git a/src/Metadata/Property/Factory/AnnotationPropertyMetadataFactory.php b/src/Metadata/Property/Factory/AnnotationPropertyMetadataFactory.php
index cdf87c452a4..2be64e02632 100644
--- a/src/Metadata/Property/Factory/AnnotationPropertyMetadataFactory.php
+++ b/src/Metadata/Property/Factory/AnnotationPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Annotation\ApiProperty;
@@ -18,7 +20,7 @@
use Doctrine\Common\Annotations\Reader;
/**
- * Creates a property metadata from {@see Property} annotations.
+ * Creates a property metadata from {@see ApiProperty} annotations.
*
* @author Kévin Dunglas
*/
diff --git a/src/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactory.php b/src/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactory.php
index b67a078b97d..727a6eaf6bf 100644
--- a/src/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactory.php
+++ b/src/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Annotation\ApiProperty;
@@ -18,7 +20,7 @@
use Doctrine\Common\Annotations\Reader;
/**
- * Creates a property name collection from {@see Property} annotations.
+ * Creates a property name collection from {@see ApiProperty} annotations.
*
* @author Kévin Dunglas
*/
@@ -74,7 +76,7 @@ public function create(string $resourceClass, array $options = []): PropertyName
}
$propertyName = $this->reflection->getProperty($reflectionMethod->name);
- if (!preg_match('/^[A-Z]{2,}/', $propertyName)) {
+ if (null !== $propertyName && !preg_match('/^[A-Z]{2,}/', $propertyName)) {
$propertyName = lcfirst($propertyName);
}
diff --git a/src/Metadata/Property/Factory/CachedPropertyMetadataFactory.php b/src/Metadata/Property/Factory/CachedPropertyMetadataFactory.php
index 0c46af9b900..9b2f36713a8 100644
--- a/src/Metadata/Property/Factory/CachedPropertyMetadataFactory.php
+++ b/src/Metadata/Property/Factory/CachedPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\PropertyMetadata;
diff --git a/src/Metadata/Property/Factory/CachedPropertyNameCollectionFactory.php b/src/Metadata/Property/Factory/CachedPropertyNameCollectionFactory.php
index 48e86a2edf2..1856129a05d 100644
--- a/src/Metadata/Property/Factory/CachedPropertyNameCollectionFactory.php
+++ b/src/Metadata/Property/Factory/CachedPropertyNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\PropertyNameCollection;
diff --git a/src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php b/src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php
index b67d094cfd3..e8a7bd05c3f 100644
--- a/src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php
+++ b/src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Exception\PropertyNotFoundException;
diff --git a/src/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactory.php b/src/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactory.php
index b37c07565b6..bb1aa9d0555 100644
--- a/src/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactory.php
+++ b/src/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Metadata/Property/Factory/InheritedPropertyMetadataFactory.php b/src/Metadata/Property/Factory/InheritedPropertyMetadataFactory.php
index 2249e71b4df..c5d5b3941b7 100644
--- a/src/Metadata/Property/Factory/InheritedPropertyMetadataFactory.php
+++ b/src/Metadata/Property/Factory/InheritedPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\PropertyMetadata;
diff --git a/src/Metadata/Property/Factory/InheritedPropertyNameCollectionFactory.php b/src/Metadata/Property/Factory/InheritedPropertyNameCollectionFactory.php
index 33551351e22..18fb6e392cf 100644
--- a/src/Metadata/Property/Factory/InheritedPropertyNameCollectionFactory.php
+++ b/src/Metadata/Property/Factory/InheritedPropertyNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\PropertyNameCollection;
diff --git a/src/Metadata/Property/Factory/PropertyMetadataFactoryInterface.php b/src/Metadata/Property/Factory/PropertyMetadataFactoryInterface.php
index e4e442a65f6..0a470267c79 100644
--- a/src/Metadata/Property/Factory/PropertyMetadataFactoryInterface.php
+++ b/src/Metadata/Property/Factory/PropertyMetadataFactoryInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Exception\PropertyNotFoundException;
diff --git a/src/Metadata/Property/Factory/PropertyNameCollectionFactoryInterface.php b/src/Metadata/Property/Factory/PropertyNameCollectionFactoryInterface.php
index 974ee00ab6e..3d5f222a191 100644
--- a/src/Metadata/Property/Factory/PropertyNameCollectionFactoryInterface.php
+++ b/src/Metadata/Property/Factory/PropertyNameCollectionFactoryInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Exception\ResourceClassNotFoundException;
diff --git a/src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php b/src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php
index 7550a44e368..cb41077baf5 100644
--- a/src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php
+++ b/src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property\Factory;
use ApiPlatform\Core\Exception\ResourceClassNotFoundException;
diff --git a/src/Metadata/Property/PropertyMetadata.php b/src/Metadata/Property/PropertyMetadata.php
index 6d123f06535..79ecebaee58 100644
--- a/src/Metadata/Property/PropertyMetadata.php
+++ b/src/Metadata/Property/PropertyMetadata.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property;
use Symfony\Component\PropertyInfo\Type;
diff --git a/src/Metadata/Property/PropertyNameCollection.php b/src/Metadata/Property/PropertyNameCollection.php
index b7eb541a71a..39dc1a739b2 100644
--- a/src/Metadata/Property/PropertyNameCollection.php
+++ b/src/Metadata/Property/PropertyNameCollection.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Property;
/**
diff --git a/src/Metadata/Resource/Factory/AnnotationResourceMetadataFactory.php b/src/Metadata/Resource/Factory/AnnotationResourceMetadataFactory.php
index 3211e331f41..7f1ecc1449f 100644
--- a/src/Metadata/Resource/Factory/AnnotationResourceMetadataFactory.php
+++ b/src/Metadata/Resource/Factory/AnnotationResourceMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/src/Metadata/Resource/Factory/AnnotationResourceNameCollectionFactory.php b/src/Metadata/Resource/Factory/AnnotationResourceNameCollectionFactory.php
index 9afef1d08af..12d45771e20 100644
--- a/src/Metadata/Resource/Factory/AnnotationResourceNameCollectionFactory.php
+++ b/src/Metadata/Resource/Factory/AnnotationResourceNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Annotation\ApiResource;
@@ -16,7 +18,7 @@
use Doctrine\Common\Annotations\Reader;
/**
- * Creates a resource name collection from {@see Resource} annotations.
+ * Creates a resource name collection from {@see ApiResource} annotations.
*
* @author Kévin Dunglas
*/
diff --git a/src/Metadata/Resource/Factory/CachedResourceMetadataFactory.php b/src/Metadata/Resource/Factory/CachedResourceMetadataFactory.php
index 898532dd7b7..4c0445d35b1 100644
--- a/src/Metadata/Resource/Factory/CachedResourceMetadataFactory.php
+++ b/src/Metadata/Resource/Factory/CachedResourceMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
diff --git a/src/Metadata/Resource/Factory/CachedResourceNameCollectionFactory.php b/src/Metadata/Resource/Factory/CachedResourceNameCollectionFactory.php
index ee7924b0557..54df86b2b5e 100644
--- a/src/Metadata/Resource/Factory/CachedResourceNameCollectionFactory.php
+++ b/src/Metadata/Resource/Factory/CachedResourceNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
diff --git a/src/Metadata/Resource/Factory/ExtractorResourceMetadataFactory.php b/src/Metadata/Resource/Factory/ExtractorResourceMetadataFactory.php
index 63f12fc41ec..bd6fa4dd6a1 100644
--- a/src/Metadata/Resource/Factory/ExtractorResourceMetadataFactory.php
+++ b/src/Metadata/Resource/Factory/ExtractorResourceMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Exception\ResourceClassNotFoundException;
diff --git a/src/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactory.php b/src/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactory.php
index 80840ba9ccc..9140667dae4 100644
--- a/src/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactory.php
+++ b/src/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Exception\InvalidArgumentException;
@@ -16,7 +18,7 @@
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
/**
- * Creates a resource name collection from {@see Resource} configuration files.
+ * Creates a resource name collection from {@see ApiResource} configuration files.
*
* @author Kévin Dunglas
* @author Antoine Bluchet
diff --git a/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php b/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php
index 7e832f67d2f..3f27155bc8c 100644
--- a/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php
+++ b/src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
diff --git a/src/Metadata/Resource/Factory/PhpDocResourceMetadataFactory.php b/src/Metadata/Resource/Factory/PhpDocResourceMetadataFactory.php
index 4bbf18a0cb7..f2257d24efd 100644
--- a/src/Metadata/Resource/Factory/PhpDocResourceMetadataFactory.php
+++ b/src/Metadata/Resource/Factory/PhpDocResourceMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
diff --git a/src/Metadata/Resource/Factory/ResourceMetadataFactoryInterface.php b/src/Metadata/Resource/Factory/ResourceMetadataFactoryInterface.php
index 6cc9f0c7b81..7931e30336a 100644
--- a/src/Metadata/Resource/Factory/ResourceMetadataFactoryInterface.php
+++ b/src/Metadata/Resource/Factory/ResourceMetadataFactoryInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Exception\ResourceClassNotFoundException;
diff --git a/src/Metadata/Resource/Factory/ResourceNameCollectionFactoryInterface.php b/src/Metadata/Resource/Factory/ResourceNameCollectionFactoryInterface.php
index e34b8d0a122..83ba404a72f 100644
--- a/src/Metadata/Resource/Factory/ResourceNameCollectionFactoryInterface.php
+++ b/src/Metadata/Resource/Factory/ResourceNameCollectionFactoryInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
diff --git a/src/Metadata/Resource/Factory/ShortNameResourceMetadataFactory.php b/src/Metadata/Resource/Factory/ShortNameResourceMetadataFactory.php
index 70b077099ff..a346e8f2d50 100644
--- a/src/Metadata/Resource/Factory/ShortNameResourceMetadataFactory.php
+++ b/src/Metadata/Resource/Factory/ShortNameResourceMetadataFactory.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
diff --git a/src/Metadata/Resource/ResourceMetadata.php b/src/Metadata/Resource/ResourceMetadata.php
index 056d4b7c61b..e43f0221165 100644
--- a/src/Metadata/Resource/ResourceMetadata.php
+++ b/src/Metadata/Resource/ResourceMetadata.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource;
/**
diff --git a/src/Metadata/Resource/ResourceNameCollection.php b/src/Metadata/Resource/ResourceNameCollection.php
index 0efeef6ae94..1c78a908350 100644
--- a/src/Metadata/Resource/ResourceNameCollection.php
+++ b/src/Metadata/Resource/ResourceNameCollection.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Metadata\Resource;
/**
diff --git a/src/PathResolver/CustomOperationPathResolver.php b/src/PathResolver/CustomOperationPathResolver.php
index 7bb6479b985..3bd0d865183 100644
--- a/src/PathResolver/CustomOperationPathResolver.php
+++ b/src/PathResolver/CustomOperationPathResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\PathResolver;
/**
diff --git a/src/PathResolver/DashOperationPathResolver.php b/src/PathResolver/DashOperationPathResolver.php
index 3db32d79b4f..8b235cadbd7 100644
--- a/src/PathResolver/DashOperationPathResolver.php
+++ b/src/PathResolver/DashOperationPathResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\PathResolver;
use Doctrine\Common\Inflector\Inflector;
diff --git a/src/PathResolver/OperationPathResolverInterface.php b/src/PathResolver/OperationPathResolverInterface.php
index c344e3b20b2..bdbb21dfb7b 100644
--- a/src/PathResolver/OperationPathResolverInterface.php
+++ b/src/PathResolver/OperationPathResolverInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\PathResolver;
/**
diff --git a/src/PathResolver/UnderscoreOperationPathResolver.php b/src/PathResolver/UnderscoreOperationPathResolver.php
index 21b52f7eda7..de4d5134cbc 100644
--- a/src/PathResolver/UnderscoreOperationPathResolver.php
+++ b/src/PathResolver/UnderscoreOperationPathResolver.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\PathResolver;
use Doctrine\Common\Inflector\Inflector;
diff --git a/src/Problem/Serializer/ConstraintViolationListNormalizer.php b/src/Problem/Serializer/ConstraintViolationListNormalizer.php
index d143d0cfdab..5b85510db80 100644
--- a/src/Problem/Serializer/ConstraintViolationListNormalizer.php
+++ b/src/Problem/Serializer/ConstraintViolationListNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Problem\Serializer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
diff --git a/src/Problem/Serializer/ErrorNormalizer.php b/src/Problem/Serializer/ErrorNormalizer.php
index 161e52e2f11..0da3f7a34fe 100644
--- a/src/Problem/Serializer/ErrorNormalizer.php
+++ b/src/Problem/Serializer/ErrorNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Problem\Serializer;
use Symfony\Component\Debug\Exception\FlattenException;
diff --git a/src/Problem/Serializer/ErrorNormalizerTrait.php b/src/Problem/Serializer/ErrorNormalizerTrait.php
index 8fad832719e..c7178628e8a 100644
--- a/src/Problem/Serializer/ErrorNormalizerTrait.php
+++ b/src/Problem/Serializer/ErrorNormalizerTrait.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Problem\Serializer;
use Symfony\Component\Debug\Exception\FlattenException;
diff --git a/src/Serializer/AbstractItemNormalizer.php b/src/Serializer/AbstractItemNormalizer.php
index 5ecd853c9c9..2e6bb96f707 100644
--- a/src/Serializer/AbstractItemNormalizer.php
+++ b/src/Serializer/AbstractItemNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
@@ -202,7 +204,7 @@ protected function setAttributeValue($object, $attribute, $value, $format = null
protected function validateType(string $attribute, Type $type, $value, string $format = null)
{
$builtinType = $type->getBuiltinType();
- if (Type::BUILTIN_TYPE_FLOAT === $builtinType && false !== strpos($format, 'json')) {
+ if (Type::BUILTIN_TYPE_FLOAT === $builtinType && null !== $format && false !== strpos($format, 'json')) {
$isValid = is_float($value) || is_int($value);
} else {
$isValid = call_user_func('is_'.$builtinType, $value);
diff --git a/src/Serializer/ContextTrait.php b/src/Serializer/ContextTrait.php
index 3de218927fd..b7f7088da60 100644
--- a/src/Serializer/ContextTrait.php
+++ b/src/Serializer/ContextTrait.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Serializer;
/**
diff --git a/src/Serializer/ItemNormalizer.php b/src/Serializer/ItemNormalizer.php
index 244371d4ee7..085d57ff65c 100644
--- a/src/Serializer/ItemNormalizer.php
+++ b/src/Serializer/ItemNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Serializer;
use ApiPlatform\Core\Exception\InvalidArgumentException;
@@ -42,7 +44,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
private function updateObjectToPopulate(array $data, array &$context)
{
try {
- $context['object_to_populate'] = $this->iriConverter->getItemFromIri($data['id'], $context + ['fetch_data' => false]);
+ $context['object_to_populate'] = $this->iriConverter->getItemFromIri((string) $data['id'], $context + ['fetch_data' => false]);
} catch (InvalidArgumentException $e) {
$identifier = null;
foreach ($this->propertyNameCollectionFactory->create($context['resource_class'], $context) as $propertyName) {
diff --git a/src/Serializer/JsonEncoder.php b/src/Serializer/JsonEncoder.php
index 5d63fc554a3..60628206da9 100644
--- a/src/Serializer/JsonEncoder.php
+++ b/src/Serializer/JsonEncoder.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Serializer;
use Symfony\Component\Serializer\Encoder\DecoderInterface;
diff --git a/src/Serializer/SerializerContextBuilder.php b/src/Serializer/SerializerContextBuilder.php
index 81eec27fc97..a8eb8ce6612 100644
--- a/src/Serializer/SerializerContextBuilder.php
+++ b/src/Serializer/SerializerContextBuilder.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Serializer;
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
diff --git a/src/Serializer/SerializerContextBuilderInterface.php b/src/Serializer/SerializerContextBuilderInterface.php
index 9a9c2ff36c7..c6004a7bfcc 100644
--- a/src/Serializer/SerializerContextBuilderInterface.php
+++ b/src/Serializer/SerializerContextBuilderInterface.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Serializer;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Swagger/Serializer/DocumentationNormalizer.php b/src/Swagger/Serializer/DocumentationNormalizer.php
index a77bb51885e..1736c772f24 100644
--- a/src/Swagger/Serializer/DocumentationNormalizer.php
+++ b/src/Swagger/Serializer/DocumentationNormalizer.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Swagger\Serializer;
use ApiPlatform\Core\Api\FilterCollection;
@@ -160,13 +162,10 @@ private function getPathOperation(string $operationName, array $operation, strin
switch ($method) {
case 'GET':
return $this->updateGetOperation($pathOperation, $mimeTypes, $collection, $resourceMetadata, $resourceClass, $resourceShortName, $operationName, $definitions);
-
case 'POST':
return $this->updatePostOperation($pathOperation, $mimeTypes, $collection, $resourceMetadata, $resourceClass, $resourceShortName, $operationName, $definitions);
-
case 'PUT':
return $this->updatePutOperation($pathOperation, $mimeTypes, $collection, $resourceMetadata, $resourceClass, $resourceShortName, $operationName, $definitions);
-
case 'DELETE':
return $this->updateDeleteOperation($pathOperation, $resourceShortName);
}
@@ -538,7 +537,7 @@ private function getFiltersParameters(string $resourceClass, string $operationNa
$parameters = [];
$resourceFilters = $resourceMetadata->getCollectionOperationAttribute($operationName, 'filters', [], true);
foreach ($this->filterCollection as $filterName => $filter) {
- if (!in_array($filterName, $resourceFilters)) {
+ if (!in_array($filterName, $resourceFilters, true)) {
continue;
}
diff --git a/src/Util/ClassInfoTrait.php b/src/Util/ClassInfoTrait.php
index 13b299ec6fe..f294f665dd9 100644
--- a/src/Util/ClassInfoTrait.php
+++ b/src/Util/ClassInfoTrait.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Util;
use Doctrine\Common\Util\ClassUtils;
diff --git a/src/Util/ErrorFormatGuesser.php b/src/Util/ErrorFormatGuesser.php
index eee60ecfb13..39c7a45b9c2 100644
--- a/src/Util/ErrorFormatGuesser.php
+++ b/src/Util/ErrorFormatGuesser.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Util;
use Symfony\Component\HttpFoundation\Request;
diff --git a/src/Util/IriHelper.php b/src/Util/IriHelper.php
index 87a7fb29c4f..e650cd51641 100644
--- a/src/Util/IriHelper.php
+++ b/src/Util/IriHelper.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Util;
use ApiPlatform\Core\Exception\InvalidArgumentException;
diff --git a/src/Util/Reflection.php b/src/Util/Reflection.php
index a4aa9ece497..b398ce060e2 100644
--- a/src/Util/Reflection.php
+++ b/src/Util/Reflection.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Util;
/**
@@ -37,5 +39,7 @@ public function getProperty($methodName)
if (preg_match('/^('.$pattern.')(.+)$/i', $methodName, $matches)) {
return $matches[2];
}
+
+ return null;
}
}
diff --git a/src/Util/RequestAttributesExtractor.php b/src/Util/RequestAttributesExtractor.php
index 190c9378eca..1a67355f79d 100644
--- a/src/Util/RequestAttributesExtractor.php
+++ b/src/Util/RequestAttributesExtractor.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Util;
use ApiPlatform\Core\Exception\RuntimeException;
diff --git a/src/Util/RequestParser.php b/src/Util/RequestParser.php
index 2799be3c47c..0991c4731a1 100644
--- a/src/Util/RequestParser.php
+++ b/src/Util/RequestParser.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Util;
use Symfony\Component\HttpFoundation\Request;
diff --git a/tests/Action/EntrypointActionTest.php b/tests/Action/EntrypointActionTest.php
index 66cb40fb339..3d4e9b3cbf8 100644
--- a/tests/Action/EntrypointActionTest.php
+++ b/tests/Action/EntrypointActionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Action;
use ApiPlatform\Core\Action\EntrypointAction;
diff --git a/tests/Action/ExceptionActionTest.php b/tests/Action/ExceptionActionTest.php
index eb6b9651c1b..a0d56dac32b 100644
--- a/tests/Action/ExceptionActionTest.php
+++ b/tests/Action/ExceptionActionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Action;
use ApiPlatform\Core\Action\ExceptionAction;
diff --git a/tests/Action/PlaceholderActionTest.php b/tests/Action/PlaceholderActionTest.php
index a85377e9e36..c1efbbee649 100644
--- a/tests/Action/PlaceholderActionTest.php
+++ b/tests/Action/PlaceholderActionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Action;
use ApiPlatform\Core\Action\PlaceholderAction;
diff --git a/tests/Annotation/ApiResourceTest.php b/tests/Annotation/ApiResourceTest.php
index f09058c8fda..a2edbb4063d 100644
--- a/tests/Annotation/ApiResourceTest.php
+++ b/tests/Annotation/ApiResourceTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Annotation;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Annotation/PropertyTest.php b/tests/Annotation/PropertyTest.php
index b2f3be01a55..2a45d01a253 100644
--- a/tests/Annotation/PropertyTest.php
+++ b/tests/Annotation/PropertyTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Annotation;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Api/EntrypointTest.php b/tests/Api/EntrypointTest.php
index edd928d76be..1ae6e30fefd 100644
--- a/tests/Api/EntrypointTest.php
+++ b/tests/Api/EntrypointTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Api;
use ApiPlatform\Core\Api\Entrypoint;
diff --git a/tests/Api/FilterCollectionTest.php b/tests/Api/FilterCollectionTest.php
index 529879dc17e..f00c15a8c66 100644
--- a/tests/Api/FilterCollectionTest.php
+++ b/tests/Api/FilterCollectionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Api;
use ApiPlatform\Core\Api\FilterCollection;
diff --git a/tests/Api/ResourceClassResolverTest.php b/tests/Api/ResourceClassResolverTest.php
index 4d671e6c8f3..00c08f33c28 100644
--- a/tests/Api/ResourceClassResolverTest.php
+++ b/tests/Api/ResourceClassResolverTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Api;
use ApiPlatform\Core\Api\ResourceClassResolver;
diff --git a/tests/Bridge/Doctrine/EventListener/WriteListenerTest.php b/tests/Bridge/Doctrine/EventListener/WriteListenerTest.php
index 4ae1291abd9..3f62ba91165 100644
--- a/tests/Bridge/Doctrine/EventListener/WriteListenerTest.php
+++ b/tests/Bridge/Doctrine/EventListener/WriteListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine;
use ApiPlatform\Core\Bridge\Doctrine\EventListener\WriteListener;
diff --git a/tests/Bridge/Doctrine/Orm/CollectionDataProviderTest.php b/tests/Bridge/Doctrine/Orm/CollectionDataProviderTest.php
index 48ec24766ee..6528ff29e71 100644
--- a/tests/Bridge/Doctrine/Orm/CollectionDataProviderTest.php
+++ b/tests/Bridge/Doctrine/Orm/CollectionDataProviderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm;
use ApiPlatform\Core\Bridge\Doctrine\Orm\CollectionDataProvider;
diff --git a/tests/Bridge/Doctrine/Orm/Extension/EagerLoadingExtensionTest.php b/tests/Bridge/Doctrine/Orm/Extension/EagerLoadingExtensionTest.php
index 131835328bd..4f0057c8ebf 100644
--- a/tests/Bridge/Doctrine/Orm/Extension/EagerLoadingExtensionTest.php
+++ b/tests/Bridge/Doctrine/Orm/Extension/EagerLoadingExtensionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\EagerLoadingExtension;
diff --git a/tests/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php b/tests/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
index b1a3a7612fd..d42c5f87ec1 100644
--- a/tests/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
+++ b/tests/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterEagerLoadingExtension;
diff --git a/tests/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php b/tests/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
index ac485a4653d..265628547a3 100644
--- a/tests/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
+++ b/tests/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Extension;
use ApiPlatform\Core\Api\FilterCollection;
diff --git a/tests/Bridge/Doctrine/Orm/Extension/OrderExtensionTest.php b/tests/Bridge/Doctrine/Orm/Extension/OrderExtensionTest.php
index 770c71cb593..b546bad2f73 100644
--- a/tests/Bridge/Doctrine/Orm/Extension/OrderExtensionTest.php
+++ b/tests/Bridge/Doctrine/Orm/Extension/OrderExtensionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\OrderExtension;
diff --git a/tests/Bridge/Doctrine/Orm/Extension/PaginationExtensionTest.php b/tests/Bridge/Doctrine/Orm/Extension/PaginationExtensionTest.php
index 09e24035043..7966a2578fa 100644
--- a/tests/Bridge/Doctrine/Orm/Extension/PaginationExtensionTest.php
+++ b/tests/Bridge/Doctrine/Orm/Extension/PaginationExtensionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Extension;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\PaginationExtension;
diff --git a/tests/Bridge/Doctrine/Orm/Filter/BooleanFilterTest.php b/tests/Bridge/Doctrine/Orm/Filter/BooleanFilterTest.php
index c10a7d52339..6640e60bb9a 100644
--- a/tests/Bridge/Doctrine/Orm/Filter/BooleanFilterTest.php
+++ b/tests/Bridge/Doctrine/Orm/Filter/BooleanFilterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
diff --git a/tests/Bridge/Doctrine/Orm/Filter/DateFilterTest.php b/tests/Bridge/Doctrine/Orm/Filter/DateFilterTest.php
index 54876ae9af0..a04ef8fcd2c 100644
--- a/tests/Bridge/Doctrine/Orm/Filter/DateFilterTest.php
+++ b/tests/Bridge/Doctrine/Orm/Filter/DateFilterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
@@ -124,14 +126,14 @@ public function provideApplyTestData(): array
],
'after' => [
[
- 'dummyDate' => true,
+ 'dummyDate' => null,
],
[
'dummyDate' => [
'after' => '2015-04-05',
],
],
- sprintf('SELECT o FROM %s o WHERE o.dummyDate >= :dummyDate_p1 AND o.dummyDate IS NOT NULL', Dummy::class),
+ sprintf('SELECT o FROM %s o WHERE o.dummyDate >= :dummyDate_p1', Dummy::class),
],
'before (all properties enabled)' => [
null,
@@ -144,14 +146,14 @@ public function provideApplyTestData(): array
],
'before' => [
[
- 'dummyDate' => true,
+ 'dummyDate' => null,
],
[
'dummyDate' => [
'before' => '2015-04-05',
],
],
- sprintf('SELECT o FROM %s o WHERE o.dummyDate <= :dummyDate_p1 AND o.dummyDate IS NOT NULL', Dummy::class),
+ sprintf('SELECT o FROM %s o WHERE o.dummyDate <= :dummyDate_p1', Dummy::class),
],
'before + after (all properties enabled)' => [
null,
@@ -165,7 +167,7 @@ public function provideApplyTestData(): array
],
'before + after' => [
[
- 'dummyDate' => true,
+ 'dummyDate' => null,
],
[
'dummyDate' => [
@@ -173,11 +175,11 @@ public function provideApplyTestData(): array
'before' => '2015-04-05',
],
],
- sprintf('SELECT o FROM %s o WHERE (o.dummyDate <= :dummyDate_p1 AND o.dummyDate IS NOT NULL) AND (o.dummyDate >= :dummyDate_p2 AND o.dummyDate IS NOT NULL)', Dummy::class),
+ sprintf('SELECT o FROM %s o WHERE o.dummyDate <= :dummyDate_p1 AND o.dummyDate >= :dummyDate_p2', Dummy::class),
],
'property not enabled' => [
[
- 'unknown',
+ 'unknown' => null,
],
[
'dummyDate' => [
@@ -189,14 +191,14 @@ public function provideApplyTestData(): array
],
'nested property' => [
[
- 'relatedDummy.dummyDate' => true,
+ 'relatedDummy.dummyDate' => null,
],
[
'relatedDummy.dummyDate' => [
'after' => '2015-04-05',
],
],
- sprintf('SELECT o FROM %s o INNER JOIN o.relatedDummy relatedDummy_a1 WHERE relatedDummy_a1.dummyDate >= :dummyDate_p1 AND relatedDummy_a1.dummyDate IS NOT NULL', Dummy::class),
+ sprintf('SELECT o FROM %s o INNER JOIN o.relatedDummy relatedDummy_a1 WHERE relatedDummy_a1.dummyDate >= :dummyDate_p1', Dummy::class),
],
'after (exclude_null)' => [
[
diff --git a/tests/Bridge/Doctrine/Orm/Filter/NumericFilterTest.php b/tests/Bridge/Doctrine/Orm/Filter/NumericFilterTest.php
index e5c6a2c280d..198a25a1cf5 100644
--- a/tests/Bridge/Doctrine/Orm/Filter/NumericFilterTest.php
+++ b/tests/Bridge/Doctrine/Orm/Filter/NumericFilterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\NumericFilter;
diff --git a/tests/Bridge/Doctrine/Orm/Filter/OrderFilterTest.php b/tests/Bridge/Doctrine/Orm/Filter/OrderFilterTest.php
index 213a5573e85..336fb1d8f19 100644
--- a/tests/Bridge/Doctrine/Orm/Filter/OrderFilterTest.php
+++ b/tests/Bridge/Doctrine/Orm/Filter/OrderFilterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
diff --git a/tests/Bridge/Doctrine/Orm/Filter/RangeFilterTest.php b/tests/Bridge/Doctrine/Orm/Filter/RangeFilterTest.php
index add155744bc..86ad046f54f 100644
--- a/tests/Bridge/Doctrine/Orm/Filter/RangeFilterTest.php
+++ b/tests/Bridge/Doctrine/Orm/Filter/RangeFilterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\RangeFilter;
diff --git a/tests/Bridge/Doctrine/Orm/Filter/SearchFilterTest.php b/tests/Bridge/Doctrine/Orm/Filter/SearchFilterTest.php
index a11bf0225ee..72353796592 100644
--- a/tests/Bridge/Doctrine/Orm/Filter/SearchFilterTest.php
+++ b/tests/Bridge/Doctrine/Orm/Filter/SearchFilterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm\Filter;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/tests/Bridge/Doctrine/Orm/ItemDataProviderTest.php b/tests/Bridge/Doctrine/Orm/ItemDataProviderTest.php
index f008f20de51..16c8ba4b765 100644
--- a/tests/Bridge/Doctrine/Orm/ItemDataProviderTest.php
+++ b/tests/Bridge/Doctrine/Orm/ItemDataProviderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
diff --git a/tests/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactoryTest.php b/tests/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactoryTest.php
index 57268ddcc6e..4e812dc0f0f 100644
--- a/tests/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactoryTest.php
+++ b/tests/Bridge/Doctrine/Orm/Metadata/Property/DoctrineOrmPropertyMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Doctrine\Orm\Metadata\Property;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory;
diff --git a/tests/Bridge/Doctrine/Orm/PaginatorTest.php b/tests/Bridge/Doctrine/Orm/PaginatorTest.php
index 72a4d8a9f85..be5185abc2d 100644
--- a/tests/Bridge/Doctrine/Orm/PaginatorTest.php
+++ b/tests/Bridge/Doctrine/Orm/PaginatorTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Orm;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Paginator;
diff --git a/tests/Bridge/Doctrine/Util/QueryCheckerTest.php b/tests/Bridge/Doctrine/Util/QueryCheckerTest.php
index fddbc9ef95b..e53d141afe1 100644
--- a/tests/Bridge/Doctrine/Util/QueryCheckerTest.php
+++ b/tests/Bridge/Doctrine/Util/QueryCheckerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Util;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryChecker;
diff --git a/tests/Bridge/Doctrine/Util/QueryJoinParserTest.php b/tests/Bridge/Doctrine/Util/QueryJoinParserTest.php
index 7a418059511..7c5bed481e4 100644
--- a/tests/Bridge/Doctrine/Util/QueryJoinParserTest.php
+++ b/tests/Bridge/Doctrine/Util/QueryJoinParserTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Util;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryJoinParser;
diff --git a/tests/Bridge/Doctrine/Util/QueryNameGeneratorTest.php b/tests/Bridge/Doctrine/Util/QueryNameGeneratorTest.php
index 362e30355da..34d9fac49be 100644
--- a/tests/Bridge/Doctrine/Util/QueryNameGeneratorTest.php
+++ b/tests/Bridge/Doctrine/Util/QueryNameGeneratorTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Doctrine\Util;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGenerator;
diff --git a/tests/Bridge/FosUser/EventListenerTest.php b/tests/Bridge/FosUser/EventListenerTest.php
index 2812568b0c6..d2f835bd4ca 100644
--- a/tests/Bridge/FosUser/EventListenerTest.php
+++ b/tests/Bridge/FosUser/EventListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\FosUser;
use ApiPlatform\Core\Bridge\FosUser\EventListener;
diff --git a/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php b/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php
index d466084ddad..8e9ef8cc09b 100644
--- a/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php
+++ b/tests/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProviderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\NelmioApiDoc\Extractor\AnnotationsProvider;
use ApiPlatform\Core\Api\FilterCollection;
diff --git a/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php b/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php
index e6399fc2d69..08a3b6b0ea5 100644
--- a/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php
+++ b/tests/Bridge/NelmioApiDoc/Parser/ApiPlatformParserTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\NelmioApiDoc\Parser;
use ApiPlatform\Core\Bridge\NelmioApiDoc\Parser\ApiPlatformParser;
diff --git a/tests/Bridge/Symfony/Bundle/Action/SwaggerUiActionTest.php b/tests/Bridge/Symfony/Bundle/Action/SwaggerUiActionTest.php
index f5f626fc1b5..792b0ef5a99 100644
--- a/tests/Bridge/Symfony/Bundle/Action/SwaggerUiActionTest.php
+++ b/tests/Bridge/Symfony/Bundle/Action/SwaggerUiActionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Action;
use ApiPlatform\Core\Bridge\Symfony\Bundle\Action\SwaggerUiAction;
diff --git a/tests/Bridge/Symfony/Bundle/ApiPlatformBundleTest.php b/tests/Bridge/Symfony/Bundle/ApiPlatformBundleTest.php
index 4e992e3933c..081b30a93d8 100644
--- a/tests/Bridge/Symfony/Bundle/ApiPlatformBundleTest.php
+++ b/tests/Bridge/Symfony/Bundle/ApiPlatformBundleTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle;
use ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle;
diff --git a/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php b/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php
index 6b0bc7f7b72..f0383f24ac4 100644
--- a/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php
+++ b/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\Command;
use Symfony\Bundle\FrameworkBundle\Console\Application;
diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php
index f0d848ddb7d..87b094f454d 100644
--- a/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php
+++ b/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\DependencyInjection;
use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\ApiPlatformExtension;
diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPassTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPassTest.php
index df92a82d21e..4f0add0e0cf 100644
--- a/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPassTest.php
+++ b/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/DoctrineQueryExtensionPassTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\DependencyInjection\Compiler;
use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\DoctrineQueryExtensionPass;
diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPassTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPassTest.php
index 9c39e4c2625..19d4035dd9c 100644
--- a/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPassTest.php
+++ b/tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/FilterPassTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\DependencyInjection\Compiler;
use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\FilterPass;
diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php
index 042266a31a4..ccf33a7f855 100644
--- a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php
+++ b/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\DependencyInjection;
use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Configuration;
diff --git a/tests/Bridge/Symfony/Bundle/EventListener/SwaggerUiListenerTest.php b/tests/Bridge/Symfony/Bundle/EventListener/SwaggerUiListenerTest.php
index 5de7ecf4ad5..04e98e4c343 100644
--- a/tests/Bridge/Symfony/Bundle/EventListener/SwaggerUiListenerTest.php
+++ b/tests/Bridge/Symfony/Bundle/EventListener/SwaggerUiListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\EventListener;
use ApiPlatform\Core\Bridge\Symfony\Bundle\EventListener\SwaggerUiListener;
diff --git a/tests/Bridge/Symfony/Routing/ApiLoaderTest.php b/tests/Bridge/Symfony/Routing/ApiLoaderTest.php
index 0be590fe633..031ce47bd96 100644
--- a/tests/Bridge/Symfony/Routing/ApiLoaderTest.php
+++ b/tests/Bridge/Symfony/Routing/ApiLoaderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Routing;
use ApiPlatform\Core\Bridge\Symfony\Routing\ApiLoader;
diff --git a/tests/Bridge/Symfony/Routing/CachedRouteNameResolverTest.php b/tests/Bridge/Symfony/Routing/CachedRouteNameResolverTest.php
index c5055128ad9..0024a922c33 100644
--- a/tests/Bridge/Symfony/Routing/CachedRouteNameResolverTest.php
+++ b/tests/Bridge/Symfony/Routing/CachedRouteNameResolverTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Routing;
use ApiPlatform\Core\Bridge\Symfony\Routing\CachedRouteNameResolver;
diff --git a/tests/Bridge/Symfony/Routing/IriConverterTest.php b/tests/Bridge/Symfony/Routing/IriConverterTest.php
index b67d497962b..d2091cb041c 100644
--- a/tests/Bridge/Symfony/Routing/IriConverterTest.php
+++ b/tests/Bridge/Symfony/Routing/IriConverterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Routing;
use ApiPlatform\Core\Bridge\Symfony\Routing\IriConverter;
diff --git a/tests/Bridge/Symfony/Routing/RouteNameResolverTest.php b/tests/Bridge/Symfony/Routing/RouteNameResolverTest.php
index 2b3a96e5813..a5836eea3cf 100644
--- a/tests/Bridge/Symfony/Routing/RouteNameResolverTest.php
+++ b/tests/Bridge/Symfony/Routing/RouteNameResolverTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Routing;
use ApiPlatform\Core\Bridge\Symfony\Routing\RouteNameResolver;
diff --git a/tests/Bridge/Symfony/Routing/RouterTest.php b/tests/Bridge/Symfony/Routing/RouterTest.php
index 648ffd1372c..0e36001ae4b 100644
--- a/tests/Bridge/Symfony/Routing/RouterTest.php
+++ b/tests/Bridge/Symfony/Routing/RouterTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Routing;
use ApiPlatform\Core\Bridge\Symfony\Routing\Router;
diff --git a/tests/Bridge/Symfony/Validator/EventListener/ValidateListenerTest.php b/tests/Bridge/Symfony/Validator/EventListener/ValidateListenerTest.php
index 5c06e312766..98fc5657418 100644
--- a/tests/Bridge/Symfony/Validator/EventListener/ValidateListenerTest.php
+++ b/tests/Bridge/Symfony/Validator/EventListener/ValidateListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Validator\EventListener;
use ApiPlatform\Core\Bridge\Symfony\Validator\EventListener\ValidateListener;
diff --git a/tests/Bridge/Symfony/Validator/EventListener/ValidationExceptionListenerTest.php b/tests/Bridge/Symfony/Validator/EventListener/ValidationExceptionListenerTest.php
index aa271625045..6e6a1e5f214 100644
--- a/tests/Bridge/Symfony/Validator/EventListener/ValidationExceptionListenerTest.php
+++ b/tests/Bridge/Symfony/Validator/EventListener/ValidationExceptionListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Validator\EventListener;
use ApiPlatform\Core\Bridge\Symfony\Validator\EventListener\ValidationExceptionListener;
diff --git a/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php b/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php
index 0f645e45723..80b9d4a8956 100644
--- a/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php
+++ b/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Validator\Metadata\Property;
use ApiPlatform\Core\Bridge\Symfony\Validator\Metadata\Property\ValidatorPropertyMetadataFactory;
diff --git a/tests/DataProvider/ChainCollectionDataProviderTest.php b/tests/DataProvider/ChainCollectionDataProviderTest.php
index 0903311be96..06cda6eb37b 100644
--- a/tests/DataProvider/ChainCollectionDataProviderTest.php
+++ b/tests/DataProvider/ChainCollectionDataProviderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\DataProvider;
use ApiPlatform\Core\DataProvider\ChainCollectionDataProvider;
@@ -44,13 +46,13 @@ public function testGetCollection()
$this->assertEquals([$dummy, $dummy2], $chainItemDataProvider->getCollection(Dummy::class));
}
- public function testGetCollectionExeptions()
+ public function testGetCollectionExceptions()
{
$firstDataProvider = $this->prophesize(CollectionDataProviderInterface::class);
- $firstDataProvider->getCollection('notfound', 1)->willThrow(ResourceClassNotSupportedException::class);
+ $firstDataProvider->getCollection('notfound', 'op')->willThrow(ResourceClassNotSupportedException::class);
$chainItemDataProvider = new ChainCollectionDataProvider([$firstDataProvider->reveal()]);
- $this->assertEquals('', $chainItemDataProvider->getCollection('notfound', 1));
+ $this->assertEquals('', $chainItemDataProvider->getCollection('notfound', 'op'));
}
}
diff --git a/tests/DataProvider/ChainItemDataProviderTest.php b/tests/DataProvider/ChainItemDataProviderTest.php
index 18295b55b89..0d7677dc6c1 100644
--- a/tests/DataProvider/ChainItemDataProviderTest.php
+++ b/tests/DataProvider/ChainItemDataProviderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\DataProvider;
use ApiPlatform\Core\DataProvider\ChainItemDataProvider;
diff --git a/tests/Documentation/Action/DocumentationActionTest.php b/tests/Documentation/Action/DocumentationActionTest.php
index 94606401d26..7feeb5cf86e 100644
--- a/tests/Documentation/Action/DocumentationActionTest.php
+++ b/tests/Documentation/Action/DocumentationActionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Action;
use ApiPlatform\Core\Documentation\Action\DocumentationAction;
diff --git a/tests/EventListener/AddFormatListenerTest.php b/tests/EventListener/AddFormatListenerTest.php
index d4f1a338a32..8f2c1155c03 100644
--- a/tests/EventListener/AddFormatListenerTest.php
+++ b/tests/EventListener/AddFormatListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\EventListener;
use ApiPlatform\Core\EventListener\AddFormatListener;
diff --git a/tests/EventListener/DeserializeListenerTest.php b/tests/EventListener/DeserializeListenerTest.php
index 8426032f452..8b2ab80e0e0 100644
--- a/tests/EventListener/DeserializeListenerTest.php
+++ b/tests/EventListener/DeserializeListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\EventListener;
use ApiPlatform\Core\EventListener\DeserializeListener;
diff --git a/tests/EventListener/EventPrioritiesTest.php b/tests/EventListener/EventPrioritiesTest.php
index 6b9c7d563bb..8b9c066bf60 100644
--- a/tests/EventListener/EventPrioritiesTest.php
+++ b/tests/EventListener/EventPrioritiesTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\EventListener;
use ApiPlatform\Core\EventListener\EventPriorities;
diff --git a/tests/EventListener/ExceptionListenerTest.php b/tests/EventListener/ExceptionListenerTest.php
index 87a4652c2c7..23609defe2f 100644
--- a/tests/EventListener/ExceptionListenerTest.php
+++ b/tests/EventListener/ExceptionListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\EventListener;
use ApiPlatform\Core\EventListener\ExceptionListener;
diff --git a/tests/EventListener/ReadListenerTest.php b/tests/EventListener/ReadListenerTest.php
index 889013ceb73..7b4f8e788d8 100644
--- a/tests/EventListener/ReadListenerTest.php
+++ b/tests/EventListener/ReadListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\EventListener;
use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface;
diff --git a/tests/EventListener/RespondListenerTest.php b/tests/EventListener/RespondListenerTest.php
index d28699aecec..f4cc1fea95f 100644
--- a/tests/EventListener/RespondListenerTest.php
+++ b/tests/EventListener/RespondListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\EventListener;
use ApiPlatform\Core\EventListener\RespondListener;
diff --git a/tests/EventListener/SerializeListenerTest.php b/tests/EventListener/SerializeListenerTest.php
index 26cc85d6896..546f086e555 100644
--- a/tests/EventListener/SerializeListenerTest.php
+++ b/tests/EventListener/SerializeListenerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\EventListener;
use ApiPlatform\Core\EventListener\SerializeListener;
diff --git a/tests/Fixtures/ClassWithNoDocBlock.php b/tests/Fixtures/ClassWithNoDocBlock.php
index 0731859d261..0ce7e57a5e8 100644
--- a/tests/Fixtures/ClassWithNoDocBlock.php
+++ b/tests/Fixtures/ClassWithNoDocBlock.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures;
// Must not have a DocBlock
diff --git a/tests/Fixtures/DummyEntity.php b/tests/Fixtures/DummyEntity.php
index 16f933fa3de..e76859cb250 100644
--- a/tests/Fixtures/DummyEntity.php
+++ b/tests/Fixtures/DummyEntity.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures;
/**
diff --git a/tests/Fixtures/DummyFilter.php b/tests/Fixtures/DummyFilter.php
index 4b24c807f81..3833c299a21 100644
--- a/tests/Fixtures/DummyFilter.php
+++ b/tests/Fixtures/DummyFilter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures;
use ApiPlatform\Core\Api\FilterInterface;
diff --git a/tests/Fixtures/DummyValidatedEntity.php b/tests/Fixtures/DummyValidatedEntity.php
index 071ab8dedea..8314774b654 100644
--- a/tests/Fixtures/DummyValidatedEntity.php
+++ b/tests/Fixtures/DummyValidatedEntity.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures;
use Symfony\Component\Validator\Constraints as Assert;
diff --git a/tests/Fixtures/NotAResource.php b/tests/Fixtures/NotAResource.php
index 92b7b1c842d..0a2b1cedfc6 100644
--- a/tests/Fixtures/NotAResource.php
+++ b/tests/Fixtures/NotAResource.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures;
/**
diff --git a/tests/Fixtures/Query.php b/tests/Fixtures/Query.php
index c5d407bc735..8705943eefc 100644
--- a/tests/Fixtures/Query.php
+++ b/tests/Fixtures/Query.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures;
/**
diff --git a/tests/Fixtures/TestBundle/Action/ConfigCustom.php b/tests/Fixtures/TestBundle/Action/ConfigCustom.php
index 3437991d86f..c3e1b8811fa 100644
--- a/tests/Fixtures/TestBundle/Action/ConfigCustom.php
+++ b/tests/Fixtures/TestBundle/Action/ConfigCustom.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Action;
use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
diff --git a/tests/Fixtures/TestBundle/Controller/CustomController.php b/tests/Fixtures/TestBundle/Controller/CustomController.php
index 46737c124ca..7c6372f71c9 100644
--- a/tests/Fixtures/TestBundle/Controller/CustomController.php
+++ b/tests/Fixtures/TestBundle/Controller/CustomController.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
diff --git a/tests/Fixtures/TestBundle/DataProvider/ContainNonResourceItemDataProvider.php b/tests/Fixtures/TestBundle/DataProvider/ContainNonResourceItemDataProvider.php
index 93dd5ffdb51..6eefdbeac9e 100644
--- a/tests/Fixtures/TestBundle/DataProvider/ContainNonResourceItemDataProvider.php
+++ b/tests/Fixtures/TestBundle/DataProvider/ContainNonResourceItemDataProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\DataProvider;
use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
diff --git a/tests/Fixtures/TestBundle/Entity/AbstractDummy.php b/tests/Fixtures/TestBundle/Entity/AbstractDummy.php
index 573773bdb36..05e11db3527 100644
--- a/tests/Fixtures/TestBundle/Entity/AbstractDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/AbstractDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/CircularReference.php b/tests/Fixtures/TestBundle/Entity/CircularReference.php
index 23baed7b14b..a12a72ad243 100644
--- a/tests/Fixtures/TestBundle/Entity/CircularReference.php
+++ b/tests/Fixtures/TestBundle/Entity/CircularReference.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/CompositeItem.php b/tests/Fixtures/TestBundle/Entity/CompositeItem.php
index c3c15fc4c38..b00bece6d28 100644
--- a/tests/Fixtures/TestBundle/Entity/CompositeItem.php
+++ b/tests/Fixtures/TestBundle/Entity/CompositeItem.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/CompositeLabel.php b/tests/Fixtures/TestBundle/Entity/CompositeLabel.php
index c2d3efd4cda..906e4773729 100644
--- a/tests/Fixtures/TestBundle/Entity/CompositeLabel.php
+++ b/tests/Fixtures/TestBundle/Entity/CompositeLabel.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/CompositeRelation.php b/tests/Fixtures/TestBundle/Entity/CompositeRelation.php
index 599fa8f9669..574149f6783 100644
--- a/tests/Fixtures/TestBundle/Entity/CompositeRelation.php
+++ b/tests/Fixtures/TestBundle/Entity/CompositeRelation.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/ConcreteDummy.php b/tests/Fixtures/TestBundle/Entity/ConcreteDummy.php
index d640cb72bdd..2b1508aafad 100644
--- a/tests/Fixtures/TestBundle/Entity/ConcreteDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/ConcreteDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/ContainNonResource.php b/tests/Fixtures/TestBundle/Entity/ContainNonResource.php
index 89b3944555a..9055f4634ef 100644
--- a/tests/Fixtures/TestBundle/Entity/ContainNonResource.php
+++ b/tests/Fixtures/TestBundle/Entity/ContainNonResource.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/CustomIdentifierDummy.php b/tests/Fixtures/TestBundle/Entity/CustomIdentifierDummy.php
index 7e7c7659f2f..f9d12bb5e27 100644
--- a/tests/Fixtures/TestBundle/Entity/CustomIdentifierDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/CustomIdentifierDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/CustomNormalizedDummy.php b/tests/Fixtures/TestBundle/Entity/CustomNormalizedDummy.php
index 3ca542ca0e3..62b981ff61f 100644
--- a/tests/Fixtures/TestBundle/Entity/CustomNormalizedDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/CustomNormalizedDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/CustomWritableIdentifierDummy.php b/tests/Fixtures/TestBundle/Entity/CustomWritableIdentifierDummy.php
index e1b287a19fe..ede113cb776 100644
--- a/tests/Fixtures/TestBundle/Entity/CustomWritableIdentifierDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/CustomWritableIdentifierDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/Dummy.php b/tests/Fixtures/TestBundle/Entity/Dummy.php
index 17d968a1040..50d61cc9740 100644
--- a/tests/Fixtures/TestBundle/Entity/Dummy.php
+++ b/tests/Fixtures/TestBundle/Entity/Dummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/DummyCar.php b/tests/Fixtures/TestBundle/Entity/DummyCar.php
index db2f46076d8..d2a572c0a32 100644
--- a/tests/Fixtures/TestBundle/Entity/DummyCar.php
+++ b/tests/Fixtures/TestBundle/Entity/DummyCar.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/DummyCarColor.php b/tests/Fixtures/TestBundle/Entity/DummyCarColor.php
index 1a43d918a5f..0fe5866aa29 100644
--- a/tests/Fixtures/TestBundle/Entity/DummyCarColor.php
+++ b/tests/Fixtures/TestBundle/Entity/DummyCarColor.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/DummyFriend.php b/tests/Fixtures/TestBundle/Entity/DummyFriend.php
index b4511f87cb9..075c230fe47 100644
--- a/tests/Fixtures/TestBundle/Entity/DummyFriend.php
+++ b/tests/Fixtures/TestBundle/Entity/DummyFriend.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/DummyTableInheritance.php b/tests/Fixtures/TestBundle/Entity/DummyTableInheritance.php
index 2ba1715352e..f862d7b795f 100644
--- a/tests/Fixtures/TestBundle/Entity/DummyTableInheritance.php
+++ b/tests/Fixtures/TestBundle/Entity/DummyTableInheritance.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/DummyTableInheritanceChild.php b/tests/Fixtures/TestBundle/Entity/DummyTableInheritanceChild.php
index 87ffeccc5b8..1403208d923 100644
--- a/tests/Fixtures/TestBundle/Entity/DummyTableInheritanceChild.php
+++ b/tests/Fixtures/TestBundle/Entity/DummyTableInheritanceChild.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/FileConfigDummy.php b/tests/Fixtures/TestBundle/Entity/FileConfigDummy.php
index 7b6b15c958f..09fc8acbd77 100644
--- a/tests/Fixtures/TestBundle/Entity/FileConfigDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/FileConfigDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
diff --git a/tests/Fixtures/TestBundle/Entity/JsonldContextDummy.php b/tests/Fixtures/TestBundle/Entity/JsonldContextDummy.php
index dca58b204fd..cc62ac5fa28 100644
--- a/tests/Fixtures/TestBundle/Entity/JsonldContextDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/JsonldContextDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/NoCollectionDummy.php b/tests/Fixtures/TestBundle/Entity/NoCollectionDummy.php
index 11b6e31d717..6b9273310b0 100644
--- a/tests/Fixtures/TestBundle/Entity/NoCollectionDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/NoCollectionDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/OverriddenOperationDummy.php b/tests/Fixtures/TestBundle/Entity/OverriddenOperationDummy.php
index e9b5e81a1cc..8d71597cf0d 100644
--- a/tests/Fixtures/TestBundle/Entity/OverriddenOperationDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/OverriddenOperationDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/ParentDummy.php b/tests/Fixtures/TestBundle/Entity/ParentDummy.php
index b68bc7ef90e..6ebf70eca51 100644
--- a/tests/Fixtures/TestBundle/Entity/ParentDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/ParentDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
diff --git a/tests/Fixtures/TestBundle/Entity/RelatedDummy.php b/tests/Fixtures/TestBundle/Entity/RelatedDummy.php
index d14513a52ce..47190b2cbde 100644
--- a/tests/Fixtures/TestBundle/Entity/RelatedDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/RelatedDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/RelatedNormalizedDummy.php b/tests/Fixtures/TestBundle/Entity/RelatedNormalizedDummy.php
index 57c8642baec..d213bff107c 100644
--- a/tests/Fixtures/TestBundle/Entity/RelatedNormalizedDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/RelatedNormalizedDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/RelatedToDummyFriend.php b/tests/Fixtures/TestBundle/Entity/RelatedToDummyFriend.php
index 980cbe0b9d0..364ab7974af 100644
--- a/tests/Fixtures/TestBundle/Entity/RelatedToDummyFriend.php
+++ b/tests/Fixtures/TestBundle/Entity/RelatedToDummyFriend.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Fixtures/TestBundle/Entity/RelationEmbedder.php b/tests/Fixtures/TestBundle/Entity/RelationEmbedder.php
index b588f0afdd3..452742e55f9 100644
--- a/tests/Fixtures/TestBundle/Entity/RelationEmbedder.php
+++ b/tests/Fixtures/TestBundle/Entity/RelationEmbedder.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/SingleFileConfigDummy.php b/tests/Fixtures/TestBundle/Entity/SingleFileConfigDummy.php
index 272cff465f3..e921498eb29 100644
--- a/tests/Fixtures/TestBundle/Entity/SingleFileConfigDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/SingleFileConfigDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
diff --git a/tests/Fixtures/TestBundle/Entity/ThirdLevel.php b/tests/Fixtures/TestBundle/Entity/ThirdLevel.php
index c86b7f6d0b7..d5b39be96ed 100644
--- a/tests/Fixtures/TestBundle/Entity/ThirdLevel.php
+++ b/tests/Fixtures/TestBundle/Entity/ThirdLevel.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/UnknownDummy.php b/tests/Fixtures/TestBundle/Entity/UnknownDummy.php
index bbc553b9a6a..62423b14807 100644
--- a/tests/Fixtures/TestBundle/Entity/UnknownDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/UnknownDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
diff --git a/tests/Fixtures/TestBundle/Entity/User.php b/tests/Fixtures/TestBundle/Entity/User.php
index 14b4512991e..6d4c238463e 100644
--- a/tests/Fixtures/TestBundle/Entity/User.php
+++ b/tests/Fixtures/TestBundle/Entity/User.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Entity/UuidIdentifierDummy.php b/tests/Fixtures/TestBundle/Entity/UuidIdentifierDummy.php
index c62f5c9a849..da6beda712c 100644
--- a/tests/Fixtures/TestBundle/Entity/UuidIdentifierDummy.php
+++ b/tests/Fixtures/TestBundle/Entity/UuidIdentifierDummy.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Fixtures/TestBundle/Manager/UserManager.php b/tests/Fixtures/TestBundle/Manager/UserManager.php
index c2852d1a53d..4c6053f9d52 100644
--- a/tests/Fixtures/TestBundle/Manager/UserManager.php
+++ b/tests/Fixtures/TestBundle/Manager/UserManager.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Manager;
use FOS\UserBundle\Doctrine\UserManager as BaseUserManager;
diff --git a/tests/Fixtures/TestBundle/Serializer/NameConverter/CustomConverter.php b/tests/Fixtures/TestBundle/Serializer/NameConverter/CustomConverter.php
index a61a1fc21e9..a2a12542435 100644
--- a/tests/Fixtures/TestBundle/Serializer/NameConverter/CustomConverter.php
+++ b/tests/Fixtures/TestBundle/Serializer/NameConverter/CustomConverter.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Serializer\NameConverter;
use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter;
diff --git a/tests/Fixtures/TestBundle/TestBundle.php b/tests/Fixtures/TestBundle/TestBundle.php
index 501ffa4e08c..a4e3bd283fc 100644
--- a/tests/Fixtures/TestBundle/TestBundle.php
+++ b/tests/Fixtures/TestBundle/TestBundle.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
diff --git a/tests/Fixtures/app/AppKernel.php b/tests/Fixtures/app/AppKernel.php
index 6aa01cfc197..89d83693d66 100644
--- a/tests/Fixtures/app/AppKernel.php
+++ b/tests/Fixtures/app/AppKernel.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
use ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle;
use ApiPlatform\Core\Tests\Fixtures\TestBundle\TestBundle;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
diff --git a/tests/Fixtures/app/bootstrap.php b/tests/Fixtures/app/bootstrap.php
index 1bc06d59d76..a488cc54f9c 100644
--- a/tests/Fixtures/app/bootstrap.php
+++ b/tests/Fixtures/app/bootstrap.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
use Doctrine\Common\Annotations\AnnotationRegistry;
date_default_timezone_set('UTC');
diff --git a/tests/Hal/Serializer/CollectionNormalizerTest.php b/tests/Hal/Serializer/CollectionNormalizerTest.php
index 3469c9dfe2a..c7112ba36d5 100644
--- a/tests/Hal/Serializer/CollectionNormalizerTest.php
+++ b/tests/Hal/Serializer/CollectionNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hal\Serializer;
use ApiPlatform\Core\Api\ResourceClassResolverInterface;
diff --git a/tests/Hal/Serializer/EntrypointNormalizerTest.php b/tests/Hal/Serializer/EntrypointNormalizerTest.php
index d8a6e827077..175911db27c 100644
--- a/tests/Hal/Serializer/EntrypointNormalizerTest.php
+++ b/tests/Hal/Serializer/EntrypointNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hal\Serializer;
use ApiPlatform\Core\Api\Entrypoint;
diff --git a/tests/Hal/Serializer/ItemNormalizerTest.php b/tests/Hal/Serializer/ItemNormalizerTest.php
index d855eb3c43b..b54f43b87f4 100644
--- a/tests/Hal/Serializer/ItemNormalizerTest.php
+++ b/tests/Hal/Serializer/ItemNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hal\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/tests/Hydra/Serializer/CollectionFiltersNormalizerTest.php b/tests/Hydra/Serializer/CollectionFiltersNormalizerTest.php
index 47203e6c141..ada3748facc 100644
--- a/tests/Hydra/Serializer/CollectionFiltersNormalizerTest.php
+++ b/tests/Hydra/Serializer/CollectionFiltersNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Hydra\Serializer;
use ApiPlatform\Core\Api\FilterCollection;
@@ -126,7 +128,7 @@ public function testNormalize()
$decorated->reveal(),
$resourceMetadataFactory->reveal(),
$resourceClassResolver->reveal(),
- new FilterCollection([$filter->reveal()])
+ new FilterCollection(['foo' => $filter->reveal()])
);
$this->assertEquals([
diff --git a/tests/Hydra/Serializer/CollectionNormalizerTest.php b/tests/Hydra/Serializer/CollectionNormalizerTest.php
index fafbea672bc..bd0bcaf4a17 100644
--- a/tests/Hydra/Serializer/CollectionNormalizerTest.php
+++ b/tests/Hydra/Serializer/CollectionNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hydra\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/tests/Hydra/Serializer/ConstraintViolationNormalizerTest.php b/tests/Hydra/Serializer/ConstraintViolationNormalizerTest.php
index 936216c00da..56449cad749 100644
--- a/tests/Hydra/Serializer/ConstraintViolationNormalizerTest.php
+++ b/tests/Hydra/Serializer/ConstraintViolationNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hydra\Serializer;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/tests/Hydra/Serializer/DocumentationNormalizerTest.php b/tests/Hydra/Serializer/DocumentationNormalizerTest.php
index c57f50068e8..e88bc6fcb81 100644
--- a/tests/Hydra/Serializer/DocumentationNormalizerTest.php
+++ b/tests/Hydra/Serializer/DocumentationNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hydra\Serializer;
use ApiPlatform\Core\Api\OperationMethodResolverInterface;
diff --git a/tests/Hydra/Serializer/EntrypointNormalizerTest.php b/tests/Hydra/Serializer/EntrypointNormalizerTest.php
index 3bf068c7049..3aca7592628 100644
--- a/tests/Hydra/Serializer/EntrypointNormalizerTest.php
+++ b/tests/Hydra/Serializer/EntrypointNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hydra\Serializer;
use ApiPlatform\Core\Api\Entrypoint;
diff --git a/tests/Hydra/Serializer/ErrorNormalizerTest.php b/tests/Hydra/Serializer/ErrorNormalizerTest.php
index 32bd2ebde98..36aa9de1de3 100644
--- a/tests/Hydra/Serializer/ErrorNormalizerTest.php
+++ b/tests/Hydra/Serializer/ErrorNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hydra\Serializer;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/tests/Hydra/Serializer/ItemNormalizerTest.php b/tests/Hydra/Serializer/ItemNormalizerTest.php
index 97b3354699f..e474a5b16dc 100644
--- a/tests/Hydra/Serializer/ItemNormalizerTest.php
+++ b/tests/Hydra/Serializer/ItemNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Hydra\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/tests/Hydra/Serializer/PartialCollectionViewNormalizerTest.php b/tests/Hydra/Serializer/PartialCollectionViewNormalizerTest.php
index 8005ce01546..efe9ac4b512 100644
--- a/tests/Hydra/Serializer/PartialCollectionViewNormalizerTest.php
+++ b/tests/Hydra/Serializer/PartialCollectionViewNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Hydra\Serializer;
use ApiPlatform\Core\DataProvider\PaginatorInterface;
diff --git a/tests/JsonLd/Action/ContextActionTest.php b/tests/JsonLd/Action/ContextActionTest.php
index a95a899e0ce..bfea996553a 100644
--- a/tests/JsonLd/Action/ContextActionTest.php
+++ b/tests/JsonLd/Action/ContextActionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\JsonLd\Action;
use ApiPlatform\Core\JsonLd\Action\ContextAction;
diff --git a/tests/JsonLd/ContextBuilderTest.php b/tests/JsonLd/ContextBuilderTest.php
index 08297556b3a..52cf04da68e 100644
--- a/tests/JsonLd/ContextBuilderTest.php
+++ b/tests/JsonLd/ContextBuilderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\JsonLd;
use ApiPlatform\Core\Api\UrlGeneratorInterface;
diff --git a/tests/Metadata/Extractor/YamlExtractorTest.php b/tests/Metadata/Extractor/YamlExtractorTest.php
index 6d794c3e8c6..704e61d1e4e 100644
--- a/tests/Metadata/Extractor/YamlExtractorTest.php
+++ b/tests/Metadata/Extractor/YamlExtractorTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Metadata\Extractor;
use ApiPlatform\Core\Metadata\Extractor\YamlExtractor;
diff --git a/tests/Metadata/Property/Factory/AnnotationPropertyMetadataFactoryTest.php b/tests/Metadata/Property/Factory/AnnotationPropertyMetadataFactoryTest.php
index a96defd1dad..211c8e808ed 100644
--- a/tests/Metadata/Property/Factory/AnnotationPropertyMetadataFactoryTest.php
+++ b/tests/Metadata/Property/Factory/AnnotationPropertyMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Annotation\ApiProperty;
diff --git a/tests/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactoryTest.php b/tests/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactoryTest.php
index c0d6a9233b1..cf550af9b68 100644
--- a/tests/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactoryTest.php
+++ b/tests/Metadata/Property/Factory/AnnotationPropertyNameCollectionFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Annotation\ApiProperty;
@@ -19,7 +21,6 @@
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy;
use Doctrine\Common\Annotations\Reader;
use Prophecy\Argument;
-use Prophecy\Prophecy\ProphecyInterface;
/**
* @author Kévin Dunglas
@@ -29,7 +30,7 @@ class AnnotationPropertyNameCollectionFactoryTest extends \PHPUnit_Framework_Tes
/**
* @dataProvider getDependencies
*/
- public function testCreate(ProphecyInterface $decorated = null, array $results)
+ public function testCreate(PropertyNameCollectionFactoryInterface $decorated = null, array $results)
{
$reader = $this->prophesize(Reader::class);
$reader->getPropertyAnnotation(new \ReflectionProperty(Dummy::class, 'name'), ApiProperty::class)->willReturn(new ApiProperty())->shouldBeCalled();
@@ -39,7 +40,7 @@ public function testCreate(ProphecyInterface $decorated = null, array $results)
$reader->getMethodAnnotation(new \ReflectionMethod(Dummy::class, 'staticMethod'), ApiProperty::class)->shouldNotBeCalled();
$reader->getMethodAnnotation(Argument::type(\ReflectionMethod::class), ApiProperty::class)->willReturn(null)->shouldBeCalled();
- $factory = new AnnotationPropertyNameCollectionFactory($reader->reveal(), $decorated ? $decorated->reveal() : null);
+ $factory = new AnnotationPropertyNameCollectionFactory($reader->reveal(), $decorated);
$metadata = $factory->create(Dummy::class, []);
$this->assertEquals($results, iterator_to_array($metadata));
@@ -55,8 +56,8 @@ public function getDependencies()
return [
[null, ['name', 'alias']],
- [$decoratedThrowsNotFound, ['name', 'alias']],
- [$decoratedReturnParent, ['name', 'alias', 'foo']],
+ [$decoratedThrowsNotFound->reveal(), ['name', 'alias']],
+ [$decoratedReturnParent->reveal(), ['name', 'alias', 'foo']],
];
}
diff --git a/tests/Metadata/Property/Factory/CachedPropertyMetadataFactoryTest.php b/tests/Metadata/Property/Factory/CachedPropertyMetadataFactoryTest.php
index 0830340bbfb..6bab006d040 100644
--- a/tests/Metadata/Property/Factory/CachedPropertyMetadataFactoryTest.php
+++ b/tests/Metadata/Property/Factory/CachedPropertyMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\Factory\CachedPropertyMetadataFactory;
diff --git a/tests/Metadata/Property/Factory/CachedPropertyNameCollectionFactoryTest.php b/tests/Metadata/Property/Factory/CachedPropertyNameCollectionFactoryTest.php
index 2513bbb20e4..6f58b377e7d 100644
--- a/tests/Metadata/Property/Factory/CachedPropertyNameCollectionFactoryTest.php
+++ b/tests/Metadata/Property/Factory/CachedPropertyNameCollectionFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\Factory\CachedPropertyNameCollectionFactory;
diff --git a/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php b/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php
index d52d6c974ba..d30a41a898c 100644
--- a/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php
+++ b/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Extractor\XmlExtractor;
diff --git a/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php b/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php
index 55844435acc..3dcc03245a2 100644
--- a/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php
+++ b/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Extractor\XmlExtractor;
diff --git a/tests/Metadata/Property/Factory/FileConfigurationMetadataFactoryProvider.php b/tests/Metadata/Property/Factory/FileConfigurationMetadataFactoryProvider.php
index 475a9ec5308..5974721cb80 100644
--- a/tests/Metadata/Property/Factory/FileConfigurationMetadataFactoryProvider.php
+++ b/tests/Metadata/Property/Factory/FileConfigurationMetadataFactoryProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\PropertyMetadata;
diff --git a/tests/Metadata/Property/Factory/InheritedPropertyMetadataFactoryTest.php b/tests/Metadata/Property/Factory/InheritedPropertyMetadataFactoryTest.php
index 13e733a00db..0ddede11bf7 100644
--- a/tests/Metadata/Property/Factory/InheritedPropertyMetadataFactoryTest.php
+++ b/tests/Metadata/Property/Factory/InheritedPropertyMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\Factory\InheritedPropertyMetadataFactory;
diff --git a/tests/Metadata/Property/Factory/InheritedPropertyNameCollectionFactoryTest.php b/tests/Metadata/Property/Factory/InheritedPropertyNameCollectionFactoryTest.php
index 9a805bf983b..2e5f23d1a80 100644
--- a/tests/Metadata/Property/Factory/InheritedPropertyNameCollectionFactoryTest.php
+++ b/tests/Metadata/Property/Factory/InheritedPropertyNameCollectionFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\Factory\InheritedPropertyNameCollectionFactory;
diff --git a/tests/Metadata/Property/Factory/SerializerPropertyMetadataFactoryTest.php b/tests/Metadata/Property/Factory/SerializerPropertyMetadataFactoryTest.php
index a666388cf95..4e18ab6d1d0 100644
--- a/tests/Metadata/Property/Factory/SerializerPropertyMetadataFactoryTest.php
+++ b/tests/Metadata/Property/Factory/SerializerPropertyMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property\Factory;
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
diff --git a/tests/Metadata/Property/PropertyMetadataTest.php b/tests/Metadata/Property/PropertyMetadataTest.php
index ba3b3d6005c..8b34768ac22 100644
--- a/tests/Metadata/Property/PropertyMetadataTest.php
+++ b/tests/Metadata/Property/PropertyMetadataTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property;
use ApiPlatform\Core\Metadata\Property\PropertyMetadata;
diff --git a/tests/Metadata/Property/PropertyNameCollectionTest.php b/tests/Metadata/Property/PropertyNameCollectionTest.php
index c786d38029c..9e19bd3eea0 100644
--- a/tests/Metadata/Property/PropertyNameCollectionTest.php
+++ b/tests/Metadata/Property/PropertyNameCollectionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Property;
use ApiPlatform\Core\Metadata\Property\PropertyNameCollection;
diff --git a/tests/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php b/tests/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php
index 2cd370958a5..af490d7035c 100644
--- a/tests/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php
+++ b/tests/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Resource\Factory;
use ApiPlatform\Core\Annotation\ApiResource;
diff --git a/tests/Metadata/Resource/Factory/CachedResourceMetadataFactoryTest.php b/tests/Metadata/Resource/Factory/CachedResourceMetadataFactoryTest.php
index a7c266a08e9..00d4903c2d2 100644
--- a/tests/Metadata/Resource/Factory/CachedResourceMetadataFactoryTest.php
+++ b/tests/Metadata/Resource/Factory/CachedResourceMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\Factory\CachedResourceMetadataFactory;
diff --git a/tests/Metadata/Resource/Factory/CachedResourceNameCollectionFactoryTest.php b/tests/Metadata/Resource/Factory/CachedResourceNameCollectionFactoryTest.php
index 96a2169bb83..76207f50350 100644
--- a/tests/Metadata/Resource/Factory/CachedResourceNameCollectionFactoryTest.php
+++ b/tests/Metadata/Resource/Factory/CachedResourceNameCollectionFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\Factory\CachedResourceNameCollectionFactory;
diff --git a/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php b/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php
index d29583f66b4..6f4f643f296 100644
--- a/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php
+++ b/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Extractor\XmlExtractor;
diff --git a/tests/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactoryTest.php b/tests/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactoryTest.php
index bfe5d6e3a42..ba6291b269e 100644
--- a/tests/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactoryTest.php
+++ b/tests/Metadata/Resource/Factory/ExtractorResourceNameCollectionFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Extractor\XmlExtractor;
diff --git a/tests/Metadata/Resource/Factory/FileConfigurationMetadataFactoryProvider.php b/tests/Metadata/Resource/Factory/FileConfigurationMetadataFactoryProvider.php
index 15620c72714..f9fd19adc76 100644
--- a/tests/Metadata/Resource/Factory/FileConfigurationMetadataFactoryProvider.php
+++ b/tests/Metadata/Resource/Factory/FileConfigurationMetadataFactoryProvider.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
diff --git a/tests/Metadata/Resource/Factory/PhpDocResourceMetadataFactoryTest.php b/tests/Metadata/Resource/Factory/PhpDocResourceMetadataFactoryTest.php
index 41599f6ed42..79424307f22 100644
--- a/tests/Metadata/Resource/Factory/PhpDocResourceMetadataFactoryTest.php
+++ b/tests/Metadata/Resource/Factory/PhpDocResourceMetadataFactoryTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Metadata\Resource\Factory;
use ApiPlatform\Core\Metadata\Resource\Factory\PhpDocResourceMetadataFactory;
diff --git a/tests/Metadata/Resource/ResourceMetadataTest.php b/tests/Metadata/Resource/ResourceMetadataTest.php
index 73d0bd828cc..d4c923ba186 100644
--- a/tests/Metadata/Resource/ResourceMetadataTest.php
+++ b/tests/Metadata/Resource/ResourceMetadataTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Metadata\Resource;
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
diff --git a/tests/Metadata/Resource/ResourceNameCollectionTest.php b/tests/Metadata/Resource/ResourceNameCollectionTest.php
index 99ebde750b0..660da9cfa8e 100644
--- a/tests/Metadata/Resource/ResourceNameCollectionTest.php
+++ b/tests/Metadata/Resource/ResourceNameCollectionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\tests\Metadata\Resource;
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
diff --git a/tests/Mock/FosUser/MailerMock.php b/tests/Mock/FosUser/MailerMock.php
index d2c36a93ad1..30d0b1b78cd 100644
--- a/tests/Mock/FosUser/MailerMock.php
+++ b/tests/Mock/FosUser/MailerMock.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Mock;
use FOS\UserBundle\Mailer\MailerInterface;
diff --git a/tests/PathResolver/DashOperationPathResolverTest.php b/tests/PathResolver/DashOperationPathResolverTest.php
index a9e252570c8..71a3ce5543a 100644
--- a/tests/PathResolver/DashOperationPathResolverTest.php
+++ b/tests/PathResolver/DashOperationPathResolverTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\PathResolver;
use ApiPlatform\Core\PathResolver\DashOperationPathResolver;
diff --git a/tests/PathResolver/UnderscoreOperationPathResolverTest.php b/tests/PathResolver/UnderscoreOperationPathResolverTest.php
index a93a9ba0c5e..ee725d71887 100644
--- a/tests/PathResolver/UnderscoreOperationPathResolverTest.php
+++ b/tests/PathResolver/UnderscoreOperationPathResolverTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\PathResolver;
use ApiPlatform\Core\PathResolver\UnderscoreOperationPathResolver;
diff --git a/tests/Problem/Serializer/ConstraintViolationNormalizerTest.php b/tests/Problem/Serializer/ConstraintViolationNormalizerTest.php
index 87cdbd3ddaf..25394f54c9d 100644
--- a/tests/Problem/Serializer/ConstraintViolationNormalizerTest.php
+++ b/tests/Problem/Serializer/ConstraintViolationNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Problem\Serializer;
use ApiPlatform\Core\Problem\Serializer\ConstraintViolationListNormalizer;
diff --git a/tests/Problem/Serializer/ErrorNormalizerTest.php b/tests/Problem/Serializer/ErrorNormalizerTest.php
index 5dc3f55096a..ce1bdcae629 100644
--- a/tests/Problem/Serializer/ErrorNormalizerTest.php
+++ b/tests/Problem/Serializer/ErrorNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Problem\Serializer;
use ApiPlatform\Core\Problem\Serializer\ErrorNormalizer;
diff --git a/tests/Serializer/AbstractItemNormalizerTest.php b/tests/Serializer/AbstractItemNormalizerTest.php
index 2b214dc3ab9..92cd5b055a4 100644
--- a/tests/Serializer/AbstractItemNormalizerTest.php
+++ b/tests/Serializer/AbstractItemNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/tests/Serializer/ItemNormalizerTest.php b/tests/Serializer/ItemNormalizerTest.php
index 347f54c6403..5a1110443f9 100644
--- a/tests/Serializer/ItemNormalizerTest.php
+++ b/tests/Serializer/ItemNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Serializer;
use ApiPlatform\Core\Api\IriConverterInterface;
diff --git a/tests/Serializer/JsonEncoderTest.php b/tests/Serializer/JsonEncoderTest.php
index 04a2fb7e02e..bbb462ba896 100644
--- a/tests/Serializer/JsonEncoderTest.php
+++ b/tests/Serializer/JsonEncoderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Serializer;
use ApiPlatform\Core\Serializer\JsonEncoder;
diff --git a/tests/Serializer/SerializerContextBuilderTest.php b/tests/Serializer/SerializerContextBuilderTest.php
index ab0455fb243..957b7e318d4 100644
--- a/tests/Serializer/SerializerContextBuilderTest.php
+++ b/tests/Serializer/SerializerContextBuilderTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Serializer;
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
diff --git a/tests/Swagger/Serializer/DocumentationNormalizerTest.php b/tests/Swagger/Serializer/DocumentationNormalizerTest.php
index 985fb0d02f8..1fbbb1f7d6e 100644
--- a/tests/Swagger/Serializer/DocumentationNormalizerTest.php
+++ b/tests/Swagger/Serializer/DocumentationNormalizerTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Swagger;
use ApiPlatform\Core\Api\FilterCollection;
diff --git a/tests/Util/ErrorFormatGuesserTest.php b/tests/Util/ErrorFormatGuesserTest.php
index 11f364207a7..cec7bc98bbe 100644
--- a/tests/Util/ErrorFormatGuesserTest.php
+++ b/tests/Util/ErrorFormatGuesserTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Util;
use ApiPlatform\Core\Util\ErrorFormatGuesser;
diff --git a/tests/Util/IriHelperTest.php b/tests/Util/IriHelperTest.php
index ca0067e3c62..d369397f0bc 100644
--- a/tests/Util/IriHelperTest.php
+++ b/tests/Util/IriHelperTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Util;
use ApiPlatform\Core\Util\IriHelper;
diff --git a/tests/Util/ReflectionTest.php b/tests/Util/ReflectionTest.php
index 0d852e90312..a061f6c88b6 100644
--- a/tests/Util/ReflectionTest.php
+++ b/tests/Util/ReflectionTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Util;
use ApiPlatform\Core\Util\Reflection;
diff --git a/tests/Util/RequestAttributesExtractorTest.php b/tests/Util/RequestAttributesExtractorTest.php
index 43303d7ac28..255cc11232b 100644
--- a/tests/Util/RequestAttributesExtractorTest.php
+++ b/tests/Util/RequestAttributesExtractorTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Util;
use ApiPlatform\Core\Util\RequestAttributesExtractor;
diff --git a/tests/Util/RequestParserTest.php b/tests/Util/RequestParserTest.php
index d32e2f91f56..b577d777c05 100644
--- a/tests/Util/RequestParserTest.php
+++ b/tests/Util/RequestParserTest.php
@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
+declare(strict_types=1);
+
namespace ApiPlatform\Core\Tests\Util;
use ApiPlatform\Core\Util\RequestParser;