Skip to content
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

Modernize codebase for PHP 8 #1351

Merged
merged 1 commit into from
Aug 22, 2023
Merged

Modernize codebase for PHP 8 #1351

merged 1 commit into from
Aug 22, 2023

Conversation

derrabus
Copy link
Member

Q A
Type improvement
BC Break no
Fixed issues N/A

Summary

We require PHP 8.1 already, so let's use what PHP 8 has to offer for us.

@derrabus derrabus added this to the 3.7.0 milestone Aug 18, 2023
@derrabus derrabus force-pushed the improvement/php-8 branch 2 times, most recently from f2ac883 to 39171dd Compare August 18, 2023 15:13
@@ -35,7 +35,7 @@ public function getConfiguration(): Configuration

try {
$config = Yaml::parse($content);
} catch (ParseException $e) {
} catch (ParseException) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we rather attach it as a previous exception, so that the user can see the actual parsing issue ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but that's out if scope for this PR. We can do this in a follow-up.

lib/Doctrine/Migrations/SchemaDumper.php Outdated Show resolved Hide resolved
@derrabus derrabus force-pushed the improvement/php-8 branch 4 times, most recently from 141a298 to 5be5221 Compare August 18, 2023 19:35
@derrabus
Copy link
Member Author

BC check failure:

[BC] CHANGED: The parameter $service of Doctrine\Migrations\DependencyFactory#setService() changed from no type to a non-contravariant object|callable
[BC] CHANGED: The parameter $service of Doctrine\Migrations\DependencyFactory#setService() changed from no type to object|callable

I think those changes are safe. We've only ever accepted those types anyway and existing child classes that override this method without parameter types should continue to work.

@derrabus derrabus merged commit 6c27173 into 3.7.x Aug 22, 2023
@derrabus derrabus deleted the improvement/php-8 branch August 22, 2023 10:25
derrabus added a commit to derrabus/migrations that referenced this pull request Sep 7, 2023
* 3.7.x: (21 commits)
  Allow doctrine/deprecations 1.0 (doctrine#1358)
  Drop support for Symfony 4 (doctrine#1352)
  Modernize codebase for PHP 8 (doctrine#1351)
  Remove docs from the archives (doctrine#1356)
  Ditch action in favor of running tool directly (doctrine#1354)
  Fix PHPStan errors after PHPUnit update (doctrine#1350)
  Add sh to .gitattributes
  Update .gitattributes
  Avoid complex mock building
  Migrate to PHPUnit 10
  Make data providers static
  Remove unneeded phpcs rule
  Suffix abstract test class with TestCase
  Add details to sync-metadata-storage's help
  Update coding standard to v12
  Remove ignore rule for @method-provided method
  build: Use the new compactors
  build: Fix cleanup of the backup composer lock file
  Add attributes to commands
  removed preceding whitespace in front of colons
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants