Passed
Push — develop ( 2975bd...a42f8c )
by Jens
02:58
created
src/components/FormComponent.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
         if (isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) {
164 164
             $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID];
165 165
         } else {
166
-            $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string)microtime(true);
166
+            $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string) microtime(true);
167 167
             $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName]['submitted'] = false;
168 168
             $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID];
169 169
         }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      * submitting the form
150 150
      *
151 151
      * @param $postValues
152
-     * @param $storage
152
+     * @param Storage $storage
153 153
      */
154 154
     protected function postSubmit($postValues, $storage)
155 155
     {
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     }
321 321
 
322 322
     /**
323
-     * @param $form
323
+     * @param string|null $form
324 324
      */
325 325
     private function setFormParameter($form)
326 326
     {
Please login to merge, or discard this patch.
src/components/LanguageComponent.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function __construct($template, Request $request, $parameters, $matchedSitemapItem)
28 28
     {
29
-        $this->parameters = (array)$parameters;
29
+        $this->parameters = (array) $parameters;
30 30
         $this->checkParameters();
31 31
 
32 32
         $lang = substr(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : $this->defaultLanguage, 0, 2);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             unset($this->parameters['languageParameterName']);
64 64
         }
65 65
         if (isset($this->parameters['forceRedirect'])) {
66
-            $this->forceRedirect = (bool)$this->parameters['forceRedirect'];
66
+            $this->forceRedirect = (bool) $this->parameters['forceRedirect'];
67 67
             unset($this->parameters['forceRedirect']);
68 68
         }
69 69
     }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
     /**
106 106
      * Detect if the language is switched manually
107 107
      *
108
-     * @param $request
108
+     * @param Request $request
109 109
      */
110 110
     private function checkLanguageSwitch($request)
111 111
     {
Please login to merge, or discard this patch.
src/images/methods/BoxCrop.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@
 block discarded – undo
27 27
 
28 28
             // Define which ratio will be used, depending on which is the smallest side
29 29
             $ratio = min($hRatio, $wRatio);
30
-            if ($ratio > 1) $ratio = 1;
30
+            if ($ratio > 1) {
31
+                $ratio = 1;
32
+            }
31 33
 
32 34
             // Define sizes
33 35
             $this->_destWidth = floor($originalWidth * $ratio);
Please login to merge, or discard this patch.
src/images/methods/SmartCrop.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,9 @@
 block discarded – undo
37 37
 
38 38
             // Define which ratio will be used, depending on which is the biggest side
39 39
             $ratio = $wRatio < $hRatio ? $wRatio : $hRatio;
40
-            if ($ratio < 1) $ratio = 1;
40
+            if ($ratio < 1) {
41
+                $ratio = 1;
42
+            }
41 43
 
42 44
             // Calculate the destination width, height, x and y
43 45
             $this->_destWidth = $originalWidth / $ratio;
Please login to merge, or discard this patch.
src/images/methods/Watermark.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,9 @@  discard block
 block discarded – undo
63 63
          */
64 64
         protected function calculateX($imageResource)
65 65
         {
66
-            if (intval($this->_x) === $this->_x) return $this->_x;
66
+            if (intval($this->_x) === $this->_x) {
67
+                return $this->_x;
68
+            }
67 69
 
68 70
             $x = strtolower($this->_x);
69 71
 
@@ -88,7 +90,9 @@  discard block
 block discarded – undo
88 90
          */
89 91
         public function calculateY($imageResource)
90 92
         {
91
-            if (intval($this->_y) === $this->_y) return $this->_y;
93
+            if (intval($this->_y) === $this->_y) {
94
+                return $this->_y;
95
+            }
92 96
 
93 97
             $y = strtolower($this->_y);
94 98
 
@@ -125,7 +129,9 @@  discard block
 block discarded – undo
125 129
          */
126 130
         public function GetWatermark()
127 131
         {
128
-            if ($this->_watermark == null) throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark');
132
+            if ($this->_watermark == null) {
133
+                throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark');
134
+            }
129 135
             return $this->_watermark;
130 136
         }
131 137
 
Please login to merge, or discard this patch.
src/images/methods/Resize.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
          */
52 52
         public function SetPreserveAspectRatio($bool)
53 53
         {
54
-            $this->_preserveAspectRatio = (bool)$bool;
54
+            $this->_preserveAspectRatio = (bool) $bool;
55 55
             return $this;
56 56
         }
57 57
 
Please login to merge, or discard this patch.
src/cc/StringUtil.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     public static function slugify($str, $replace = array(), $delimiter = '-')
21 21
     {
22 22
         if (!empty($replace)) {
23
-            $str = str_replace((array)$replace, ' ', $str);
23
+            $str = str_replace((array) $replace, ' ', $str);
24 24
         }
25 25
 
26 26
         $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,12 +78,15 @@
 block discarded – undo
78 78
      */
79 79
     public static function humanFileSize($size, $unit = "")
80 80
     {
81
-        if ((!$unit && $size >= 1 << 30) || $unit == "GB")
82
-            return number_format($size / (1 << 30), 2) . "GB";
83
-        if ((!$unit && $size >= 1 << 20) || $unit == "MB")
84
-            return number_format($size / (1 << 20), 2) . "MB";
85
-        if ((!$unit && $size >= 1 << 10) || $unit == "KB")
86
-            return number_format($size / (1 << 10), 2) . "KB";
81
+        if ((!$unit && $size >= 1 << 30) || $unit == "GB") {
82
+                    return number_format($size / (1 << 30), 2) . "GB";
83
+        }
84
+        if ((!$unit && $size >= 1 << 20) || $unit == "MB") {
85
+                    return number_format($size / (1 << 20), 2) . "MB";
86
+        }
87
+        if ((!$unit && $size >= 1 << 10) || $unit == "KB") {
88
+                    return number_format($size / (1 << 10), 2) . "KB";
89
+        }
87 90
 
88 91
         return number_format($size) . " bytes";
89 92
     }
Please login to merge, or discard this patch.
src/storage/factories/ValuelistFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
             }
35 35
             $object_vars = get_object_vars($valuelistObject->pairs);
36 36
             ksort($object_vars);
37
-            $valuelistObject->pairs = (object)$object_vars;
37
+            $valuelistObject->pairs = (object) $object_vars;
38 38
 
39 39
             return $valuelistObject;
40 40
         } else {
Please login to merge, or discard this patch.
src/storage/Repository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
     public function save()
152 152
     {
153 153
         $host = $this;
154
-        array_map(function ($value) use ($host) {
154
+        array_map(function($value) use ($host) {
155 155
             $host->saveSubset($value);
156 156
         }, $this->fileBasedSubsets);
157 157
     }
Please login to merge, or discard this patch.