Skip to content
Permalink
Browse files

refactor: Fixed SonarCloud error "Boolean literals should not be redu…

…ndant"
  • Loading branch information...
tarlepp committed Jun 23, 2019
1 parent 83fb412 commit ecee76e6048def0058a5490fc19ac931f3947ec9
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/Collection/CollectionTrait.php
@@ -80,9 +80,13 @@ public function getAll(): Traversable
*/
public function has(?string $className = null): bool
{
return $className === null
? false
: count(array_filter(iterator_to_array($this->items), $this->filter($className))) === 1;
$output = false;
if ($className !== null) {
$output = count(array_filter(iterator_to_array($this->items), $this->filter($className))) === 1;
}
return $output;
}
/**

0 comments on commit ecee76e

Please sign in to comment.
You can’t perform that action at this time.