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

[HttpKernel] ConfigDataCollector to return known data without the need of a Kernel#40535

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
Nyholm merged 1 commit intosymfony:4.4fromtopikito:kernel-lts-4.4
Mar 25, 2021

Conversation

@topikito
Copy link
Contributor

@topikitotopikito commentedMar 21, 2021
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#40534
LicenseMIT
Doc PR

Sets$this->data with information that can be known without the need of aKernel.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@derrabus
Copy link
Member

How is it possible that we getnull here in the first place? Shouldn't we always be able to determine that piece of information?

@ciaranmcnulty
Copy link
Contributor

@derrabus Not when this condition is false

if (isset($this->kernel)) {
foreach ($this->kernel->getBundles()as$name =>$bundle) {
$this->data['bundles'][$name] =newClassStub(\get_class($bundle));
}
$this->data['symfony_state'] =$this->determineSymfonyState();
$this->data['symfony_minor_version'] =sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
$this->data['symfony_lts'] =4 === Kernel::MINOR_VERSION;
$eom = \DateTime::createFromFormat('d/m/Y','01/'.Kernel::END_OF_MAINTENANCE);
$eol = \DateTime::createFromFormat('d/m/Y','01/'.Kernel::END_OF_LIFE);
$this->data['symfony_eom'] =$eom->format('F Y');
$this->data['symfony_eol'] =$eol->format('F Y');
}

@ro0NL
Copy link
Contributor

we should only rely on the$this->kernel instance for bundle aggregration IMHO.

then always get remaining metadata from staticKernel symbol (which is a hard dep)

topikito and ciaranmcnulty reacted with thumbs up emoji

@topikito
Copy link
ContributorAuthor

I have suggested a different solution as to the suggestion of@fabpot to returnfalse: bring out of theif block all assignments that rely onKernel and not on$kernel.

#40535 (comment)

@topikito
Copy link
ContributorAuthor

I have extracted the corresponding bits outside of theif block.

For the tests, I decided to add extra checks for all the content I extracted. I required a way to generate the same output fordetermineSymfonyState() so I decided to copy the behaviour. The reason behind this is that I assume it's not desired to rewrite the tests for each version, so it should rather expect to have the same logic in the tests. If the logic in the class would change, the test should catch it. If this is not acceptable, please let me know how to proceed to test that particular getter.

@nicolas-grekas
Copy link
Member

The descrition+title of the PR need an update now ;)

topikito reacted with thumbs up emoji

@topikitotopikito requested a review fromstofMarch 23, 2021 12:33
@topikitotopikito changed the title[HttpKernel] Add nullable return type on isSymfonyLts()[HttpKernel] ConfigDataCollector to return known data without the need of a KernelMar 23, 2021
@Nyholm
Copy link
Member

Awesome. Congratulations to your first contribution!

topikito and derrabus reacted with hooray emoji

@NyholmNyholm merged commita863e2f intosymfony:4.4Mar 25, 2021
@topikitotopikito deleted the kernel-lts-4.4 branchMarch 25, 2021 22:08
@NyholmNyholm mentioned this pull requestMar 28, 2021
This was referencedMar 29, 2021
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

@derrabusderrabusderrabus approved these changes

@stofstofAwaiting requested review from stof

@fabpotfabpotAwaiting requested review from fabpot

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

9 participants

@topikito@carsonbot@derrabus@ciaranmcnulty@ro0NL@nicolas-grekas@Nyholm@fabpot@stof

[8]ページ先頭

©2009-2025 Movatter.jp