File manager - Edit - /home/autoph/public_html/projects/Rating-AutoHub/public/css/spatie.zip
Back
PK o%�Z��Y= = ignition/LICENSE.mdnu �[��� The MIT License (MIT) Copyright (c) Spatie <info@spatie.be> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK o%�ZJ� � � ignition/composer.jsonnu �[��� { "name": "spatie/ignition", "description": "A beautiful error page for PHP applications.", "keywords": [ "error", "page", "laravel", "flare" ], "authors": [ { "name": "Spatie", "email": "info@spatie.be", "role": "Developer" } ], "homepage": "https://flareapp.io/ignition", "license": "MIT", "require": { "php": "^8.0", "ext-json": "*", "ext-mbstring": "*", "spatie/flare-client-php": "^1.1", "symfony/console": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0" }, "require-dev": { "mockery/mockery": "^1.4", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "symfony/process": "^5.4|^6.0", "pestphp/pest": "^1.20" }, "config": { "sort-packages": true, "allow-plugins": { "phpstan/extension-installer": true, "pestphp/pest-plugin": true } }, "autoload": { "psr-4": { "Spatie\\Ignition\\": "src" } }, "autoload-dev": { "psr-4": { "Spatie\\Ignition\\Tests\\": "tests" } }, "minimum-stability": "dev", "prefer-stable": true, "scripts": { "analyse": "vendor/bin/phpstan analyse", "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", "test": "vendor/bin/pest", "test-coverage": "vendor/bin/phpunit --coverage-html coverage" }, "support": { "issues": "https://github.com/spatie/ignition/issues", "forum": "https://twitter.com/flareappio", "source": "https://github.com/spatie/ignition", "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction" }, "extra": { "branch-alias": { "dev-main": "1.4.x-dev" } } } PK o%�ZT��` ` 0 ignition/src/Solutions/SuggestImportSolution.phpnu �[��� <?php namespace Spatie\Ignition\Solutions; use Spatie\Ignition\Contracts\Solution; class SuggestImportSolution implements Solution { protected string $class; public function __construct(string $class) { $this->class = $class; } public function getSolutionTitle(): string { return 'A class import is missing'; } public function getSolutionDescription(): string { return 'You have a missing class import. Try importing this class: `'.$this->class.'`.'; } public function getDocumentationLinks(): array { return []; } } PK o%�Z�\玛 � J ignition/src/Solutions/SolutionProviders/BadMethodCallSolutionProvider.phpnu �[��� <?php namespace Spatie\Ignition\Solutions\SolutionProviders; use BadMethodCallException; use Illuminate\Support\Collection; use ReflectionClass; use ReflectionMethod; use Spatie\Ignition\Contracts\BaseSolution; use Spatie\Ignition\Contracts\HasSolutionsForThrowable; use Throwable; class BadMethodCallSolutionProvider implements HasSolutionsForThrowable { protected const REGEX = '/([a-zA-Z\\\\]+)::([a-zA-Z]+)/m'; public function canSolve(Throwable $throwable): bool { if (! $throwable instanceof BadMethodCallException) { return false; } if (is_null($this->getClassAndMethodFromExceptionMessage($throwable->getMessage()))) { return false; } return true; } public function getSolutions(Throwable $throwable): array { return [ BaseSolution::create('Bad Method Call') ->setSolutionDescription($this->getSolutionDescription($throwable)), ]; } public function getSolutionDescription(Throwable $throwable): string { if (! $this->canSolve($throwable)) { return ''; } /** @phpstan-ignore-next-line */ extract($this->getClassAndMethodFromExceptionMessage($throwable->getMessage()), EXTR_OVERWRITE); $possibleMethod = $this->findPossibleMethod($class ?? '', $method ?? ''); $class ??= 'UnknownClass'; return "Did you mean {$class}::{$possibleMethod?->name}() ?"; } /** * @param string $message * * @return null|array<string, mixed> */ protected function getClassAndMethodFromExceptionMessage(string $message): ?array { if (! preg_match(self::REGEX, $message, $matches)) { return null; } return [ 'class' => $matches[1], 'method' => $matches[2], ]; } /** * @param class-string $class * @param string $invalidMethodName * * @return \ReflectionMethod|null */ protected function findPossibleMethod(string $class, string $invalidMethodName): ?ReflectionMethod { return $this->getAvailableMethods($class) ->sortByDesc(function (ReflectionMethod $method) use ($invalidMethodName) { similar_text($invalidMethodName, $method->name, $percentage); return $percentage; })->first(); } /** * @param class-string $class * * @return \Illuminate\Support\Collection<int, ReflectionMethod> */ protected function getAvailableMethods(string $class): Collection { $class = new ReflectionClass($class); return Collection::make($class->getMethods()); } } PK o%�ZFT38 8 J ignition/src/Solutions/SolutionProviders/MergeConflictSolutionProvider.phpnu �[��� <?php namespace Spatie\Ignition\Solutions\SolutionProviders; use Illuminate\Support\Str; use ParseError; use Spatie\Ignition\Contracts\BaseSolution; use Spatie\Ignition\Contracts\HasSolutionsForThrowable; use Throwable; class MergeConflictSolutionProvider implements HasSolutionsForThrowable { public function canSolve(Throwable $throwable): bool { if (! ($throwable instanceof ParseError)) { return false; } if (! $this->hasMergeConflictExceptionMessage($throwable)) { return false; } $file = (string)file_get_contents($throwable->getFile()); if (! str_contains($file, '=======')) { return false; } if (! str_contains($file, '>>>>>>>')) { return false; } return true; } public function getSolutions(Throwable $throwable): array { $file = (string)file_get_contents($throwable->getFile()); preg_match('/\>\>\>\>\>\>\> (.*?)\n/', $file, $matches); $source = $matches[1]; $target = $this->getCurrentBranch(basename($throwable->getFile())); return [ BaseSolution::create("Merge conflict from branch '$source' into $target") ->setSolutionDescription('You have a Git merge conflict. To undo your merge do `git reset --hard HEAD`'), ]; } protected function getCurrentBranch(string $directory): string { $branch = "'".trim((string)shell_exec("cd {$directory}; git branch | grep \\* | cut -d ' ' -f2"))."'"; if ($branch === "''") { $branch = 'current branch'; } return $branch; } protected function hasMergeConflictExceptionMessage(Throwable $throwable): bool { // For PHP 7.x and below if (Str::startsWith($throwable->getMessage(), 'syntax error, unexpected \'<<\'')) { return true; } // For PHP 8+ if (Str::startsWith($throwable->getMessage(), 'syntax error, unexpected token "<<"')) { return true; } return false; } } PK o%�Z�=��� � N ignition/src/Solutions/SolutionProviders/UndefinedPropertySolutionProvider.phpnu �[��� <?php namespace Spatie\Ignition\Solutions\SolutionProviders; use ErrorException; use Illuminate\Support\Collection; use ReflectionClass; use ReflectionProperty; use Spatie\Ignition\Contracts\BaseSolution; use Spatie\Ignition\Contracts\HasSolutionsForThrowable; use Throwable; class UndefinedPropertySolutionProvider implements HasSolutionsForThrowable { protected const REGEX = '/([a-zA-Z\\\\]+)::\$([a-zA-Z]+)/m'; protected const MINIMUM_SIMILARITY = 80; public function canSolve(Throwable $throwable): bool { if (! $throwable instanceof ErrorException) { return false; } if (is_null($this->getClassAndPropertyFromExceptionMessage($throwable->getMessage()))) { return false; } if (! $this->similarPropertyExists($throwable)) { return false; } return true; } public function getSolutions(Throwable $throwable): array { return [ BaseSolution::create('Unknown Property') ->setSolutionDescription($this->getSolutionDescription($throwable)), ]; } public function getSolutionDescription(Throwable $throwable): string { if (! $this->canSolve($throwable) || ! $this->similarPropertyExists($throwable)) { return ''; } extract( /** @phpstan-ignore-next-line */ $this->getClassAndPropertyFromExceptionMessage($throwable->getMessage()), EXTR_OVERWRITE, ); $possibleProperty = $this->findPossibleProperty($class ?? '', $property ?? ''); $class = $class ?? ''; return "Did you mean {$class}::\${$possibleProperty->name} ?"; } protected function similarPropertyExists(Throwable $throwable): bool { /** @phpstan-ignore-next-line */ extract($this->getClassAndPropertyFromExceptionMessage($throwable->getMessage()), EXTR_OVERWRITE); $possibleProperty = $this->findPossibleProperty($class ?? '', $property ?? ''); return $possibleProperty !== null; } /** * @param string $message * * @return null|array<string, string> */ protected function getClassAndPropertyFromExceptionMessage(string $message): ?array { if (! preg_match(self::REGEX, $message, $matches)) { return null; } return [ 'class' => $matches[1], 'property' => $matches[2], ]; } /** * @param class-string $class * @param string $invalidPropertyName * * @return mixed */ protected function findPossibleProperty(string $class, string $invalidPropertyName): mixed { return $this->getAvailableProperties($class) ->sortByDesc(function (ReflectionProperty $property) use ($invalidPropertyName) { similar_text($invalidPropertyName, $property->name, $percentage); return $percentage; }) ->filter(function (ReflectionProperty $property) use ($invalidPropertyName) { similar_text($invalidPropertyName, $property->name, $percentage); return $percentage >= self::MINIMUM_SIMILARITY; })->first(); } /** * @param class-string $class * * @return Collection<int, ReflectionProperty> */ protected function getAvailableProperties(string $class): Collection { $class = new ReflectionClass($class); return Collection::make($class->getProperties()); } } PK o%�Z'ٮ�g g G ignition/src/Solutions/SolutionProviders/SolutionProviderRepository.phpnu �[��� <?php namespace Spatie\Ignition\Solutions\SolutionProviders; use Illuminate\Support\Collection; use Spatie\Ignition\Contracts\HasSolutionsForThrowable; use Spatie\Ignition\Contracts\ProvidesSolution; use Spatie\Ignition\Contracts\Solution; use Spatie\Ignition\Contracts\SolutionProviderRepository as SolutionProviderRepositoryContract; use Throwable; class SolutionProviderRepository implements SolutionProviderRepositoryContract { /** @var Collection<int, class-string<HasSolutionsForThrowable>|HasSolutionsForThrowable> */ protected Collection $solutionProviders; /** @param array<int, class-string<HasSolutionsForThrowable>|HasSolutionsForThrowable> $solutionProviders */ public function __construct(array $solutionProviders = []) { $this->solutionProviders = Collection::make($solutionProviders); } public function registerSolutionProvider(string|HasSolutionsForThrowable $solutionProvider): SolutionProviderRepositoryContract { $this->solutionProviders->push($solutionProvider); return $this; } public function registerSolutionProviders(array $solutionProviderClasses): SolutionProviderRepositoryContract { $this->solutionProviders = $this->solutionProviders->merge($solutionProviderClasses); return $this; } public function getSolutionsForThrowable(Throwable $throwable): array { $solutions = []; if ($throwable instanceof Solution) { $solutions[] = $throwable; } if ($throwable instanceof ProvidesSolution) { $solutions[] = $throwable->getSolution(); } $providedSolutions = $this ->initialiseSolutionProviderRepositories() ->filter(function (HasSolutionsForThrowable $solutionProvider) use ($throwable) { try { return $solutionProvider->canSolve($throwable); } catch (Throwable $exception) { return false; } }) ->map(function (HasSolutionsForThrowable $solutionProvider) use ($throwable) { try { return $solutionProvider->getSolutions($throwable); } catch (Throwable $exception) { return []; } }) ->flatten() ->toArray(); return array_merge($solutions, $providedSolutions); } public function getSolutionForClass(string $solutionClass): ?Solution { if (! class_exists($solutionClass)) { return null; } if (! in_array(Solution::class, class_implements($solutionClass) ?: [])) { return null; } if (! function_exists('app')) { return null; } return app($solutionClass); } /** @return Collection<int, HasSolutionsForThrowable> */ protected function initialiseSolutionProviderRepositories(): Collection { return $this->solutionProviders ->filter(fn (HasSolutionsForThrowable|string $provider) => in_array(HasSolutionsForThrowable::class, class_implements($provider) ?: [])) ->map(function (string|HasSolutionsForThrowable $provider): HasSolutionsForThrowable { if (is_string($provider)) { return new $provider; } return $provider; }); } } PK p%�Z��Ɨ3 3 . ignition/src/Solutions/SolutionTransformer.phpnu �[��� <?php namespace Spatie\Ignition\Solutions; use Illuminate\Contracts\Support\Arrayable; use Spatie\Ignition\Contracts\Solution; /** @implements Arrayable<string, array<string,string>|string|false> */ class SolutionTransformer implements Arrayable { protected Solution $solution; public function __construct(Solution $solution) { $this->solution = $solution; } /** @return array<string, array<string,string>|string|false> */ public function toArray(): array { return [ 'class' => get_class($this->solution), 'title' => $this->solution->getSolutionTitle(), 'links' => $this->solution->getDocumentationLinks(), 'description' => $this->solution->getSolutionDescription(), 'is_runnable' => false, ]; } } PK p%�Z�˱�~ ~ = ignition/src/Solutions/SuggestCorrectVariableNameSolution.phpnu �[��� <?php namespace Spatie\Ignition\Solutions; use Spatie\Ignition\Contracts\Solution; class SuggestCorrectVariableNameSolution implements Solution { protected ?string $variableName; protected ?string $viewFile; protected ?string $suggested; public function __construct(string $variableName = null, string $viewFile = null, string $suggested = null) { $this->variableName = $variableName; $this->viewFile = $viewFile; $this->suggested = $suggested; } public function getSolutionTitle(): string { return 'Possible typo $'.$this->variableName; } public function getDocumentationLinks(): array { return []; } public function getSolutionDescription(): string { return "Did you mean `$$this->suggested`?"; } public function isRunnable(): bool { return false; } } PK p%�Z=��" # ignition/src/Contracts/Solution.phpnu �[��� <?php namespace Spatie\Ignition\Contracts; interface Solution { public function getSolutionTitle(): string; public function getSolutionDescription(): string; /** @return array<string, string> */ public function getDocumentationLinks(): array; } PK p%�Z`�on n '