Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| StockIOChangeEquipService | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| change | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\StockIO\Services; |
| 4 | |
| 5 | use App\Events\ServiceProcessed; |
| 6 | use App\Models\StockIO\StockIO; |
| 7 | use App\Models\Team\Team; |
| 8 | use App\Models\User; |
| 9 | |
| 10 | readonly class StockIOChangeEquipService |
| 11 | { |
| 12 | /** |
| 13 | * @param StockIO $stockIO |
| 14 | * @param Team $team |
| 15 | * @param User $user |
| 16 | * @return void |
| 17 | */ |
| 18 | public function change(StockIO $stockIO, Team $team, User $user): void |
| 19 | { |
| 20 | $stockIO->team()->associate($team); |
| 21 | $stockIO->save(); |
| 22 | |
| 23 | ServiceProcessed::dispatch(self::class, $user); |
| 24 | } |
| 25 | } |