Add the event listener for the awards #155
This commit is contained in:
29
app/Support/ClassLoader.php
Normal file
29
app/Support/ClassLoader.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use Symfony\Component\ClassLoader\ClassMapGenerator;
|
||||
|
||||
class ClassLoader
|
||||
{
|
||||
/**
|
||||
* @param $path
|
||||
* @return array
|
||||
*/
|
||||
public static function getClassesInPath($path)
|
||||
{
|
||||
$classes = [];
|
||||
|
||||
if (!file_exists($path)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$all_classes = array_keys(ClassMapGenerator::createMap($path));
|
||||
foreach ($all_classes as $cl) {
|
||||
$klass = new $cl;
|
||||
$classes[] = $klass;
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user