Skip to content

Commit

Permalink
Sync namesapce and path
Browse files Browse the repository at this point in the history
simplify finder lookup
  • Loading branch information
Xuphey committed Apr 10, 2019
1 parent 335c525 commit 85aac65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Util/Logfile/AbstractReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public static function autoloadCustomReaders($clazz)
private static function getCustomReaders()
{
$finder = Finder::create()->in(__DIR__.DIRECTORY_SEPARATOR.'Custom');
array_map(array($finder, 'name'), array('*.php'));
$finder->name('*.php');

$readers = array();
foreach ($finder as $file) {
$clazz = __NAMESPACE__.'\\'.$file->getBasename('.php');
$clazz = __NAMESPACE__.'\\Custom\\'.$file->getBasename('.php');
$readers[] = new $clazz;
}
return $readers;
Expand Down
4 changes: 3 additions & 1 deletion src/Util/Logfile/Custom/NginxCustomLogFormatReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
*
* Released under the MIT license
*/
namespace UAParser\Util\Logfile;
namespace UAParser\Util\Logfile\Custom;

use UAParser\Util\Logfile\AbstractReader;

class NginxCustomLogFormatReader extends AbstractReader
{
Expand Down

0 comments on commit 85aac65

Please sign in to comment.