feat!: upgrade all dependencies to current stable versions#32
Open
Patrick Gugelsberger (Patrick-Gugelsberger) wants to merge 2 commits into
Open
feat!: upgrade all dependencies to current stable versions#32Patrick Gugelsberger (Patrick-Gugelsberger) wants to merge 2 commits into
Patrick Gugelsberger (Patrick-Gugelsberger) wants to merge 2 commits into
Conversation
BREAKING CHANGE: Minimum PHP version raised from 7.4 to 8.2. Multiple major dependency upgrades require consumers to align. Dependencies upgraded: - PHP >=7.4 -> >=8.2 - symfony/* ^5.0|^6.0 -> ^8.0 (console, event-dispatcher, filesystem, finder, http-foundation) - doctrine/dbal ^3.0 -> ^4.0 - doctrine/collections ^2.2 -> ^3.0 - monolog/monolog ^2.0|^3.0 -> ^3.0 - php-di/php-di ^6.0 -> ^7.0 - phpunit/phpunit ^9.0 -> ^11.0 - phpstan/phpstan ^1.0 -> ^2.0 - squizlabs/php_codesniffer ^3.10 -> ^4.0 - slevomat/coding-standard ^8.15 -> ^8.29 - micheh/phpcs-gitlab ^1.1 -> ^2.0 - jtl/connector-cq * -> ^2.0 - mockery/mockery ^1.3 -> ^1.6 Dependencies removed: - doctrine/annotations (zero usage) - doctrine/cache (zero usage) - jtl/unit-test (helpers inlined into tests/src/dbc/TestCase.php) DBAL 4 migration: - Rewrite QueryBuilder to track query type internally (INSERT/UPDATE/DELETE/SELECT) - Replace execute() with executeQuery()/executeStatement() - Replace fetch()/fetchAll() with fetchAssociative()/fetchAllAssociative() - Replace getSchemaManager() with createSchemaManager() - Replace Schema::getMigrateToSql() with Comparator + Platform::getAlterSchemaSQL() - Replace Type::getName() with TypeRegistry::lookupName() - Replace Connection::PARAM_STR_ARRAY with ArrayParameterType::STRING - Replace DBALException with Exception, SchemaException with ColumnDoesNotExist::new() - Replace ConversionException::conversionFailedInvalidType() with InvalidType::new() - Add normalizeIntrospectedSchema() for SQLite type round-trip mismatches - Update platform class references (MySqlPlatform -> MySQLPlatform, SqlitePlatform -> SQLitePlatform) - Update connection params (driver key mandatory, pdo key removed) Symfony 8 migration: - Replace removed Request::get() with Request::request->get() / Request::query->get() - Replace Request mock with real Request in tests (typed property) Monolog 3 / PHP-DI 7: - Remove useAnnotations(true) call - Clean up backward-compat union type hints in logger processors/handlers PHPUnit 11 migration: - Convert 69 @dataProvider annotations to #[DataProvider()] attributes across 27 files - Make all data provider methods static - Convert @Depends to #[Depends()], @runInSeparateProcess to #[RunInSeparateProcess] - Replace setMethods() with onlyMethods() - Remove SebastianBergmann\RecursionContext\InvalidArgumentException (85 occurrences, 45 files) - Remove invalid PHPUnit MockObject exception imports and @throws (~260 annotations) - Fix unqualified exception names in @throws to prevent namespace misresolution - Inline jtl/unit-test reflection helpers into tests/src/dbc/TestCase.php - Update phpunit.xml.dist schema to 11.5, replace <coverage> with <source> PHPStan 2 migration: - Fix ~148 errors across ~47 files at level max - Narrow mixed types before binary ops, casts, foreach, offset access - Remove redundant type checks (instanceof, is_int, is_string, is_array, is_object) - Fix ReflectionClass template covariance (inline instead of property) - Add @var annotations for superglobals and loosely-typed returns - Extract typed variables from method chains for static analysis phpcs 4 / slevomat 8.29: - Auto-fix 364 @throws annotation ordering violations across 77 files - Console command: $defaultName property -> #[AsCommand] attribute
Copilot started reviewing on behalf of
Patrick Gugelsberger (Patrick-Gugelsberger)
June 1, 2026 08:31
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades jtl/connector-core to current stable dependencies (PHP 8.2+, Symfony 8, Doctrine DBAL 4, Monolog 3, PHPUnit 11, PHPStan 2) and adapts the codebase and test suite to the new major-version APIs.
Changes:
- Migrates DB access layer to Doctrine DBAL 4 (schema diffing, query execution, types, exceptions).
- Updates runtime and serializer/logging utilities for Symfony 8 / Monolog 3 / stricter typing.
- Modernizes PHPUnit tests to PHPUnit 11 attributes and updated mocking/exception APIs.
Reviewed changes
Copilot reviewed 114 out of 114 changed files in this pull request and generated 36 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/src/Utilities/StrTest.php | PHPUnit 11 DataProvider attributes |
| tests/src/TestCase.php | Test base updates (static providers) |
| tests/src/Subscriber/SyncErrorSubscriberTest.php | Stronger assertion for no errors |
| tests/src/Subscriber/RequestParamsTransformSubscriberTest.php | DataProvider attributes + doc updates |
| tests/src/Subscriber/FeaturesSubscriberTest.php | PHPUnit exception cleanup |
| tests/src/Session/SqliteSessionHandlerTest.php | PHPStan-friendly typing assertions |
| tests/src/Session/SessionHelperTest.php | Session superglobal typing annotations |
| tests/src/Serializer/Subscriber/ProductAttributeSubscriberTest.php | PHPStan-friendly stdClass typing |
| tests/src/Serializer/Subscriber/LanguageIsoSubscriberTest.php | PHPUnit 11 providers + exception cleanup |
| tests/src/Serializer/Subscriber/ImageSubscriberTest.php | Adds assertion + exception cleanup |
| tests/src/Serializer/Subscriber/CrossSellingSubscriberTest.php | DataProvider attribute + typing |
| tests/src/Serializer/Handler/IdentityHandlerTest.php | DataProvider attribute + static provider |
| tests/src/Rpc/ResponsePacketTest.php | DataProvider attribute + exception cleanup |
| tests/src/Rpc/RequestPacketTest.php | DataProvider attributes + updated provider types |
| tests/src/Rpc/PacketTest.php | Docblock ordering tweak |
| tests/src/Rpc/MethodTest.php | DataProvider attribute + static provider |
| tests/src/Rpc/ErrorTest.php | Removes redundant assertion pattern |
| tests/src/Model/TranslatableAttributeTest.php | PHPUnit 11 attributes + provider hardening |
| tests/src/Model/TranslatableAttributeI18nTest.php | PHPUnit 11 attributes + provider static |
| tests/src/Model/ModelTest.php | DataProvider attribute + provider hardening |
| tests/src/Model/AbstractImageTest.php | DataProvider attribute + static providers |
| tests/src/mapping-tables/TableStub.php | DBAL exception type migration |
| tests/src/mapping-tables/TableProxyTest.php | DBAL exception type migration |
| tests/src/mapping-tables/TableManagerTest.php | DBAL exception type migration |
| tests/src/mapping-tables/TableDummyTest.php | PHPUnit exception cleanup |
| tests/src/mapping-tables/TableCollectionTest.php | PHPUnit exception cleanup |
| tests/src/Logger/LoggerServiceTest.php | Updated exception docs for PHPUnit/Monolog |
| tests/src/Linker/IdentityLinkerTest.php | DataProvider attribute + deterministic providers |
| tests/src/Definition/RpcMethodTest.php | DataProvider attributes + merge behavior tweak |
| tests/src/Definition/RelationTypeTest.php | DataProvider attributes + static providers |
| tests/src/Definition/PaymentTypeTest.php | DataProvider attribute + static provider |
| tests/src/Definition/ModelTest.php | DataProvider attributes + stronger typing |
| tests/src/Definition/IdentityTypeTest.php | DataProvider attribute + static provider |
| tests/src/Definition/EventTest.php | DataProvider attribute + static provider |
| tests/src/Definition/ControllerTest.php | DataProvider attribute + static provider |
| tests/src/Definition/ActionTest.php | DataProvider attribute + static provider |
| tests/src/dbc/Types/Uuid4TypeTest.php | DBAL 4 platform/type exception updates |
| tests/src/dbc/TestCase.php | Inlines removed helpers; DBAL 4 execution API |
| tests/src/dbc/TableStub.php | DBAL 4 Result + Types constants |
| tests/src/dbc/TableCollectionTest.php | DBAL exception type migration |
| tests/src/dbc/Table2Stub.php | DBAL Types constants migration |
| tests/src/dbc/Schema/TableRestrictionTest.php | DBAL 4 ColumnDoesNotExist exception |
| tests/src/dbc/DbManagerTest.php | DBAL 4 params + execution APIs |
| tests/src/dbc/DbManagerStub.php | Adjusts return shapes for DBAL 4 |
| tests/src/dbc/CoordinatesStub.php | DBAL 4 Result + Types constants |
| tests/src/Controller/ConnectorTest.php | PHPUnit exception cleanup |
| tests/src/Config/FileConfigTest.php | PHPUnit exception cleanup |
| tests/src/Config/ConfigSchemaTest.php | PHPUnit exception cleanup |
| tests/src/Config/ConfigParameterTest.php | DataProvider attribute + static provider |
| tests/src/Authentication/TokenValidationTest.php | DataProvider attribute + static provider |
| tests/src/Application/ResponseTest.php | DataProvider attribute + static provider |
| tests/src/Application/RequestTest.php | PHPUnit exception cleanup |
| tests/bootstrap.php | Removes Doctrine annotations bootstrap |
| src/Utilities/Validator/ValidatorInterface.php | Docblock ordering tweak |
| src/Utilities/Validator/Validator.php | Better exception message typing |
| src/Utilities/Validator/Validate.php | Docblock ordering tweak |
| src/Utilities/Money.php | Tightens legacy method signatures/docs |
| src/System/Check.php | Clearer PHP version compare logic |
| src/SyncError/SqliteSyncErrorCollector.php | PHPStan typing for sqlite fetch result |
| src/Subscriber/RequestParamsTransformSubscriber.php | Safer array handling + typed usort |
| src/Session/SqliteSessionHandler.php | Docblock ordering tweak |
| src/Session/SessionHelper.php | Session superglobal typing annotations |
| src/Serializer/Subscriber/ProductStockLevelSubscriber.php | Removes phpstan ignore via visitor typing |
| src/Serializer/Subscriber/LanguageIsoSubscriber.php | Removes phpstan ignore + typing |
| src/Serializer/Subscriber/ImageSubscriber.php | Removes phpstan ignore + typing |
| src/Serializer/Subscriber/CrossSellingSubscriber.php | Removes phpstan ignores + typing |
| src/Serializer/SerializerBuilder.php | Docblock ordering tweak |
| src/Serializer/Handler/IdentityHandler.php | Adds typing for current path |
| src/Rpc/ResponsePacket.php | Warning validation tweak |
| src/Rpc/RequestPacket.php | Removes annotations exception references |
| src/Rpc/Packet.php | Removes annotations exception references |
| src/Model/TranslatableAttributeI18n.php | Docblock ordering tweak |
| src/Model/TranslatableAttribute.php | Adjusts getValues type selection logic |
| src/Model/QueryFilter.php | Stronger stdClass handling/typing |
| src/Model/Generator/TaxRateFactory.php | Docblock ordering tweak |
| src/Model/Generator/ProductVariationFactory.php | Corrects i18ns array typing |
| src/Model/Generator/ProductPriceFactory.php | Makes faker price generation safer |
| src/Model/Generator/ProductFactory.php | Docblock ordering tweak |
| src/Model/Generator/AbstractModelFactory.php | Better typing around overrides + asserts |
| src/Model/AbstractImage.php | Removes cached ReflectionClass property |
| src/mapping-tables/Validator.php | Uses DBAL 4 Result type |
| src/mapping-tables/TableProxy.php | DBAL exception type migration + doc updates |
| src/mapping-tables/TableManager.php | Adjusts boolean semantics for operations |
| src/Logger/Processor/WarningProcessor.php | Monolog 3 LogRecord-only processor |
| src/Logger/Processor/RequestProcessor.php | Monolog 3 LogRecord-only processor |
| src/Logger/LoggerService.php | Monolog 3 log level resolution + handler lifecycle |
| src/Logger/Handler/ChunkedHandler.php | Monolog 3 LogRecord-only handler |
| src/Linker/IdentityLinker.php | Docblock ordering tweak |
| src/Linker/ChecksumLinker.php | Better typing around checksums/model id |
| src/Http/JsonResponse.php | Removes annotations exception references |
| src/Definition/PaymentType.php | Tightens cached constants typing |
| src/Definition/Event.php | Docblock ordering tweaks |
| src/Definition/Action.php | Tightens cached constants typing |
| src/dbc/Types/Uuid4Type.php | DBAL 4 type exception + SQL conversion changes |
| src/dbc/TableCollection.php | Simplifies has() |
| src/dbc/Session/SessionHandler.php | DBAL 4 query execution + builder API |
| src/dbc/Schema/TableRestriction.php | DBAL 4 ColumnDoesNotExist exception |
| src/dbc/Query/QueryBuilder.php | DBAL 4 QueryBuilder rewrite for restrictions |
| src/dbc/DbManager.php | DBAL 4 schema diffing + normalize introspected schema |
| src/dbc/Console/Command/UpdateDatabaseSchemaCommand.php | Symfony 8 AsCommand attribute |
| src/dbc/Connection.php | DBAL 4 parameter/return typing + rollback rename |
| src/dbc/AbstractTable.php | DBAL 4 types registry + Result API updates |
| src/Controller/ConnectorController.php | Safer feature parsing + ini_get handling |
| src/Config/CoreConfigInterface.php | Docblock ordering tweak |
| phpunit.xml.dist | PHPUnit 11 schema + <source> config |
| composer.json | Dependency bumps + PHP 8.2 minimum |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
67
to
71
| if (!empty($this->warnings)) { | ||
| foreach ($this->warnings as $warning) { | ||
| if (!\is_string($warning)) { | ||
| if ($warning === '') { | ||
| $isValid = false; | ||
| } |
Comment on lines
72
to
75
| * @return void | ||
| * @throws \PHPUnit\Framework\ExpectationFailedException | ||
| * \Exception | ||
| * @throws \RuntimeException |
Comment on lines
89
to
93
| * @return void | ||
| * @throws ExpectationFailedException | ||
| * @throws InvalidArgumentException | ||
| * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException | ||
| * @throws \InvalidArgumentException | ||
| * \Exception | ||
| * @throws \PHPUnit\Framework\ExpectationFailedException | ||
| */ |
Comment on lines
106
to
109
| * @return void | ||
| * @throws ExpectationFailedException | ||
| * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException | ||
| * @throws \PHPUnit\Framework\ExpectationFailedException | ||
| * \Exception | ||
| */ |
Comment on lines
103
to
107
| * @return void | ||
| * @throws DatabaseException | ||
| * @throws ExpectationFailedException | ||
| * @throws InvalidArgumentException | ||
| * @throws RuntimeException | ||
| * @throws \InvalidArgumentException | ||
| * @throws \InvalidArgumentException | ||
| * @throws \PDOException |
Comment on lines
20
to
25
| /** | ||
| * @return array<int, \Doctrine\DBAL\Schema\Table> | ||
| * @throws DBALException | ||
| * @return array<\Doctrine\DBAL\Schema\Table> | ||
| * @throws DbcRuntimeException | ||
| * @throws DbcRuntimeException | ||
| * @throws Exception | ||
| */ |
Comment on lines
7
to
11
| use Doctrine\DBAL\Exception as DBALException; | ||
| use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
| use Doctrine\DBAL\Query\QueryBuilder; | ||
| use Doctrine\DBAL\Result; | ||
| use Jtl\UnitTest\TestCase as JtlTestCase; | ||
| use PDO; | ||
| use PDOException; | ||
| use RuntimeException; |
Comment on lines
+10
to
14
| use Doctrine\DBAL\Schema\Comparator; | ||
| use Doctrine\DBAL\Schema\Schema; | ||
| use Doctrine\DBAL\Schema\SchemaException; | ||
| use Doctrine\DBAL\Schema\SchemaManagerFactory; | ||
| use Doctrine\DBAL\Schema\Table; |
Comment on lines
63
to
67
| */ | ||
| public function save(int $type, string $endpointId, int $hostId): bool | ||
| { | ||
| return \is_int($this->collection->get($type)->save($endpointId, $hostId)); | ||
| return $this->collection->get($type)->save($endpointId, $hostId) > 0; | ||
| } |
Comment on lines
14
to
16
| "require": { | ||
| "php": ">=8.1", | ||
| "php": ">=8.2", | ||
| "jms/serializer": "*", |
Replace the single Mockery usage in IdentityLinkerTest with PHPUnit's built-in createMock(). Sequential return values are handled via willReturnCallback() with array queues. This also removes the transitive hamcrest/hamcrest-php dependency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat!: upgrade all dependencies to current stable versions
Summary
Upgrades every dependency in
jtl/connector-coreto its current stable version. This is a breaking change — minimum PHP version moves from 7.4 to 8.2 and multiple major versions are bumped.Dependency Changes
Production (
require)php>=7.4>=8.2symfony/*(5 packages)^5.0|^6.0^8.0doctrine/dbal^3.0^4.0doctrine/collections^2.2^3.0monolog/monolog^2.0|^3.0^3.0php-di/php-di^6.0^7.0Development (
require-dev)phpunit/phpunit^9.0^11.0phpstan/phpstan^1.0^2.0squizlabs/php_codesniffer^3.10^4.0slevomat/coding-standard^8.15^8.29micheh/phpcs-gitlab^1.1^2.0jtl/connector-cq*^2.0mockery/mockery^1.3^1.6Removed
doctrine/annotationsdoctrine/cachejtl/unit-testtests/src/dbc/TestCase.phpCode Changes by Area
Doctrine DBAL 3 → 4 (largest migration)
The custom
QueryBuilder(src/dbc/Query/QueryBuilder.php) was fully rewritten to work with DBAL 4's redesigned builder API. Key changes across the DBAL layer:setValue, UPDATE viaset+andWhere, SELECT/DELETE viaandWhere)fetch()→fetchAssociative(),fetchAll()→fetchAllAssociative()execute()removed →executeQuery()/executeStatement()getSchemaManager()→createSchemaManager(),getMigrateToSql()→Comparator+getAlterSchemaSQL()Type::getName()→TypeRegistry::lookupName(), platform classes renamed (MySqlPlatform→MySQLPlatform,SqlitePlatform→SQLitePlatform)Connection::PARAM_STR_ARRAY→ArrayParameterType::STRINGDBALException→Exception,SchemaException::columnDoesNotExist()→ColumnDoesNotExist::new(),ConversionException::conversionFailedInvalidType()→InvalidType::new()pdokey no longer accepted,driverkey mandatorynormalizeIntrospectedSchema()to handle type mismatches (DateTimeType vs DateTimeImmutableType, float defaults) during schema comparisonAffected files:
src/dbc/(8 files),src/mapping-tables/(4 files), corresponding test filesSymfony 7 → 8
Request::get()removed → replaced with$request->request->get()(POST) and$request->query->get()(query string) inApplication.phpdisableOriginalConstructor()replaced with realRequestobjects (typed$filesproperty no longer allows uninitialized access)PHPUnit 9 → 11
@dataProvider→#[DataProvider()]attributes across 27 test filesstatic@depends→#[Depends()],@runInSeparateProcess→#[RunInSeparateProcess]setMethods()→onlyMethods()(2 calls)SebastianBergmann\RecursionContext\InvalidArgumentException(85 occurrences across 45 files)@throwsannotations@throwsto prevent namespace misresolutionphpunit.xml.dist: Updated schema to 11.5,<coverage>→<source>PHPStan 1 → 2
~148 errors fixed across ~47 files at level max:
mixedtypes before binary operations, casts,foreach, and offset accessinstanceof,is_int,is_string,is_array,is_object) flagged by stricter analysisReflectionClasstemplate covariance — inlined construction instead of storing as typed property@varannotations for superglobals ($_SESSION,$_SERVER,$_GET) and loosely-typed method returnsphpcs 4 / slevomat 8.29
@throwsannotation ordering violations auto-fixed across 77 files (newThrowsAnnotationsOrdersniff)$defaultNameproperty →#[AsCommand]attribute on console commandMonolog 3 / PHP-DI 7
useAnnotations(true)(PHP-DI 7)Validation
composer run analyze(phpcs + phpstan)composer run testsPrerequisites
Requires
jtl/connector-cqv2.0.0 (already published).Stats