Skip to content

Commit

Permalink
Merge pull request #671 from spatie/solutions-refactor
Browse files Browse the repository at this point in the history
Solutions refactor
  • Loading branch information
rubenvanassche authored Jun 12, 2024
2 parents 68ec0d3 + d0f5a1d commit e3a68e1
Show file tree
Hide file tree
Showing 24 changed files with 11 additions and 1,109 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"php": "^8.0",
"ext-json": "*",
"ext-mbstring": "*",
"spatie/backtrace": "^1.5.3",
"spatie/flare-client-php": "^1.4.0",
"spatie/flare-client-php": "^1.7",
"symfony/console": "^5.4|^6.0|^7.0",
"symfony/var-dumper": "^5.4|^6.0|^7.0"
"symfony/var-dumper": "^5.4|^6.0|^7.0",
"spatie/error-solutions": "^1.0"
},
"require-dev" : {
"illuminate/cache" : "^9.52|^10.0|^11.0",
Expand Down
45 changes: 0 additions & 45 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^PHPDoc tag @param for parameter \\$solutionProvider with type class\\-string\\<Spatie\\\\Ignition\\\\Contracts\\\\HasSolutionsForThrowable\\>\\|Spatie\\\\Ignition\\\\Contracts\\\\HasSolutionsForThrowable is not subtype of native type string\\.$#"
count: 1
path: src/Contracts/SolutionProviderRepository.php

-
message: "#^Method Spatie\\\\Ignition\\\\ErrorPage\\\\Renderer\\:\\:renderAsString\\(\\) has parameter \\$date with no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -24,43 +19,3 @@ parameters:
message: "#^Parameter \\#1 \\$callback of function set_exception_handler expects \\(callable\\(Throwable\\)\\: void\\)\\|null, array\\{\\$this\\(Spatie\\\\Ignition\\\\Ignition\\), 'handleException'\\} given\\.$#"
count: 1
path: src/Ignition.php

-
message: "#^Method Spatie\\\\Ignition\\\\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\\\\Ignition\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse constructor expects string, string\\|null given\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php

-
message: "#^Parameter \\$line of class Spatie\\\\Ignition\\\\Solutions\\\\OpenAi\\\\OpenAiPromptViewModel constructor expects string, int given\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php

-
message: "#^Property Spatie\\\\Ignition\\\\Solutions\\\\OpenAi\\\\OpenAiSolution\\:\\:\\$openAiSolutionResponse \\(Spatie\\\\Ignition\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse\\) does not accept Spatie\\\\Ignition\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse\\|null\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolution.php

-
message: "#^Method Spatie\\\\Ignition\\\\Solutions\\\\OpenAi\\\\OpenAiSolutionResponse\\:\\:links\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Solutions/OpenAi/OpenAiSolutionResponse.php
65 changes: 0 additions & 65 deletions src/Contracts/BaseSolution.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Contracts/HasSolutionsForThrowable.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/Contracts/ProvidesSolution.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Contracts/RunnableSolution.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Contracts/Solution.php

This file was deleted.

36 changes: 0 additions & 36 deletions src/Contracts/SolutionProviderRepository.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/ErrorPage/ErrorPageViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Spatie\Ignition\ErrorPage;

use Spatie\ErrorSolutions\Contracts\Solution;
use Spatie\ErrorSolutions\Solutions\SolutionTransformer;
use Spatie\FlareClient\Report;
use Spatie\FlareClient\Truncation\ReportTrimmer;
use Spatie\Ignition\Config\IgnitionConfig;
use Spatie\Ignition\Contracts\Solution;
use Spatie\Ignition\Solutions\SolutionTransformer;
use Throwable;

class ErrorPageViewModel
Expand Down
12 changes: 6 additions & 6 deletions src/Ignition.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

use ArrayObject;
use ErrorException;
use Spatie\ErrorSolutions\Contracts\HasSolutionsForThrowable;
use Spatie\ErrorSolutions\Contracts\SolutionProviderRepository as SolutionProviderRepositoryContract;
use Spatie\ErrorSolutions\SolutionProviderRepository;
use Spatie\ErrorSolutions\SolutionProviders\BadMethodCallSolutionProvider;
use Spatie\ErrorSolutions\SolutionProviders\MergeConflictSolutionProvider;
use Spatie\ErrorSolutions\SolutionProviders\UndefinedPropertySolutionProvider;
use Spatie\FlareClient\Context\BaseContextProviderDetector;
use Spatie\FlareClient\Context\ContextProviderDetector;
use Spatie\FlareClient\Enums\MessageLevels;
Expand All @@ -13,14 +19,8 @@
use Spatie\FlareClient\FlareMiddleware\FlareMiddleware;
use Spatie\FlareClient\Report;
use Spatie\Ignition\Config\IgnitionConfig;
use Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use Spatie\Ignition\Contracts\SolutionProviderRepository as SolutionProviderRepositoryContract;
use Spatie\Ignition\ErrorPage\ErrorPageViewModel;
use Spatie\Ignition\ErrorPage\Renderer;
use Spatie\Ignition\Solutions\SolutionProviders\BadMethodCallSolutionProvider;
use Spatie\Ignition\Solutions\SolutionProviders\MergeConflictSolutionProvider;
use Spatie\Ignition\Solutions\SolutionProviders\SolutionProviderRepository;
use Spatie\Ignition\Solutions\SolutionProviders\UndefinedPropertySolutionProvider;
use Throwable;

class Ignition
Expand Down
48 changes: 0 additions & 48 deletions src/Solutions/OpenAi/DummyCache.php

This file was deleted.

46 changes: 0 additions & 46 deletions src/Solutions/OpenAi/OpenAiPromptViewModel.php

This file was deleted.

Loading

0 comments on commit e3a68e1

Please sign in to comment.