Skip to content

Commit

Permalink
removed support for PHP 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed May 21, 2015
1 parent 2a9619e commit 6ec9057
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 83 deletions.
37 changes: 0 additions & 37 deletions src/Finder/CallbackFilterIterator.php

This file was deleted.

13 changes: 6 additions & 7 deletions src/Finder/Finder.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ private function buildIterator($path)


if ($this->exclude) { if ($this->exclude) {
$filters = $this->exclude; $filters = $this->exclude;
$iterator = new RecursiveCallbackFilterIterator($iterator, function($foo, $bar, RecursiveCallbackFilterIterator $iterator) use ($filters) { $iterator = new \RecursiveCallbackFilterIterator($iterator, function($foo, $bar, \RecursiveDirectoryIterator $file) use ($filters) {
$file = $iterator->getInnerIterator();
if (!$file->isDot() && !$file->isFile()) { if (!$file->isDot() && !$file->isFile()) {
foreach ($filters as $filter) { foreach ($filters as $filter) {
if (!call_user_func($filter, $file)) { if (!call_user_func($filter, $file)) {
Expand All @@ -252,10 +251,10 @@ private function buildIterator($path)


if ($this->groups) { if ($this->groups) {
$groups = $this->groups; $groups = $this->groups;
$iterator = new CallbackFilterIterator($iterator, function($foo, $bar, CallbackFilterIterator $file) use ($groups) { $iterator = new \CallbackFilterIterator($iterator, function($foo, $bar, \Iterator $file) use ($groups) {
do { while ($file instanceof \OuterIterator) {
$file = $file->getInnerIterator(); $file = $file->getInnerIterator();
} while (!$file instanceof FilesystemIterator); }


foreach ($groups as $filters) { foreach ($groups as $filters) {
foreach ($filters as $filter) { foreach ($filters as $filter) {
Expand Down Expand Up @@ -339,7 +338,7 @@ public function size($operator, $size = NULL)
$operator = $operator ? $operator : '='; $operator = $operator ? $operator : '=';
} }
return $this->filter(function(FilesystemIterator $file) use ($operator, $size) { return $this->filter(function(FilesystemIterator $file) use ($operator, $size) {
return Finder::compare($file->getSize(), $operator, $size); return self::compare($file->getSize(), $operator, $size);
}); });
} }


Expand All @@ -361,7 +360,7 @@ public function date($operator, $date = NULL)
} }
$date = DateTime::from($date)->format('U'); $date = DateTime::from($date)->format('U');
return $this->filter(function(FilesystemIterator $file) use ($operator, $date) { return $this->filter(function(FilesystemIterator $file) use ($operator, $date) {
return Finder::compare($file->getMTime(), $operator, $date); return self::compare($file->getMTime(), $operator, $date);
}); });
} }


Expand Down
39 changes: 0 additions & 39 deletions src/Finder/RecursiveCallbackFilterIterator.php

This file was deleted.

0 comments on commit 6ec9057

Please sign in to comment.