Skip to content

Symfony 5 compatibility #466

@nicolashachet

Description

@nicolashachet

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.

Activity

TomasVotruba

TomasVotruba commented on Dec 19, 2019

@TomasVotruba
Contributor

Hi,

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

nicolashachet

nicolashachet commented on Dec 19, 2019

@nicolashachet
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

TomasVotruba commented on Dec 19, 2019

@TomasVotruba
Contributor

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

nicolashachet

nicolashachet commented on Dec 19, 2019

@nicolashachet
Author

Thanks, composer update is OK with alpha3.

I'll try use the bundle tomorrow.

TomasVotruba

TomasVotruba commented on Dec 19, 2019

@TomasVotruba
Contributor

Great, thanks for confirmation 👍

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

laurentHCM

laurentHCM commented on Dec 20, 2019

@laurentHCM

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

TomasVotruba commented on Dec 20, 2019

@TomasVotruba
Contributor

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

laurentHCM commented on Dec 20, 2019

@laurentHCM
TomasVotruba

TomasVotruba commented on Dec 20, 2019

@TomasVotruba
Contributor

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

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

laurentHCM

laurentHCM commented on Dec 20, 2019

@laurentHCM
TomasVotruba

TomasVotruba commented on Dec 20, 2019

@TomasVotruba
Contributor

Could you show me CategoryTranslation as well?

laurentHCM

laurentHCM commented on Dec 20, 2019

@laurentHCM
TomasVotruba

TomasVotruba commented on Dec 20, 2019

@TomasVotruba
Contributor

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

laurentHCM

laurentHCM commented on Dec 20, 2019

@laurentHCM
nicolashachet

nicolashachet commented on Dec 20, 2019

@nicolashachet
Author

Hi,

I tried successfully following behaviours :

  • Loggable
  • Blameable
  • Timestampable
  • Soft-Deletable

Thanks for your work !

TomasVotruba

TomasVotruba commented on Dec 23, 2019

@TomasVotruba
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

laurentHCM commented on Dec 24, 2019

@laurentHCM
TomasVotruba

TomasVotruba commented on Dec 24, 2019

@TomasVotruba
Contributor

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

laurentHCM

laurentHCM commented on Dec 25, 2019

@laurentHCM
TomasVotruba

TomasVotruba commented on Dec 25, 2019

@TomasVotruba
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

TomasVotruba commented on Jan 1, 2020

@TomasVotruba
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Symfony 5 compatibility · Issue #466 · KnpLabs/DoctrineBehaviors