Release 2.0.0: PHP ^8.2, portphp ^2.0, DBAL 3/4#9
Merged
Conversation
Breaking major: drop PHP < 8.2, portphp 1.x, and doctrine/dbal 2.x. Rewrite DbalReader for the Result API; modern PHPUnit + GHA.
There was a problem hiding this comment.
Pull request overview
Modernizes the Port DBAL adapter for a 2.0.0 release by raising minimum PHP/dependency versions, updating the DbalReader implementation to Doctrine DBAL 3/4’s Result API, and refreshing project tooling/docs accordingly.
Changes:
- Bumped requirements to PHP ^8.2,
portphp/portphp^2.0, anddoctrine/dbal^3.0 || ^4.0. - Rewrote
DbalReaderto useexecuteQuery()/Result::fetchAssociative()and updated tests to PHPUnit 9 style. - Removed legacy Travis/Scrutinizer/PhpSpec artifacts and added (currently empty) GitHub Actions / Dependabot config stubs plus upgrade notes.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| UPGRADE-2.0.md | Adds an upgrade guide summarizing breaking changes and tooling moves for 2.0. |
| tests/Reader/DbalReaderTest.php | Removes the legacy PHPUnit-era DBAL reader tests. |
| tests/DbalReaderTest.php | Adds a PHPUnit 9+ test suite for the rewritten reader. |
| src/DbalReaderFactory.php | Drops ReaderFactory implementation and modernizes typing/constructor. |
| src/DbalReader.php | Ports reader internals from Statement to DBAL 3/4 Result API with strict typing. |
| spec/DbalReaderFactorySpec.php | Removes PhpSpec coverage for the factory. |
| README.md | Updates badges/requirements and removes deprecated service references. |
| phpunit.xml.dist | Updates PHPUnit configuration for PHPUnit 9 schema and stricter output settings. |
| phpspec.yml.dist | Removes PhpSpec configuration (PhpSpec is no longer used). |
| composer.json | Updates runtime/dev requirements and support links for the 2.0 line. |
| .travis.yml | Removes Travis CI configuration. |
| .scrutinizer.yml | Removes Scrutinizer configuration. |
| .github/workflows/test.yml | Adds a GitHub Actions workflow file (currently empty). |
| .github/dependabot.yml | Adds a Dependabot config file (currently empty). |
| .gitattributes | Updates export-ignore list to reflect removed CI/PhpSpec files. |
Comments suppressed due to low confidence (2)
.github/dependabot.yml:2
- This Dependabot config file is empty, so dependency updates won’t be created. Add a minimal v2 config for Composer and GitHub Actions.
.github/workflows/test.yml:2 - This workflow file is empty, so GitHub Actions CI won’t run and the README badge points to a non-functional workflow. Add a basic CI workflow to run PHPUnit on supported PHP versions (and ideally both DBAL 3 and 4).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+18
| private ?array $data = null; | ||
|
|
||
| private ?Result $result = null; |
- Allow array|false|null for iterator end marker (PHP 8.2+) - Restore non-empty GitHub Actions workflow and Dependabot YAML
Comment on lines
+90
to
+94
| public function rewind(): void | ||
| { | ||
| if (null === $this->stmt) { | ||
| $this->stmt = $this->prepare($this->sql, $this->params); | ||
| } | ||
| if (0 !== $this->key) { | ||
| $this->stmt->execute(); | ||
| $this->data = $this->stmt->fetch(\PDO::FETCH_ASSOC); | ||
| $this->key = 0; | ||
| } | ||
| $this->result = $this->connection->executeQuery($this->sql, $this->params); | ||
| $this->data = $this->result->fetchAssociative(); | ||
| $this->key = 0; |
Comment on lines
+46
to
50
| public function setSql(string $sql, array $params = []): void | ||
| { | ||
| $this->sql = (string) $sql; | ||
|
|
||
| $this->sql = $sql; | ||
| $this->setSqlParameters($params); | ||
| } |
Comment on lines
+12
to
15
| public function __construct( | ||
| private Connection $connection | ||
| ) { | ||
| } |
| $this->assertSame($first, $second); | ||
| } | ||
|
|
||
| private function getConnection() |
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.
Summary
Major modernization of the DBAL reader.
Breaking
php:^8.2portphp/portphp:^2.0doctrine/dbal:^3.0 || ^4.0(DBAL 2 dropped)DbalReaderrewritten for Result APIDbalReaderFactoryno longer implements file-basedReaderFactoryOther
UPGRADE-2.0.mdPlease do not merge until approved.