| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
namespace Carbon\Exceptions; |
| 15 |
|
| 16 |
use Throwable; |
| 17 |
|
| 18 |
class BadComparisonUnitException extends UnitException |
| 19 |
{ |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
protected $unit; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
public function __construct($unit, $code = 0, ?Throwable $previous = null) |
| 35 |
{ |
| 36 |
$this->unit = $unit; |
| 37 |
|
| 38 |
parent::__construct("Bad comparison unit: '$unit'", $code, $previous); |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
public function getUnit(): string |
| 47 |
{ |
| 48 |
return $this->unit; |
| 49 |
} |
| 50 |
} |