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

[FrameworkBundle] Allow to pass a logger instance to the Router#24826

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/fwb/add_router_logger
Dec 1, 2017
Merged

[FrameworkBundle] Allow to pass a logger instance to the Router#24826

fabpot merged 1 commit intosymfony:masterfromogizanagi:feature/fwb/add_router_logger
Dec 1, 2017

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedNov 5, 2017
edited
Loading

QA
Branch?4.1
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#24739
LicenseMIT
Doc PRN/A

As explained in#24739, this will allow theUrlGenerator to log invalid calls whenrouter.strict_requirements isfalse (so instead of throwing):

screenshot 2017-10-29 a 09 57 31

This PR must re-introduce thelogger argument in the definition along with themonolog.logger tag removed for cleaning in#24739, once it's merged up into master. Done

* @param LoggerInterface|null $logger
*/
publicfunction__construct(ContainerInterface$container,$resource,array$options =array(),RequestContext$context =null)
publicfunction__construct(ContainerInterface$container,$resource,array$options =array(),RequestContext$context =null,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.

how about using a nullable typehint ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

We reverted it last time we tried adding one 😄
See discussion starting from#22743 (comment)


$this->resource =$resource;
$this->context =$context ?:newRequestContext();
$this->logger =$logger;
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering: Why don't we call the parent class' constructor?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The$loader argument is mandatory in parent constructor, but in this implementation we're lazy-loading it.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, I missed that.

Copy link
Member

Choose a reason for hiding this comment

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

We should probably change this in 4.1 to have a lazy-loading implementation of the LoaderInterface (using composition over the actual loader which would get loaded when needed), to avoid having a special constructor.

@fabpot
Copy link
Member

Thank you@ogizanagi.

@fabpotfabpot merged commit78f4f88 intosymfony:masterDec 1, 2017
fabpot added a commit that referenced this pull requestDec 1, 2017
…he Router (ogizanagi)This PR was merged into the 4.1-dev branch.Discussion----------[FrameworkBundle] Allow to pass a logger instance to the Router| Q             | A| ------------- | ---| Branch?       | 4.1 <!-- see comment below -->| Bug fix?      | no| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass?   | yes| Fixed tickets |#24739 <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | N/AAs explained in#24739, this will allow the `UrlGenerator` to log invalid calls when `router.strict_requirements` is `false` (so instead of throwing):<img width="1064" alt="screenshot 2017-10-29 a 09 57 31" src="https://user-images.githubusercontent.com/2211145/32142080-482bc64e-bc90-11e7-8382-b78b507bae48.PNG">~~This PR must re-introduce the `logger` argument in the definition along with the `monolog.logger` tag removed for cleaning in#24739, once it's merged up into master.~~ DoneCommits-------78f4f88 [FrameworkBundle] Allow to pass a logger instance to the Router
@ogizanagiogizanagi deleted the feature/fwb/add_router_logger branchDecember 1, 2017 14:40
@fabpotfabpot mentioned this pull requestMay 7, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@dunglasdunglasdunglas approved these changes

@xabbuhxabbuhxabbuh approved these changes

+1 more reviewer

@TaluuTaluuTaluu left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

7 participants

@ogizanagi@fabpot@dunglas@Taluu@stof@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp