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

Kernel::$projectDir is inconsistent#22727

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

Closed
leofeyer wants to merge1 commit intosymfony:masterfromleofeyer:patch-1
Closed

Kernel::$projectDir is inconsistent#22727

leofeyer wants to merge1 commit intosymfony:masterfromleofeyer:patch-1

Conversation

@leofeyer
Copy link
Contributor

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

The newKernel::$projectDir property isprivate instead ofprotected, which is inconsistent if you want to set the property in a child class.

class AppKernelextends Kernel{publicfunctionoverwriteDirectories()    {$this->rootDir ='';// works$this->projectDir ='';// does not work    }}

Since the Kernel class is almost always extended and since the project root dir is very likely to be overwritten (e.g. in the unit tests), the property should beprotected IMHO.

jvasseur, linaori, chalasr, and Taluu reacted with thumbs down emoji
@xabbuh
Copy link
Member

I am 👎 on this change. Maintaining BC for protected properties is a nightmare. And you can already achieve the same by overriding thegetProjectDir() method in your custom kernel class.

theofidry reacted with thumbs up emoji

@javiereguiluz
Copy link
Member

@leofeyer allowing to override these variables is very important ... but we don't allow to do that changing the value of the properties directly, but by overriding thegetProjectDir() method of the Kernel class, as@xabbuh explained.

So I'm going to close this issue as "won't fix" because this can already be solved in other way. Thanks!

@stof
Copy link
Member

Note that writing directly torootDir is not really something we want to support either (you should also overwrite the method). But we cannot switch it to private outside major versions

@stof
Copy link
Member

thus, you still have not provided a use case requiring the visibility change (i.e. something whichcannot be achieved by overwriting the method)

@leofeyer
Copy link
ContributorAuthor

Ok, thanks for the clarification. We should merge#22728 then.

fabpot added a commit that referenced this pull requestMay 25, 2017
This PR was merged into the 3.3 branch.Discussion----------[HttpKernel] Fix kernel.project_dir extensibility| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#22727| License       | MIT| Doc PR        | n/aAlternative to#22727 that makes use of the existing public api.Commits-------3230fc7 Fix kernel.project_dir extensibility
symfony-splitter pushed a commit to symfony/http-kernel that referenced this pull requestMay 25, 2017
This PR was merged into the 3.3 branch.Discussion----------[HttpKernel] Fix kernel.project_dir extensibility| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |symfony/symfony#22727| License       | MIT| Doc PR        | n/aAlternative to #22727 that makes use of the existing public api.Commits-------3230fc7 Fix kernel.project_dir extensibility
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@leofeyer@xabbuh@javiereguiluz@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp