Skip to content

Commit

Permalink
Override HandlesTraits trait (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodevs authored Jan 3, 2025
1 parent d49ef4e commit bcc2560
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Generators/PestTestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Blueprint\Blueprint;
use Blueprint\Concerns\HandlesImports;
use Blueprint\Concerns\HandlesTraits;
use Blueprint\Contracts\Generator;
use Blueprint\Contracts\Model as BlueprintModel;
use Blueprint\Models\Column;
Expand All @@ -25,7 +26,7 @@

class PestTestGenerator extends AbstractClassGenerator implements Generator
{
use HandlesImports;
use HandlesImports, HandlesTraits;

const TESTS_VIEW = 1;

Expand All @@ -41,8 +42,6 @@ class PestTestGenerator extends AbstractClassGenerator implements Generator

protected array $types = ['controllers', 'tests'];

protected array $traits = [];

public function output(Tree $tree): array
{
$this->tree = $tree;
Expand Down Expand Up @@ -658,11 +657,6 @@ private function buildLines($lines): string
return str_pad(' ', 4) . implode(PHP_EOL . str_pad(' ', 4), $lines);
}

protected function addTrait(BlueprintModel $model, $trait): void
{
$this->traits[$model->name()][] = $trait;
}

protected function buildTraits(BlueprintModel $model): string
{
if (empty($this->traits[$model->name()])) {
Expand Down

0 comments on commit bcc2560

Please sign in to comment.