Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DependencyInjection] Add types to private properties#41928

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:6.0fromderrabus:types/di-properties
Jul 3, 2021

Conversation

@derrabus
Copy link
Member

QA
Branch?6.0
Bug fix?no
New feature?no
Deprecations?no
TicketsN/A
LicenseMIT
Doc PRN/A

Same procedure as#41924, but on a more complex component.

@stof
Copy link
Member

stof commentedJul 1, 2021

for the Psalm false positive, I reported the bug atvimeo/psalm#6027

derrabus reacted with thumbs up emoji

privatefunctiongetExpressionLanguage():ExpressionLanguage
{
if (null ===$this->expressionLanguage) {
if (!isset($this->expressionLanguage)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not nullable?

Copy link
Contributor

@ro0NLro0NLJul 1, 2021
edited
Loading

Choose a reason for hiding this comment

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

the private scope confused me. But from#41924 i figured this lazy loading tactic is probably slightly preferred, as we dont need to give in on type info.

👍

derrabus reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Right.null was previously used for lazy initialization only and I'd like to avoid making properties nullable. If someone accesses this property before initialization, they made a mistake and PHP will raise an exception for us. This is a good thing.

fabpot added a commit that referenced this pull requestJul 2, 2021
This PR was merged into the 4.4 branch.Discussion----------[DependencyInjection] Fix doc blocks| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | N/A| License       | MIT| Doc PR        | N/ATwo small backports from#41928.Commits-------950b2e7 [DependencyInjection] Fix doc blocks
$this->getEnv->setAccessible(true);
$this->getEnv =$this->getEnv->getClosure($this);
}
$this->getEnv ??= \Closure::fromCallable([$this,__FUNCTION__]);

Choose a reason for hiding this comment

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

psalm bug here, it's not able to compute__FUNCTION__ correctly
let's use 'getEnv' instead

fabpot added a commit that referenced this pull requestJul 2, 2021
…nto a constant (derrabus)This PR was merged into the 4.4 branch.Discussion----------[DependencyInjection] Turn $defaultDeprecationTemplate into a constant| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       |#41928 (comment)| License       | MIT| Doc PR        | N/ACommits-------936e399 [DependencyInjection] Turn $defaultDeprecationTemplate into a constant
symfony-splitter pushed a commit to symfony/dependency-injection that referenced this pull requestJul 2, 2021
…nto a constant (derrabus)This PR was merged into the 4.4 branch.Discussion----------[DependencyInjection] Turn $defaultDeprecationTemplate into a constant| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       |symfony/symfony#41928 (comment)| License       | MIT| Doc PR        | N/ACommits-------936e399ff9 [DependencyInjection] Turn $defaultDeprecationTemplate into a constant
@nicolas-grekas
Copy link
Member

Thank you@derrabus.

@nicolas-grekasnicolas-grekas merged commitd948312 intosymfony:6.0Jul 3, 2021
@derrabusderrabus deleted the types/di-properties branchJuly 4, 2021 17:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@stofstofstof left review comments

@chalasrchalasrchalasr approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

+1 more reviewer

@ro0NLro0NLro0NL left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.0

Development

Successfully merging this pull request may close these issues.

6 participants

@derrabus@stof@nicolas-grekas@ro0NL@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp