-
Notifications
You must be signed in to change notification settings - Fork 233
Updated to support Symfony 5.0 & Twig 3.0 #930
Changes from all commits
bc25e94
f0cad58
526beff
cb26da3
8ff49d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,20 @@ | |
"php": ">=7.1", | ||
"doctrine/orm": "^2.5", | ||
"friendsofsymfony/jsrouting-bundle": "^1.6|^2.0", | ||
"symfony/framework-bundle": "^3.4|^4.1", | ||
"symfony/options-resolver": "^3.4|^4.1", | ||
"symfony/property-access": "^3.4|^4.1", | ||
"symfony/security": "^3.4|^4.1", | ||
"symfony/translation": "^3.4|^4.1", | ||
"twig/twig": "^2.9" | ||
"symfony/config": "^3.4|^4.1|^5.0", | ||
"symfony/dependency-injection": "^3.4|^4.1|^5.0", | ||
"symfony/http-foundation": "^3.4|^4.1|^5.0", | ||
"symfony/http-kernel": "^3.4|^4.1|^5.0", | ||
"symfony/framework-bundle": "^3.4|^4.1|^5.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know if there is any reason to not be compatible with Symfony There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change made here for Not sure if its the responsibility of this bundle to force people to upgrade because this version of symfony is not maintained anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dunno, but it's a bit out of scope for this PR ... i've only just expanded the existing composer requirements to 5.0 and added the extra components based on the existing 4.1 requirements for the existing components. |
||
"symfony/options-resolver": "^3.4|^4.1|^5.0", | ||
"symfony/property-access": "^3.4|^4.1|^5.0", | ||
"symfony/routing": "^3.4|^4.1|^5.0", | ||
"symfony/security-core": "^3.4|^4.1|^5.0", | ||
"symfony/translation": "^3.4|^4.1|^5.0", | ||
"twig/twig": "^2.9|^3.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "5.7.*", | ||
"phpunit/phpunit": "^7.5|^8.5", | ||
"friendsofphp/php-cs-fixer": "^2.15" | ||
}, | ||
"autoload": { | ||
|
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.
Are you sure this is required?
I suppose this should work with both
TranslatorInterface
.No need to force people to use Contracts
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.
Yes, it makes sure that you're getting either the deprecated interface from the component (available in Symfony 4.4 and earlier) or the newer interface from the contract (available for Symfony 4.3 and newer). The runtime check replaces the typehint that can't be enforced across multiple Symfony major versions.
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.
Oh yeah I didn't realize you added
!
on both conditions. I thought you wanted to force the use of Contracts.But since the translation interface param is injected with DI, I am not sure this check is very useful.
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.
@Seb33300 the services.xml just passes in the @translator service ... so in 4.4 it'll be the previous class... in 5.0 it'll be the new contracts-interface.
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.
I know and this means this cannot be something else than a
TranslatorInterface
.The the check is quite useless, except if the developer override the configuration to pass something else.
If you really want to keep this check I think this is better to place it at the beginning of the method.
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.
I don't think the contracts interface existed in 4.1 though; https://symfony.com/doc/4.1/translation.html