Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| BulkEventResult | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| created | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace LambdaTwelve\OneRecord\Client; |
| 6 | |
| 7 | use LambdaTwelve\OneRecord\Api\Error; |
| 8 | use LambdaTwelve\OneRecord\Rdf\Iri; |
| 9 | |
| 10 | /** |
| 11 | * The outcome of posting one event to one object, whether it went through |
| 12 | * the 2.3 bulk endpoint or a per-object POST. |
| 13 | */ |
| 14 | final readonly class BulkEventResult |
| 15 | { |
| 16 | public function __construct( |
| 17 | public Iri $logisticsObject, |
| 18 | public int $status, |
| 19 | public ?Iri $event, |
| 20 | public ?Error $error, |
| 21 | ) {} |
| 22 | |
| 23 | public function created(): bool |
| 24 | { |
| 25 | return $this->status === 201; |
| 26 | } |
| 27 | } |