From 3eee205a37efccc63bbe0f0c173917a865d3be35 Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Tue, 24 Mar 2026 23:29:47 +0100 Subject: [PATCH 1/3] Clean CI and upgrade analysis tools to latest on lowest dependency runs Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/build.yml | 25 ++++++++++++------- .gitignore | 2 +- composer.json | 1 - phpcs.xml.dist | 2 +- phpunit.xml.dist | 1 + src/AssoConnectDoctrineTypesBundle.php | 2 -- .../DateTimeImmutableMicroSecondsType.php | 2 +- .../Types/BelgianEnterpriseNumberTypeTest.php | 4 +-- tests/Doctrine/DBAL/Types/BicTypeTest.php | 3 +-- tests/Doctrine/DBAL/Types/CountryTypeTest.php | 4 +-- .../Doctrine/DBAL/Types/LatitudeTypeTest.php | 4 +-- 11 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a87f58..8245a3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,30 +2,37 @@ name: Build on: push: - branches: [ master ] + branches: [ main ] pull_request: types: [opened, synchronize, reopened] jobs: build: strategy: + fail-fast: false matrix: php-versions: ['8.3', '8.4'] dependency-versions: ['lowest', 'highest'] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - + - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - + - run: composer validate --strict - - run: composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true - - run: composer install --prefer-dist --no-progress --no-suggest - + + - uses: ramsey/composer-install@v2 + with: + dependency-versions: ${{ matrix.dependency-versions }} + + - name: Upgrade analysis tools to latest + if: ${{ matrix.dependency-versions == 'lowest' }} + run: composer update phpstan/phpstan rector/rector phpunit/phpunit squizlabs/php_codesniffer --with-all-dependencies --no-interaction + - run: vendor/bin/phpcs if: ${{ failure() || success() }} @@ -37,12 +44,12 @@ jobs: - run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover ./clover.xml --log-junit ./phpunit.report.xml if: ${{ failure() || success() }} - + # https://community.sonarsource.com/t/code-coverage-doesnt-work-with-github-action/16747 # $GITHUB_WORKSPACE contains a slash so @ is used as delimiter - run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' clover.xml - run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' phpunit.report.xml - + - uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any diff --git a/.gitignore b/.gitignore index d97b838..193fd50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /vendor/* -.phpunit.result.cache +.phpunit.cache .idea .php_cs.cache composer.lock diff --git a/composer.json b/composer.json index 8e0a521..e11f655 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,6 @@ "doctrine/annotations": "~1.0", "symfony/framework-bundle": "^7.0", "symfony/yaml": "^7.0", - "squizlabs/php_codesniffer": "^3.5", "assoconnect/php-quality-config": "^2" }, "config": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index d84c2e9..8c4e835 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -3,7 +3,7 @@ - + src/ tests/ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1b92e68..aa34d0b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,6 +5,7 @@ + diff --git a/src/AssoConnectDoctrineTypesBundle.php b/src/AssoConnectDoctrineTypesBundle.php index 316d7c9..d748e3d 100644 --- a/src/AssoConnectDoctrineTypesBundle.php +++ b/src/AssoConnectDoctrineTypesBundle.php @@ -4,8 +4,6 @@ namespace AssoConnect\DoctrineTypesBundle; -use AssoConnect\DoctrineTypesBundle\DependencyInjection\AssoConnectDoctrineValidatorExtension; -use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; use Symfony\Component\HttpKernel\Bundle\Bundle; class AssoConnectDoctrineTypesBundle extends Bundle diff --git a/src/Doctrine/DBAL/Types/DateTimeImmutableMicroSecondsType.php b/src/Doctrine/DBAL/Types/DateTimeImmutableMicroSecondsType.php index 78177e2..4263161 100644 --- a/src/Doctrine/DBAL/Types/DateTimeImmutableMicroSecondsType.php +++ b/src/Doctrine/DBAL/Types/DateTimeImmutableMicroSecondsType.php @@ -6,9 +6,9 @@ use DateTimeImmutable; use DateTimeInterface; -use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\ConversionException; +use Doctrine\DBAL\Types\Type; class DateTimeImmutableMicroSecondsType extends Type { diff --git a/tests/Doctrine/DBAL/Types/BelgianEnterpriseNumberTypeTest.php b/tests/Doctrine/DBAL/Types/BelgianEnterpriseNumberTypeTest.php index daeaf54..b09ec90 100644 --- a/tests/Doctrine/DBAL/Types/BelgianEnterpriseNumberTypeTest.php +++ b/tests/Doctrine/DBAL/Types/BelgianEnterpriseNumberTypeTest.php @@ -24,8 +24,8 @@ public function testGetSQLDeclaration(): void $this->abstractPlatform ->method('getVarcharTypeDeclarationSQL') ->with(['length' => BelgianEnterpriseNumberType::LENGTH]) - ->willReturn("VARCHAR"); + ->willReturn('VARCHAR'); - self::assertSame("VARCHAR", $this->type->getSQLDeclaration([], $this->abstractPlatform)); + self::assertSame('VARCHAR', $this->type->getSQLDeclaration([], $this->abstractPlatform)); } } diff --git a/tests/Doctrine/DBAL/Types/BicTypeTest.php b/tests/Doctrine/DBAL/Types/BicTypeTest.php index 91cac33..277d2e2 100644 --- a/tests/Doctrine/DBAL/Types/BicTypeTest.php +++ b/tests/Doctrine/DBAL/Types/BicTypeTest.php @@ -6,7 +6,6 @@ use AssoConnect\DoctrineTypesBundle\Doctrine\DBAL\Types\BicType; use AssoConnect\DoctrineTypesBundle\Tests\TypeTestCase; -use Doctrine\DBAL\Platforms\MySqlPlatform; class BicTypeTest extends TypeTestCase { @@ -22,7 +21,7 @@ public function testGetName(): void public function testGetSQLDeclaration(): void { - $this->abstractPlatform->method("getVarcharTypeDeclarationSQL")->willReturn("VARCHAR"); + $this->abstractPlatform->method('getVarcharTypeDeclarationSQL')->willReturn('VARCHAR'); self::assertSame('VARCHAR', $this->type->getSQLDeclaration([], $this->abstractPlatform)); } } diff --git a/tests/Doctrine/DBAL/Types/CountryTypeTest.php b/tests/Doctrine/DBAL/Types/CountryTypeTest.php index 3a7a413..995aafc 100644 --- a/tests/Doctrine/DBAL/Types/CountryTypeTest.php +++ b/tests/Doctrine/DBAL/Types/CountryTypeTest.php @@ -24,8 +24,8 @@ public function testGetSQLDeclaration(): void $this->abstractPlatform ->method('getVarcharTypeDeclarationSQL') ->with(['fixed' => true, 'length' => CountryType::LENGTH]) - ->willReturn("VARCHAR"); + ->willReturn('VARCHAR'); - self::assertSame("VARCHAR", $this->type->getSQLDeclaration([], $this->abstractPlatform)); + self::assertSame('VARCHAR', $this->type->getSQLDeclaration([], $this->abstractPlatform)); } } diff --git a/tests/Doctrine/DBAL/Types/LatitudeTypeTest.php b/tests/Doctrine/DBAL/Types/LatitudeTypeTest.php index 9a629fb..03c3d70 100644 --- a/tests/Doctrine/DBAL/Types/LatitudeTypeTest.php +++ b/tests/Doctrine/DBAL/Types/LatitudeTypeTest.php @@ -21,8 +21,8 @@ public function testGetName(): void public function testGetSQLDeclaration(): void { - $this->abstractPlatform->method("getDecimalTypeDeclarationSQL")->willReturn("DECIMAL"); + $this->abstractPlatform->method('getDecimalTypeDeclarationSQL')->willReturn('DECIMAL'); - self::assertSame("DECIMAL", $this->type->getSQLDeclaration([], $this->abstractPlatform)); + self::assertSame('DECIMAL', $this->type->getSQLDeclaration([], $this->abstractPlatform)); } } From b95c7806a3b39df3448896a869147d861094a6ce Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Tue, 24 Mar 2026 23:31:14 +0100 Subject: [PATCH 2/3] Fix CRLF line endings in README Co-Authored-By: Claude Sonnet 4.6 --- README.md | 58 +++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 602b67c..5cabd85 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,29 @@ -# AssoConnectDoctrineTypesBundle - -[![Build Status](https://github.com/assoconnect/doctrine-types-bundle/actions/workflows/build.yml/badge.svg)](https://github.com/assoconnect/doctrine-types-bundle/actions/workflows/build.yml) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=assoconnect_doctrine-types-bundle&metric=coverage)](https://sonarcloud.io/dashboard?id=assoconnect_doctrine-types-bundle) - -This Symfony5 bundle provides the integration of [Symfony validation component](https://symfony.com/doc/current/validation.html) with [Doctrine entity custom type](https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/cookbook/custom-mapping-types.html) to avoid duplicate code for the following types: -- [Amount](/src/Doctrine/DBAL/Types/AmountType.php) -- [AbsolutePercentValue](/src/Doctrine/DBAL/Types/AbsolutePercentValueType.php) -- [BelgianEnterpriseNumber](/src/Doctrine/DBAL/Types/BelgianEnterpriseNumberType.php) -- [Bic](/src/Doctrine/DBAL/Types/BicType.php) -- [Country](/src/Doctrine/DBAL/Types/CountryType.php) -- [Currency](/src/Doctrine/DBAL/Types/CurrencyType.php) -- [Email](/src/Doctrine/DBAL/Types/EmailType.php) -- [FrenchRna](/src/Doctrine/DBAL/Types/FrenchRnaType.php) -- [FrenchSiren](/src/Doctrine/DBAL/Types/FrenchSirenType.php) -- [FrenchSiret](/src/Doctrine/DBAL/Types/FrenchSiretType.php) -- [Iban](/src/Doctrine/DBAL/Types/IbanType.php) -- [Ip](/src/Doctrine/DBAL/Types/IpType.php) -- [Latitude](/src/Doctrine/DBAL/Types/LatitudeType.php) -- [Locale](/src/Doctrine/DBAL/Types/LocaleType.php) -- [Longitude](/src/Doctrine/DBAL/Types/LongitudeType.php) -- [Money](/src/Doctrine/DBAL/Types/MoneyType.php) -- [PhoneLandline](/src/Doctrine/DBAL/Types/PhoneLandlineType.php) -- [PhoneMobile](/src/Doctrine/DBAL/Types/PhoneMobileType.php) -- [Phone](/src/Doctrine/DBAL/Types/PhoneType.php) -- [Postal](/src/Doctrine/DBAL/Types/PostalType.php) -- [Timezone](/src/Doctrine/DBAL/Types/TimezoneType.php) - -It also supports nullable and non-nullable fields. +# AssoConnectDoctrineTypesBundle + +[![Build Status](https://github.com/assoconnect/doctrine-types-bundle/actions/workflows/build.yml/badge.svg)](https://github.com/assoconnect/doctrine-types-bundle/actions/workflows/build.yml) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=assoconnect_doctrine-types-bundle&metric=coverage)](https://sonarcloud.io/dashboard?id=assoconnect_doctrine-types-bundle) + +This Symfony5 bundle provides the integration of [Symfony validation component](https://symfony.com/doc/current/validation.html) with [Doctrine entity custom type](https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/cookbook/custom-mapping-types.html) to avoid duplicate code for the following types: +- [Amount](/src/Doctrine/DBAL/Types/AmountType.php) +- [AbsolutePercentValue](/src/Doctrine/DBAL/Types/AbsolutePercentValueType.php) +- [BelgianEnterpriseNumber](/src/Doctrine/DBAL/Types/BelgianEnterpriseNumberType.php) +- [Bic](/src/Doctrine/DBAL/Types/BicType.php) +- [Country](/src/Doctrine/DBAL/Types/CountryType.php) +- [Currency](/src/Doctrine/DBAL/Types/CurrencyType.php) +- [Email](/src/Doctrine/DBAL/Types/EmailType.php) +- [FrenchRna](/src/Doctrine/DBAL/Types/FrenchRnaType.php) +- [FrenchSiren](/src/Doctrine/DBAL/Types/FrenchSirenType.php) +- [FrenchSiret](/src/Doctrine/DBAL/Types/FrenchSiretType.php) +- [Iban](/src/Doctrine/DBAL/Types/IbanType.php) +- [Ip](/src/Doctrine/DBAL/Types/IpType.php) +- [Latitude](/src/Doctrine/DBAL/Types/LatitudeType.php) +- [Locale](/src/Doctrine/DBAL/Types/LocaleType.php) +- [Longitude](/src/Doctrine/DBAL/Types/LongitudeType.php) +- [Money](/src/Doctrine/DBAL/Types/MoneyType.php) +- [PhoneLandline](/src/Doctrine/DBAL/Types/PhoneLandlineType.php) +- [PhoneMobile](/src/Doctrine/DBAL/Types/PhoneMobileType.php) +- [Phone](/src/Doctrine/DBAL/Types/PhoneType.php) +- [Postal](/src/Doctrine/DBAL/Types/PostalType.php) +- [Timezone](/src/Doctrine/DBAL/Types/TimezoneType.php) + +It also supports nullable and non-nullable fields. From 1db391954e6997c7e143ece6860e8c8a23f7a4e1 Mon Sep 17 00:00:00 2001 From: Sylvain Fabre Date: Tue, 24 Mar 2026 23:38:23 +0100 Subject: [PATCH 3/3] Require php-quality-config ^2.2 to ensure PHPUnit 10 as lowest Co-Authored-By: Claude Sonnet 4.6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e11f655..e40efb8 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "doctrine/annotations": "~1.0", "symfony/framework-bundle": "^7.0", "symfony/yaml": "^7.0", - "assoconnect/php-quality-config": "^2" + "assoconnect/php-quality-config": "^2.2" }, "config": { "allow-plugins": {