-
Notifications
You must be signed in to change notification settings - Fork 44
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
allow Symfony 6 #96
allow Symfony 6 #96
Conversation
So actually I think it will be a bit more tricky to support 6.0 and lower versions in parallel 😕
I think we need two different implementations of |
I will look into this in the coming days. We probably can do it similar to here by conditionally declaring the class |
Now failing because of phpspec/prophecy#527 😕 |
@@ -67,14 +67,28 @@ public function testValidate($value, $violates, $type = null, $defaultRegion = n | |||
} | |||
|
|||
if (true === $violates) { | |||
$constraintViolationBuilder = $this->prophesize(ConstraintViolationBuilderInterface::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rewritten because of phpspec/prophecy#527
964849d
to
2c1510b
Compare
Is there any reason to create |
yeah we cannot put the code from But I could indeed try to move the code from |
Maybe we should actually wait a couple more days. There is an open discussion about relaxing the typehints on Symfony 6 because this is an issue for other projects as well. |
Could you also add Method "Twig\Extension\ExtensionInterface::getFunctions()" might add "array" as a native return type declaration in the future. Do the same in implementation "Misd\PhoneNumberBundle\Twig\Extension\PhoneNumberHelperExtension" now to avoid errors or add an explicit @return annotation to suppress this message.
Method "Twig\Extension\ExtensionInterface::getFilters()" might add "array" as a native return type declaration in the future. Do the same in implementation "Misd\PhoneNumberBundle\Twig\Extension\PhoneNumberHelperExtension" now to avoid errors or add an explicit @return annotation to suppress this message.
Method "Twig\Extension\ExtensionInterface::getTests()" might add "array" as a native return type declaration in the future. Do the same in implementation "Misd\PhoneNumberBundle\Twig\Extension\PhoneNumberHelperExtension" now to avoid errors or add an explicit @return annotation to suppress this message. |
With the normalizer not being final, adding return typehints would be a B/C break since it would force any subclass to add them as well. So it's either use a "creative" solution like this one or just add the types and accept the break. |
things might change in 6.0.1 symfony/symfony#44331 |
symfony-require: 5.3.* | ||
- php: '8.0' | ||
symfony-require: 6.0.* | ||
stability: dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stability requirement can be removed once Symfony 6.0.1 was released
I simplified it and reverted changes to So with 6.0.x-dev or 6.0.1 this works fine |
Hello guys I have an issue with installation on Symfo 6 (it's a fresh new project)
|
@Owlympus this bundle will not be compatible with Symfony 6 until 6.0.1 is released (this should happen in the next weeks). For now you should use Symfony 5.4 if you want to use the bundle. |
TODOs:
PhoneNumberNormalizer
so it works for Symfony <6.0 and >=6.0