diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index 760ee0d1..1780c819 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -8,11 +8,11 @@ jobs: phpstan: name: PHPStan - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a9823b8b..23ae9a2f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,7 +5,7 @@ on: [push, pull_request ] jobs: test: name: 'PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }}' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -16,9 +16,10 @@ jobs: php-version: - '8.2' - '8.3' + - '8.4' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: @@ -28,6 +29,6 @@ jobs: uses: 'ramsey/composer-install@v1' with: dependency-versions: '${{ matrix.dependencies }}' - composer-options: '--prefer-dist --prefer-stable' + composer-options: --prefer-dist --prefer-stable ${{ matrix.php-version == '8.4' && '--ignore-platform-req=php' || '' }} - name: Run Tests run: composer test diff --git a/composer.json b/composer.json index f8064196..f6aa84ce 100644 --- a/composer.json +++ b/composer.json @@ -21,12 +21,13 @@ ], "require": { "php": ">=8.2", - "doctrine/orm": "^3.0 || ^2.18", - "symfony/property-access": "^7.0 || ^6.0", - "symfony/polyfill-php80": "^1.20" + "doctrine/orm": "^3.3", + "symfony/property-access": "^7.1", + "symfony/polyfill-php80": "^1.31" }, "require-dev": { - "phpspec/phpspec": "^7.5" + "phpspec/phpspec": "^7.5", + "phpspec/prophecy": "^1.20" }, "autoload": { "psr-4": { diff --git a/src/DBALTypesResolver.php b/src/DBALTypesResolver.php index e639c557..a58cbdf8 100644 --- a/src/DBALTypesResolver.php +++ b/src/DBALTypesResolver.php @@ -52,7 +52,7 @@ public static function tryGetTypeForValue($value): ?Type $classNameParts = explode('\\', str_replace('_', '\\', $className)); $typeName = array_pop($classNameParts); - if (null !== $typeName && array_key_exists($typeName, Type::getTypesMap())) { + if (array_key_exists($typeName, Type::getTypesMap())) { return Type::getType($typeName); } diff --git a/src/Operand/PlatformFunction/Executor/SubstringExecutor.php b/src/Operand/PlatformFunction/Executor/SubstringExecutor.php index 4b0c67ab..2db3cf73 100644 --- a/src/Operand/PlatformFunction/Executor/SubstringExecutor.php +++ b/src/Operand/PlatformFunction/Executor/SubstringExecutor.php @@ -21,7 +21,7 @@ final class SubstringExecutor * @param int $offset * @param int|null $length * - * @return false|string + * @return string */ public function __invoke(string $string, int $offset, ?int $length = null) { diff --git a/src/Query/QueryModifierCollection.php b/src/Query/QueryModifierCollection.php index 26463c43..8c0d0beb 100644 --- a/src/Query/QueryModifierCollection.php +++ b/src/Query/QueryModifierCollection.php @@ -15,7 +15,6 @@ namespace Happyr\DoctrineSpecification\Query; use Doctrine\ORM\QueryBuilder; -use Happyr\DoctrineSpecification\Exception\InvalidArgumentException; final class QueryModifierCollection implements QueryModifier { @@ -41,14 +40,6 @@ public function __construct(...$children) public function modify(QueryBuilder $qb, string $context): void { foreach ($this->children as $child) { - if (!$child instanceof QueryModifier) { - throw new InvalidArgumentException(sprintf( - 'Child passed to QueryModifierCollection must be an instance of %s, but instance of %s found', - QueryModifier::class, - get_class($child) - )); - } - $child->modify($qb, $context); } } diff --git a/src/Result/ResultModifierCollection.php b/src/Result/ResultModifierCollection.php index 5479ca94..4f587167 100644 --- a/src/Result/ResultModifierCollection.php +++ b/src/Result/ResultModifierCollection.php @@ -15,7 +15,6 @@ namespace Happyr\DoctrineSpecification\Result; use Doctrine\ORM\AbstractQuery; -use Happyr\DoctrineSpecification\Exception\InvalidArgumentException; final class ResultModifierCollection implements ResultModifier { @@ -40,14 +39,6 @@ public function __construct(...$children) public function modify(AbstractQuery $query): void { foreach ($this->children as $child) { - if (!$child instanceof ResultModifier) { - throw new InvalidArgumentException(sprintf( - 'Child passed to ResultModifierCollection must be an instance of %s, but instance of %s found', - ResultModifier::class, - get_class($child) - )); - } - $child->modify($query); } }