Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
StockIOFinishService
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 finish
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Domain\StockIO\Services;
4
5use App\Models\StockIO\StockIO;
6use Carbon\Carbon;
7use Domain\StockIO\Enums\StockStatusEnum;
8
9readonly class StockIOFinishService
10{
11    public function finish(StockIO $stockIO): void
12    {
13        $stockIO->setAttribute('status', StockStatusEnum::SEPARATED->value);
14        $stockIO->setAttribute('end_date', Carbon::now());
15        $stockIO->save();
16    }
17}