d48cda4081
CI / Test (ubuntu-latest, Node 18.x, bun) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, npm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, pnpm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, yarn) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 20.x, bun) (push) Failing after 17m13s
CI / Test (ubuntu-latest, Node 20.x, npm) (push) Failing after 18m42s
CI / Test (ubuntu-latest, Node 20.x, pnpm) (push) Failing after 15m0s
CI / Test (ubuntu-latest, Node 20.x, yarn) (push) Failing after 49m44s
CI / Test (ubuntu-latest, Node 22.x, bun) (push) Failing after 51m55s
CI / Test (ubuntu-latest, Node 22.x, pnpm) (push) Failing after 21m57s
CI / Test (ubuntu-latest, Node 22.x, npm) (push) Failing after 37m39s
CI / Test (ubuntu-latest, Node 22.x, yarn) (push) Failing after 34m7s
CI / Validate Components (push) Failing after 37m15s
CI / Python Tests (push) Failing after 10m1s
CI / Security Scan (push) Failing after 10m1s
CI / Lint (push) Failing after 17m12s
CI / Coverage (push) Failing after 20m19s
CI / Test (macos-latest, Node 18.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, yarn) (push) Has been cancelled
34 lines
1.7 KiB
Markdown
34 lines
1.7 KiB
Markdown
---
|
|
paths:
|
|
- "**/*.php"
|
|
- "**/composer.json"
|
|
---
|
|
# PHP パターン
|
|
|
|
> このファイルは [common/patterns.md](../common/patterns.md) を PHP 固有のコンテンツで拡張します。
|
|
|
|
## 薄いコントローラ、明示的なサービス
|
|
|
|
- コントローラはトランスポートに集中する: 認証、バリデーション、シリアライゼーション、ステータスコード。
|
|
- ビジネスルールは HTTP ブートストラップなしでテストしやすいアプリケーション/ドメインサービスに移動する。
|
|
|
|
## DTO と値オブジェクト
|
|
|
|
- 形状の重い連想配列をリクエスト、コマンド、外部 API ペイロード用の DTO に置き換える。
|
|
- 金額、識別子、日付範囲、その他の制約のある概念には値オブジェクトを使用する。
|
|
|
|
## 依存性注入
|
|
|
|
- フレームワークのグローバルではなく、インターフェースまたは狭いサービス契約に依存する。
|
|
- サービスロケータ検索なしでテスト可能になるよう、コンストラクタ経由で協力オブジェクトを渡す。
|
|
|
|
## 境界
|
|
|
|
- モデル層が永続化以上のことをしている場合、ORM モデルをドメイン判断から分離する。
|
|
- サードパーティ SDK を小さなアダプタでラップし、コードベースの残りが彼らの契約ではなく自身の契約に依存するようにする。
|
|
|
|
## リファレンス
|
|
|
|
スキル: `api-design` でエンドポイントの規約とレスポンス形状のガイダンスを参照してください。
|
|
スキル: `laravel-patterns` で Laravel 固有のアーキテクチャガイダンスを参照してください。
|