REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 3.43 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Foundation/Events/DiscoverEvents.php
Text
Base64
<?php namespace Illuminate\Foundation\Events; use Illuminate\Support\Collection; use Illuminate\Support\Reflector; use Illuminate\Support\Str; use ReflectionClass; use ReflectionException; use ReflectionMethod; use SplFileInfo; use Symfony\Component\Finder\Finder; class DiscoverEvents { /** * The callback to be used to guess class names. * * @var callable(SplFileInfo, string): string|null */ public static $guessClassNamesUsingCallback; /** * 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) { $listeners = new Collection(static::getListenerEvents( Finder::create()->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 ucfirst(Str::camel(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; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
DiagnosingHealth.php
82 B
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DiscoverEvents.php
3.43 KB
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Dispatchable.php
1.21 KB
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LocaleUpdated.php
354 B
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MaintenanceModeDisabled.php
89 B
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MaintenanceModeEnabled.php
88 B
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PublishingStubs.php
660 B
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Terminating.php
77 B
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
VendorTagPublished.php
544 B
lrw-rw-rw-
2025-09-17 06:52:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).