1 | <?php |
||
5 | class Image |
||
6 | { |
||
7 | /** @var string */ |
||
8 | protected $rootPath; |
||
9 | |||
10 | /** @var string */ |
||
11 | protected $name; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $path; |
||
15 | |||
16 | /** @var int */ |
||
17 | protected $width; |
||
18 | |||
19 | /** @var int */ |
||
20 | protected $height; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $type; |
||
24 | |||
25 | public function __construct(string $image, string $rootPath = '') |
||
35 | |||
36 | public function verify(): void |
||
42 | |||
43 | protected function splitNameAndPath(string $image): array |
||
49 | |||
50 | protected function extractImageInformation(): self |
||
60 | |||
61 | public function getOriginalName(): string |
||
69 | |||
70 | public function getOriginalFullPath(): string |
||
78 | |||
79 | public function getPath(): string |
||
83 | |||
84 | public function getName(): string |
||
88 | |||
89 | public function getType(): string |
||
93 | |||
94 | public function getWidth(): int |
||
98 | |||
99 | public function getHeight(): int |
||
103 | |||
104 | public function getAspectRatio(): float |
||
108 | |||
109 | public function isSmallerThan(?int $width, ?int $height): bool |
||
113 | |||
114 | public function content(): string |
||
118 | } |
||
119 |