-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyAccess] Add type-hints to public interfaces and classes #32234
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
[PropertyAccess] Add type-hints to public interfaces and classes #32234
Conversation
d9564fa
to
3c3fb27
Compare
@@ -1700,7 +1700,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con | |||
|
|||
if (!$container->getParameter('kernel.debug')) { | |||
$propertyAccessDefinition->setFactory([PropertyAccessor::class, 'createCache']); | |||
$propertyAccessDefinition->setArguments([null, null, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]); | |||
$propertyAccessDefinition->setArguments([null, 0, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]); |
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.
If that change is necessary, your int
type-hint was a small breaking change. We could make the type-hint nullable, but I also prefer int
over ?int
in that case.
I'd suggest that we backport this change to FrameworkBundle 4.4 along with a deprecation in PropertyAccessor::createCache()
that is triggered if null
is passed as $defaultLifetime
.
…efaultLifetime argument in createCache method (jschaedl) This PR was squashed before being merged into the 4.4 branch (closes #32241). Discussion ---------- [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32179 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A<!-- required for new features --> This PR is related to symfony/symfony#32234 (comment) Commits ------- 9aac42698a [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method
…efaultLifetime argument in createCache method (jschaedl) This PR was squashed before being merged into the 4.4 branch (closes #32241). Discussion ---------- [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32179 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A<!-- required for new features --> This PR is related to #32234 (comment) Commits ------- 9aac426 [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method
3c3fb27
to
2c293f0
Compare
PropertyAccess | ||
-------------- | ||
|
||
* Removed support of passing `null` as 2nd argument of `PropertyAccessor::createCache()` method (`$defaultLifetime`), pass `0` instead. |
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.
This should also be done in #32269 (we always document the deprecation and its removal in the same branch).
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.
Done in a71ee27
f5e63a2
to
91138a9
Compare
Thank you @jschaedl. |
… classes (jschaedl) This PR was squashed before being merged into the 5.0-dev branch (closes #32234). Discussion ---------- [PropertyAccess] Add type-hints to public interfaces and classes | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32179 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A <!-- required for new features --> This PR adds type hints to public interfaces and classes of the PropertyAccess component. Some docblocks without valuable information got also removed. Commits ------- 91138a9 [PropertyAccess] Add type-hints to public interfaces and classes
This PR adds type hints to public interfaces and classes of the PropertyAccess component. Some docblocks without valuable information got also removed.