Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] Move AddConsoleCommandPass from FrameworkBundle to Console. #19443

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

Merged
merged 1 commit into from
Jan 11, 2017

Conversation

bcremer
Copy link
Contributor

@bcremer bcremer commented Jul 27, 2016

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

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from c2deecc to dffd5e6 Compare July 27, 2016 09:45
@mcfedr
Copy link
Contributor

mcfedr commented Jul 27, 2016

Maybe worth merging (or reviewing) #19305 first so that it doesnt conflict.

@@ -22,6 +22,7 @@
"symfony/class-loader": "~3.2",
"symfony/dependency-injection": "~3.2",
"symfony/config": "~2.8|~3.0",
"symfony/console": "~3.2",
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed. Because of the class_exists call, if the installed component is an older version or isn't installed it will still work. Maybe should you add a another test to not load the deprecated pass if the component is not installed at all (to prevent throwing an illegitimate deprecation warning).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the dependency.

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from b6f8cc5 to 94a19f3 Compare July 28, 2016 05:51
*/
class AddConsoleCommandPass implements CompilerPassInterface
{
public function __construct()
{
@trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass instead.', __CLASS__), E_USER_DEPRECATED);
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 be jus below the namespace declaration, see other places in the code base

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, changed.

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from 94a19f3 to 1094537 Compare July 28, 2016 07:28
@@ -11,13 +11,17 @@

namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;

@trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass instead.', __CLASS__), E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

AddConsoleCommandPass::class instead of __CLASS__ (which is undefined)

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from 1094537 to 17385a7 Compare July 28, 2016 08:04
"symfony/filesystem": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0",
"psr/log": "~1.0"
},
"suggest": {
"symfony/dependency-injection": "",
Copy link
Member

Choose a reason for hiding this comment

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

I would remove this suggestion. The DI component does not allow to add more features to the Console component.

The compiler pass is useful only for people already using the component. So the suggestion is just useless noise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense; changed.

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from 17385a7 to 6e57865 Compare July 28, 2016 12:33
@bcremer bcremer changed the title Move AddConsoleCommandPass from FrameworkBundle to Console. [Console] Move AddConsoleCommandPass from FrameworkBundle to Console. Jul 29, 2016
@fabpot
Copy link
Member

fabpot commented Sep 14, 2016

Tests do not pass because of the deprecation.

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from 6e57865 to db03053 Compare September 15, 2016 05:22
@bcremer
Copy link
Contributor Author

bcremer commented Sep 15, 2016

Tests are now all fixed.

@@ -6,6 +6,7 @@ FrameworkBundle

* The `Controller::getUser()` method has been deprecated and will be removed in
Symfony 4.0; typehint the security user object in the action instead.
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been deprecated. Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead.
Copy link
Member

Choose a reason for hiding this comment

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

Please also add this to the UPGRADE-4.0.md (but reword it to "removed" there).

$container->compile();
}

public function testHttpKernelRegisterCommandsIngoreCommandAsAService()
Copy link
Member

Choose a reason for hiding this comment

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

This whole test case looks a bit suspicious to me. We don't have anything HttpKernel specific here, do we?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test was copied 1 to 1 from the original location
\Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\AddConsoleCommandPassTest::testHttpKernelRegisterCommandsIngoreCommandAsAService.

Any suggestions how to name the testcase instead?

Copy link
Member

Choose a reason for hiding this comment

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

Imo this test case should have never lived here. It actually does not test test compiler pass, but the bundle class from the HttpKernel component and therefore should live there.

Copy link
Member

Choose a reason for hiding this comment

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

see #20273

*
* @author Grégoire Pineau <[email protected]>
*
* @deprecated since version 3.2, to be removed in 4.0. Use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass instead.
*/
class AddConsoleCommandPass implements CompilerPassInterface
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to let this class extend the new compiler pass instead of having to maintain the same code twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would introduce a new dependency symfony/console to symfony/framework-bundle that is not yet defined in composer.json.

Should the new dependency be added to composer.json or can should this fail during runtime?

Copy link
Member

Choose a reason for hiding this comment

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

We could add a conflict rule for versions of the Console component before 3.2.

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from 014c9eb to cf946c9 Compare October 17, 2016 12:39
@@ -11,14 +11,18 @@

namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;

@trigger_error(sprintf('%s is deprecated as of 3.2 and will be removed in 4.0. Use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass instead.', AddConsoleCommandPass::class), E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

[...] deprecated since version 3.2 [...]

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from cf946c9 to e7f2763 Compare October 21, 2016 08:31
@xabbuh
Copy link
Member

xabbuh commented Oct 22, 2016

👍 (failure is unrelated)

Status: Reviewed

@ro0NL
Copy link
Contributor

ro0NL commented Oct 22, 2016

Should we make some hardcoded id's / strings configurable thru required constructor args, as done in #20250? See discussion: #20250 (comment)

fabpot added a commit that referenced this pull request Oct 22, 2016
…l component (xabbuh)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle][HttpKernel] move test to the HttpKernel component

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19443 (comment)
| License       | MIT
| Doc PR        |

The moved test case does not test the `AddConsoleCommandPass` class, but ensures certain behavior in the `registerCommands()` method of the `Bundle` class from the HttpKernel component.

Commits
-------

c9ca322 move test to the HttpKernel component
@javiereguiluz javiereguiluz added this to the 3.3 milestone Nov 7, 2016
@bcremer
Copy link
Contributor Author

bcremer commented Jan 11, 2017

Is there still anything I can help to get this merged into 3.3?

@xabbuh
Copy link
Member

xabbuh commented Jan 11, 2017

@bcremer You rebase this once again to resolve conflicts, but otherwise this looks ready to me.

ping @symfony/deciders

@@ -27,6 +27,7 @@ FrameworkBundle
* The `Resources/public/images/*` files have been removed.
* The `Resources/public/css/*.css` files have been removed (they are now inlined
in TwigBundle).
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been deprecated. Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead.
Copy link
Member

Choose a reason for hiding this comment

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

Ah sorry, now that Symfony 3.2 is released we would need to move this to the UPGRADE-3.2md file and update deprecation messages accordingly.

@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from e7f2763 to 4928c24 Compare January 11, 2017 12:04
@bcremer bcremer force-pushed the move-AddConsoleCommandPass branch from 4928c24 to 7743989 Compare January 11, 2017 12:05
@bcremer
Copy link
Contributor Author

bcremer commented Jan 11, 2017

@xabbuh Rebased onto master and targeted to Symfony 3.3.

@fabpot
Copy link
Member

fabpot commented Jan 11, 2017

Thank you @bcremer.

@fabpot fabpot merged commit 7743989 into symfony:master Jan 11, 2017
fabpot added a commit that referenced this pull request Jan 11, 2017
…dle to Console. (bcremer)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Move AddConsoleCommandPass from FrameworkBundle to Console.

| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | yes |
| Deprecations? | yes |
| Tests pass? | yes |
| Fixed tickets | #19440 |
| License | MIT |
| Doc PR | - |

Commits
-------

7743989 Move AddConsoleCommandPass from FrameworkBundle to Console.
@bcremer bcremer deleted the move-AddConsoleCommandPass branch January 12, 2017 06:26
fabpot added a commit that referenced this pull request Jan 12, 2017
…ent isn't installed (dunglas)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Prevent an error when the console component isn't installed

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21246
| License       | MIT
| Doc PR        |n/a

Finish #19443. Alternative to #21246.

Commits
-------

ab133ca [FrameworkBundle] Prevent an error when the console component isn't installed
fabpot added a commit that referenced this pull request Feb 16, 2017
…onent (chalasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form][FrameworkBundle] Move FormPass to the Form component

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

So that anyone using only Form and DI can use it for registering form types/type guessers.
Follows #19443, related to #21284

Commits
-------

e68a6d9 [FrameworkBundle][Form] Move FormPass to the Form component
@nicolas-grekas nicolas-grekas modified the milestones: 3.x, 3.3 Mar 24, 2017
@fabpot fabpot mentioned this pull request May 1, 2017
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.

10 participants