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 | /** @var string */ |
||
26 | protected $outputFormat = null; |
||
27 | |||
28 | public function __construct(string $image, string $rootPath = '') |
||
38 | |||
39 | public function verify(): void |
||
45 | |||
46 | protected function splitNameAndPath(string $image): array |
||
52 | |||
53 | protected function extractImageInformation(): self |
||
63 | |||
64 | public function getOriginalName(): string |
||
72 | |||
73 | public function getOriginalFullPath(): string |
||
81 | |||
82 | public function getPath(): string |
||
86 | |||
87 | public function getName(): string |
||
91 | |||
92 | public function getType(): string |
||
96 | |||
97 | public function getWidth(): int |
||
101 | |||
102 | public function getHeight(): int |
||
106 | |||
107 | public function getAspectRatio(): float |
||
111 | |||
112 | public function getOutputFormat(): string |
||
116 | |||
117 | public function setOutputFormat(string $outputFormat): self |
||
129 | |||
130 | public function isSmallerThan(?int $width, ?int $height): bool |
||
134 | |||
135 | public function content(): string |
||
139 | } |
||
140 |