Skip to content

Commit 2cffba9

Browse files
committed
wip
1 parent 614bc70 commit 2cffba9

File tree

4 files changed

+68
-6
lines changed

4 files changed

+68
-6
lines changed

psalm-baseline.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="3.17.1@8f211792d813e4dc89f04ed372785ce93b902fd1">
3+
<file src="src/IgnitionServiceProvider.php">
4+
<UndefinedInterfaceMethod occurrences="7">
5+
<code>$this-&gt;app</code>
6+
<code>$this-&gt;app</code>
7+
<code>$this-&gt;app</code>
8+
<code>$this-&gt;app</code>
9+
<code>$this-&gt;app</code>
10+
<code>$this-&gt;app</code>
11+
<code>$this-&gt;app</code>
12+
</UndefinedInterfaceMethod>
13+
</file>
14+
<file src="src/LogRecorder/LogRecorder.php">
15+
<UndefinedInterfaceMethod occurrences="1">
16+
<code>$this-&gt;app</code>
17+
</UndefinedInterfaceMethod>
18+
</file>
19+
<file src="src/QueryRecorder/QueryRecorder.php">
20+
<UndefinedInterfaceMethod occurrences="3">
21+
<code>$this-&gt;app</code>
22+
<code>$this-&gt;app</code>
23+
<code>$this-&gt;app</code>
24+
</UndefinedInterfaceMethod>
25+
</file>
26+
<file src="src/SolutionProviders/MissingLivewireComponentSolutionProvider.php">
27+
<UndefinedClass occurrences="1">
28+
<code>ComponentNotFoundException</code>
29+
</UndefinedClass>
30+
</file>
31+
<file src="src/SolutionProviders/UnknownValidationSolutionProvider.php">
32+
<UndefinedClass occurrences="1">
33+
<code>app('validator')</code>
34+
</UndefinedClass>
35+
</file>
36+
<file src="src/Solutions/LivewireDiscoverSolution.php">
37+
<UndefinedClass occurrences="1">
38+
<code>LivewireComponentsFinder</code>
39+
</UndefinedClass>
40+
</file>
41+
<file src="src/Views/Engines/CompilerEngine.php">
42+
<ParamNameMismatch occurrences="1">
43+
<code>$baseException</code>
44+
</ParamNameMismatch>
45+
</file>
46+
<file src="src/Views/Engines/PhpEngine.php">
47+
<ParamNameMismatch occurrences="1">
48+
<code>$baseException</code>
49+
</ParamNameMismatch>
50+
</file>
51+
</files>

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
88
xmlns="https://getpsalm.org/schema/config"
99
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
10+
errorBaseline="psalm-baseline.xml"
1011
>
1112
<projectFiles>
1213
<directory name="src"/>

src/SolutionProviders/MissingLivewireComponentSolutionProvider.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ class MissingLivewireComponentSolutionProvider implements HasSolutionsForThrowab
1313
{
1414
public function canSolve(Throwable $throwable): bool
1515
{
16-
if (! class_exists(ComponentNotFoundException::class)) {
17-
return false;
18-
}
19-
if (! class_exists(LivewireComponentsFinder::class)) {
16+
if (! $this->livewireIsInstalled()) {
2017
return false;
2118
}
19+
2220
if (! $throwable instanceof ComponentNotFoundException) {
2321
return false;
2422
}
@@ -30,4 +28,16 @@ public function getSolutions(Throwable $throwable): array
3028
{
3129
return [new LivewireDiscoverSolution('A livewire component was not found')];
3230
}
31+
32+
public function livewireIsInstalled(): bool
33+
{
34+
if (! class_exists(ComponentNotFoundException::class)) {
35+
return false;
36+
}
37+
if (! class_exists(LivewireComponentsFinder::class)) {
38+
return false;
39+
}
40+
41+
return true;
42+
}
3343
}

src/Solutions/LivewireDiscoverSolution.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getSolutionTitle(): string
2121

2222
public function getSolutionDescription(): string
2323
{
24-
return 'You might have forgotten to discover your livewire components. You can discover your livewire components using `php artisan livewire:discover`.';
24+
return 'You might have forgotten to discover your Livewire components. You can discover your Livewire components using `php artisan livewire:discover`.';
2525
}
2626

2727
public function getDocumentationLinks(): array
@@ -38,7 +38,7 @@ public function getRunParameters(): array
3838

3939
public function getSolutionActionDescription(): string
4040
{
41-
return 'Pressing the button below will try to discover your components.';
41+
return 'Pressing the button below will try to discover your Livewire components.';
4242
}
4343

4444
public function getRunButtonText(): string

0 commit comments

Comments
 (0)