Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
zendframework/zendframework#6058 - Preferring `ArrayUtils::iteratorTo…
Browse files Browse the repository at this point in the history
…Array()` over `iterator_to_array`
  • Loading branch information
Ocramius committed May 3, 2014
1 parent a711054 commit 31d21b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Filter/Timestamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use DateTime;
use Traversable;
use Zend\Log\Exception;
use Zend\Stdlib\ArrayUtils;

/**
* Filters log events based on the time when they were triggered.
Expand Down Expand Up @@ -49,8 +50,9 @@ class Timestamp implements FilterInterface
public function __construct($value, $dateFormatChar = null, $operator = '<=')
{
if ($value instanceof Traversable) {
$value = iterator_to_array($value);
$value = ArrayUtils::iteratorToArray($value);
}

if (is_array($value)) {
$dateFormatChar = isset($value['dateFormatChar']) ? $value['dateFormatChar'] : null;
$operator = isset($value['operator']) ? $value['operator'] : null;
Expand Down

0 comments on commit 31d21b4

Please sign in to comment.