1
0
mirror of https://github.com/danog/class-finder.git synced 2024-11-30 04:29:03 +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);
}, array());
$potentialClasses = array_map(function($file) use ($self) {
return $self->namespace . str_replace('.php', '', $file);
$selfNamespace = $this->namespace; // PHP 5.3 BC
$potentialClasses = array_map(function($file) use ($self, $selfNamespace) {
return $selfNamespace . str_replace('.php', '', $file);
}, $potentialClassFiles);
return array_filter($potentialClasses, function($potentialClass) {