Skip to content

Commit

Permalink
Merge 3.x into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Dec 8, 2024
2 parents d5941ff + bf119c9 commit ca68acd
Show file tree
Hide file tree
Showing 10 changed files with 333 additions and 36 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ jobs:
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 5.4.*
variant: symfony/symfony:"5.4.*"
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.3.*
variant: symfony/symfony:"6.3.*"
symfony-require: 7.1.*
variant: symfony/symfony:"7.1.*"
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"
symfony-require: 7.2.*
variant: symfony/symfony:"7.2.*"

steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,35 @@ permissions:

jobs:
test:
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }} (Symfony 7)
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }} (+ knplabs)

runs-on: ubuntu-latest

continue-on-error: ${{ matrix.allowed-to-fail }}

env:
SYMFONY_REQUIRE: ${{matrix.symfony-require}}
SYMFONY_REQUIRE: ${{ matrix.symfony-require }}

strategy:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
dependencies: [highest]
allowed-to-fail: [false]
symfony-require: ['']
variant: [normal]
include:
- php-version: '8.2'
dependencies: highest
- php-version: '8.1'
dependencies: lowest
allowed-to-fail: false
symfony-require: 7.0.*
variant: symfony/symfony:"7.0.*"
variant: normal
- php-version: '8.3'
dependencies: highest
allowed-to-fail: false
symfony-require: 7.0.*
variant: symfony/symfony:"7.0.*"
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"

steps:
- name: Checkout
Expand All @@ -53,8 +60,8 @@ jobs:
- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Remove knplabs/doctrine-behaviors
run: composer remove knplabs/doctrine-behaviors --dev --no-update
- name: Add knplabs/doctrine-behaviors
run: composer require knplabs/doctrine-behaviors --dev --no-update

- name: Install variant
if: matrix.variant != 'normal' && !startsWith(matrix.variant, 'symfony/symfony')
Expand Down
31 changes: 15 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
],
"homepage": "https://docs.sonata-project.org/projects/SonataTranslationBundle",
"require": {
"php": "^8.0",
"sonata-project/admin-bundle": "^4.15",
"php": "^8.1",
"sonata-project/admin-bundle": "^4.34",
"sonata-project/block-bundle": "^4.11 || ^5.0",
"symfony/config": "^5.4 || ^6.2 || ^7.0",
"symfony/dependency-injection": "^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/intl": "^5.4 || ^6.2 || ^7.0",
"symfony/options-resolver": "^5.4 || ^6.2 || ^7.0",
"symfony/config": "^6.4 || ^7.1",
"symfony/dependency-injection": "^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/intl": "^6.4 || ^7.1",
"symfony/options-resolver": "^6.4 || ^7.1",
"twig/twig": "^3.0"
},
"require-dev": {
Expand All @@ -40,7 +40,6 @@
"doctrine/persistence": "^3.0.2",
"friendsofphp/php-cs-fixer": "^3.4",
"gedmo/doctrine-extensions": "^3.11",
"knplabs/doctrine-behaviors": "^2.6.2",
"matthiasnoback/symfony-config-test": "^4.2 || ^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",
"phpstan/extension-installer": "^1.0",
Expand All @@ -55,11 +54,11 @@
"psalm/plugin-symfony": "^5.0",
"rector/rector": "^1.1",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"symfony/browser-kit": "^5.4 || ^6.2 || ^7.0",
"symfony/css-selector": "^5.4 || ^6.2 || ^7.0",
"symfony/doctrine-bridge": "^5.4 || ^6.2 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.2 || ^7.0",
"symfony/phpunit-bridge": "^7.0",
"symfony/browser-kit": "^6.4 || ^7.1",
"symfony/css-selector": "^6.4 || ^7.1",
"symfony/doctrine-bridge": "^6.4 || ^7.1",
"symfony/filesystem": "^6.4 || ^7.1",
"symfony/phpunit-bridge": "^7.1",
"vimeo/psalm": "^5.8",
"weirdan/doctrine-psalm-plugin": "^2.0"
},
Expand Down
128 changes: 128 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
parameters:
excludePaths:
analyseAndScan:
- tests/Traits/KnplabsOrmTest.php
- tests/Fixtures/Traits/ORM/Knplabs/
- tests/Fixtures/Model/Knplabs/
- src/Provider/Knplabs/
- tests/App/Provider/
- tests/Provider/Knplabs/
- tests/App/KnpEntity/
- tests/App/DataFixtures
- tests/Checker/TranslatableCheckerForKnpTest.php
- tests/App/Admin/KnpCategoryAdmin.php
ignoreErrors:
-
message: "#^Call to method mergeNewTranslations\\(\\) on an unknown class Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 2
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Call to method setCurrentLocale\\(\\) on an unknown class Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 2
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^PHPDoc tag @extends has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$admin of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:alterNewInstance\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$admin of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:alterObject\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$admin of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:prePersist\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$admin of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:preUpdate\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:alterNewInstance\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:alterObject\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:prePersist\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Parameter \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:preUpdate\\(\\) has invalid type Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface\\.$#"
count: 1
path: src/Admin/Extension/Knplabs/TranslatableAdminExtension.php

-
message: "#^Class Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface not found\\.$#"
count: 1
path: src/DependencyInjection/SonataTranslationExtension.php

-
message: "#^Class Knp\\\\DoctrineBehaviors\\\\Contract\\\\Provider\\\\LocaleProviderInterface not found\\.$#"
count: 1
path: src/Resources/config/service_knplabs.php

-
message: "#^Call to an undefined method Sonata\\\\TranslationBundle\\\\Tests\\\\Fixtures\\\\Model\\\\Knplabs\\\\TranslatableEntity\\:\\:getCurrentLocale\\(\\)\\.$#"
count: 2
path: tests/Admin/Extension/Knplabs/TranslatableAdminExtensionTest.php

-
message: "#^Parameter \\#2 \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:alterNewInstance\\(\\) expects Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface, Sonata\\\\TranslationBundle\\\\Tests\\\\Fixtures\\\\Model\\\\Knplabs\\\\TranslatableEntity given\\.$#"
count: 1
path: tests/Admin/Extension/Knplabs/TranslatableAdminExtensionTest.php

-
message: "#^Parameter \\#2 \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:alterObject\\(\\) expects Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface, Sonata\\\\TranslationBundle\\\\Tests\\\\Fixtures\\\\Model\\\\Knplabs\\\\TranslatableEntity given\\.$#"
count: 1
path: tests/Admin/Extension/Knplabs/TranslatableAdminExtensionTest.php

-
message: "#^Parameter \\#2 \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:prePersist\\(\\) expects Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface, PHPUnit\\\\Framework\\\\MockObject\\\\MockObject&Sonata\\\\TranslationBundle\\\\Tests\\\\Fixtures\\\\Model\\\\Knplabs\\\\TranslatableEntity given\\.$#"
count: 1
path: tests/Admin/Extension/Knplabs/TranslatableAdminExtensionTest.php

-
message: "#^Parameter \\#2 \\$object of method Sonata\\\\TranslationBundle\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtension\\:\\:preUpdate\\(\\) expects Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface, PHPUnit\\\\Framework\\\\MockObject\\\\MockObject&Sonata\\\\TranslationBundle\\\\Tests\\\\Fixtures\\\\Model\\\\Knplabs\\\\TranslatableEntity given\\.$#"
count: 1
path: tests/Admin/Extension/Knplabs/TranslatableAdminExtensionTest.php

-
message: "#^Property Sonata\\\\TranslationBundle\\\\Tests\\\\Admin\\\\Extension\\\\Knplabs\\\\TranslatableAdminExtensionTest\\:\\:\\$admin has unknown class Knp\\\\DoctrineBehaviors\\\\Contract\\\\Entity\\\\TranslatableInterface as its type\\.$#"
count: 1
path: tests/Admin/Extension/Knplabs/TranslatableAdminExtensionTest.php

-
message: "#^Trying to mock an undefined method mergeNewTranslations\\(\\) on class Sonata\\\\TranslationBundle\\\\Tests\\\\Fixtures\\\\Model\\\\Knplabs\\\\TranslatableEntity\\.$#"
count: 2
path: tests/Admin/Extension/Knplabs/TranslatableAdminExtensionTest.php

-
message: "#^Method Sonata\\\\TranslationBundle\\\\Tests\\\\App\\\\AppKernel\\:\\:registerBundles\\(\\) should return iterable\\<Symfony\\\\Component\\\\HttpKernel\\\\Bundle\\\\BundleInterface\\> but returns array\\<int, Doctrine\\\\Bundle\\\\DoctrineBundle\\\\DoctrineBundle\\|Doctrine\\\\Bundle\\\\FixturesBundle\\\\DoctrineFixturesBundle\\|Knp\\\\Bundle\\\\MenuBundle\\\\KnpMenuBundle\\|Knp\\\\DoctrineBehaviors\\\\DoctrineBehaviorsBundle\\|Sonata\\\\AdminBundle\\\\SonataAdminBundle\\|Sonata\\\\BlockBundle\\\\SonataBlockBundle\\|Sonata\\\\Doctrine\\\\Bridge\\\\Symfony\\\\SonataDoctrineBundle\\|Sonata\\\\DoctrineORMAdminBundle\\\\SonataDoctrineORMAdminBundle\\|Sonata\\\\Form\\\\Bridge\\\\Symfony\\\\SonataFormBundle\\|Sonata\\\\TranslationBundle\\\\SonataTranslationBundle\\|Sonata\\\\Twig\\\\Bridge\\\\Symfony\\\\SonataTwigBundle\\|Symfony\\\\Bundle\\\\FrameworkBundle\\\\FrameworkBundle\\|Symfony\\\\Bundle\\\\SecurityBundle\\\\SecurityBundle\\|Symfony\\\\Bundle\\\\TwigBundle\\\\TwigBundle\\>\\.$#"
count: 1
path: tests/App/AppKernel.php

-
message: "#^Class Knp\\\\DoctrineBehaviors\\\\EventSubscriber\\\\TranslatableEventSubscriber not found\\.$#"
count: 1
path: tests/App/config/services.php

-
message: "#^Class Knp\\\\DoctrineBehaviors\\\\Provider\\\\UserProvider not found\\.$#"
count: 1
path: tests/App/config/services.php
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# It's auto-generated by sonata-project/dev-kit package.

includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan/conf/bleedingEdge.neon

parameters:
Expand Down
Loading

0 comments on commit ca68acd

Please sign in to comment.