Skip to content

Commit

Permalink
Merge pull request #1110 from spiral/feature/tokenizer-scan-parent-at…
Browse files Browse the repository at this point in the history
…tributes
  • Loading branch information
spiralbot committed May 22, 2024
1 parent 39879ad commit 14c552e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/LoggerInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ public function createInjection(
*/
private function extractChannelAttribute(\ReflectionParameter $parameter): ?string
{
/** @var \ReflectionAttribute<LoggerChannel>[] $attributes */
$attributes = $parameter->getAttributes(LoggerChannel::class);

return $attributes[0]?->newInstance()->name;
return ($parameter->getAttributes(LoggerChannel::class)[0] ?? null)?->newInstance()->name;
}
}

0 comments on commit 14c552e

Please sign in to comment.