Passed
Push — master ( ba00c7...bfa3fc )
by Sebastian
08:42
created
src/StyleCollection/StyleBuilder/Flavors/Font/FontFamily.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
     private function addFont(string $name) : FontFamily
34 34
     {
35
-        if(!in_array($name, $this->fonts, true))
35
+        if (!in_array($name, $this->fonts, true))
36 36
         {
37 37
             $this->fonts[] = $name;
38 38
         }
Please login to merge, or discard this patch.
src/Request/AcceptHeaders.php 3 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -33,22 +33,22 @@  discard block
 block discarded – undo
33 33
         $this->parse();
34 34
     }
35 35
     
36
-   /**
37
-    * Retrieves an indexed array with accept mime types
38
-    * that the client sent, in the order of preference
39
-    * the client specified.
40
-    *
41
-    * Example:
42
-    *
43
-    * array(
44
-    *     'text/html',
45
-    *     'application/xhtml+xml',
46
-    *     'image/webp'
47
-    *     ...
48
-    * )
49
-    *
50
-    * @return string[]
51
-    */
36
+    /**
37
+     * Retrieves an indexed array with accept mime types
38
+     * that the client sent, in the order of preference
39
+     * the client specified.
40
+     *
41
+     * Example:
42
+     *
43
+     * array(
44
+     *     'text/html',
45
+     *     'application/xhtml+xml',
46
+     *     'image/webp'
47
+     *     ...
48
+     * )
49
+     *
50
+     * @return string[]
51
+     */
52 52
     public function getMimeStrings() : array
53 53
     {
54 54
         $result = array();
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
         return $result;
62 62
     }
63 63
     
64
-   /**
65
-    * Checks that an "Accept" header string exists, and tries to parse it.
66
-    */
64
+    /**
65
+     * Checks that an "Accept" header string exists, and tries to parse it.
66
+     */
67 67
     protected function parse() : void
68 68
     {
69 69
         // we may be in a CLI environment where the headers
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
         $this->headers = $this->parseHeader($_SERVER['HTTP_ACCEPT']);
76 76
     }
77 77
     
78
-   /**
79
-    * Splits the "Accept" header string and parses the mime types.
80
-    *  
81
-    * @param string $acceptHeader
82
-    * @return AcceptHeader[]
83
-    */
78
+    /**
79
+     * Splits the "Accept" header string and parses the mime types.
80
+     *  
81
+     * @param string $acceptHeader
82
+     * @return AcceptHeader[]
83
+     */
84 84
     protected function parseHeader(string $acceptHeader) : array
85 85
     {
86 86
         $tokens = preg_split('/\s*,\s*/', $acceptHeader);
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
         return $accept;
98 98
     }
99 99
     
100
-   /**
101
-    * Parses a single mime type entry.
102
-    * 
103
-    * @param int $i The position in the "Accept" string
104
-    * @param string $mime The mime type
105
-    * @return AcceptHeader
106
-    */
100
+    /**
101
+     * Parses a single mime type entry.
102
+     * 
103
+     * @param int $i The position in the "Accept" string
104
+     * @param string $mime The mime type
105
+     * @return AcceptHeader
106
+     */
107 107
     protected function parseEntry(int $i, string $mime) : AcceptHeader
108 108
     {
109 109
         $quality = 0;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $result = array();
55 55
         
56
-        foreach($this->headers as $header)
56
+        foreach ($this->headers as $header)
57 57
         {
58 58
             $result[] = $header->getMimeType();
59 59
         }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         // we may be in a CLI environment where the headers
70 70
         // are not populated.
71
-        if(!isset($_SERVER['HTTP_ACCEPT'])) {
71
+        if (!isset($_SERVER['HTTP_ACCEPT'])) {
72 72
             return;
73 73
         }
74 74
         
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         
88 88
         $accept = array();
89 89
         
90
-        foreach($tokens as $i => $term)
90
+        foreach ($tokens as $i => $term)
91 91
         {
92 92
             $accept[] = $this->parseEntry($i, $term);
93 93
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         $quality = 0;
110 110
         $params = array();
111 111
         
112
-        if(strpos($mime, ';') !== false)
112
+        if (strpos($mime, ';') !== false)
113 113
         {
114 114
             $parts = explode(';', $mime);
115 115
             $mime = (string)array_shift($parts);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             // like a URL query string if separated by ampersands;
119 119
             $params = ConvertHelper::parseQueryString(implode('&', $parts));
120 120
                 
121
-            if(isset($params['q']))
121
+            if (isset($params['q']))
122 122
             {
123 123
                 $quality = (double)$params['q'];
124 124
             } 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -148,14 +148,12 @@
 block discarded – undo
148 148
         if ($diff > 0) 
149 149
         {
150 150
             $diff = 1;
151
-        } 
152
-        else
151
+        } else
153 152
         {
154 153
             if ($diff < 0)
155 154
             {
156 155
                 $diff = -1;
157
-            }
158
-            else
156
+            } else
159 157
             {
160 158
                 /* tie-breaker: first listed item wins */
161 159
                 $diff = $a->getPosition() - $b->getPosition();
Please login to merge, or discard this patch.
src/Request/AcceptHeader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
      */
92 92
     public function offsetSet($offset, $value) : void
93 93
     {
94
-        if(isset($this->data[$offset]) && gettype($this->data[$offset]) === gettype($value)) {
94
+        if (isset($this->data[$offset]) && gettype($this->data[$offset]) === gettype($value)) {
95 95
             $this->data[$offset] = $value;
96 96
         }
97 97
     }
Please login to merge, or discard this patch.
src/ClassHelper.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      *                         the vendor name, for example (Vendor\PackageName\Folder\Class).
42 42
      * @return string|null The detected class name, or NULL otherwise.
43 43
      */
44
-    public static function resolveClassName(string $legacyName, string $nsPrefix='') : ?string
44
+    public static function resolveClassName(string $legacyName, string $nsPrefix = '') : ?string
45 45
     {
46 46
         $names = array(
47 47
             str_replace('\\', '_', $legacyName),
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             $nsPrefix.'\\'.str_replace('_', '\\', $legacyName)
50 50
         );
51 51
 
52
-        foreach($names as $name) {
52
+        foreach ($names as $name) {
53 53
             if (class_exists($name)) {
54 54
                 return ltrim($name, '\\');
55 55
             }
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
      * @return string
69 69
      * @throws ClassNotExistsException
70 70
      */
71
-    public static function requireResolvedClass(string $legacyName, string $nsPrefix='') : string
71
+    public static function requireResolvedClass(string $legacyName, string $nsPrefix = '') : string
72 72
     {
73 73
         $class = self::resolveClassName($legacyName, $nsPrefix);
74 74
 
75
-        if($class !== null)
75
+        if ($class !== null)
76 76
         {
77 77
             return $class;
78 78
         }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public static function requireClassExists(string $className) : void
94 94
     {
95
-        if(class_exists($className))
95
+        if (class_exists($className))
96 96
         {
97 97
             return;
98 98
         }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         self::requireClassExists($targetClass);
118 118
         self::requireClassExists($extendsClass);
119 119
 
120
-        if(is_a($targetClass, $extendsClass, true))
120
+        if (is_a($targetClass, $extendsClass, true))
121 121
         {
122 122
             return;
123 123
         }
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
      * @throws ClassNotExistsException
143 143
      * @throws ClassNotImplementsException
144 144
      */
145
-    public static function requireObjectInstanceOf(string $class, object $object, int $errorCode=0)
145
+    public static function requireObjectInstanceOf(string $class, object $object, int $errorCode = 0)
146 146
     {
147
-        if($object instanceof Throwable)
147
+        if ($object instanceof Throwable)
148 148
         {
149 149
             throw new ClassNotExistsException(
150 150
                 $class,
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
             );
154 154
         }
155 155
 
156
-        if(!class_exists($class) && !interface_exists($class) && !trait_exists($class))
156
+        if (!class_exists($class) && !interface_exists($class) && !trait_exists($class))
157 157
         {
158 158
             throw new ClassNotExistsException($class, $errorCode);
159 159
         }
160 160
 
161
-        if(is_a($object, $class, true))
161
+        if (is_a($object, $class, true))
162 162
         {
163 163
             return $object;
164 164
         }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     public static function getClassLoader() : ClassLoader
181 181
     {
182
-        if(isset(self::$classLoader)) {
182
+        if (isset(self::$classLoader)) {
183 183
             return self::$classLoader;
184 184
         }
185 185
 
@@ -193,14 +193,14 @@  discard block
 block discarded – undo
193 193
 
194 194
         $autoloadFile = null;
195 195
 
196
-        foreach($paths as $path)
196
+        foreach ($paths as $path)
197 197
         {
198
-            if(file_exists($path)) {
198
+            if (file_exists($path)) {
199 199
                 $autoloadFile = $path;
200 200
             }
201 201
         }
202 202
 
203
-        if($autoloadFile === null) {
203
+        if ($autoloadFile === null) {
204 204
             throw new ClassLoaderNotFoundException($paths);
205 205
         }
206 206
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     private static function splitClass($subject) : array
253 253
     {
254
-        if(is_object($subject)) {
254
+        if (is_object($subject)) {
255 255
             $class = get_class($subject);
256 256
         } else {
257 257
             $class = $subject;
Please login to merge, or discard this patch.
src/URLInfo/Parser/URLTypeDetector/DetectStandardURL.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
     public function detect() : bool
12 12
     {
13
-        if($this->hasHost() || $this->hasQuery() || $this->hasScheme()) {
13
+        if ($this->hasHost() || $this->hasQuery() || $this->hasScheme()) {
14 14
             $this->setTypeURL();
15 15
             return true;
16 16
         }
Please login to merge, or discard this patch.
src/URLInfo/Parser/URLTypeDetector/DetectFragmentLink.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 {
12 12
     public function detect() : bool
13 13
     {
14
-        if($this->hasFragment() && (!$this->hasScheme() && !$this->hasHost() && !$this->hasQuery() && !$this->hasPath())) {
14
+        if ($this->hasFragment() && (!$this->hasScheme() && !$this->hasHost() && !$this->hasQuery() && !$this->hasPath())) {
15 15
             $this->setTypeFragment();
16 16
             return true;
17 17
         }
Please login to merge, or discard this patch.
src/URLInfo/Parser/URLTypeDetector/DetectIPAddress.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function detect() : bool
13 13
     {
14
-        if(!$this->hasHost() && $this->hasPath() && preg_match(RegexHelper::REGEX_IPV4, $this->getPath())) {
14
+        if (!$this->hasHost() && $this->hasPath() && preg_match(RegexHelper::REGEX_IPV4, $this->getPath())) {
15 15
             $this
16 16
                 ->setHost($this->getPath())
17 17
                 ->setSchemeHTTPS()
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             return true;
23 23
         }
24 24
 
25
-        if($this->hasHost() && preg_match(RegexHelper::REGEX_IPV4, $this->getHost())) {
25
+        if ($this->hasHost() && preg_match(RegexHelper::REGEX_IPV4, $this->getHost())) {
26 26
             $this->setIP($this->getHost());
27 27
             $this->setTypeURL();
28 28
             return true;
Please login to merge, or discard this patch.
src/URLInfo/Parser/URLTypeDetector/DetectPhoneLink.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 {
12 12
     public function detect() : bool
13 13
     {
14
-        if($this->getScheme() === 'tel') {
14
+        if ($this->getScheme() === 'tel') {
15 15
             $this->setTypePhone();
16 16
             return true;
17 17
         }
Please login to merge, or discard this patch.
src/URLInfo/Parser/URLValidator/ValidateHostIsPresent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@
 block discarded – undo
15 15
         // every link needs a host. This case can happen for ex, if
16 16
         // the link starts with a typo with only one slash, like:
17 17
         // "http:/hostname"
18
-        if($this->hasHost() || $this->isSchemeLess()) {
18
+        if ($this->hasHost() || $this->isSchemeLess()) {
19 19
             return true;
20 20
         }
21 21
 
22 22
         $this->parser->setError(
23 23
             URLInfo::ERROR_MISSING_HOST,
24
-            t('Cannot determine the link\'s host name.') . ' ' .
24
+            t('Cannot determine the link\'s host name.').' '.
25 25
             t('This usually happens when there\'s a typo somewhere.')
26 26
         );
27 27
 
Please login to merge, or discard this patch.