| 1 |
<?php |
| 2 |
|
| 3 |
namespace Spatie\ImageOptimizer; |
| 4 |
|
| 5 |
interface Optimizer |
| 6 |
{ |
| 7 |
/** |
| 8 |
* Returns the name of the binary to be executed. |
| 9 |
* |
| 10 |
* @return string |
| 11 |
*/ |
| 12 |
public function binaryName(): string; |
| 13 |
|
| 14 |
/** |
| 15 |
* Determines if the given image can be handled by the optimizer. |
| 16 |
* |
| 17 |
* @param \Spatie\ImageOptimizer\Image $image |
| 18 |
* |
| 19 |
* @return bool |
| 20 |
*/ |
| 21 |
public function canHandle(Image $image): bool; |
| 22 |
|
| 23 |
/** |
| 24 |
* Set the path to the image that should be optimized. |
| 25 |
* |
| 26 |
* @param string $imagePath |
| 27 |
* |
| 28 |
* @return $this |
| 29 |
*/ |
| 30 |
public function setImagePath(string $imagePath); |
| 31 |
|
| 32 |
/** |
| 33 |
* Set the options the optimizer should use. |
| 34 |
* |
| 35 |
* @param array $options |
| 36 |
* |
| 37 |
* @return $this |
| 38 |
*/ |
| 39 |
public function setOptions(array $options = []); |
| 40 |
|
| 41 |
/** |
| 42 |
* Get the command that should be executed. |
| 43 |
* |
| 44 |
* @return string |
| 45 |
*/ |
| 46 |
public function getCommand(): string; |
| 47 |
|
| 48 |
/** |
| 49 |
* Get the temporary file's path. |
| 50 |
* |
| 51 |
* @return null|string |
| 52 |
*/ |
| 53 |
public function getTmpPath(): ?string; |
| 54 |
} |
| 55 |
|