| 1 | <?php |
||
| 5 | class Builder |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | protected $key; |
||
| 11 | /** |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $manipulations; |
||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $url; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Builder constructor. |
||
| 22 | * |
||
| 23 | * @param string $key |
||
| 24 | */ |
||
| 25 | 15 | public function __construct($key) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * Make a circle of the image with the given radius. |
||
| 32 | * |
||
| 33 | * @param string $radius |
||
| 34 | * @return $this |
||
| 35 | */ |
||
| 36 | 2 | public function circle($radius = 'max') |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Fit the image when resizing it. |
||
| 45 | * |
||
| 46 | * @param null|string $gravity |
||
| 47 | * @return $this |
||
| 48 | */ |
||
| 49 | 5 | public function fit($gravity = null) |
|
| 59 | |||
| 60 | /** |
||
| 61 | * Set the desired height of the image. |
||
| 62 | * |
||
| 63 | * @param int $height |
||
| 64 | * @return $this |
||
| 65 | */ |
||
| 66 | 3 | public function height($height) |
|
| 72 | |||
| 73 | /** |
||
| 74 | * Set the desired width of the image. |
||
| 75 | * |
||
| 76 | * @param int $width |
||
| 77 | * @return $this |
||
| 78 | */ |
||
| 79 | 6 | public function width($width) |
|
| 85 | |||
| 86 | /** |
||
| 87 | * Get the string representation of all manipulations that |
||
| 88 | * need to be executed on the given resource. |
||
| 89 | * |
||
| 90 | * @return string|null |
||
| 91 | */ |
||
| 92 | public function getManipulations() |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Get the key where we build the url for. |
||
| 103 | * |
||
| 104 | * @return string |
||
| 105 | */ |
||
| 106 | 11 | public function getKey() |
|
| 110 | } |