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

Symfony 5 compatibility #466

Closed
nicolashachet opened this issue Dec 19, 2019 · 21 comments
Closed

Symfony 5 compatibility #466

nicolashachet opened this issue Dec 19, 2019 · 21 comments

Comments

@nicolashachet
Copy link

Hi,

is it planned to ensure compatibility with Symfony 5 ?

Here is the result when activating the bundle :

Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in \vendor\knplabs\doctrine-behaviors\src\Bundle\DependencyInjection\Configuration.php on line 12 and at least 1 expected

Thanks for the feedback.

@TomasVotruba
Copy link
Contributor

TomasVotruba commented Dec 19, 2019

Hi,

could you try latest alpha version?
It has lot of BC breaking changes, but it should be compatible with Symfony 5.

@nicolashachet
Copy link
Author

Thanks for your reply.

I tried this in composer.json :

"behat/transliterator": "dev-master",
"knplabs/doctrine-behaviors": "v2.0.0-alpha2"

But the requirements can't be resolved :


...
Restricting packages listed in "symfony/symfony" to "5.0.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/security v4.4.1 requires symfony/http-kernel ^4.4 -> no matching package found.
    - symfony/security v4.4.0 requires symfony/http-kernel ^4.4 -> no matching package found.
    - knplabs/doctrine-behaviors v2.0.0-alpha2 requires symfony/security ^4.4|^5.0 -> satisfiable by symfony/security[v4.4.0, v4.4.1].
    - Installation request for knplabs/doctrine-behaviors v2.0.0-alpha2 -> satisfiable by knplabs/doctrine-behaviors[v2.0.0-alpha2].

Any idea ?

@TomasVotruba
Copy link
Contributor

This should be resolved with v2.0.0-alpha3. Could you try it?

@nicolashachet
Copy link
Author

Thanks, composer update is OK with alpha3.

I'll try use the bundle tomorrow.

@TomasVotruba
Copy link
Contributor

Great, thanks for confirmation 👍

Working on a an upgrade path now:
https://github.com/KnpLabs/DoctrineBehaviors#upgrade-1x-to-2

@laurentHCM
Copy link

Hello Tomas,

Thanks for your job. I will also test.
I tried the upgrade process and there is a side effect by using this command

vendor/bin/rector process src --config vendor/knplabs/doctrine-behaviors/upgrade/rector/doctrine-behaviors-20.yaml

If we use a fullname as return signature for a function , the full name is changed ( in fact all full names are changed) but in many case like when using Stripe, you have a Customer entity and Stripe has also a customer entity so we have to fully qualify the name

public function createIntent(Customer $customer, float $amount): \Stripe\PaymentIntent
  • public function createIntent(Customer $customer, float $amount): PaymentIntent

@TomasVotruba
Copy link
Contributor

TomasVotruba commented Dec 20, 2019

Hi,

the import issue should be solved by: rectorphp/rector#2459

If not, please provide minimal PHP code so I can replicate the bug

@laurentHCM
Copy link

laurentHCM commented Dec 20, 2019 via email

@TomasVotruba
Copy link
Contributor

TomasVotruba commented Dec 20, 2019

Yea, we need to complete that migration rule to Rector.

How does your normal id property in an entity looks like?

@laurentHCM
Copy link

laurentHCM commented Dec 20, 2019 via email

@TomasVotruba
Copy link
Contributor

Could you show me CategoryTranslation as well?

@laurentHCM
Copy link

laurentHCM commented Dec 20, 2019 via email

@TomasVotruba
Copy link
Contributor

I see. That's all I need, I'll prepare the migration rule during today

@laurentHCM
Copy link

laurentHCM commented Dec 20, 2019 via email

@nicolashachet
Copy link
Author

Hi,

I tried successfully following behaviours :

  • Loggable
  • Blameable
  • Timestampable
  • Soft-Deletable

Thanks for your work !

@TomasVotruba
Copy link
Contributor

I've updated the upgrade set with @Orm\Id property completion to the entity.

Could you retry the run? rector/rector dev-master is needed

@laurentHCM
Copy link

laurentHCM commented Dec 24, 2019 via email

@TomasVotruba
Copy link
Contributor

Wow, that's great to hear.
Have a great xmass too!

@laurentHCM
Copy link

laurentHCM commented Dec 25, 2019 via email

@TomasVotruba
Copy link
Contributor

Hi Laurent,

good point. I was thinking about it, but didn't get to real work.
Will be handled here: rectorphp/rector#2479

@TomasVotruba
Copy link
Contributor

Closing as Symfony 5 is on.
For any new issues, just create a new issue here.

Thank you ❤️

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

No branches or pull requests

3 participants