Skip to content

Commit 31e40d9

Browse files
committed
docs: fix php typos in factories
1 parent ebbb5b5 commit 31e40d9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/pages/services/factories.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ use Cycle\Annotated\Annotation\Column;
258258
use Cycle\Annotated\Annotation\Entity;
259259
use Cycle\Annotated\Annotation\Relation\BelongsTo;
260260
use Cycle\Annotated\Annotation\Relation\HasMany;
261+
use Ramsey\Uuid\Uuid;
261262

262263
#[Entity(repository: PostRepository::class)]
263264
class Post
@@ -284,7 +285,7 @@ class Post
284285
$this->content = $content;
285286
$this->user = $user;
286287

287-
$this->comments = new Collection()
288+
$this->comments = new Collection();
288289
}
289290

290291
public function id(): string
@@ -321,6 +322,11 @@ class Post
321322
namespace Domain\Post\Comment;
322323

323324
use Domain\User\User;
325+
use Cycle\Annotated\Annotation\Column;
326+
use Cycle\Annotated\Annotation\Entity;
327+
use Cycle\Annotated\Annotation\Relation\BelongsTo;
328+
use Domain\User\User;
329+
use Ramsey\Uuid\Uuid;
324330

325331
#[Entity(repository: CommentRepository::class)]
326332
class Comment
@@ -332,6 +338,9 @@ class Comment
332338
private string $content;
333339

334340
#[BelongsTo(target: Post::class, innerKey: 'post_id', outerKey: 'id', nullable: false)]
341+
private ?Post $post;
342+
343+
#[BelongsTo(target: User::class, innerKey: 'user_id', outerKey: 'id', nullable: false)]
335344
private ?User $user;
336345

337346
public function __construct(string $content, Post $post, ?User $user)
@@ -375,6 +384,7 @@ use Cycle\Annotated\Annotation\Entity;
375384
use Cycle\Annotated\Annotation\Relation\HasMany;
376385
use Domain\Post\Post;
377386
use Illuminate\Support\Collection;
387+
use Ramsey\Uuid\Uuid;
378388

379389
#[Entity(repository: UserRepository::class)]
380390
class User

0 commit comments

Comments
 (0)