Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Oct 14, 2020
1 parent 614bc70 commit 2cffba9
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 6 deletions.
51 changes: 51 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.17.1@8f211792d813e4dc89f04ed372785ce93b902fd1">
<file src="src/IgnitionServiceProvider.php">
<UndefinedInterfaceMethod occurrences="7">
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/LogRecorder/LogRecorder.php">
<UndefinedInterfaceMethod occurrences="1">
<code>$this-&gt;app</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/QueryRecorder/QueryRecorder.php">
<UndefinedInterfaceMethod occurrences="3">
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
<code>$this-&gt;app</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/SolutionProviders/MissingLivewireComponentSolutionProvider.php">
<UndefinedClass occurrences="1">
<code>ComponentNotFoundException</code>
</UndefinedClass>
</file>
<file src="src/SolutionProviders/UnknownValidationSolutionProvider.php">
<UndefinedClass occurrences="1">
<code>app('validator')</code>
</UndefinedClass>
</file>
<file src="src/Solutions/LivewireDiscoverSolution.php">
<UndefinedClass occurrences="1">
<code>LivewireComponentsFinder</code>
</UndefinedClass>
</file>
<file src="src/Views/Engines/CompilerEngine.php">
<ParamNameMismatch occurrences="1">
<code>$baseException</code>
</ParamNameMismatch>
</file>
<file src="src/Views/Engines/PhpEngine.php">
<ParamNameMismatch occurrences="1">
<code>$baseException</code>
</ParamNameMismatch>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="src"/>
Expand Down
18 changes: 14 additions & 4 deletions src/SolutionProviders/MissingLivewireComponentSolutionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ class MissingLivewireComponentSolutionProvider implements HasSolutionsForThrowab
{
public function canSolve(Throwable $throwable): bool
{
if (! class_exists(ComponentNotFoundException::class)) {
return false;
}
if (! class_exists(LivewireComponentsFinder::class)) {
if (! $this->livewireIsInstalled()) {
return false;
}

if (! $throwable instanceof ComponentNotFoundException) {
return false;
}
Expand All @@ -30,4 +28,16 @@ public function getSolutions(Throwable $throwable): array
{
return [new LivewireDiscoverSolution('A livewire component was not found')];
}

public function livewireIsInstalled(): bool
{
if (! class_exists(ComponentNotFoundException::class)) {
return false;
}
if (! class_exists(LivewireComponentsFinder::class)) {
return false;
}

return true;
}
}
4 changes: 2 additions & 2 deletions src/Solutions/LivewireDiscoverSolution.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getSolutionTitle(): string

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

public function getDocumentationLinks(): array
Expand All @@ -38,7 +38,7 @@ public function getRunParameters(): array

public function getSolutionActionDescription(): string
{
return 'Pressing the button below will try to discover your components.';
return 'Pressing the button below will try to discover your Livewire components.';
}

public function getRunButtonText(): string
Expand Down

0 comments on commit 2cffba9

Please sign in to comment.