-
Notifications
You must be signed in to change notification settings - Fork 16
Use Rector to upgrade codebase to PHP 8.4 #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 21 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
694d4d5
Set default value for "old_stable" in CI workflow.
koriym 6f45e88
Update pagerfanta dependency to support version 4.x
koriym 108f33c
Add `#[Override]` annotations to methods across the codebase
koriym 393f658
Make classes final and enhance security with SensitiveParameter
koriym 5376d33
Update CI workflow to remove old_stable parameter
koriym 82f059b
fixup! Set default value for "old_stable" in CI workflow.
koriym b07e6db
fixup! fixup! Set default value for "old_stable" in CI workflow.
koriym fad5427
Update PHPUnit dependency to version ^12.1
koriym 76231df
Upgrade with rector to PHP 8.4 + PHPUnit 11
koriym 2864e83
Remove Scrutinizer Code Quality badge from README
koriym 7732128
Add UPGRADE.md for guidance on v1.x to v2.x transition
koriym 16601c9
Update README for v2.x with PHP 8.4 and Aura.Sql 6.0 support
koriym f5f3f79
Update license year to 2025
koriym d81d538
Update README to remove DI trait section
koriym 1b8888e
fixup! Update README to remove DI trait section
koriym f8fbb61
Add PHPUnit configuration and update .gitignore
koriym 0c62b67
Add Rector configuration file for automated refactoring
koriym ffe27ae
Update PHPUnit configuration and remove phpunit.xml
koriym f9f9778
Add .phpunit.result.cache to .gitignore
koriym 0f4617b
Update dependencies in vendor-bin/tools/composer.json
koriym 8254eba
Update static analysis workflow to exclude PHPMD
koriym d1a6d84
Remove UPGRADE.md and add CHANGELOG.md for clarity
koriym 9096c27
Update README.md to simplify installation section
koriym 6d10b73
Fix formatting and typos in README.md
koriym 540241c
Update dependencies in vendor-bin tools
koriym 3f16ebe
Update Pagerfanta dependency to support version 4.7
koriym 817e8a1
Update dependencies and remove unused packages.
koriym 30ac750
Update README to use PHP attributes instead of annotations
koriym a590324
Update README.md with corrected PHP use statements
koriym 5b79ff1
Update PHPUnit schema to version 12.0
koriym 43a4ffc
Update annotation syntax for AuraSqlQueryConfig
koriym 7510547
Update composer.json
koriym ad24c2f
Update configuration to remove 'old_stable' PHP version
koriym File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
/build/ | ||
/vendor/ | ||
/composer.lock | ||
/.phpunit.result.cache | ||
/tests/tmp/* | ||
/.phpcs-cache | ||
/.php_cs.cache | ||
/.phpcs-cache | ||
/vendor-bin/tools/vendor/ | ||
/.phpunit.cache | ||
/vendor-bin/tools/vendor/ | ||
/.phpunit.result.cache |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# UPGRADE | ||
|
||
## From v1.x to v2.x | ||
|
||
### Overview | ||
|
||
Ray.AuraSqlModule v2.x is released to support PHP 8.4+, which introduced breaking changes in PDO connection handling. This major version bump is **only** due to dependency updates and **does not include any API or interface changes**. | ||
|
||
### What Changed | ||
|
||
- **PHP version requirement**: `^8.1` → `^8.4` | ||
- **Aura.Sql dependency**: `^5.0` → `^6.0` | ||
- **Internal PDO compatibility**: Updated to work with PHP 8.4's PDO changes | ||
|
||
### What Didn't Change | ||
|
||
- ✅ **All public APIs remain identical** | ||
- ✅ **No interface changes** | ||
- ✅ **No behavioral changes** | ||
- ✅ **No configuration changes** | ||
- ✅ **No breaking changes in your application code** | ||
|
||
### Migration Guide | ||
|
||
#### Step 1: Check Your PHP Version | ||
|
||
**If you're using PHP 8.4+:** | ||
```bash | ||
composer require ray/aura-sql-module:^2.0 | ||
``` | ||
|
||
**If you're using PHP 8.1-8.3:** | ||
```bash | ||
composer require ray/aura-sql-module:^1.0 | ||
``` | ||
|
||
#### Step 2: Update Dependencies | ||
|
||
No code changes are required. Simply update your `composer.json`: | ||
|
||
```diff | ||
{ | ||
"require": { | ||
- "ray/aura-sql-module": "^1.0" | ||
+ "ray/aura-sql-module": "^2.0" | ||
} | ||
} | ||
``` | ||
|
||
#### Step 3: Test Your Application | ||
|
||
Since there are no API changes, your existing code should work without modification. However, we recommend running your test suite to ensure everything works as expected with the updated dependencies. | ||
|
||
### Version Compatibility | ||
|
||
| Ray.AuraSqlModule | PHP Version | Aura.Sql | Status | | ||
|-------------------|-------------|----------|--------| | ||
| v1.x | ^8.1 | ^5.0 | Maintained | | ||
| v2.x | ^8.4 | ^6.0 | Current | | ||
|
||
### Support Policy | ||
|
||
- **v1.x**: Continues to be maintained for PHP 8.1-8.3 users | ||
- **v2.x**: New development for PHP 8.4+ users | ||
|
||
### Frequently Asked Questions | ||
|
||
#### Q: Do I need to change my code? | ||
**A: No.** All public APIs and interfaces remain exactly the same. | ||
|
||
#### Q: Why the major version bump? | ||
**A: PHP 8.4 introduced breaking changes in PDO that required Aura.Sql v6. Following semantic versioning, we bumped the major version even though no user-facing changes were made.** | ||
|
||
#### Q: Can I stay on v1.x? | ||
**A: Yes.** If you're using PHP 8.1-8.3, you can continue using v1.x, which will be maintained. | ||
|
||
#### Q: When should I upgrade? | ||
**A: Only when you upgrade to PHP 8.4+.** There's no urgency if you're on PHP 8.1-8.3. | ||
|
||
### Need Help? | ||
|
||
If you encounter any issues during the upgrade: | ||
|
||
1. Check that you're using the correct version for your PHP version | ||
2. Ensure all dependencies are properly updated | ||
3. [Open an issue](https://github.com/ray-di/Ray.AuraSqlModule/issues) if you find any problems | ||
|
||
### Technical Details | ||
|
||
The upgrade addresses PDO connection signature changes introduced in PHP 8.4. The underlying Aura.Sql library handles these changes transparently, maintaining full backward compatibility at the application level. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\PHPUnit\Set\PHPUnitSetList; | ||
|
||
return RectorConfig::configure() | ||
->withPaths([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/src-files', | ||
__DIR__ . '/tests', | ||
]) | ||
// uncomment to reach your current PHP version | ||
->withPhpSets() | ||
koriym marked this conversation as resolved.
Show resolved
Hide resolved
|
||
->withSets( | ||
[ | ||
PHPUnitSetList::PHPUNIT_90, | ||
PHPUnitSetList::PHPUNIT_100, | ||
PHPUnitSetList::PHPUNIT_110, | ||
] | ||
) | ||
->withTypeCoverageLevel(0) | ||
->withDeadCodeLevel(0) | ||
->withCodeQualityLevel(0); |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.