Passed
Push — master ( 41e544...0b916c )
by Sebastian
07:52
created
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.
src/URLInfo/Parser/URLValidator/ValidateIsTypeKnown.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 {
13 13
     public function validate() : bool
14 14
     {
15
-        if($this->getType() !== URLInfo::TYPE_NONE)
15
+        if ($this->getType() !== URLInfo::TYPE_NONE)
16 16
         {
17 17
             return true;
18 18
         }
Please login to merge, or discard this patch.
src/URLInfo/Parser/URLValidator/ValidateSchemeIsSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 {
13 13
     public function validate() : bool
14 14
     {
15
-        if($this->hasScheme() || $this->isFragmentOnly()) {
15
+        if ($this->hasScheme() || $this->isFragmentOnly()) {
16 16
             return true;
17 17
         }
18 18
 
Please login to merge, or discard this patch.
src/URLInfo/Parser/URLValidator/ValidateSchemeIsKnown.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 {
14 14
     public function validate() : bool
15 15
     {
16
-        if(!$this->hasScheme() || URISchemes::isValidSchemeName((string)$this->getScheme())) {
16
+        if (!$this->hasScheme() || URISchemes::isValidSchemeName((string)$this->getScheme())) {
17 17
             return true;
18 18
         }
19 19
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
         $this->parser->setError(
23 23
             URLInfo::ERROR_INVALID_SCHEME,
24
-            t('The scheme %1$s is not supported for links.', $this->getScheme()) . ' ' .
24
+            t('The scheme %1$s is not supported for links.', $this->getScheme()).' '.
25 25
             t('Valid schemes are: %1$s.', implode(', ', URISchemes::getSchemeNames()))
26 26
         );
27 27
 
Please login to merge, or discard this patch.
src/URLInfo/URISchemes.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public static function detectScheme(string $url) : ?string
75 75
     {
76
-        foreach(self::$schemes as $scheme) {
77
-            if(stripos($url, $scheme) === 0) {
76
+        foreach (self::$schemes as $scheme) {
77
+            if (stripos($url, $scheme) === 0) {
78 78
                 return $scheme;
79 79
             }
80 80
         }
@@ -85,20 +85,20 @@  discard block
 block discarded – undo
85 85
     /**
86 86
      * @var string[]|null
87 87
      */
88
-    private static ?array $schemeNames = null;
88
+    private static ? array $schemeNames = null;
89 89
 
90 90
     /**
91 91
      * @return string[]
92 92
      */
93 93
     public static function getSchemeNames() : array
94 94
     {
95
-        if(isset(self::$schemeNames)) {
95
+        if (isset(self::$schemeNames)) {
96 96
             return self::$schemeNames;
97 97
         }
98 98
 
99 99
         self::$schemeNames = array();
100 100
 
101
-        foreach(self::$schemes as $scheme) {
101
+        foreach (self::$schemes as $scheme) {
102 102
             self::$schemeNames[] = self::resolveSchemeName($scheme);
103 103
         }
104 104
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     {
132 132
         self::requireValidScheme($scheme);
133 133
 
134
-        if(!in_array($scheme, self::$schemes, true))
134
+        if (!in_array($scheme, self::$schemes, true))
135 135
         {
136 136
             self::$schemes[] = $scheme;
137 137
         }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
     public static function requireValidScheme(string $scheme) : void
143 143
     {
144
-        if(strpos($scheme, ':'))
144
+        if (strpos($scheme, ':'))
145 145
         {
146 146
             return;
147 147
         }
Please login to merge, or discard this patch.
src/URLInfo/URINormalizer.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     * @param bool $enable Whether to turn it on or off.
36 36
     * @return URINormalizer
37 37
     */
38
-    public function enableAuth(bool $enable=true) : URINormalizer
38
+    public function enableAuth(bool $enable = true) : URINormalizer
39 39
     {
40 40
         $this->auth = $enable;
41 41
         return $this;
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         $scheme = $this->info->getScheme();
73 73
         $normalized = '';
74 74
 
75
-        if(!empty($scheme))
75
+        if (!empty($scheme))
76 76
         {
77
-            $normalized = $this->info->getScheme() . '://';
77
+            $normalized = $this->info->getScheme().'://';
78 78
         }
79 79
 
80 80
         $normalized = $this->renderAuth($normalized);
@@ -89,48 +89,48 @@  discard block
 block discarded – undo
89 89
     
90 90
     protected function renderAuth(string $normalized) : string
91 91
     {
92
-        if(!$this->auth || !$this->info->hasUsername()) {
92
+        if (!$this->auth || !$this->info->hasUsername()) {
93 93
             return $normalized;
94 94
         }
95 95
          
96
-        return $normalized . urlencode($this->info->getUsername()).':'.urlencode($this->info->getPassword()).'@';
96
+        return $normalized.urlencode($this->info->getUsername()).':'.urlencode($this->info->getPassword()).'@';
97 97
     }
98 98
     
99 99
     protected function renderPort(string $normalized) : string
100 100
     {
101
-        if(!$this->info->hasPort()) {
101
+        if (!$this->info->hasPort()) {
102 102
             return $normalized;
103 103
         }
104 104
         
105
-        return $normalized . ':'.$this->info->getPort();
105
+        return $normalized.':'.$this->info->getPort();
106 106
     }
107 107
     
108 108
     protected function renderPath(string $normalized) : string
109 109
     {
110
-        if(!$this->info->hasPath()) {
110
+        if (!$this->info->hasPath()) {
111 111
             return $normalized; 
112 112
         }
113 113
         
114
-        return $normalized . $this->info->getPath();
114
+        return $normalized.$this->info->getPath();
115 115
     }
116 116
     
117 117
     protected function renderParams(string $normalized) : string
118 118
     {
119 119
         $params = $this->info->getParams();
120 120
         
121
-        if(empty($params)) {
121
+        if (empty($params)) {
122 122
             return $normalized;
123 123
         }
124 124
         
125
-        return $normalized . '?'.http_build_query($params, '', '&', PHP_QUERY_RFC3986);
125
+        return $normalized.'?'.http_build_query($params, '', '&', PHP_QUERY_RFC3986);
126 126
     }
127 127
     
128 128
     protected function renderFragment(string $normalized) : string
129 129
     {
130
-        if(!$this->info->hasFragment()) {
130
+        if (!$this->info->hasFragment()) {
131 131
             return $normalized;
132 132
         }
133 133
         
134
-        return $normalized . '#'.$this->info->getFragment();
134
+        return $normalized.'#'.$this->info->getFragment();
135 135
     }
136 136
 }
Please login to merge, or discard this patch.