1
0
mirror of https://github.com/danog/class-finder.git synced 2024-12-02 09:27:48 +01:00

Fix PHP 5.3 compatibility

This commit is contained in:
Hayden Pierce 2019-02-03 09:45:41 -06:00
parent 1428e1a0a6
commit 2f81fac230

View File

@ -202,8 +202,9 @@ class PSR4Namespace
return array_merge($carry, $arrayOfClasses); return array_merge($carry, $arrayOfClasses);
}, array()); }, array());
$potentialClasses = array_map(function($file) use ($self) { $selfNamespace = $this->namespace; // PHP 5.3 BC
return $self->namespace . str_replace('.php', '', $file); $potentialClasses = array_map(function($file) use ($self, $selfNamespace) {
return $selfNamespace . str_replace('.php', '', $file);
}, $potentialClassFiles); }, $potentialClassFiles);
return array_filter($potentialClasses, function($potentialClass) { return array_filter($potentialClasses, function($potentialClass) {