Skip to content
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

Fix: No need to verify whether hard dependency is not null #469

Merged
merged 1 commit into from
Nov 5, 2018

Conversation

localheinz
Copy link
Contributor

This PR

  • removes what appears to be a condition that should not evaluate to false

@@ -42,7 +42,7 @@ public function __construct(RedisLogger $logger)
public function collect(Request $request, Response $response, \Exception $exception = null)
{
$this->data = array(
'commands' => null !== $this->logger ? $this->logger->getCommands() : array(),
Copy link
Contributor Author

@localheinz localheinz Nov 2, 2018

Choose a reason for hiding this comment

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

The $logger is a hard dependency, see Snc\RedisBundle\DataCollector\RedisDataCollector::__construct().

This condition only makes sense for scenarios where the constructor is not invoked:

  • instantiated via reflection
  • collector is overridden, but original constructor is not invoked

@localheinz
Copy link
Contributor Author

Build failure appears to be unrelated.

@B-Galati
Copy link
Collaborator

B-Galati commented Nov 2, 2018

Thanks @localheinz

@curry684 curry684 merged commit d9c12a2 into snc:master Nov 5, 2018
@curry684
Copy link
Collaborator

curry684 commented Nov 5, 2018

Thanks!

@localheinz localheinz deleted the fix/condition branch November 5, 2018 08:02
@localheinz
Copy link
Contributor Author

Thank you, @B-Galati, @curry684, and @OskarStark!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants