Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
Offset
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 create
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __toString
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 empty
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Projom\Storage\SQL\Component;
6
7use Projom\Storage\SQL\Component\ComponentInterface;
8
9class Offset implements ComponentInterface
10{
11    private readonly null|int $offset;
12
13    public function __construct(null|int $offset)
14    {
15        $this->offset = $offset;
16    }
17
18    public static function create(null|int $offset): Offset
19    {
20        return new Offset($offset);
21    }
22
23    public function __toString(): string
24    {
25        return (string) $this->offset;
26    }
27
28    public function empty(): bool
29    {
30        return $this->offset === null;
31    }
32}