-
Notifications
You must be signed in to change notification settings - Fork 93
Correct / improve SymfonyProfilerController #370
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
Conversation
a7d78ce
to
e497783
Compare
e497783
to
a5701e8
Compare
@@ -149,3 +149,8 @@ parameters: | |||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Translation\\\\TranslatorBagInterface\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface\\:\\:transChoice\\(\\)\\.$#" | |||
count: 2 | |||
path: Twig/TranslationExtension.php | |||
|
|||
- | |||
message: "#^Call to method getValue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\DataCollector\\\\Data\\.$#" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will become useless once missing use will be added in symfony
See: symfony/symfony#35122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPStan will also give an error when a message is not used anymore 👍 Great way of gradually improving code quality
compliments to @ondrejmirtes 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
/** @var \Symfony\Component\HttpKernel\DataCollector\RequestDataCollector */ | ||
$requestCollector = $this->profiler->loadProfile($token)->getCollector('request'); | ||
|
||
$message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about reducing fluent usage? That way you don't need to rely on the message returning itself.
$message->setLocale()
$message->setTranslation()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the original syntax.
@@ -6,6 +6,7 @@ services: | |||
- { name: 'data_collector', template: "@Translation/SymfonyProfiler/translation.html.twig", id: "translation", priority: 200 } | |||
|
|||
Translation\Bundle\Controller\SymfonyProfilerController: | |||
autowire: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving this to a _defaults
section?
_defaults:
autowire: true
autoconfigure: true
No description provided.