This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -62,16 +62,17 @@ A `Spatie\Backtrace\Frame` has these properties:
- `arguments`: the arguments used for this frame. Will be `null` if `withArguments` was not used.
- `class`: the class name for this frame. Will be `null` if the frame concerns a function.
- `method`: the method used in this frame
- `object`: the object when the frame is in an object context (method call, closure bound to object, arrow function which captured `$this`, etc.). Will be `null` if `withObject` was not used.
- `applicationFrame`: contains `true` is this frame belongs to your application, and `false` if it belongs to a file in
the vendor directory
### Collecting arguments
### Collecting arguments and objects
For performance reasons, the frames of the back trace will not contain the arguments of the called functions. If you
want to add those use the `withArguments` method.
For performance reasons, the frames of the back trace will not contain the arguments of the called functions and the
object. If you want to add those, use the `withArguments` and `withObject` methods.
```php
$backtrace = Spatie\Backtrace\Backtrace::create()->withArguments();
$backtrace = Spatie\Backtrace\Backtrace::create()->withArguments()->withObject();
```
#### Reducing arguments
@@ -123,6 +124,13 @@ frame is an application frame, or a vendor frame. Here's an example using a Lara
```php
$backtrace = Spatie\Backtrace\Backtrace::create()->applicationPath(base_path());
```
### Removing the application path from the file name
You can use `trimFilePaths` to remove the base path of your app from the file. This will only work if you use it in conjunction with the `applicationPath` method re above. Here's an example using a Laravel specific function. This will ensure the Frame has the trimmedFilePath property set.
```php
$backtrace = Backtrace::create()->applicationPath(base_path())->trimFilePaths());
```
### Getting a certain part of a trace
@@ -168,7 +176,10 @@ Here's how you can get a backtrace for a throwable.
$frames = Spatie\Backtrace\Backtrace::createForThrowable($throwable)
```
Because we will use the backtrace that is already available the throwable, the frames will always contain the arguments used.
Because we will use the backtrace that is already available in the throwable, the frames will contain the arguments used
in the backtrace as long as the `zend.exception_ignore_args` INI option is disabled (set to `0`) *before* the throwable
is thrown. On the other hand, objects will never be included in the backtrace.
[More information](https://www.php.net/manual/en/throwable.gettrace.php#129087).
## Testing

View File

@@ -1,12 +1,11 @@
{
"name": "spatie/backtrace",
"description": "A better backtrace",
"license": "MIT",
"keywords": [
"spatie",
"backtrace"
],
"homepage": "https://github.com/spatie/backtrace",
"license": "MIT",
"authors": [
{
"name": "Freek Van de Herten",
@@ -15,15 +14,29 @@
"role": "Developer"
}
],
"homepage": "https://github.com/spatie/backtrace",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/spatie"
},
{
"type": "other",
"url": "https://spatie.be/open-source/support-us"
}
],
"require": {
"php": "^7.3|^8.0"
"php": "^7.3 || ^8.0"
},
"require-dev": {
"ext-json": "*",
"phpunit/phpunit": "^9.3",
"spatie/phpunit-snapshot-assertions": "^4.2",
"symfony/var-dumper": "^5.1"
"laravel/serializable-closure": "^1.3 || ^2.0",
"phpunit/phpunit": "^9.3 || ^11.4.3",
"spatie/phpunit-snapshot-assertions": "^4.2 || ^5.1.6",
"symfony/var-dumper": "^5.1 || ^6.0 || ^7.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Spatie\\Backtrace\\": "src"
@@ -34,25 +47,13 @@
"Spatie\\Backtrace\\Tests\\": "tests"
}
},
"scripts": {
"psalm": "vendor/bin/psalm",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/spatie"
},
{
"type": "other",
"url": "https://spatie.be/open-source/support-us"
}
]
"scripts": {
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"psalm": "vendor/bin/psalm",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
}
}

View File

@@ -10,7 +10,7 @@ class MinimalArrayArgumentReducer implements ArgumentReducer
{
public function execute($argument): ReducedArgumentContract
{
if(! is_array($argument)) {
if (! is_array($argument)) {
return UnReducedArgument::create();
}

View File

@@ -11,7 +11,7 @@ class SymphonyRequestArgumentReducer implements ArgumentReducer
{
public function execute($argument): ReducedArgumentContract
{
if(! $argument instanceof Request) {
if (! $argument instanceof Request) {
return UnReducedArgument::create();
}

View File

@@ -3,6 +3,7 @@
namespace Spatie\Backtrace;
use Closure;
use Laravel\SerializableClosure\Support\ClosureStream;
use Spatie\Backtrace\Arguments\ArgumentReducers;
use Spatie\Backtrace\Arguments\ReduceArgumentsAction;
use Spatie\Backtrace\Arguments\Reducers\ArgumentReducer;
@@ -22,6 +23,9 @@ class Backtrace
/** @var bool */
protected $withObject = false;
/** @var bool */
protected $trimFilePaths = false;
/** @var string|null */
protected $applicationPath;
@@ -76,9 +80,9 @@ class Backtrace
return $this;
}
public function withObject(): self
public function withObject(bool $withObject = true): self
{
$this->withObject = true;
$this->withObject = $withObject;
return $this;
}
@@ -90,6 +94,13 @@ class Backtrace
return $this;
}
public function trimFilePaths(): self
{
$this->trimFilePaths = true;
return $this;
}
public function offset(int $offset): self
{
$this->offset = $offset;
@@ -138,13 +149,16 @@ class Backtrace
return $this->throwable->getTrace();
}
$options = null;
// Omit arguments and object
$options = DEBUG_BACKTRACE_IGNORE_ARGS;
if (! $this->withArguments) {
$options = $options | DEBUG_BACKTRACE_IGNORE_ARGS;
// Populate arguments
if ($this->withArguments) {
$options = 0;
}
if ($this->withObject()) {
// Populate object
if ($this->withObject) {
$options = $options | DEBUG_BACKTRACE_PROVIDE_OBJECT;
}
@@ -171,15 +185,34 @@ class Backtrace
$reduceArgumentsAction = new ReduceArgumentsAction($this->resolveArgumentReducers());
foreach ($rawFrames as $rawFrame) {
$frames[] = new Frame(
$textSnippet = null;
if (
class_exists(ClosureStream::class)
&& substr($currentFile, 0, strlen(ClosureStream::STREAM_PROTO)) === ClosureStream::STREAM_PROTO
) {
$textSnippet = $currentFile;
$currentFile = ClosureStream::STREAM_PROTO.'://function()';
$currentLine -= 1;
}
if ($this->trimFilePaths && $this->applicationPath) {
$trimmedFilePath = str_replace($this->applicationPath, '', $currentFile);
}
$frame = new Frame(
$currentFile,
$currentLine,
$arguments,
$rawFrame['function'] ?? null,
$rawFrame['class'] ?? null,
$this->isApplicationFrame($currentFile)
$rawFrame['object'] ?? null,
$this->isApplicationFrame($currentFile),
$textSnippet,
$trimmedFilePath ?? null,
);
$frames[] = $frame;
$arguments = $this->withArguments
? $rawFrame['args'] ?? null
: null;

View File

@@ -1,6 +1,6 @@
<?php
namespace Spatie\Backtrace;
namespace Spatie\Backtrace\CodeSnippets;
use RuntimeException;
@@ -26,27 +26,21 @@ class CodeSnippet
return $this;
}
public function get(string $fileName): array
public function get(SnippetProvider $provider): array
{
if (! file_exists($fileName)) {
return [];
}
try {
$file = new File($fileName);
[$startLineNumber, $endLineNumber] = $this->getBounds($file->numberOfLines());
[$startLineNumber, $endLineNumber] = $this->getBounds($provider->numberOfLines());
$code = [];
$line = $file->getLine($startLineNumber);
$line = $provider->getLine($startLineNumber);
$currentLineNumber = $startLineNumber;
while ($currentLineNumber <= $endLineNumber) {
$code[$currentLineNumber] = rtrim(substr($line, 0, 250));
$line = $file->getNextLine();
$line = $provider->getNextLine();
$currentLineNumber++;
}
@@ -56,9 +50,9 @@ class CodeSnippet
}
}
public function getAsString(string $fileName): string
public function getAsString(SnippetProvider $provider): string
{
$snippet = $this->get($fileName);
$snippet = $this->get($provider);
$snippetStrings = array_map(function (string $line, string $number) {
return "{$number} {$line}";

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\Backtrace;
namespace Spatie\Backtrace\CodeSnippets;
use SplFileObject;
class File
class FileSnippetProvider implements SnippetProvider
{
/** @var \SplFileObject */
protected $file;
@@ -21,7 +21,7 @@ class File
return $this->file->key() + 1;
}
public function getLine(int $lineNumber = null): string
public function getLine(?int $lineNumber = null): string
{
if (is_null($lineNumber)) {
return $this->getNextLine();

View File

@@ -0,0 +1,67 @@
<?php
namespace Spatie\Backtrace\CodeSnippets;
class LaravelSerializableClosureSnippetProvider implements SnippetProvider
{
/** @var array<string> */
protected $lines;
/** @var int */
protected $counter = 0;
public function __construct(string $snippet)
{
$this->lines = preg_split("/\r\n|\n|\r/", $snippet);
$this->cleanupLines();
}
public function numberOfLines(): int
{
return count($this->lines);
}
public function getLine(?int $lineNumber = null): string
{
if (is_null($lineNumber)) {
return $this->getNextLine();
}
$this->counter = $lineNumber - 1;
return $this->lines[$lineNumber - 1];
}
public function getNextLine(): string
{
$this->counter++;
if ($this->counter >= count($this->lines)) {
return '';
}
return $this->lines[$this->counter];
}
protected function cleanupLines(): void
{
$spacesOrTabsToRemove = PHP_INT_MAX;
for ($i = 1; $i < count($this->lines); $i++) {
if (empty($this->lines[$i])) {
continue;
}
$spacesOrTabsToRemove = min(strspn($this->lines[$i], " \t"), $spacesOrTabsToRemove);
}
if ($spacesOrTabsToRemove === PHP_INT_MAX) {
$spacesOrTabsToRemove = 0;
}
for ($i = 1; $i < count($this->lines); $i++) {
$this->lines[$i] = substr($this->lines[$i], $spacesOrTabsToRemove);
}
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Spatie\Backtrace\CodeSnippets;
class NullSnippetProvider implements SnippetProvider
{
public function numberOfLines(): int
{
return 1;
}
public function getLine(?int $lineNumber = null): string
{
return $this->getNextLine();
}
public function getNextLine(): string
{
return "File not found for code snippet";
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Spatie\Backtrace\CodeSnippets;
interface SnippetProvider
{
public function numberOfLines(): int;
public function getLine(?int $lineNumber = null): string;
public function getNextLine(): string;
}

View File

@@ -2,11 +2,20 @@
namespace Spatie\Backtrace;
use Spatie\Backtrace\CodeSnippets\CodeSnippet;
use Spatie\Backtrace\CodeSnippets\FileSnippetProvider;
use Spatie\Backtrace\CodeSnippets\LaravelSerializableClosureSnippetProvider;
use Spatie\Backtrace\CodeSnippets\NullSnippetProvider;
use Spatie\Backtrace\CodeSnippets\SnippetProvider;
class Frame
{
/** @var string */
public $file;
/** @var string|null */
public $trimmedFilePath;
/** @var int */
public $lineNumber;
@@ -22,16 +31,27 @@ class Frame
/** @var string|null */
public $class;
/** @var object|null */
public $object;
/** @var string|null */
protected $textSnippet;
public function __construct(
string $file,
int $lineNumber,
?array $arguments,
string $method = null,
string $class = null,
bool $isApplicationFrame = false
?string $method = null,
?string $class = null,
?object $object = null,
bool $isApplicationFrame = false,
?string $textSnippet = null,
?string $trimmedFilePath = null
) {
$this->file = $file;
$this->trimmedFilePath = $trimmedFilePath;
$this->lineNumber = $lineNumber;
$this->arguments = $arguments;
@@ -40,7 +60,11 @@ class Frame
$this->class = $class;
$this->object = $object;
$this->applicationFrame = $isApplicationFrame;
$this->textSnippet = $textSnippet;
}
public function getSnippet(int $lineCount): array
@@ -48,7 +72,7 @@ class Frame
return (new CodeSnippet())
->surroundingLine($this->lineNumber)
->snippetLineCount($lineCount)
->get($this->file);
->get($this->getCodeSnippetProvider());
}
public function getSnippetAsString(int $lineCount): string
@@ -56,7 +80,7 @@ class Frame
return (new CodeSnippet())
->surroundingLine($this->lineNumber)
->snippetLineCount($lineCount)
->getAsString($this->file);
->getAsString($this->getCodeSnippetProvider());
}
public function getSnippetProperties(int $lineCount): array
@@ -70,4 +94,17 @@ class Frame
];
}, array_keys($snippet));
}
protected function getCodeSnippetProvider(): SnippetProvider
{
if ($this->textSnippet) {
return new LaravelSerializableClosureSnippetProvider($this->textSnippet);
}
if (@file_exists($this->file)) {
return new FileSnippetProvider($this->file);
}
return new NullSnippetProvider();
}
}

View File

@@ -0,0 +1,35 @@
<?php
$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);

View File

@@ -0,0 +1,90 @@
# Changelog
All notable changes to `error-solutions` will be documented in this file.
## 1.1.2 - 2024-12-11
### What's Changed
* Documentation link should follow the latest major version by @mshukurlu in https://github.com/spatie/error-solutions/pull/17
* Replace implicitly nullable parameters for PHP 8.4 by @txdFabio in https://github.com/spatie/error-solutions/pull/22
### New Contributors
* @mshukurlu made their first contribution in https://github.com/spatie/error-solutions/pull/17
* @txdFabio made their first contribution in https://github.com/spatie/error-solutions/pull/22
**Full Changelog**: https://github.com/spatie/error-solutions/compare/1.1.1...1.1.2
## 1.1.1 - 2024-07-25
### What's Changed
* Fix OpenAI response text links by @Lukaaashek in https://github.com/spatie/error-solutions/pull/9
### New Contributors
* @Lukaaashek made their first contribution in https://github.com/spatie/error-solutions/pull/9
**Full Changelog**: https://github.com/spatie/error-solutions/compare/1.1.0...1.1.1
## 1.1.0 - 2024-07-22
### What's Changed
* Allow to customize OpenAI Model by @arnebr in https://github.com/spatie/error-solutions/pull/7
### New Contributors
* @arnebr made their first contribution in https://github.com/spatie/error-solutions/pull/7
**Full Changelog**: https://github.com/spatie/error-solutions/compare/1.0.5...1.1.0
## 1.0.5 - 2024-07-09
### What's Changed
* Legacy `RunnableSolution` should continue to extend legacy `Solution` by @duncanmcclean in https://github.com/spatie/error-solutions/pull/6
### New Contributors
* @duncanmcclean made their first contribution in https://github.com/spatie/error-solutions/pull/6
**Full Changelog**: https://github.com/spatie/error-solutions/compare/1.0.4...1.0.5
## 1.0.4 - 2024-06-28
**Full Changelog**: https://github.com/spatie/error-solutions/compare/1.0.3...1.0.4
## 1.0.3 - 2024-06-27
**Full Changelog**: https://github.com/spatie/error-solutions/compare/1.0.2...1.0.3
## 1.0.2 - 2024-06-26
### What's Changed
* Fix AI solutions
* Bump dependabot/fetch-metadata from 1.6.0 to 2.1.0 by @dependabot in https://github.com/spatie/error-solutions/pull/1
### New Contributors
* @dependabot made their first contribution in https://github.com/spatie/error-solutions/pull/1
**Full Changelog**: https://github.com/spatie/error-solutions/compare/0.0.1...1.0.2
## 1.0.1 - 2024-06-21
- Add the legacy string comperator
**Full Changelog**: https://github.com/spatie/error-solutions/compare/1.0.0...1.0.1
## 1.0.0 - 2024-06-12
- Initial release
**Full Changelog**: https://github.com/spatie/error-solutions/compare/0.0.1...1.0.0
## 0.0.1 - 2024-06-11
**Full Changelog**: https://github.com/spatie/error-solutions/commits/0.0.1

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Spatie <ruben@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.

57
vendor/spatie/error-solutions/README.md vendored Normal file
View File

@@ -0,0 +1,57 @@
# Error solutions
[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/error-solutions.svg?style=flat-square)](https://packagist.org/packages/spatie/error-solutions)
[![Tests](https://img.shields.io/github/actions/workflow/status/spatie/error-solutions/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/spatie/error-solutions/actions/workflows/run-tests.yml)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/error-solutions.svg?style=flat-square)](https://packagist.org/packages/spatie/error-solutions)
At Spatie we develop multiple packages handling errors and providing solutions for these errors. This package is a collection of all these solutions.
## Support us
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/error-solutions.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/error-solutions)
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
## Installation
You can install the package via composer:
```bash
composer require spatie/error-solutions
```
## Usage
We've got some excellent documentation on how to use solutions:
- [Flare](https://flareapp.io/docs/ignition/solutions/implementing-solutions)
- [Ignition](https://github.com/spatie/ignition/?tab=readme-ov-file#displaying-solutions)
## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Ruben Van Assche](https://github.com/rubenvanassche)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

View File

@@ -0,0 +1,69 @@
{
"name" : "spatie/error-solutions",
"description" : "This is my package error-solutions",
"keywords" : [
"Spatie",
"error-solutions"
],
"homepage" : "https://github.com/spatie/error-solutions",
"license" : "MIT",
"authors" : [
{
"name" : "Ruben Van Assche",
"email" : "ruben@spatie.be",
"role" : "Developer"
}
],
"require" : {
"php": "^8.0"
},
"require-dev" : {
"livewire/livewire": "^2.11|^3.5.20",
"illuminate/support": "^10.0|^11.0|^12.0",
"illuminate/broadcasting" : "^10.0|^11.0|^12.0",
"openai-php/client": "^0.10.1",
"illuminate/cache" : "^10.0|^11.0|^12.0",
"pestphp/pest" : "^2.20|^3.0",
"phpstan/phpstan" : "^2.1",
"psr/simple-cache-implementation" : "^3.0",
"psr/simple-cache" : "^3.0",
"spatie/ray" : "^1.28",
"symfony/cache" : "^5.4|^6.0|^7.0",
"symfony/process" : "^5.4|^6.0|^7.0",
"vlucas/phpdotenv" : "^5.5",
"orchestra/testbench": "8.22.3|^9.0|^10.0"
},
"autoload" : {
"psr-4" : {
"Spatie\\ErrorSolutions\\" : "src",
"Spatie\\Ignition\\" : "legacy/ignition",
"Spatie\\LaravelIgnition\\" : "legacy/laravel-ignition"
}
},
"autoload-dev" : {
"psr-4" : {
"Spatie\\ErrorSolutions\\Tests\\" : "tests"
}
},
"suggest" : {
"openai-php/client" : "Require get solutions from OpenAI",
"simple-cache-implementation" : "To cache solutions from OpenAI"
},
"scripts" : {
"analyse" : "vendor/bin/phpstan analyse",
"baseline" : "vendor/bin/phpstan analyse --generate-baseline",
"test" : "vendor/bin/pest",
"test-coverage" : "vendor/bin/pest --coverage",
"format" : "vendor/bin/pint"
},
"config" : {
"sort-packages" : true,
"allow-plugins" : {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true,
"php-http/discovery": false
}
},
"minimum-stability" : "dev",
"prefer-stable" : true
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Spatie\Ignition\Contracts;
class BaseSolution extends \Spatie\ErrorSolutions\Contracts\BaseSolution implements Solution
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Spatie\Ignition\Contracts;
interface HasSolutionsForThrowable extends \Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Spatie\Ignition\Contracts;
interface ProvidesSolution extends \Spatie\ErrorSolutions\Contracts\ProvidesSolution
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Spatie\Ignition\Contracts;
interface Solution extends \Spatie\ErrorSolutions\Contracts\Solution
{
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Spatie\Ignition\Contracts;
interface SolutionProviderRepository extends \Spatie\ErrorSolutions\Contracts\SolutionProviderRepository
{
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Spatie\Ignition\Solutions\OpenAi;
class DummyCache extends \Spatie\ErrorSolutions\Solutions\OpenAi\DummyCache
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Spatie\Ignition\Solutions\OpenAi;
class OpenAiPromptViewModel extends \Spatie\ErrorSolutions\Solutions\OpenAi\OpenAiPromptViewModel
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\Ignition\Solutions\OpenAi;
use Spatie\Ignition\Contracts\Solution;
class OpenAiSolution extends \Spatie\ErrorSolutions\Solutions\OpenAi\OpenAiSolution implements Solution
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\Ignition\Solutions\OpenAi;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class OpenAiSolutionProvider extends \Spatie\ErrorSolutions\Solutions\OpenAi\OpenAiSolutionProvider implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Spatie\Ignition\Solutions\OpenAi;
class OpenAiSolutionResponse extends \Spatie\ErrorSolutions\Solutions\OpenAi\OpenAiSolutionResponse
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\Ignition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\BadMethodCallSolutionProvider as BaseBadMethodCallSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class BadMethodCallSolutionProvider extends BaseBadMethodCallSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\Ignition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\MergeConflictSolutionProvider as BaseMergeConflictSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class MergeConflictSolutionProvider extends BaseMergeConflictSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\Ignition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviderRepository as BaseSolutionProviderRepositoryAlias;
use Spatie\Ignition\Contracts\SolutionProviderRepository as SolutionProviderRepositoryContract;
class SolutionProviderRepository extends BaseSolutionProviderRepositoryAlias implements SolutionProviderRepositoryContract
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\Ignition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\UndefinedPropertySolutionProvider as BaseUndefinedPropertySolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class UndefinedPropertySolutionProvider extends BaseUndefinedPropertySolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Spatie\Ignition\Solutions;
class SolutionTransformer extends \Spatie\ErrorSolutions\Solutions\SolutionTransformer
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\Ignition\Solutions;
use Spatie\ErrorSolutions\Solutions\SuggestCorrectVariableNameSolution as BaseSuggestCorrectVariableNameSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestCorrectVariableNameSolution extends BaseSuggestCorrectVariableNameSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\Ignition\Solutions;
use Spatie\ErrorSolutions\Solutions\SuggestImportSolution as BaseSuggestImportSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestImportSolution extends BaseSuggestImportSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\GenerateAppKeySolution as BaseGenerateAppKeySolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class GenerateAppKeySolution extends BaseGenerateAppKeySolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\LivewireDiscoverSolution as BaseLivewireDiscoverSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class LivewireDiscoverSolution extends BaseLivewireDiscoverSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\MakeViewVariableOptionalSolution as BaseMakeViewVariableOptionalSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class MakeViewVariableOptionalSolution extends BaseMakeViewVariableOptionalSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\RunMigrationsSolution as BaseRunMigrationsSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class RunMigrationsSolution extends BaseRunMigrationsSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\DefaultDbNameSolutionProvider as BaseDefaultDbNameSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class DefaultDbNameSolutionProvider extends BaseDefaultDbNameSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\GenericLaravelExceptionSolutionProvider as BaseGenericLaravelExceptionSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class GenericLaravelExceptionSolutionProvider extends BaseGenericLaravelExceptionSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\IncorrectValetDbCredentialsSolutionProvider as BaseIncorrectValetDbCredentialsSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class IncorrectValetDbCredentialsSolutionProvider extends BaseIncorrectValetDbCredentialsSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\InvalidRouteActionSolutionProvider as BaseInvalidRouteActionSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class InvalidRouteActionSolutionProvider extends BaseInvalidRouteActionSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\LazyLoadingViolationSolutionProvider as BaseLazyLoadingViolationSolutionProviderAlias;
class LazyLoadingViolationSolutionProvider extends BaseLazyLoadingViolationSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\MissingAppKeySolutionProvider as BaseMissingAppKeySolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class MissingAppKeySolutionProvider extends BaseMissingAppKeySolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\MissingColumnSolutionProvider as BaseMissingColumnSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class MissingColumnSolutionProvider extends BaseMissingColumnSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\MissingImportSolutionProvider as BaseMissingImportSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class MissingImportSolutionProvider extends BaseMissingImportSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\MissingLivewireComponentSolutionProvider as BaseMissingLivewireComponentSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class MissingLivewireComponentSolutionProvider extends BaseMissingLivewireComponentSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\MissingMixManifestSolutionProvider as BaseMissingMixManifestSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class MissingMixManifestSolutionProvider extends BaseMissingMixManifestSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\MissingViteManifestSolutionProvider as BaseMissingViteManifestSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class MissingViteManifestSolutionProvider extends BaseMissingViteManifestSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\OpenAiSolutionProvider as BaseOpenAiSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class OpenAiSolutionProvider extends BaseOpenAiSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\RouteNotDefinedSolutionProvider as BaseRouteNotDefinedSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class RouteNotDefinedSolutionProvider extends BaseRouteNotDefinedSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\RunningLaravelDuskInProductionProvider as BaseRunningLaravelDuskInProductionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class RunningLaravelDuskInProductionProvider extends BaseRunningLaravelDuskInProductionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\SailNetworkSolutionProvider as BaseSailNetworkSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class SailNetworkSolutionProvider extends BaseSailNetworkSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviderRepository as BaseSolutionProviderRepositoryAlias;
use Spatie\Ignition\Contracts\SolutionProviderRepository as SolutionProviderRepositoryContract;
class SolutionProviderRepository extends BaseSolutionProviderRepositoryAlias implements SolutionProviderRepositoryContract
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\TableNotFoundSolutionProvider as BaseTableNotFoundSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class TableNotFoundSolutionProvider extends BaseTableNotFoundSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\UndefinedLivewireMethodSolutionProvider as BaseUndefinedLivewireMethodSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class UndefinedLivewireMethodSolutionProvider extends BaseUndefinedLivewireMethodSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\UndefinedLivewirePropertySolutionProvider as BaseUndefinedLivewirePropertySolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class UndefinedLivewirePropertySolutionProvider extends BaseUndefinedLivewirePropertySolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\UndefinedViewVariableSolutionProvider as BaseUndefinedViewVariableSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class UndefinedViewVariableSolutionProvider extends BaseUndefinedViewVariableSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\UnknownMariadbCollationSolutionProvider as BaseUnknownMariadbCollationSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class UnknownMariadbCollationSolutionProvider extends BaseUnknownMariadbCollationSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\UnknownMysql8CollationSolutionProvider as BaseUnknownMysql8CollationSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class UnknownMysql8CollationSolutionProvider extends BaseUnknownMysql8CollationSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\UnknownValidationSolutionProvider as BaseUnknownValidationSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class UnknownValidationSolutionProvider extends BaseUnknownValidationSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
use Spatie\ErrorSolutions\SolutionProviders\Laravel\ViewNotFoundSolutionProvider as BaseViewNotFoundSolutionProviderAlias;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
class ViewNotFoundSolutionProvider extends BaseViewNotFoundSolutionProviderAlias implements HasSolutionsForThrowable
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\SuggestCorrectVariableNameSolution as BaseSuggestCorrectVariableNameSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestCorrectVariableNameSolution extends BaseSuggestCorrectVariableNameSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\SuggestImportSolution as BaseSuggestImportSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestImportSolution extends BaseSuggestImportSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\SuggestLivewireMethodNameSolution as BaseSuggestLivewireMethodNameSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestLivewireMethodNameSolution extends BaseSuggestLivewireMethodNameSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\SuggestLivewirePropertyNameSolution as BaseSuggestLivewirePropertyNameSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestLivewirePropertyNameSolution extends BaseSuggestLivewirePropertyNameSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\SuggestUsingCorrectDbNameSolution as BaseSuggestUsingCorrectDbNameSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestUsingCorrectDbNameSolution extends BaseSuggestUsingCorrectDbNameSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\SuggestUsingMariadbDatabaseSolution as BaseSuggestUsingMariadbDatabaseSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestUsingMariadbDatabaseSolution extends BaseSuggestUsingMariadbDatabaseSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\SuggestUsingMysql8DatabaseSolution as BaseSuggestUsingMysql8DatabaseSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class SuggestUsingMysql8DatabaseSolution extends BaseSuggestUsingMysql8DatabaseSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions;
use Spatie\ErrorSolutions\Solutions\Laravel\UseDefaultValetDbCredentialsSolution as BaseUseDefaultValetDbCredentialsSolutionAlias;
use Spatie\Ignition\Contracts\Solution;
class UseDefaultValetDbCredentialsSolution extends BaseUseDefaultValetDbCredentialsSolutionAlias implements Solution
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Support;
use Spatie\ErrorSolutions\Support\Laravel\StringComparator as BaseStringComparator;
class StringComparator extends BaseStringComparator
{
}

View File

@@ -0,0 +1,181 @@
parameters:
ignoreErrors:
-
message: "#^PHPDoc tag @param for parameter \\$solutionProvider with type class\\-string\\<Spatie\\\\ErrorSolutions\\\\Contracts\\\\HasSolutionsForThrowable\\>\\|Spatie\\\\ErrorSolutions\\\\Contracts\\\\HasSolutionsForThrowable is not subtype of native type string\\.$#"
count: 1
path: src/Contracts/SolutionProviderRepository.php
-
message: "#^Method Spatie\\\\ErrorSolutions\\\\DiscoverSolutionProviders\\:\\:getProviderClassesForType\\(\\) should return array\\<Spatie\\\\ErrorSolutions\\\\Contracts\\\\HasSolutionsForThrowable\\> but returns array\\<int, string\\>\\.$#"
count: 1
path: src/DiscoverSolutionProviders.php
-
message: "#^Unable to resolve the template type TKey in call to function collect$#"
count: 1
path: src/SolutionProviders/Laravel/InvalidRouteActionSolutionProvider.php
-
message: "#^Unable to resolve the template type TValue in call to function collect$#"
count: 1
path: src/SolutionProviders/Laravel/InvalidRouteActionSolutionProvider.php
-
message: "#^Call to method getSolutionDescription\\(\\) on an unknown class Spatie\\\\ErrorSolutions\\\\Solutions\\\\Laravel\\\\SuggestCorrectVariableNameSolution\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Call to method getSolutionTitle\\(\\) on an unknown class Spatie\\\\ErrorSolutions\\\\Solutions\\\\Laravel\\\\SuggestCorrectVariableNameSolution\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Call to method getViewData\\(\\) on an unknown class Spatie\\\\LaravelFlare\\\\Exceptions\\\\ViewException\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Call to method getViewData\\(\\) on an unknown class Spatie\\\\LaravelIgnition\\\\Exceptions\\\\ViewException\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Call to method isRunnable\\(\\) on an unknown class Spatie\\\\ErrorSolutions\\\\Solutions\\\\Laravel\\\\SuggestCorrectVariableNameSolution\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Class Spatie\\\\LaravelFlare\\\\Exceptions\\\\ViewException not found\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Class Spatie\\\\LaravelIgnition\\\\Exceptions\\\\ViewException not found\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Instantiated class Spatie\\\\ErrorSolutions\\\\Solutions\\\\Laravel\\\\SuggestCorrectVariableNameSolution not found\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Parameter \\$throwable of method Spatie\\\\ErrorSolutions\\\\SolutionProviders\\\\Laravel\\\\UndefinedViewVariableSolutionProvider\\:\\:findCorrectVariableSolutions\\(\\) has invalid type Spatie\\\\LaravelFlare\\\\Exceptions\\\\ViewException\\.$#"
count: 2
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Parameter \\$throwable of method Spatie\\\\ErrorSolutions\\\\SolutionProviders\\\\Laravel\\\\UndefinedViewVariableSolutionProvider\\:\\:findCorrectVariableSolutions\\(\\) has invalid type Spatie\\\\LaravelIgnition\\\\Exceptions\\\\ViewException\\.$#"
count: 2
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Unable to resolve the template type TKey in call to function collect$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Unable to resolve the template type TValue in call to function collect$#"
count: 1
path: src/SolutionProviders/Laravel/UndefinedViewVariableSolutionProvider.php
-
message: "#^Method Spatie\\\\ErrorSolutions\\\\SolutionProviders\\\\Laravel\\\\UnknownValidationSolutionProvider\\:\\:getAvailableMethods\\(\\) return type with generic class Illuminate\\\\Support\\\\Collection does not specify its types\\: TKey, TValue$#"
count: 1
path: src/SolutionProviders/Laravel/UnknownValidationSolutionProvider.php
-
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,ReflectionMethod\\>\\:\\:filter\\(\\) expects \\(callable\\(ReflectionMethod, int\\)\\: bool\\)\\|null, Closure\\(ReflectionMethod\\)\\: \\(0\\|1\\|false\\) given\\.$#"
count: 1
path: src/SolutionProviders/Laravel/UnknownValidationSolutionProvider.php
-
message: "#^Unable to resolve the template type TMakeKey in call to method static method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:make\\(\\)$#"
count: 1
path: src/SolutionProviders/Laravel/UnknownValidationSolutionProvider.php
-
message: "#^Unable to resolve the template type TMakeValue in call to method static method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:make\\(\\)$#"
count: 1
path: src/SolutionProviders/Laravel/UnknownValidationSolutionProvider.php
-
message: "#^Call to method getMessage\\(\\) on an unknown class Spatie\\\\Ignition\\\\Exceptions\\\\ViewException\\.$#"
count: 1
path: src/SolutionProviders/Laravel/ViewNotFoundSolutionProvider.php
-
message: "#^Call to method getMessage\\(\\) on an unknown class Spatie\\\\LaravelFlare\\\\Exceptions\\\\ViewException\\.$#"
count: 1
path: src/SolutionProviders/Laravel/ViewNotFoundSolutionProvider.php
-
message: "#^Class Spatie\\\\Ignition\\\\Exceptions\\\\ViewException not found\\.$#"
count: 1
path: src/SolutionProviders/Laravel/ViewNotFoundSolutionProvider.php
-
message: "#^Class Spatie\\\\LaravelFlare\\\\Exceptions\\\\ViewException not found\\.$#"
count: 1
path: src/SolutionProviders/Laravel/ViewNotFoundSolutionProvider.php
-
message: "#^Parameter \\#1 \\$missingView of method Spatie\\\\ErrorSolutions\\\\SolutionProviders\\\\Laravel\\\\ViewNotFoundSolutionProvider\\:\\:findRelatedView\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: src/SolutionProviders/Laravel/ViewNotFoundSolutionProvider.php
-
message: "#^Class Livewire\\\\LivewireComponentsFinder not found\\.$#"
count: 1
path: src/Solutions/Laravel/LivewireDiscoverSolution.php
-
message: "#^Method Spatie\\\\ErrorSolutions\\\\Solutions\\\\OpenAi\\\\DummyCache\\:\\:setMultiple\\(\\) has parameter \\$values with no value type specified in iterable type iterable\\.$#"
count: 1
path: src/Solutions/OpenAi/DummyCache.php
-
message: "#^Cannot call method get\\(\\) on Psr\\\\SimpleCache\\\\CacheInterface\\|null\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php
-
message: "#^Cannot call method getSnippetAsString\\(\\) on Spatie\\\\Backtrace\\\\Frame\\|null\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php
-
message: "#^Cannot call method set\\(\\) on Psr\\\\SimpleCache\\\\CacheInterface\\|null\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php
-
message: "#^Parameter \\#1 \\$rawText of class Spatie\\\\ErrorSolutions\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse constructor expects string, string\\|null given\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php
-
message: "#^Parameter \\$line of class Spatie\\\\ErrorSolutions\\\\Solutions\\\\OpenAi\\\\OpenAiPromptViewModel constructor expects string, int given\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php
-
message: "#^Property Spatie\\\\ErrorSolutions\\\\Solutions\\\\OpenAi\\\\OpenAiSolution\\:\\:\\$openAiSolutionResponse \\(Spatie\\\\ErrorSolutions\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse\\) does not accept Spatie\\\\ErrorSolutions\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse\\|null\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php
-
message: "#^Method Spatie\\\\ErrorSolutions\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse\\:\\:links\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolutionResponse.php
-
message: "#^Method Spatie\\\\ErrorSolutions\\\\Support\\\\AiPromptRenderer\\:\\:renderAsString\\(\\) should return string but returns string\\|false\\.$#"
count: 1
path: src/Support/AiPromptRenderer.php
-
message: "#^Property Spatie\\\\ErrorSolutions\\\\Support\\\\Laravel\\\\LivewireComponentParser\\:\\:\\$reflectionClass \\(ReflectionClass\\<Livewire\\\\Component\\>\\) does not accept ReflectionClass\\<object\\>\\.$#"
count: 1
path: src/Support/Laravel/LivewireComponentParser.php

View File

@@ -0,0 +1,11 @@
includes:
- phpstan-baseline.neon
parameters:
level: 8
paths:
- src
tmpDir: build/phpstan
checkMissingIterableValueType: true

View File

@@ -0,0 +1,36 @@
<?php /** @var \Spatie\Ignition\ignition\Solutions\OpenAi\OpenAiPromptViewModel $viewModel */ ?>
You are a very skilled PHP programmer.
<?php if($viewModel->applicationType()) { ?>
You are working on a <?php echo $viewModel->applicationType() ?> application.
<?php } ?>
Use the following context to find a possible fix for the exception message at the end. Limit your answer to 4 or 5 sentences. Also include a few links to documentation that might help.
Use this format in your answer, make sure links are json:
FIX
insert the possible fix here
ENDFIX
LINKS
{"title": "Title link 1", "url": "URL link 1"}
{"title": "Title link 2", "url": "URL link 2"}
ENDLINKS
---
Here comes the context and the exception message:
Line: <?php echo $viewModel->line() ?>
File:
<?php echo $viewModel->file() ?>
Snippet including line numbers:
<?php echo $viewModel->snippet() ?>
Exception class:
<?php echo $viewModel->exceptionClass() ?>
Exception message:
<?php echo $viewModel->exceptionMessage() ?>

View File

@@ -1,6 +1,6 @@
<?php
namespace Spatie\Ignition\Contracts;
namespace Spatie\ErrorSolutions\Contracts;
class BaseSolution implements Solution
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Spatie\Ignition\Contracts;
namespace Spatie\ErrorSolutions\Contracts;
use Throwable;
@@ -11,6 +11,6 @@ interface HasSolutionsForThrowable
{
public function canSolve(Throwable $throwable): bool;
/** @return array<int, \Spatie\Ignition\Contracts\Solution> */
/** @return array<int, Solution> */
public function getSolutions(Throwable $throwable): array;
}

View File

@@ -1,6 +1,6 @@
<?php
namespace Spatie\Ignition\Contracts;
namespace Spatie\ErrorSolutions\Contracts;
/**
* Interface to be used on exceptions that provide their own solution.

View File

@@ -0,0 +1,16 @@
<?php
namespace Spatie\ErrorSolutions\Contracts;
interface RunnableSolution extends Solution
{
public function getSolutionActionDescription(): string;
public function getRunButtonText(): string;
/** @param array<string, mixed> $parameters */
public function run(array $parameters = []): void;
/** @return array<string, mixed> */
public function getRunParameters(): array;
}

View File

@@ -1,6 +1,6 @@
<?php
namespace Spatie\Ignition\Contracts;
namespace Spatie\ErrorSolutions\Contracts;
interface Solution
{

View File

@@ -1,6 +1,6 @@
<?php
namespace Spatie\Ignition\Contracts;
namespace Spatie\ErrorSolutions\Contracts;
use Throwable;

View File

@@ -0,0 +1,91 @@
<?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;
}
}

View File

@@ -1,12 +1,12 @@
<?php
namespace Spatie\Ignition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions;
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 Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\ProvidesSolution;
use Spatie\ErrorSolutions\Contracts\Solution;
use Spatie\ErrorSolutions\Contracts\SolutionProviderRepository as SolutionProviderRepositoryContract;
use Throwable;
class SolutionProviderRepository implements SolutionProviderRepositoryContract
@@ -89,7 +89,17 @@ class SolutionProviderRepository implements SolutionProviderRepositoryContract
protected function initialiseSolutionProviderRepositories(): Collection
{
return $this->solutionProviders
->filter(fn (HasSolutionsForThrowable|string $provider) => in_array(HasSolutionsForThrowable::class, class_implements($provider) ?: []))
->filter(function (HasSolutionsForThrowable|string $provider) {
if (! in_array(HasSolutionsForThrowable::class, class_implements($provider) ?: [])) {
return false;
}
if (function_exists('config') && in_array($provider, config('ErrorSolutions.ignored_solution_providers', []))) {
return false;
}
return true;
})
->map(function (string|HasSolutionsForThrowable $provider): HasSolutionsForThrowable {
if (is_string($provider)) {
return new $provider;

View File

@@ -1,13 +1,13 @@
<?php
namespace Spatie\Ignition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders;
use BadMethodCallException;
use Illuminate\Support\Collection;
use ReflectionClass;
use ReflectionMethod;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Throwable;
class BadMethodCallSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Database\QueryException;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\SuggestUsingCorrectDbNameSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\Laravel\SuggestUsingCorrectDbNameSolution;
use Throwable;
class DefaultDbNameSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,11 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Broadcasting\BroadcastException;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Support\LaravelVersion;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Support\Laravel\LaravelVersion;
use Throwable;
class GenericLaravelExceptionSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Database\QueryException;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\UseDefaultValetDbCredentialsSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\Laravel\UseDefaultValetDbCredentialsSolution;
use Throwable;
class IncorrectValetDbCredentialsSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,12 +1,12 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Support\Str;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Support\Composer\ComposerClassMap;
use Spatie\LaravelIgnition\Support\StringComparator;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Support\Laravel\Composer\ComposerClassMap;
use Spatie\ErrorSolutions\Support\Laravel\StringComparator;
use Throwable;
use UnexpectedValueException;
@@ -33,6 +33,10 @@ class InvalidRouteActionSolutionProvider implements HasSolutionsForThrowable
$invalidController = $matches[1] ?? null;
if (! $invalidController) {
return [];
}
$suggestedController = $this->findRelatedController($invalidController);
if ($suggestedController === $invalidController) {

View File

@@ -1,11 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Database\LazyLoadingViolationException;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Support\LaravelVersion;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Support\Laravel\LaravelVersion;
use Throwable;
class LazyLoadingViolationSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use RuntimeException;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\GenerateAppKeySolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\Laravel\GenerateAppKeySolution;
use Throwable;
class MissingAppKeySolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Database\QueryException;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\RunMigrationsSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\Laravel\RunMigrationsSolution;
use Throwable;
class MissingColumnSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\SuggestImportSolution;
use Spatie\LaravelIgnition\Support\Composer\ComposerClassMap;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\SuggestImportSolution;
use Spatie\ErrorSolutions\Support\Laravel\Composer\ComposerClassMap;
use Throwable;
class MissingImportSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,11 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Livewire\Exceptions\ComponentNotFoundException;
use Livewire\LivewireComponentsFinder;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\LivewireDiscoverSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\Laravel\LivewireDiscoverSolution;
use Throwable;
class MissingLivewireComponentSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,11 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Support\Str;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Throwable;
class MissingMixManifestSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,19 +1,25 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Support\Str;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\Ignition\Contracts\Solution;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\Solution;
use Spatie\ErrorSolutions\Support\Laravel\LaravelVersion;
use Throwable;
class MissingViteManifestSolutionProvider implements HasSolutionsForThrowable
{
/** @var array<string, string> */
protected array $links = [
'Asset bundling with Vite' => 'https://laravel.com/docs/9.x/vite#running-vite',
];
protected array $links = [];
public function __construct()
{
$this->links = [
'Asset bundling with Vite' => 'https://laravel.com/docs/'.LaravelVersion::major().'.x/vite#running-vite',
];
}
public function canSolve(Throwable $throwable): bool
{

View File

@@ -1,11 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Support\Str;
use OpenAI\Client;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\Ignition\Solutions\OpenAi\OpenAiSolutionProvider as BaseOpenAiSolutionProvider;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\OpenAi\OpenAiSolutionProvider as BaseOpenAiSolutionProvider;
use Throwable;
class OpenAiSolutionProvider implements HasSolutionsForThrowable
@@ -16,7 +16,7 @@ class OpenAiSolutionProvider implements HasSolutionsForThrowable
return false;
}
if (config('ignition.open_ai_key') === null) {
if (config('error-solutions.open_ai_key') === null) {
return false;
}
@@ -26,11 +26,12 @@ class OpenAiSolutionProvider implements HasSolutionsForThrowable
public function getSolutions(Throwable $throwable): array
{
$solutionProvider = new BaseOpenAiSolutionProvider(
openAiKey: config('ignition.open_ai_key'),
openAiKey: config('error-solutions.open_ai_key'),
cache: cache()->store(config('cache.default')),
cacheTtlInSeconds: 60,
applicationType: 'Laravel ' . Str::before(app()->version(), '.'),
applicationPath: base_path(),
openAiModel: config('error-solutions.open_ai_model', 'gpt-3.5-turbo'),
);
return $solutionProvider->getSolutions($throwable);

View File

@@ -1,11 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Support\Facades\Route;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Support\StringComparator;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Support\Laravel\StringComparator;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Throwable;

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Exception;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Throwable;
class RunningLaravelDuskInProductionProvider implements HasSolutionsForThrowable

View File

@@ -1,9 +1,9 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Spatie\Ignition\Contracts\BaseSolution;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\BaseSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Throwable;
class SailNetworkSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,10 +1,10 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Illuminate\Database\QueryException;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\RunMigrationsSolution;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\Laravel\RunMigrationsSolution;
use Throwable;
class TableNotFoundSolutionProvider implements HasSolutionsForThrowable

View File

@@ -1,11 +1,11 @@
<?php
namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;
namespace Spatie\ErrorSolutions\SolutionProviders\Laravel;
use Livewire\Exceptions\MethodNotFoundException;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\LaravelIgnition\Solutions\SuggestLivewireMethodNameSolution;
use Spatie\LaravelIgnition\Support\LivewireComponentParser;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Solutions\Laravel\SuggestLivewireMethodNameSolution;
use Spatie\ErrorSolutions\Support\Laravel\LivewireComponentParser;
use Throwable;
class UndefinedLivewireMethodSolutionProvider implements HasSolutionsForThrowable

Some files were not shown because too many files have changed in this diff Show More