| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Endroid\QrCode\Label\Margin; |
| 6 |
|
| 7 |
final class Margin implements MarginInterface |
| 8 |
{ |
| 9 |
public function __construct( |
| 10 |
private readonly int $top, |
| 11 |
private readonly int $right, |
| 12 |
private readonly int $bottom, |
| 13 |
private readonly int $left |
| 14 |
) { |
| 15 |
} |
| 16 |
|
| 17 |
public function getTop(): int |
| 18 |
{ |
| 19 |
return $this->top; |
| 20 |
} |
| 21 |
|
| 22 |
public function getRight(): int |
| 23 |
{ |
| 24 |
return $this->right; |
| 25 |
} |
| 26 |
|
| 27 |
public function getBottom(): int |
| 28 |
{ |
| 29 |
return $this->bottom; |
| 30 |
} |
| 31 |
|
| 32 |
public function getLeft(): int |
| 33 |
{ |
| 34 |
return $this->left; |
| 35 |
} |
| 36 |
|
| 37 |
/** @return array<string, int> */ |
| 38 |
public function toArray(): array |
| 39 |
{ |
| 40 |
return [ |
| 41 |
'top' => $this->top, |
| 42 |
'right' => $this->right, |
| 43 |
'bottom' => $this->bottom, |
| 44 |
'left' => $this->left, |
| 45 |
]; |
| 46 |
} |
| 47 |
} |