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 | 18 | 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 | * Set the desired dpr of the image. |
||
88 | * |
||
89 | * @param mixed $dpr |
||
90 | * @return $this |
||
91 | */ |
||
92 | 3 | public function dpr($dpr = 'auto') |
|
98 | |||
99 | /** |
||
100 | * Get the string representation of all manipulations that |
||
101 | * need to be executed on the given resource. |
||
102 | * |
||
103 | * @return string|null |
||
104 | */ |
||
105 | public function getManipulations() |
||
113 | |||
114 | /** |
||
115 | * Get the key where we build the url for. |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | 14 | public function getKey() |
|
123 | } |