✨feature: Initial MVP
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// phpcs:disable PEAR.Commenting.FileComment,PEAR.Commenting.ClassComment
|
||||
|
||||
/**
|
||||
* Project domain model.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace IronKanban\Domain;
|
||||
|
||||
/**
|
||||
* Represents a project and its metadata.
|
||||
*/
|
||||
final class Project
|
||||
{
|
||||
/**
|
||||
* Create a project instance.
|
||||
*
|
||||
* @param string $id Project identifier.
|
||||
* @param string $title Project title.
|
||||
* @param string $path Project storage path.
|
||||
* @param string $body Project description body.
|
||||
* @param array<string, mixed> $meta Additional project metadata.
|
||||
*/
|
||||
public function __construct(
|
||||
public string $id,
|
||||
public string $title,
|
||||
public string $path,
|
||||
public string $body = '',
|
||||
public array $meta = []
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the project into an API-friendly array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'path' => $this->path,
|
||||
'body' => $this->body,
|
||||
'meta' => $this->meta,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user