Skip to content

Remove doctrine/dbal:^4 support #1507

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 3 commits into from
Feb 5, 2024
Merged

Conversation

mfn
Copy link
Collaborator

@mfn mfn commented Feb 3, 2024

Summary

Remove doctrine/dbal:^4 support

Tests fail with:
PHP Fatal error: Declaration of Illuminate\Database\PDO\Concerns\ConnectsToDatabase::connect(array $params, $username = null, $password = null, array $driverOptions = []) must be compatible with Doctrine\DBAL\Driver::connect(array $params): Doctrine\DBAL\Driver\Connection in /home/runner/work/laravel-ide-helper/laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Database/PDO/Concerns/ConnectsToDatabase.php on line 22

This was just recently added, before doctrine/dbal 4.0.0 was released, which happened 1 hour ago and tests don't work now.

Remove it until this is figured.

Marking it as internal change, because this wasn't release yet.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Misc. change (internal, infrastructure, maintenance, etc.)

Checklist

  • Existing tests have been adapted and/or new tests have been added
  • Add a CHANGELOG.md entry
  • Update the README.md
  • Code style has been fixed via composer fix-style

Tests fail with:
`PHP Fatal error:  Declaration of Illuminate\Database\PDO\Concerns\ConnectsToDatabase::connect(array $params, $username = null, $password = null, array $driverOptions = []) must be compatible with Doctrine\DBAL\Driver::connect(array $params): Doctrine\DBAL\Driver\Connection in /home/runner/work/laravel-ide-helper/laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Database/PDO/Concerns/ConnectsToDatabase.php on line 22`
@mfn mfn self-assigned this Feb 3, 2024
@mfn
Copy link
Collaborator Author

mfn commented Feb 3, 2024

Hmm, yeah, catch-22: either the unit tests fail or the integration tests :/

@mfn mfn marked this pull request as draft February 3, 2024 20:17
@mfn mfn force-pushed the mfn-failing-master branch from 43fa0ad to 7b95191 Compare February 4, 2024 17:01
@mfn
Copy link
Collaborator Author

mfn commented Feb 4, 2024

Finally figured it; feels a bit like a workaround though but it "only" affects Laravel 8 & 9, and with the pending Laravel 11 on the horizon and my plan to remove Laravel 8, IMHO this is a reasonable compromise.

As far as I understood the situation:
nesbot/carbon requires carbonphp/carbon-doctrine-types which requires doctrine/dbal

Due to the circumstances of how our integration tests work (I think), when installing laravel-ide-helper (without doctrine/dbal:^4 support), due to carbonphp/carbon-doctrine-types it tries to pick 4 and conflicts.

With adding the downgrading switch to composer, we fix the integration tests for now until we sort this out.

Also: at least until Laravel 10 it has an explicit conflicts rule in composer.json for dbal:^4 -> https://github.com/laravel/framework/blob/c4f46abce0e69737de35b71439943ac2a24d6ec3/composer.json#L123

@barryvdh I think this one is good to merge!

After that I will rebase and check #1503 and #1504

@mfn mfn marked this pull request as ready for review February 4, 2024 19:28
@mfn mfn requested a review from barryvdh February 4, 2024 19:28
@barryvdh barryvdh merged commit e65d30b into barryvdh:master Feb 5, 2024
@mfn mfn deleted the mfn-failing-master branch February 5, 2024 06:11
d3v2a pushed a commit to d3v2a/laravel-ide-helper that referenced this pull request Feb 16, 2024
* Remove doctrine/dbal:^4 support

Tests fail with:
`PHP Fatal error:  Declaration of Illuminate\Database\PDO\Concerns\ConnectsToDatabase::connect(array $params, $username = null, $password = null, array $driverOptions = []) must be compatible with Doctrine\DBAL\Driver::connect(array $params): Doctrine\DBAL\Driver\Connection in /home/runner/work/laravel-ide-helper/laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Database/PDO/Concerns/ConnectsToDatabase.php on line 22`

* gha: install with downgrading all dependencies

* Add note to readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants