-
Notifications
You must be signed in to change notification settings - Fork 319
Symfony 5 compatibility #466
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
Comments
Hi, could you try latest alpha version? |
Thanks for your reply. I tried this in composer.json :
But the requirements can't be resolved :
Any idea ? |
This should be resolved with |
Thanks, composer update is OK with alpha3. I'll try use the bundle tomorrow. |
Great, thanks for confirmation 👍 Working on a an upgrade path now: |
Hello Tomas, Thanks for your job. I will also test. 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
|
Hi, the import issue should be solved by: rectorphp/rector#2459 If not, please provide minimal PHP code so I can replicate the bug |
Hi Tomas,
Thanks.
I will do it again to check.
For translatable, I modified my entities according to the new format.
And now when I try to apply bin/console make:migration I have an error message:
In RuntimeReflectionService.php line 63:
Property App\Entity\CategoryTranslation::$id does not exist
I hope it can help.
Thanks.
De : Tomáš Votruba [mailto:notifications@github.com]
Envoyé : vendredi 20 décembre 2019 13:45
À : KnpLabs/DoctrineBehaviors
Cc : laurent BARBEAU; Comment
Objet : Re: [KnpLabs/DoctrineBehaviors] Symfony 5 compatibility (#466)
Hi,
the import issue should be solved by: rectorphp/rector#2459<rectorphp/rector#2459>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#466?email_source=notifications&email_token=AJ6MDRY2IP6TJY2TDVZNKLTQZRSW7A5CNFSM4J5IB3QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHMBXVA#issuecomment-567811028>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ6MDRZ2QFUSTB2XVWGVQX3QZRSW7ANCNFSM4J5IB3QA>.
|
Yea, we need to complete that migration rule to Rector. How does your normal id property in an entity looks like? |
Here is the header of my Entity.
It works well with Symfony4 and knplabs/doctrine-behaviors 1.6.0
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
use Symfony\Component\Validator\Constraints as Assert ;
/**
* @Orm\Table(name="category")
* @Orm\Entity(repositoryClass="App\Repository\CategoryRepository")
*/
class Category
{
use ORMBehaviors\Translatable\Translatable;
/**
* @Orm\Id()
* @Orm\GeneratedValue()
* @Orm\Column(type="integer")
*/
private $id;
De : Tomáš Votruba [mailto:notifications@github.com]
Envoyé : vendredi 20 décembre 2019 14:00
À : KnpLabs/DoctrineBehaviors
Cc : laurent BARBEAU; Comment
Objet : Re: [KnpLabs/DoctrineBehaviors] Symfony 5 compatibility (#466)
Yea, we need to complete that migration rule to Rector.
How does your normal id property look like?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#466?email_source=notifications&email_token=AJ6MDRZQF2VIXWLNY24CPN3QZRUPTA5CNFSM4J5IB3QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHMCWCI#issuecomment-567814921>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ6MDR3EE3DYQPQ5Z5UVUR3QZRUPTANCNFSM4J5IB3QA>.
|
Could you show me |
Sure , this is the new version.
<?php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
/**
* @Orm\Entity
*/
class CategoryTranslation implements TranslationInterface
{
use TranslationTrait;
/**
* @Orm\Column(name="ca_name",type="string",length=128)
*/
private $name;
/**
* @return string
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string
* @return null
De : Tomáš Votruba [mailto:notifications@github.com]
Envoyé : vendredi 20 décembre 2019 14:09
À : KnpLabs/DoctrineBehaviors
Cc : laurent BARBEAU; Comment
Objet : Re: [KnpLabs/DoctrineBehaviors] Symfony 5 compatibility (#466)
Could you show me CategoryTranslation as well?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#466?email_source=notifications&email_token=AJ6MDR3NFUCFAT2KV64Y7FTQZRVR7A5CNFSM4J5IB3QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHMDJTQ#issuecomment-567817422>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ6MDR7TERZRFNGFKZMMMRDQZRVR7ANCNFSM4J5IB3QA>.
|
I see. That's all I need, I'll prepare the migration rule during today |
Great. Do not hesitate to contact me If I can do something.
De : Tomáš Votruba [mailto:notifications@github.com]
Envoyé : vendredi 20 décembre 2019 14:18
À : KnpLabs/DoctrineBehaviors
Cc : laurent BARBEAU; Comment
Objet : Re: [KnpLabs/DoctrineBehaviors] Symfony 5 compatibility (#466)
I see. That's all I need, I'll prepare the migration rule during today
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#466?email_source=notifications&email_token=AJ6MDR4U2CSQ2MQLCHO6OKDQZRWTZA5CNFSM4J5IB3QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHMD5GA#issuecomment-567819928>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ6MDRZ2IZCDHPZBHIV6W6LQZRWTZANCNFSM4J5IB3QA>.
|
Hi, I tried successfully following behaviours :
Thanks for your work ! |
I've updated the upgrade set with @Orm\Id property completion to the entity. Could you retry the run? |
Hi Tomas,
I’ve tried today and it’s perfect.
Thanks a lot.
Merry Christmas.
De : Tomáš Votruba [mailto:notifications@github.com]
Envoyé : mardi 24 décembre 2019 06:58
À : KnpLabs/DoctrineBehaviors
Cc : laurent BARBEAU; Comment
Objet : Re: [KnpLabs/DoctrineBehaviors] Symfony 5 compatibility (#466)
I've updated the upgrade set with @Orm<https://github.com/Orm>\Id property completion to the entity.
Could you retry the run? rector/rector dev-master is needed
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#466?email_source=notifications&email_token=AJ6MDRYL3YBVWRBABMOHHBTQ2FF7BA5CNFSM4J5IB3QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHSES3Y#issuecomment-568609135>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ6MDR2EP6L6KK5VHNIMK6DQ2FF7BANCNFSM4J5IB3QA>.
|
Wow, that's great to hear. |
Hi Tomas,
Maybe there is a point that can be improve.
If I launch two times this process vendor/bin/rector process src --config vendor/knplabs/doctrine-behaviors/upgrade/rector/doctrine-behaviors-20.yaml
Then the variable var $id is declared two times in the EntityTranslation.php .
/**
* @var int
* @Orm\Id
* @Orm\Column(type="integer")
* @Orm\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var int
* @Orm\Id
* @Orm\Column(type="integer")
* @Orm\GeneratedValue(strategy="AUTO")
*/
private $id;
Laurent.
De : Tomáš Votruba [mailto:notifications@github.com]
Envoyé : mardi 24 décembre 2019 17:42
À : KnpLabs/DoctrineBehaviors
Cc : laurent BARBEAU; Comment
Objet : Re: [KnpLabs/DoctrineBehaviors] Symfony 5 compatibility (#466)
Wow, that's great to hear.
Have a great xmass too!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#466?email_source=notifications&email_token=AJ6MDRYANOWQR4M3NXXDQHDQ2HRO3A5CNFSM4J5IB3QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHS72OA#issuecomment-568720696>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ6MDR36LZOLASXIURU42MTQ2HRO3ANCNFSM4J5IB3QA>.
|
Hi Laurent, good point. I was thinking about it, but didn't get to real work. |
Closing as Symfony 5 is on. Thank you ❤️ |
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.
The text was updated successfully, but these errors were encountered: