Skip to content

Commit

Permalink
Streamline Livewire solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Nov 25, 2021
1 parent 28d12b4 commit 44ba8d1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Solutions/SuggestLivewireMethodNameSolution.php
Expand Up @@ -24,7 +24,7 @@ public function __construct($methodName = null, $componentClass = null, $suggest

public function getSolutionTitle(): string
{
return "Possible typo `{$this->componentClass}::{$this->methodName}`";
return "Possible typo `{$this->componentClass}::{$this->methodName}()`";
}

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

public function getSolutionDescription(): string
{
return "Did you mean `{$this->componentClass}::{$this->suggested}`?";
return "Did you mean `{$this->suggested}()`?";
}

public function isRunnable(): bool
Expand Down
2 changes: 1 addition & 1 deletion src/Solutions/SuggestLivewirePropertyNameSolution.php
Expand Up @@ -24,7 +24,7 @@ public function __construct($variableName = null, $componentClass = null, $sugge

public function getSolutionTitle(): string
{
return "Possible typo {$this->variableName}";
return "Possible typo {$this->componentClass}::{$this->variableName}";
}

public function getDocumentationLinks(): array
Expand Down
Expand Up @@ -22,7 +22,7 @@ public function it_can_solve_an_unknown_livewire_method()

$this->assertTrue($canSolve);

$this->assertSame('Possible typo `Facade\Ignition\Tests\stubs\Components\TestLivewireComponent::chnge`', $solution->getSolutionTitle());
$this->assertSame('Did you mean `Facade\Ignition\Tests\stubs\Components\TestLivewireComponent::change`?', $solution->getSolutionDescription());
$this->assertSame('Possible typo `Facade\Ignition\Tests\stubs\Components\TestLivewireComponent::chnge()`', $solution->getSolutionTitle());
$this->assertSame('Did you mean `change()`?', $solution->getSolutionDescription());
}
}
Expand Up @@ -22,10 +22,10 @@ public function it_can_solve_an_unknown_livewire_property()

$this->assertTrue($canSolve);

$this->assertSame('Possible typo $strng', $firstSolution->getSolutionTitle());
$this->assertSame('Possible typo Facade\Ignition\Tests\stubs\Components\TestLivewireComponent::$strng', $firstSolution->getSolutionTitle());
$this->assertSame('Did you mean `$string`?', $firstSolution->getSolutionDescription());

$this->assertSame('Possible typo $strng', $secondSolution->getSolutionTitle());
$this->assertSame('Possible typo Facade\Ignition\Tests\stubs\Components\TestLivewireComponent::$strng', $secondSolution->getSolutionTitle());
$this->assertSame('Did you mean `$stringable`?', $secondSolution->getSolutionDescription());
}

Expand All @@ -41,7 +41,7 @@ public function it_can_solve_an_unknown_livewire_computed_property()

$this->assertTrue($canSolve);

$this->assertSame('Possible typo $compted', $solution->getSolutionTitle());
$this->assertSame('Possible typo Facade\Ignition\Tests\stubs\Components\TestLivewireComponent::$compted', $solution->getSolutionTitle());
$this->assertSame('Did you mean `$computed`?', $solution->getSolutionDescription());
}
}

0 comments on commit 44ba8d1

Please sign in to comment.