Skip to content

Commit

Permalink
Merge pull request #3 from shlinkio/feature/test-php-8.4
Browse files Browse the repository at this point in the history
Add PHP 8.4 to workflow
  • Loading branch information
acelaya authored Nov 20, 2024
2 parents ac1c4e0 + 43bd4a6 commit 7c60a44
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/DBALTypesResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
9 changes: 0 additions & 9 deletions src/Query/QueryModifierCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Happyr\DoctrineSpecification\Query;

use Doctrine\ORM\QueryBuilder;
use Happyr\DoctrineSpecification\Exception\InvalidArgumentException;

final class QueryModifierCollection implements QueryModifier
{
Expand All @@ -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);
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/Result/ResultModifierCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Happyr\DoctrineSpecification\Result;

use Doctrine\ORM\AbstractQuery;
use Happyr\DoctrineSpecification\Exception\InvalidArgumentException;

final class ResultModifierCollection implements ResultModifier
{
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 7c60a44

Please sign in to comment.