generated from pestphp/pest-plugin-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
refactor: support for violations
- Loading branch information
1 parent
dd0ecdc
commit 8e66263
Showing
8 changed files
with
74 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Pest\Arch\Exceptions; | ||
|
|
||
| use NunoMaduro\Collision\Contracts\RenderableOnCollisionEditor; | ||
| use Pest\Arch\ValueObjects\Violation; | ||
| use PHPUnit\Framework\AssertionFailedError; | ||
| use Whoops\Exception\Frame; | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| final class ArchExpectationFailedException extends AssertionFailedError implements RenderableOnCollisionEditor // @phpstan-ignore-line | ||
| { | ||
| /** | ||
| * Creates a new exception instance. | ||
| */ | ||
| public function __construct(private readonly Violation $reference, string $message) | ||
| { | ||
| parent::__construct($message); | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function toCollisionEditor(): Frame | ||
| { | ||
| return new Frame([ | ||
| 'file' => $this->reference->path, | ||
| 'line' => $this->reference->start, | ||
| ]); | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters