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] Remove convention based commands registration#23857

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

Conversation

chalasr
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?yes
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

TomasVotruba reacted with thumbs up emoji
return;
}

if (!class_exists('Symfony\Component\Finder\Finder')) {

Choose a reason for hiding this comment

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

the dep can be removed from composer.json

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

it is still used elsewhere

Copy link
MemberAuthor

@chalasrchalasrAug 10, 2017
edited
Loading

Choose a reason for hiding this comment

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

nevermind, I thought I was in FrameworkBundle, done

@chalasrchalasr added this to the4.0 milestoneAug 10, 2017
@chalasrchalasrforce-pushed theremove-commands-convention branch 3 times, most recently fromc33a1b1 to2090f07CompareAugust 10, 2017 16:16
@@ -59,20 +38,6 @@ public function testGetContainerExtensionWithInvalidClass()
$bundle->getContainerExtension();
}

public function testHttpKernelRegisterCommandsIgnoresCommandsThatAreRegisteredAsServices()
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

should probably have been flagged as legacy in 3.4. Do we care?

Copy link
Contributor

Choose a reason for hiding this comment

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

Imo we don't care, no deprecation is triggered here anyway.

*
* * Commands are in the 'Command' sub-directory
* * Commands extend Symfony\Component\Console\Command\Command
* Registers console commands.
*
* @param Application $application An Application instance
*/
public function registerCommands(Application $application)
Copy link
Contributor

Choose a reason for hiding this comment

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

overrides can be removed i guess

Copy link
Member

Choose a reason for hiding this comment

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

this is not an override. It is the base definition

Copy link
Contributor

Choose a reason for hiding this comment

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

TwigBundle::registerCommands etc. They are now noop.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

This is not good if you don't change the min version to forbid using TwigBundle 4.0 with HttpKernel 3.4 and the no-op was important though

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

indeed, no-ops re-added in bundles

}
$class = $ns.'\\'.$file->getBasename('.php');
if ($this->container) {
$commandIds = $this->container->hasParameter('console.command.ids') ? $this->container->getParameter('console.command.ids') : array();
Copy link
Contributor

Choose a reason for hiding this comment

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

should we deprecate this param as well?console.command.ids

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

no, it is still used to filter out lazy commands in framework Application

Copy link
Contributor

Choose a reason for hiding this comment

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

i see... but after#23796 we could right?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

not sure, implementing it would be optional so non lazy command services would still be supported. To be rediscussed at/after it :)

@chalasrchalasrforce-pushed theremove-commands-convention branch 3 times, most recently fromb1b91e3 to6959dfaCompareAugust 10, 2017 17:15
@chalasr
Copy link
MemberAuthor

Ready to me.

@@ -31,7 +31,6 @@
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/dom-crawler": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/finder": "~3.4|~4.0",

Choose a reason for hiding this comment

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

there is one more in "suggest"

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

done

@chalasrchalasrforce-pushed theremove-commands-convention branch from6959dfa tocc1695cCompareAugust 10, 2017 17:24
* @group legacy
* @expectedDeprecation Auto-registration of the command "Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
*/
public function testRegisterCommands()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would keep this test and assert no command is registered forExtensionPresentBundle.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

not sure that testing a no-op is useful at all, we don't for others likebuild(). Already covered by Application tests anyway

Copy link
Contributor

Choose a reason for hiding this comment

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

Here that could prevent mistakes due to merging conflicts.

@@ -59,20 +38,6 @@ public function testGetContainerExtensionWithInvalidClass()
$bundle->getContainerExtension();
}

public function testHttpKernelRegisterCommandsIgnoresCommandsThatAreRegisteredAsServices()
Copy link
Contributor

Choose a reason for hiding this comment

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

Imo we don't care, no deprecation is triggered here anyway.

@ogizanagi
Copy link
Contributor

Thanks Robin.

@ogizanagiogizanagi merged commitcc1695c intosymfony:masterAug 12, 2017
ogizanagi added a commit that referenced this pull requestAug 12, 2017
…tion (chalasr)This PR was merged into the 4.0-dev branch.Discussion----------[HttpKernel] Remove convention based commands registration| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | yes| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aCommits-------cc1695c [HttpKernel] Remove convention based commands registration
@chalasrchalasr deleted the remove-commands-convention branchAugust 13, 2017 06:10
@TomasVotruba
Copy link
Contributor

Awesome job@chalasr !

@chalasr
Copy link
MemberAuthor

@TomasVotruba Thanks, but that's community work! This was the funniest part :)

TomasVotruba reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof left review comments

@ro0NLro0NLro0NL left review comments

@GuilhemNGuilhemNGuilhemN left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@ogizanagiogizanagiogizanagi approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
4.0
Development

Successfully merging this pull request may close these issues.

8 participants
@chalasr@ogizanagi@TomasVotruba@nicolas-grekas@stof@ro0NL@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp