REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.20 KB
Close
/proc/thread-self/root/home/byroehnu/easetack.com/vendor/spatie/error-solutions/src/DiscoverSolutionProviders.php
Text
Base64
<?php namespace Spatie\ErrorSolutions; use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable; class DiscoverSolutionProviders { /** @var array<string, string> */ protected array $config = [ 'ai' => 'SolutionProviders/OpenAi', 'php' => 'SolutionProviders', 'laravel' => 'SolutionProviders/Laravel', ]; /** * @param array<string> $types * * @return array<HasSolutionsForThrowable> */ public static function for(array $types): array { if (in_array('php', $types)) { $types[] = 'ai'; } return (new self($types))->get(); } /** * @param array<string> $types */ public function __construct(protected array $types) { } /** @return array<HasSolutionsForThrowable> */ public function get(): array { $providers = []; foreach ($this->types as $type) { $providers = array_merge($providers, $this->getProviderClassesForType($type)); } return $providers; } /** @return array<HasSolutionsForThrowable> */ protected function getProviderClassesForType(string $type): array { $relativePath = $this->config[$type] ?? null; if (! $relativePath) { return []; } $namespace = $this->getNamespaceForPath($relativePath); $globPattern = __DIR__ . '/' . $relativePath . '/*.php'; $files = glob($globPattern); if (! $files) { return []; } $solutionProviders = array_map(function (string $solutionProviderFilePath) use ($namespace) { $fileName = pathinfo($solutionProviderFilePath, PATHINFO_FILENAME); $fqcn = $namespace . '\\' . $fileName; $validClass = in_array(HasSolutionsForThrowable::class, class_implements($fqcn) ?: []); return $validClass ? $fqcn : null; }, $files); return array_values(array_filter($solutionProviders)); } protected function getNamespaceForPath(string $relativePath): string { $namespacePath = str_replace('/', '\\', $relativePath); $namespace = 'Spatie\\ErrorSolutions\\' . $namespacePath; return $namespace; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 4 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Contracts
DIR
-
drwxrwxrwx
2025-05-16 16:14:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SolutionProviders
DIR
-
drwxrwxrwx
2025-05-16 16:14:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Solutions
DIR
-
drwxrwxrwx
2025-05-16 16:14:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Support
DIR
-
drwxrwxrwx
2025-05-16 16:14:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DiscoverSolutionProviders.php
2.20 KB
lrw-rw-rw-
2025-02-14 12:29:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SolutionProviderRepository.php
3.65 KB
lrw-rw-rw-
2025-02-14 12:29:50
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).