Skip to content

Commit

Permalink
Fix nullable syntax for factory docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
bastien-phi committed Jun 29, 2020
1 parent a5a45ff commit 766eed1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Domain/Factories/Output/FactoryDocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ private function creationMethods(): string
{
return collect([
" * @method {$this->factory->model->fqcn} createOne(\$attributes = [])",
" * @method {$this->factory->model->fqcn}|{$this->factory->model->collection->fqcn} create(\$attributes = [], ?\\Illuminate\\Database\\Eloquent\\Model \$parent = null)",
" * @method {$this->factory->model->fqcn}|{$this->factory->model->collection->fqcn} create(\$attributes = [], \\Illuminate\\Database\\Eloquent\\Model|null \$parent = null)",
" * @method {$this->factory->model->fqcn} makeOne(\$attributes = [])",
" * @method {$this->factory->model->fqcn}|{$this->factory->model->collection->fqcn} make(\$attributes = [], ?\\Illuminate\\Database\\Eloquent\\Model \$parent = null)",
" * @method {$this->factory->model->fqcn}|{$this->factory->model->collection->fqcn} make(\$attributes = [], \\Illuminate\\Database\\Eloquent\\Model|null \$parent = null)",
" * @method {$this->factory->model->fqcn} newModel(array \$attributes = [])",
])->implode(PHP_EOL);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/Factories/PostFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

/**
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post createOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection create($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection create($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post makeOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection make($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection make($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post newModel(array $attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Factories\PostFactory forUser($attributes = [])
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/Factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/**
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User createOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection create($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection create($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User makeOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection make($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection make($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User newModel(array $attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Factories\UserFactory hasPosts($count = 1, $attributes = [])
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/PostFactory.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post;

/**
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post createOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection create($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection create($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post makeOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection make($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post|\Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\PostCollection make($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Blog\Post newModel(array $attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Factories\PostFactory forUser($attributes = [])
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/UserFactory.stub
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use Soyhuce\NextIdeHelper\Tests\Fixtures\User;

/**
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User createOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection create($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection create($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User makeOne($attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection make($attributes = [], ?\Illuminate\Database\Eloquent\Model $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User|\Illuminate\Database\Eloquent\Collection make($attributes = [], \Illuminate\Database\Eloquent\Model|null $parent = null)
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\User newModel(array $attributes = [])
* @method \Soyhuce\NextIdeHelper\Tests\Fixtures\Factories\UserFactory hasPosts($count = 1, $attributes = [])
*/
Expand Down

0 comments on commit 766eed1

Please sign in to comment.