芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/invoicer.pulsehost.co.uk/vendor/laravel/framework/DiscoverEvents.php
files()->in($listenerPath), $basePath )); $discoveredEvents = []; foreach ($listeners as $listener => $events) { foreach ($events as $event) { if (! isset($discoveredEvents[$event])) { $discoveredEvents[$event] = []; } $discoveredEvents[$event][] = $listener; } } return $discoveredEvents; } /** * Get all of the listeners and their corresponding events. * * @param iterable $listeners * @param string $basePath * @return array */ protected static function getListenerEvents($listeners, $basePath) { $listenerEvents = []; foreach ($listeners as $listener) { try { $listener = new ReflectionClass( static::classFromFile($listener, $basePath) ); } catch (ReflectionException) { continue; } if (! $listener->isInstantiable()) { continue; } foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if ((! Str::is('handle*', $method->name) && ! Str::is('__invoke', $method->name)) || ! isset($method->getParameters()[0])) { continue; } $listenerEvents[$listener->name.'@'.$method->name] = Reflector::getParameterClassNames($method->getParameters()[0]); } } return array_filter($listenerEvents); } /** * Extract the class name from the given file path. * * @param \SplFileInfo $file * @param string $basePath * @return string */ protected static function classFromFile(SplFileInfo $file, $basePath) { if (static::$guessClassNamesUsingCallback) { return call_user_func(static::$guessClassNamesUsingCallback, $file, $basePath); } $class = trim(Str::replaceFirst($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR); return str_replace( [DIRECTORY_SEPARATOR, ucfirst(basename(app()->path())).'\\'], ['\\', app()->getNamespace()], ucfirst(Str::replaceLast('.php', '', $class)) ); } /** * Specify a callback to be used to guess class names. * * @param callable(SplFileInfo, string): string $callback * @return void */ public static function guessClassNamesUsing(callable $callback) { static::$guessClassNamesUsingCallback = $callback; } }