Skip to content

Commit

Permalink
Simplify acceptFilter()
Browse files Browse the repository at this point in the history
  • Loading branch information
fabfuel committed Apr 23, 2015
1 parent be78fea commit 226b782
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Fabfuel/Prophiler/Iterator/ComponentFilteredIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,10 @@ protected function acceptFilters()
*/
protected function acceptFilter(BenchmarkInterface $benchmark, $field, $value)
{
if (is_array($value) && !in_array($benchmark->getMetadataValue($field), $value, true)) {
return false;
} elseif (!is_array($value) && $benchmark->getMetadataValue($field) !== $value) {
return false;
if (is_array($value)) {
return in_array($benchmark->getMetadataValue($field), $value, true);
}
return true;
return $benchmark->getMetadataValue($field) === $value;
}

/**
Expand Down

0 comments on commit 226b782

Please sign in to comment.