Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ interface UserRepository
interface UserRepository
{
#[DbQuery('user_stats', type: 'row')]
public function getStats(string $id): array; // ['total' => 10, 'active' => 5]
public function getStats(string $id): ?array; // ['total' => 10, 'active' => 5], or null when no row matches
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ Hello
- 戻り値型 `Article|null` (単一) や docblock `@return array<Article>` (複数) を見て、フレームワークが `Article` を組み立てる。
- 今回の `Article` は constructor を持つので、`FetchNewInstance` が選ばれて `PDO::FETCH_FUNC` で組み立てられる。**SELECT カラム順が constructor 引数順にそのまま渡される**。詳細は次章。
- Constructor Promotion のおかげで getter / setter は不要。`readonly` で意図せぬ変更を防ぐ。
- PHP 8.4 以降なら `final readonly class Article { ... }` と書けばさらに簡潔。
- PHP 8.2 以降なら `final readonly class Article { ... }` と書けばさらに簡潔。

---

Expand Down
Loading