Completed
Branch scrutinizer-score-improvements (437d31)
by dan
02:16
created
Controller/ImageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
                 $response->setExpires(date_create()->modify('+1 years'));
59 59
 
60 60
                 $response->setCallback(
61
-                    function () use ($stream) {
61
+                    function() use ($stream) {
62 62
                         if (ftell($stream['stream']) !== 0) {
63 63
                             rewind($stream['stream']);
64 64
                         }
Please login to merge, or discard this patch.
Command/GenerateImageEntityCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
             $question->setValidator(['Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateBundleName']);
155 155
             $question->setNormalizer(
156
-                function ($value) {
156
+                function($value) {
157 157
                     return $value ? trim($value) : '';
158 158
                 }
159 159
             );
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                 $input->getOption('entity_name')
177 177
             );
178 178
             $question->setValidator(
179
-                function ($answer) {
179
+                function($answer) {
180 180
                     // Should only contain letters.
181 181
                     $valid = preg_match('/^[a-zA-Z]+$/', $answer);
182 182
                     if (!$valid) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                 }
190 190
             );
191 191
             $question->setNormalizer(
192
-                function ($value) {
192
+                function($value) {
193 193
                     return $value ? trim($value) : '';
194 194
                 }
195 195
             );
@@ -269,18 +269,18 @@  discard block
 block discarded – undo
269 269
             ), 'yes'
270 270
         );
271 271
         $question->setNormalizer(
272
-            function ($value) {
272
+            function($value) {
273 273
                 return $value[0] == 'y' ? 'y' : 'n';
274 274
             }
275 275
         );
276 276
         $question->setValidator(
277
-            function ($answer) {
277
+            function($answer) {
278 278
                 // Should only contain letters.
279 279
                 $allowed = [
280 280
                     'y',
281 281
                     'n',
282 282
                 ];
283
-                $valid   = in_array($answer, $allowed);
283
+                $valid = in_array($answer, $allowed);
284 284
                 if (!$valid) {
285 285
                     throw new \RuntimeException(
286 286
                         'Only allowed values are ' . implode(', ', $allowed)
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
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
         $builder->addEventListener(
46 46
             FormEvents::PRE_SET_DATA,
47
-            function (FormEvent $event) {
47
+            function(FormEvent $event) {
48 48
                 $image = $event->getData();
49 49
                 $form  = $event->getForm();
50 50
                 // Conditionally add form elements.
Please login to merge, or discard this patch.
ImageProcessing/ImageStyler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $this->image->resize(
99 99
             $width,
100 100
             $height,
101
-            function ($constraint) {
101
+            function($constraint) {
102 102
                 $constraint->aspectRatio();
103 103
             }
104 104
         );
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                     $this->image->fit(
178 178
                         $this->styleData['width'],
179 179
                         $this->styleData['height'],
180
-                        function ($constraint) {
180
+                        function($constraint) {
181 181
                             $constraint->upsize();
182 182
                         }
183 183
                     );
Please login to merge, or discard this patch.
ImageProcessing/FocusCropDataCalculator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -161,10 +161,10 @@
 block discarded – undo
161 161
         $focusY2 = $this->focusCoordinates[3];
162 162
 
163 163
         if ($type == 'near') {
164
-            $point = ${'focus' . $axis . '1'} - ${'crop' . $axis . '1'};
164
+            $point = ${'focus' . $axis . '1'} -${'crop' . $axis . '1'};
165 165
         }
166 166
         else {
167
-            $point = ${'focus' . $axis . '2'} - ${'crop' . $axis . '1'};
167
+            $point = ${'focus' . $axis . '2'} -${'crop' . $axis . '1'};
168 168
         }
169 169
 
170 170
         return $point;
Please login to merge, or discard this patch.
ImageProcessing/CoordinateGeometry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         $size->resize(
52 52
             $scaleX,
53 53
             $scaleY,
54
-            function ($constraint) {
54
+            function($constraint) {
55 55
                 $constraint->aspectRatio();
56 56
             }
57 57
         );
Please login to merge, or discard this patch.
Tests/File/FileToObjectTest.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,21 +45,21 @@
 block discarded – undo
45 45
 
46 46
         // Mock the EntityManager to return the mock of the repository
47 47
         $entityManager = $this->getMockBuilder(EntityManager::class)
48
-                              ->disableOriginalConstructor()
49
-                              ->getMock();
48
+                                ->disableOriginalConstructor()
49
+                                ->getMock();
50 50
 
51 51
         $entityManager->expects($this->any())
52
-                      ->method('getRepository')
53
-                      ->will($this->returnValue($imageRepository));
52
+                        ->method('getRepository')
53
+                        ->will($this->returnValue($imageRepository));
54 54
 
55 55
         // The mock the ImageEntityName
56 56
         $nameResolver = $this->getMockBuilder(ImageEntityNameResolver::class)
57
-                             ->disableOriginalConstructor()
58
-                             ->getMock();
57
+                                ->disableOriginalConstructor()
58
+                                ->getMock();
59 59
 
60 60
         $nameResolver->expects($this->once())
61
-                     ->method('getClassName')
62
-                     ->will($this->returnValue('ResponsiveImage'));
61
+                        ->method('getClassName')
62
+                        ->will($this->returnValue('ResponsiveImage'));
63 63
 
64 64
         $fileToObject = new FileToObject($entityManager, $nameResolver);
65 65
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
                         ->method('findImageFromFilename')
32 32
                         ->will(
33 33
                             $this->returnCallback(
34
-                                function ($filename) {
34
+                                function($filename) {
35 35
                                     $image = new TestImage();
36 36
                                     if ($filename === $image->getPath()) {
37 37
                                         return $image;
Please login to merge, or discard this patch.
Tests/File/FilenameTransliteratorTest.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -20,29 +20,29 @@
 block discarded – undo
20 20
     {
21 21
         // Mock the repository so it returns the mock of the Image repository.
22 22
         $fileToObject = $this->getMockBuilder(FileToObject::class)
23
-                             ->disableOriginalConstructor()
24
-                             ->getMock();
23
+                                ->disableOriginalConstructor()
24
+                                ->getMock();
25 25
 
26 26
         $fileToObject->expects($this->any())
27
-                     ->method('getObjectFromFilename')
28
-                     ->will(
29
-                         $this->returnCallback(
30
-                             function ($filename) {
31
-                                 $existingFilenames = [
32
-                                     'test.jpg',
33
-                                     'test_1.jpg',
34
-                                 ];
35
-                                 if (in_array($filename, $existingFilenames)) {
36
-                                     $image = new TestImage();
37
-
38
-                                     return $image;
39
-                                 }
40
-                                 else {
41
-                                     return null;
42
-                                 }
43
-                             }
44
-                         )
45
-                     );
27
+                        ->method('getObjectFromFilename')
28
+                        ->will(
29
+                            $this->returnCallback(
30
+                                function ($filename) {
31
+                                    $existingFilenames = [
32
+                                        'test.jpg',
33
+                                        'test_1.jpg',
34
+                                    ];
35
+                                    if (in_array($filename, $existingFilenames)) {
36
+                                        $image = new TestImage();
37
+
38
+                                        return $image;
39
+                                    }
40
+                                    else {
41
+                                        return null;
42
+                                    }
43
+                                }
44
+                            )
45
+                        );
46 46
 
47 47
         $transliterator = new FilenameTransliterator($fileToObject);
48 48
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
                      ->method('getObjectFromFilename')
28 28
                      ->will(
29 29
                          $this->returnCallback(
30
-                             function ($filename) {
30
+                             function($filename) {
31 31
                                  $existingFilenames = [
32 32
                                      'test.jpg',
33 33
                                      'test_1.jpg',
Please login to merge, or discard this patch.
Tests/File/FileValidatorTest.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $uploadedFile = $this->getMockFileUpload();
29 29
         $uploadedFile->expects($this->once())
30
-                     ->method('getClientOriginalExtension')
31
-                     ->will(
32
-                         $this->returnValue('jpg')
33
-                     );
30
+                        ->method('getClientOriginalExtension')
31
+                        ->will(
32
+                            $this->returnValue('jpg')
33
+                        );
34 34
         $uploadedFile->expects($this->once())
35
-                     ->method('guessExtension')
36
-                     ->will(
37
-                         $this->returnValue('jpg')
38
-                     );
35
+                        ->method('guessExtension')
36
+                        ->will(
37
+                            $this->returnValue('jpg')
38
+                        );
39 39
 
40 40
         // Test the validator.
41 41
         $validator = new FileValidator();
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $uploadedFile = $this->getMockFileUpload();
51 51
         $uploadedFile->expects($this->once())
52
-                     ->method('getClientOriginalExtension')
53
-                     ->will(
54
-                         $this->returnValue('doc')
55
-                     );
52
+                        ->method('getClientOriginalExtension')
53
+                        ->will(
54
+                            $this->returnValue('doc')
55
+                        );
56 56
         $uploadedFile->expects($this->once())
57
-                     ->method('guessExtension')
58
-                     ->will(
59
-                         $this->returnValue('doc')
60
-                     );
57
+                        ->method('guessExtension')
58
+                        ->will(
59
+                            $this->returnValue('doc')
60
+                        );
61 61
 
62 62
         // Test the validator.
63 63
         $validator = new FileValidator();
@@ -71,15 +71,15 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $uploadedFile = $this->getMockFileUpload();
73 73
         $uploadedFile->expects($this->once())
74
-                     ->method('getClientOriginalExtension')
75
-                     ->will(
76
-                         $this->returnValue('jpg')
77
-                     );
74
+                        ->method('getClientOriginalExtension')
75
+                        ->will(
76
+                            $this->returnValue('jpg')
77
+                        );
78 78
         $uploadedFile->expects($this->once())
79
-                     ->method('guessExtension')
80
-                     ->will(
81
-                         $this->returnValue('png')
82
-                     );
79
+                        ->method('guessExtension')
80
+                        ->will(
81
+                            $this->returnValue('png')
82
+                        );
83 83
 
84 84
         // Test the validator.
85 85
         $validator = new FileValidator();
Please login to merge, or discard this patch.