@@ -39,7 +39,7 @@ public function load($path, $type = null)
39
39
$ collection = new RouteCollection ();
40
40
$ collection ->addResource (new DirectoryResource ($ dir , '/\.php$/ ' ));
41
41
$ files = iterator_to_array (new \RecursiveIteratorIterator (
42
- new RecursiveCallbackFilterIterator (
42
+ new \ RecursiveCallbackFilterIterator (
43
43
new \RecursiveDirectoryIterator ($ dir ),
44
44
function (\SplFileInfo $ current ) {
45
45
return '. ' !== substr ($ current ->getBasename (), 0 , 1 );
@@ -87,34 +87,3 @@ public function supports($resource, $type = null)
87
87
return is_dir ($ path ) && (!$ type || 'annotation ' === $ type );
88
88
}
89
89
}
90
-
91
- /**
92
- * @internal To be removed as RecursiveCallbackFilterIterator is available since PHP 5.4
93
- */
94
- class RecursiveCallbackFilterIterator extends \FilterIterator implements \RecursiveIterator
95
- {
96
- private $ iterator ;
97
- private $ callback ;
98
-
99
- public function __construct (\RecursiveIterator $ iterator , $ callback )
100
- {
101
- $ this ->iterator = $ iterator ;
102
- $ this ->callback = $ callback ;
103
- parent ::__construct ($ iterator );
104
- }
105
-
106
- public function accept ()
107
- {
108
- return call_user_func ($ this ->callback , $ this ->current (), $ this ->key (), $ this ->iterator );
109
- }
110
-
111
- public function hasChildren ()
112
- {
113
- return $ this ->iterator ->hasChildren ();
114
- }
115
-
116
- public function getChildren ()
117
- {
118
- return new static ($ this ->iterator ->getChildren (), $ this ->callback );
119
- }
120
- }
0 commit comments