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] Add a ContainerControllerResolver (psr-11)#21768

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
fabpot merged 1 commit intosymfony:masterfromogizanagi:feature/3.3/http_kernel/psr11_controller_resolver
Feb 28, 2017
Merged

[HttpKernel] Add a ContainerControllerResolver (psr-11)#21768

fabpot merged 1 commit intosymfony:masterfromogizanagi:feature/3.3/http_kernel/psr11_controller_resolver
Feb 28, 2017

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedFeb 26, 2017
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

Extracts the controller as service resolution from the framework bundle controller resolver in aSymfony/Component/HttpKernel/Controller/Psr11ControllerResolver, allowing you to useHttpKernel with your own psr-11 container.

linaori, chalasr, and jvasseur reacted with thumbs up emoji
}
}

returnparent::createController($controller);
Copy link
Contributor

Choose a reason for hiding this comment

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

This method could be rewritten to use guard clauses, making it a lot easier to read

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I made some changes. Is it better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Much better yes!

useSymfony\Component\HttpKernel\Tests\Controller\Psr11ControllerResolverTest;

class ControllerResolverTestextendsBaseControllerResolverTest
class ControllerResolverTestextendsPsr11ControllerResolverTest
Copy link
Contributor

Choose a reason for hiding this comment

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

tests in this class could stay to verify it doesn't change behavior, if this happens, it would break a lot.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The tests cases were simply moved in thePsr11ControllerResolverTest class and are inherited, so I think we're safe, aren't we? :)

* @param ControllerNameParser $parser A ControllerNameParser instance
* @param LoggerInterface $logger A LoggerInterface instance
*/
publicfunction__construct(ContainerInterface$container,ControllerNameParser$parser,LoggerInterface$logger =null)
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 just changing the type hint and make the parser optional?

Copy link
ContributorAuthor

@ogizanagiogizanagiFeb 26, 2017
edited
Loading

Choose a reason for hiding this comment

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

Because the new class is available in theHttpKernel component, whereas this one is in the framework bundle, as well as theControllerNameParser.
I'm fine with this class as is in the framework. :) I just think having a base ControllerResolver usable with psr-11 shipped with the component makes sense.

@nicolas-grekasnicolas-grekas added this to the3.x milestoneFeb 27, 2017
@nicolas-grekas
Copy link
Member

I'm not fan of the Psr11 prefix. What about ServiceLocatorControllerResolver? ContainerControllerResolver? ServiceControllerResolver?

@ogizanagi
Copy link
ContributorAuthor

Why not. What is your own preference? What do others think?

I likeServiceControllerResolver.

@stof
Copy link
Member

I prefer ContainerControllerResolver actually.Service alone looks a bit weird to me

@ogizanagiogizanagi changed the title[HttpKernel] Add a Psr11ControllerResolver[HttpKernel] Add a ContainerControllerResolver (psr-11)Feb 28, 2017
@ogizanagi
Copy link
ContributorAuthor

Renamed toContainerControllerResolver. That's the psr title after all :)

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

👍 (minor comment)

/**
* @param ContainerInterface $container A psr-11 container instance
* @param LoggerInterface|null $logger
*/
Copy link
Member

Choose a reason for hiding this comment

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

The docblock can be removed

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Fixed

@fabpot
Copy link
Member

Thank you@ogizanagi.

@fabpotfabpot merged commit7bbae41 intosymfony:masterFeb 28, 2017
fabpot added a commit that referenced this pull requestFeb 28, 2017
…) (ogizanagi)This PR was merged into the 3.3-dev branch.Discussion----------[HttpKernel] Add a ContainerControllerResolver (psr-11)| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | N/A| License       | MIT| Doc PR        | N/AExtracts the controller as service resolution from the framework bundle controller resolver in a `Symfony/Component/HttpKernel/Controller/Psr11ControllerResolver`, allowing you to use `HttpKernel` with your own psr-11 container.Commits-------7bbae41 [HttpKernel] Add a ContainerControllerResolver (psr-11)
@ogizanagiogizanagi deleted the feature/3.3/http_kernel/psr11_controller_resolver branchFebruary 28, 2017 20:46
@nicolas-grekasnicolas-grekas modified the milestones:3.x,3.3Mar 24, 2017
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

+2 more reviewers

@linaorilinaorilinaori left review comments

@GuilhemNGuilhemNGuilhemN left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

7 participants

@ogizanagi@nicolas-grekas@stof@fabpot@linaori@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp