Completed
Push — develop ( 80f130...524d8a )
by Maxim
08:25
created
manager/media/browser/mcpuk/lib/class_image.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-abstract class image {
15
+abstract class image{
16 16
     const DEFAULT_JPEG_QUALITY = 75;
17 17
 
18 18
 /** Image resource or object
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
   * @param string $property
42 42
   * @return mixed */
43 43
 
44
-    final public function __get($property) {
44
+    final public function __get($property){
45 45
         return property_exists($this, $property) ? $this->$property : null;
46 46
     }
47 47
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
   * @param mixed $image
58 58
   * @param array $options */
59 59
 
60
-    public function __construct($image, array $options=array()) {
60
+    public function __construct($image, array $options = array()){
61 61
         $this->image = $this->width = $this->height = null;
62 62
         $imageDetails = $this->buildImage($image);
63 63
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
   * @param mixed $image
76 76
   * @return object */
77 77
 
78
-    final static function factory($driver, $image, array $options=array()) {
78
+    final static function factory($driver, $image, array $options = array()){
79 79
         $class = "image_$driver";
80 80
         return new $class($image, $options);
81 81
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
   * @param array $drivers
87 87
   * @return string */
88 88
 
89
-    final static function getDriver(array $drivers=array('gd')) {
89
+    final static function getDriver(array $drivers = array('gd')){
90 90
         foreach ($drivers as $driver) {
91 91
             if (!preg_match('/^[a-z0-9\_]+$/i', $driver))
92 92
                 continue;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
   * @param mixed $image
106 106
   * @return array */
107 107
 
108
-    final protected function buildImage($image) {
108
+    final protected function buildImage($image){
109 109
         $class = get_class($this);
110 110
         if ($image instanceof $class) {
111 111
             $width = $image->width;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
   * @param integer $resizedHeight
130 130
   * @return integer */
131 131
 
132
-    final public function getPropWidth($resizedHeight) {
132
+    final public function getPropWidth($resizedHeight){
133 133
         $width = round(($this->width * $resizedHeight) / $this->height);
134 134
         if (!$width) $width = 1;
135 135
         return $width;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
   * @param integer $resizedWidth
141 141
   * @return integer */
142 142
 
143
-    final public function getPropHeight($resizedWidth) {
143
+    final public function getPropHeight($resizedWidth){
144 144
         $height = round(($this->height * $resizedWidth) / $this->width);
145 145
         if (!$height) $height = 1;
146 146
         return $height;
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
   * static method should be implemented into driver classes like abstract
152 152
   * methods
153 153
   * @return bool */
154
-    static function available() { return false; }
154
+    static function available(){ return false; }
155 155
 
156 156
 /** Checks if file is an image. This static method should be implemented into
157 157
   * driver classes like abstract methods
158 158
   * @param string $file
159 159
   * @return bool */
160
-    static function checkImage($file) { return false; }
160
+    static function checkImage($file){ return false; }
161 161
 
162 162
 /** Resize image. Should return TRUE on success or FALSE on failure
163 163
   * @param integer $width
@@ -173,21 +173,21 @@  discard block
 block discarded – undo
173 173
   * @param integer $height
174 174
   * @param mixed $background
175 175
   * @return bool */
176
-    abstract public function resizeFit($width, $height, $background=false);
176
+    abstract public function resizeFit($width, $height, $background = false);
177 177
 
178 178
 /** Resize and crop the image to fit in given resolution. Returns TRUE on
179 179
   * success or FALSE on failure
180 180
   * @param mixed $src
181 181
   * @param integer $offset
182 182
   * @return bool */
183
-    abstract public function resizeCrop($width, $height, $offset=false);
183
+    abstract public function resizeCrop($width, $height, $offset = false);
184 184
 
185 185
 
186 186
 /** Rotate image
187 187
   * @param integer $angle
188 188
   * @param string $background
189 189
   * @return bool */
190
-    abstract public function rotate($angle, $background="#000000");
190
+    abstract public function rotate($angle, $background = "#000000");
191 191
 
192 192
     abstract public function flipHorizontal();
193 193
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
   * @param mixed $top
204 204
   * @param mixed $left
205 205
   * @return bool */
206
-    abstract public function watermark($file, $left=false, $top=false);
206
+    abstract public function watermark($file, $left = false, $top = false);
207 207
 
208 208
 /** Should output the image. Second parameter is used to pass some options like
209 209
   *   'file' - if is set, the output will be written to a file
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
   * @param string $type
213 213
   * @param array $options
214 214
   * @return bool */
215
-    abstract public function output($type='jpeg', array $options=array());
215
+    abstract public function output($type = 'jpeg', array $options = array());
216 216
 
217 217
 /** This method should create a blank image with selected size. Should returns
218 218
   * resource or object related to the created image, which will be passed to
Please login to merge, or discard this patch.