diff --git a/.github/workflows/test_orm_3.yaml b/.github/workflows/test_orm_3.yaml deleted file mode 100644 index 865a6f268..000000000 --- a/.github/workflows/test_orm_3.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# TEMPORARILY USED until AuditBundle is compatible with ORM 3 - -name: Test - -on: - pull_request: - -permissions: - contents: read - -jobs: - test: - name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }} (ORM 3) - - runs-on: ubuntu-latest - - continue-on-error: ${{ matrix.allowed-to-fail }} - - env: - SYMFONY_REQUIRE: ${{matrix.symfony-require}} - - strategy: - matrix: - include: - - php-version: '8.3' - dependencies: highest - allowed-to-fail: false - symfony-require: 7.0.* - variant: symfony/symfony:"7.0.*" - remove-audit-bundle: true - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install PHP with extensions - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - coverage: pcov - tools: composer:v2, flex - - - name: Add PHPUnit matcher - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Remove AuditBundle - if: matrix.remove-audit-bundle - run: composer remove sonata-project/entity-audit-bundle --dev --no-update - - - name: Install variant - if: matrix.variant != 'normal' && !startsWith(matrix.variant, 'symfony/symfony') - run: composer require ${{ matrix.variant }} --no-update - - - name: Install Composer dependencies (${{ matrix.dependencies }}) - uses: ramsey/composer-install@v2 - with: - dependency-versions: ${{ matrix.dependencies }} - - - name: Run Tests with coverage - run: make coverage - - - name: Send coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: build/logs/clover.xml diff --git a/composer.json b/composer.json index 20612f097..f7a3d7bc9 100644 --- a/composer.json +++ b/composer.json @@ -25,24 +25,24 @@ ], "homepage": "https://docs.sonata-project.org/projects/SonataDoctrineORMAdminBundle", "require": { - "php": "^8.0", + "php": "^8.1", "doctrine/dbal": "^3.4 || ^4.0", "doctrine/doctrine-bundle": "^2.10", "doctrine/orm": "^2.17 || ^3.0", "doctrine/persistence": "^3.0.2", - "sonata-project/admin-bundle": "^4.18", + "sonata-project/admin-bundle": "^4.34", "sonata-project/exporter": "^2.0 || ^3.0", "sonata-project/form-extensions": "^1.19 || ^2.0", - "symfony/config": "^5.4 || ^6.2 || ^7.0", - "symfony/console": "^5.4 || ^6.2 || ^7.0", - "symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0", - "symfony/doctrine-bridge": "^5.4 || ^6.2 || ^7.0", - "symfony/form": "^5.4 || ^6.2 || ^7.0", - "symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0", - "symfony/http-foundation": "^5.4 || ^6.2 || ^7.0", - "symfony/http-kernel": "^5.4 || ^6.2 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.2 || ^7.0", - "symfony/property-access": "^5.4 || ^6.2 || ^7.0", + "symfony/config": "^6.4 || ^7.1", + "symfony/console": "^6.4 || ^7.1", + "symfony/dependency-injection": "^6.4 || ^7.1", + "symfony/doctrine-bridge": "^6.4 || ^7.1", + "symfony/form": "^6.4 || ^7.1", + "symfony/framework-bundle": "^6.4 || ^7.1", + "symfony/http-foundation": "^6.4 || ^7.1", + "symfony/http-kernel": "^6.4 || ^7.1", + "symfony/options-resolver": "^6.4 || ^7.1", + "symfony/property-access": "^6.4 || ^7.1", "symfony/security-acl": "^3.0", "twig/twig": "^3.0" }, @@ -63,13 +63,13 @@ "rector/rector": "^1.1", "sonata-project/block-bundle": "^5.0", "sonata-project/entity-audit-bundle": "^1.1", - "symfony/browser-kit": "^5.4 || ^6.2 || ^7.0", - "symfony/css-selector": "^5.4 || ^6.2 || ^7.0", + "symfony/browser-kit": "^6.4 || ^7.1", + "symfony/css-selector": "^6.4 || ^7.1", "symfony/panther": "^2.0.1", - "symfony/phpunit-bridge": "^6.2 || ^7.0", - "symfony/templating": "^5.4 || ^6.2 || ^7.0", - "symfony/uid": "^5.4 || ^6.2 || ^7.0", - "symfony/yaml": "^5.4 || ^6.2 || ^7.0", + "symfony/phpunit-bridge": "^6.4 || ^7.1", + "symfony/templating": "^6.4 || ^7.1", + "symfony/uid": "^6.4 || ^7.1", + "symfony/yaml": "^6.4 || ^7.1", "vimeo/psalm": "^5.7", "weirdan/doctrine-psalm-plugin": "^2.0" }, diff --git a/rector.php b/rector.php index d57c8f491..254341a3b 100644 --- a/rector.php +++ b/rector.php @@ -19,6 +19,8 @@ use Rector\Config\RectorConfig; use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector; +use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; +use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; use Rector\PHPUnit\CodeQuality\Rector\Class_\NarrowUnusedSetUpDefinedPropertyRector; use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector; use Rector\PHPUnit\Set\PHPUnitSetList; @@ -40,6 +42,8 @@ $rectorConfig->importShortClasses(false); $rectorConfig->skip([ ExceptionHandlerTypehintRector::class, + ReadOnlyPropertyRector::class, + NullToStrictStringFuncCallArgRector::class, PreferPHPUnitThisCallRector::class, NarrowUnusedSetUpDefinedPropertyRector::class, ]); diff --git a/src/Exporter/DataSource.php b/src/Exporter/DataSource.php index ec47b7233..aed35b745 100644 --- a/src/Exporter/DataSource.php +++ b/src/Exporter/DataSource.php @@ -95,7 +95,7 @@ private function findFieldName(ProxyQueryInterface $query, string $alias): ?stri $joinAlias = $joinPart->getAlias(); if ($joinAlias === $alias) { - $joinParts = explode('.', $join); + $joinParts = explode('.', (string) $join); return end($joinParts); } diff --git a/src/Filter/ModelFilter.php b/src/Filter/ModelFilter.php index c7bed61af..68d811df5 100644 --- a/src/Filter/ModelFilter.php +++ b/src/Filter/ModelFilter.php @@ -126,7 +126,7 @@ private function getParentAlias(ProxyQueryInterface $query, string $alias): stri if (isset($joins[$rootAlias])) { foreach ($joins[$rootAlias] as $join) { if ($join->getAlias() === $alias) { - $parts = explode('.', $join->getJoin()); + $parts = explode('.', (string) $join->getJoin()); $parentAlias = $parts[0]; break; diff --git a/src/Util/SmartPaginatorFactory.php b/src/Util/SmartPaginatorFactory.php index 6c29bcf09..bb3f6ecd3 100644 --- a/src/Util/SmartPaginatorFactory.php +++ b/src/Util/SmartPaginatorFactory.php @@ -158,7 +158,7 @@ private static function hasOrderByWithToManyAssociation(ProxyQueryInterface $pro foreach ($orderByParts as $orderByPart) { foreach ($orderByPart->getParts() as $part) { foreach ($joinAliases as $joinAlias) { - if (str_starts_with($part, $joinAlias.'.')) { + if (str_starts_with((string) $part, $joinAlias.'.')) { return true; } } diff --git a/tests/Filter/CallbackFilterTest.php b/tests/Filter/CallbackFilterTest.php index 8d57ba7b2..bf8b5182d 100644 --- a/tests/Filter/CallbackFilterTest.php +++ b/tests/Filter/CallbackFilterTest.php @@ -58,7 +58,7 @@ public function testFilterMethod(): void $filter = new CallbackFilter(); $filter->initialize('field_name', [ - 'callback' => [$this, 'customCallback'], + 'callback' => $this->customCallback(...), ]); $filter->filter($proxyQuery, 'alias', 'field', FilterData::fromArray(['value' => 'myValue']));