Skip to content
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

Merged

Conversation

jschaedl
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #32179
License MIT
Doc PR N/A

This PR adds type hints to public interfaces and classes of the PropertyAccess component. Some docblocks without valuable information got also removed.

@jschaedl jschaedl force-pushed the improvement/property-access_type-hints branch 2 times, most recently from d9564fa to 3c3fb27 Compare June 27, 2019 21:35
@@ -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)]);
Copy link
Member

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.

@nicolas-grekas nicolas-grekas added this to the 5.0 milestone Jun 28, 2019
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Jun 28, 2019
…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
fabpot added a commit that referenced this pull request Jun 28, 2019
…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
@jschaedl jschaedl force-pushed the improvement/property-access_type-hints branch from 3c3fb27 to 2c293f0 Compare June 29, 2019 06:11
@derrabus derrabus mentioned this pull request Jun 29, 2019
57 tasks
PropertyAccess
--------------

* Removed support of passing `null` as 2nd argument of `PropertyAccessor::createCache()` method (`$defaultLifetime`), pass `0` instead.
Copy link
Member

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a71ee27

@fabpot fabpot force-pushed the improvement/property-access_type-hints branch from f5e63a2 to 91138a9 Compare July 5, 2019 05:25
@fabpot
Copy link
Member

fabpot commented Jul 5, 2019

Thank you @jschaedl.

@fabpot fabpot merged commit 91138a9 into symfony:master Jul 5, 2019
fabpot added a commit that referenced this pull request Jul 5, 2019
… 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
@jschaedl jschaedl deleted the improvement/property-access_type-hints branch February 23, 2020 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants