We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0387287 + 14b0b9b commit 5fb9273Copy full SHA for 5fb9273
1 file changed
buildPHAR.php
@@ -2,6 +2,24 @@
2
3
$phar = new Phar('build/phpctags.phar', 0, 'phpctags.phar');
4
5
+if (version_compare(PHP_VERSION, '5.4.0') < 0) {
6
+ class RecursiveCallbackFilterIterator extends RecursiveFilterIterator {
7
+ public function __construct ( RecursiveIterator $iterator, $callback ) {
8
+ $this->callback = $callback;
9
+ parent::__construct($iterator);
10
+ }
11
+
12
+ public function accept () {
13
+ $callback = $this->callback;
14
+ return $callback(parent::current(), parent::key(), parent::getInnerIterator());
15
16
17
+ public function getChildren () {
18
+ return new self($this->getInnerIterator()->getChildren(), $this->callback);
19
20
21
+}
22
23
$phar->buildFromIterator(
24
new RecursiveIteratorIterator(
25
new RecursiveCallbackFilterIterator(
0 commit comments