Completed
Branch master (a06a95)
by dan
07:18
created
FileManager.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
     /**
193 193
      * @param $fileName
194
-     * @return mixed
194
+     * @return boolean
195 195
      */
196 196
     public function fileExists($fileName)
197 197
     {
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
     /**
204 204
      * Deletes a directory and its contents or a file.
205 205
      *
206
-     * @param $target
207
-     * @return bool
206
+     * @param string $target
207
+     * @return boolean|null
208 208
      */
209 209
     public function deleteDirectory($target)
210 210
     {
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
     /**
233 233
      * @param $path
234
-     * @return bool
234
+     * @return boolean|null
235 235
      */
236 236
     public function deleteFile($path)
237 237
     {
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
     /**
390 390
      * Ensures that a string has a trailing slash or not.
391 391
      *
392
-     * @param      $path
392
+     * @param      boolean|string $path
393 393
      * @param bool $slash
394 394
      * @return string
395 395
      */
Please login to merge, or discard this patch.
ImageMaker.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
      *
116 116
      * @param       $source
117 117
      * @param       $destination
118
-     * @param array $style
118
+     * @param boolean $style
119 119
      * @param null  $cropFocusCoords
120 120
      * @return string
121 121
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
     protected function scaleImage($width, $height)
98 98
     {
99
-        $this->img->resize($width, $height, function ($constraint) {
99
+        $this->img->resize($width, $height, function($constraint) {
100 100
             $constraint->aspectRatio();
101 101
         });
102 102
     }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                         }
161 161
                     }
162 162
 
163
-                    $this->img->fit($this->styleData['width'], $this->styleData['height'], function ($constraint) {
163
+                    $this->img->fit($this->styleData['width'], $this->styleData['height'], function($constraint) {
164 164
                         $constraint->upsize();
165 165
                     });
166 166
 
Please login to merge, or discard this patch.
ResponsiveImageManager.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
      * Creates styled images for an image object.
83 83
      * Handles generation from the controller or the form.
84 84
      *
85
-     * @param $imageObject
85
+     * @param ResponsiveImageInterface $imageObject
86 86
      * @param $styleName
87
-     * @return mixed
87
+     * @return string
88 88
      */
89 89
     private function createImageDerivative($imageObject, $styleName = NULL)
90 90
     {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      *
117 117
      * @param ResponsiveImageInterface $image
118 118
      * @paran string $stylename
119
-     * @return image
119
+     * @return string
120 120
      */
121 121
     public function createStyledImages(ResponsiveImageInterface $image, $stylename = NULL)
122 122
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
             
228 228
             // Check if the file exists on the server.
229 229
             if (!$this->system->fileExists($filename)) {
230
-                $fetchFromS3 =  TRUE;
230
+                $fetchFromS3 = TRUE;
231 231
             }
232 232
             $tree = $this->system->getUploadsDirectory() . '/' . $filename;
233 233
             // If the policy was set to keep no files locally, then original should be downloaded from s3.
234 234
             if (!empty($fetchFromS3)) {
235
-                $s3key = empty($this->config['aws_s3']['directory']) ? $tree :  $this->config['aws_s3']['directory'] . '/' . $tree;
236
-                $this->system->directoryExists($directory , TRUE);
235
+                $s3key = empty($this->config['aws_s3']['directory']) ? $tree : $this->config['aws_s3']['directory'] . '/' . $tree;
236
+                $this->system->directoryExists($directory, TRUE);
237 237
                 $this->s3->fetchS3Object($path, $s3key);
238 238
             }
239 239
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         $enabled = $this->s3enabled();
267 267
         if ($enabled) {
268 268
             $aws_config = $this->config['aws_s3'];
269
-            $remoteFilePolicy = empty($aws_config['remote_file_policy']) ? 'ALL': $aws_config['remote_file_policy'];
269
+            $remoteFilePolicy = empty($aws_config['remote_file_policy']) ? 'ALL' : $aws_config['remote_file_policy'];
270 270
 
271 271
             // If AWS is enabled.
272 272
             if ($enabled) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@  discard block
 block discarded – undo
96 96
         if (!empty($styleName)) {
97 97
             // $paths = [];
98 98
             $paths = [$styleName => $paths[$styleName]];
99
-        }
100
-        else {
99
+        } else {
101 100
             unset($paths[0]);
102 101
         }
103 102
 
@@ -175,8 +174,7 @@  discard block
 block discarded – undo
175 174
         // @TODO: at yet implemented.
176 175
         if (empty($styles)) {
177 176
             // Delete all styled files.
178
-        }
179
-        else {
177
+        } else {
180 178
             // Delete files for the given style.
181 179
         }
182 180
     }
@@ -219,8 +217,7 @@  discard block
 block discarded – undo
219 217
         $fetchFromS3 = FALSE;
220 218
         if (!empty($this->images[0])) {
221 219
             return $this->images[0][0];
222
-        }
223
-        else {
220
+        } else {
224 221
             // The original file is in difference places depending on the local file policy.
225 222
             $directory = $this->system->getStorageDirectory('original');
226 223
             $path = $directory . $filename;
Please login to merge, or discard this patch.
StyleManager.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     /**
38 38
      * StyleManager constructor.
39 39
      *
40
-     * @param \ResponsiveImageBundle\FileManager $system
40
+     * @param FileManager $system
41 41
      * @param array                              $parameters
42 42
      */
43 43
     public function __construct(FileManager $system, array $parameters)
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     /**
164 164
      * Prefixes url string with the displayPathPrefix string, if the style and the config require it.
165 165
      *
166
-     * @param $url
166
+     * @param string $url
167 167
      * @param $style
168 168
      * @return string
169 169
      */
Please login to merge, or discard this patch.
Tests/Entity/TestImage.php 1 patch
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,6 +67,9 @@  discard block
 block discarded – undo
67 67
         return $this->path;
68 68
     }
69 69
 
70
+    /**
71
+     * @param string $path
72
+     */
70 73
     public function setPath($path)
71 74
     {
72 75
         $this->path = $path;
@@ -156,7 +159,6 @@  discard block
 block discarded – undo
156 159
     /**
157 160
      * Generates an <img> tag for a given style.
158 161
      *
159
-     * @param null $style
160 162
      * @return string
161 163
      */
162 164
     public function img()
Please login to merge, or discard this patch.
Uploader.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * Sanitizes and cleans up filename
68 68
      *
69 69
      * @param $str
70
-     * @return mixed
70
+     * @return string
71 71
      */
72 72
     private function createFilename($str)
73 73
     {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     /**
91 91
      * Convert MB/K/G to bytesize
92 92
      *
93
-     * @param $uploadMaxSize
93
+     * @param string $uploadMaxSize
94 94
      * @return int
95 95
      */
96 96
     public function mToBytes($uploadMaxSize)
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     /**
119 119
      * Checks to see if a file name is unique in the storage directory.
120 120
      *
121
-     * @param $name
121
+     * @param string $name
122 122
      * @return bool
123 123
      */
124 124
     private function isUniqueFilename($name)
Please login to merge, or discard this patch.
Form/ResponsiveImageType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
             ->add('title')
29 29
             ->add('alt');
30 30
 
31
-        $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
31
+        $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
32 32
             $image = $event->getData();
33 33
             $form = $event->getForm();
34 34
             // Conditionally add form elements.
Please login to merge, or discard this patch.
FocusCropDataCalculator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,9 +101,9 @@
 block discarded – undo
101 101
         $focusY2 = $this->focusCoordinates[3];
102 102
 
103 103
         if ($type == 'near') {
104
-            $point = ${'focus' . $axis . '1'} - ${'crop' . $axis . '1'};
104
+            $point = ${'focus' . $axis . '1'} -${'crop' . $axis . '1'};
105 105
         } else {
106
-            $point = ${'focus' . $axis . '2'} - ${'crop' . $axis . '1'};
106
+            $point = ${'focus' . $axis . '2'} -${'crop' . $axis . '1'};
107 107
         }
108 108
 
109 109
         return $point;
Please login to merge, or discard this patch.
DependencyInjection/Configuration.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@
 block discarded – undo
104 104
                 //     ->values(['KEEP_ALL', 'KEEP_NONE', 'KEEP_ORIGINAL'])
105 105
                 // ->end()
106 106
                 ->enumNode('remote_file_policy')
107
-                   ->defaultValue('ALL')
108
-                   ->values(['ALL', 'STYLED_ONLY'])
107
+                    ->defaultValue('ALL')
108
+                    ->values(['ALL', 'STYLED_ONLY'])
109 109
                 ->end()
110 110
                 ->scalarNode('temp_directory')
111 111
                     ->defaultValue(null)
Please login to merge, or discard this patch.