@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct($path) |
30 | 30 | { |
31 | - if($path instanceof FolderInfo) |
|
31 | + if ($path instanceof FolderInfo) |
|
32 | 32 | { |
33 | 33 | $this->folder = $path; |
34 | 34 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ); |
47 | 47 | } |
48 | 48 | |
49 | - public function makeRecursive(bool $recursive=true) : self |
|
49 | + public function makeRecursive(bool $recursive = true) : self |
|
50 | 50 | { |
51 | 51 | return $this->setOption(self::OPTION_RECURSIVE, $recursive); |
52 | 52 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $result = array(); |
78 | 78 | |
79 | - foreach($this->folders as $folder) |
|
79 | + foreach ($this->folders as $folder) |
|
80 | 80 | { |
81 | 81 | $result[] = $this->resolvePath($folder); |
82 | 82 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | private function resolvePath(FolderInfo $folder) : string |
98 | 98 | { |
99 | - if(!$this->isPathModeAbsolute()) |
|
99 | + if (!$this->isPathModeAbsolute()) |
|
100 | 100 | { |
101 | 101 | return $folder->getRelativeTo($this->folder); |
102 | 102 | } |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | { |
118 | 118 | $d = new DirectoryIterator($folder->getPath()); |
119 | 119 | |
120 | - foreach($d as $item) |
|
120 | + foreach ($d as $item) |
|
121 | 121 | { |
122 | - if($item->isDir() && !$item->isDot()) |
|
122 | + if ($item->isDir() && !$item->isDot()) |
|
123 | 123 | { |
124 | 124 | $this->processFolder(FileHelper::getFolderInfo($item->getPathname())); |
125 | 125 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | $this->folders[] = $folder; |
142 | 142 | |
143 | - if($this->isRecursive()) |
|
143 | + if ($this->isRecursive()) |
|
144 | 144 | { |
145 | 145 | $this->scanFolder($folder); |
146 | 146 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $os = $this->getOS(); |
61 | 61 | |
62 | - if(isset(self::$osCommands[$os])) |
|
62 | + if (isset(self::$osCommands[$os])) |
|
63 | 63 | { |
64 | 64 | return self::$osCommands[$os]; |
65 | 65 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function exists(string $command) : bool |
85 | 85 | { |
86 | - if(isset(self::$checked[$command])) |
|
86 | + if (isset(self::$checked[$command])) |
|
87 | 87 | { |
88 | 88 | return self::$checked[$command]; |
89 | 89 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $pipes |
115 | 115 | ); |
116 | 116 | |
117 | - if($process === false) |
|
117 | + if ($process === false) |
|
118 | 118 | { |
119 | 119 | return ''; |
120 | 120 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | proc_close($process); |
128 | 128 | |
129 | - if($stdout === false) |
|
129 | + if ($stdout === false) |
|
130 | 130 | { |
131 | 131 | return ''; |
132 | 132 | } |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * @var array<string,string>|NULL |
29 | 29 | */ |
30 | - protected static ?array $utfBoms = null; |
|
30 | + protected static ? array $utfBoms = null; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @var string[]|NULL |
34 | 34 | */ |
35 | - protected static ?array $encodings = null; |
|
35 | + protected static ? array $encodings = null; |
|
36 | 36 | |
37 | 37 | public function __construct() |
38 | 38 | { |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | |
71 | 71 | fclose($fp); |
72 | 72 | |
73 | - foreach(self::$utfBoms as $bom => $value) |
|
73 | + foreach (self::$utfBoms as $bom => $value) |
|
74 | 74 | { |
75 | - if(mb_strpos($text, $value) === 0) |
|
75 | + if (mb_strpos($text, $value) === 0) |
|
76 | 76 | { |
77 | 77 | return $bom; |
78 | 78 | } |
@@ -83,23 +83,23 @@ discard block |
||
83 | 83 | |
84 | 84 | private function initBOMs() : void |
85 | 85 | { |
86 | - if(isset(self::$utfBoms)) |
|
86 | + if (isset(self::$utfBoms)) |
|
87 | 87 | { |
88 | 88 | return; |
89 | 89 | } |
90 | 90 | |
91 | 91 | self::$utfBoms = array( |
92 | - 'UTF32-BE' => chr(0x00) . chr(0x00) . chr(0xFE) . chr(0xFF), |
|
93 | - 'UTF32-LE' => chr(0xFF) . chr(0xFE) . chr(0x00) . chr(0x00), |
|
94 | - 'UTF16-BE' => chr(0xFE) . chr(0xFF), |
|
95 | - 'UTF16-LE' => chr(0xFF) . chr(0xFE), |
|
96 | - 'UTF8' => chr(0xEF) . chr(0xBB) . chr(0xBF) |
|
92 | + 'UTF32-BE' => chr(0x00).chr(0x00).chr(0xFE).chr(0xFF), |
|
93 | + 'UTF32-LE' => chr(0xFF).chr(0xFE).chr(0x00).chr(0x00), |
|
94 | + 'UTF16-BE' => chr(0xFE).chr(0xFF), |
|
95 | + 'UTF16-LE' => chr(0xFF).chr(0xFE), |
|
96 | + 'UTF8' => chr(0xEF).chr(0xBB).chr(0xBF) |
|
97 | 97 | ); |
98 | 98 | } |
99 | 99 | |
100 | 100 | private function initEncodings() : void |
101 | 101 | { |
102 | - if(isset(self::$encodings)) |
|
102 | + if (isset(self::$encodings)) |
|
103 | 103 | { |
104 | 104 | return; |
105 | 105 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | self::$encodings = array(); |
110 | 110 | |
111 | - foreach($encodings as $string) |
|
111 | + foreach ($encodings as $string) |
|
112 | 112 | { |
113 | 113 | $withHyphen = str_replace('UTF', 'UTF-', $string); |
114 | 114 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $this->file = $info; |
36 | 36 | } |
37 | 37 | |
38 | - public function send(?string $fileName = null, bool $asAttachment=true) : void |
|
38 | + public function send(?string $fileName = null, bool $asAttachment = true) : void |
|
39 | 39 | { |
40 | 40 | $this->file |
41 | 41 | ->requireExists() |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | header("Cache-Control: public", true); |
55 | 55 | header("Content-Description: File Transfer", true); |
56 | - header("Content-Type: " . $this->detectMime(), true); |
|
56 | + header("Content-Type: ".$this->detectMime(), true); |
|
57 | 57 | |
58 | 58 | header(sprintf( |
59 | 59 | "Content-Disposition: %s; filename=%s", |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | private function resolveDisposition(bool $asAttachment) : string |
71 | 71 | { |
72 | - if($asAttachment) |
|
72 | + if ($asAttachment) |
|
73 | 73 | { |
74 | 74 | return 'attachment'; |
75 | 75 | } |
@@ -47,15 +47,15 @@ discard block |
||
47 | 47 | |
48 | 48 | $file = new SplFileObject($this->file->getPath()); |
49 | 49 | |
50 | - if($file->eof()) { |
|
50 | + if ($file->eof()) { |
|
51 | 51 | return ''; |
52 | 52 | } |
53 | 53 | |
54 | - $targetLine = $lineNumber-1; |
|
54 | + $targetLine = $lineNumber - 1; |
|
55 | 55 | |
56 | 56 | $file->seek($targetLine); |
57 | 57 | |
58 | - if($file->key() !== $targetLine) |
|
58 | + if ($file->key() !== $targetLine) |
|
59 | 59 | { |
60 | 60 | return null; |
61 | 61 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $number = $spl->key(); |
77 | 77 | |
78 | 78 | // if seeking to the end the cursor is still at 0, there are no lines. |
79 | - if($number === 0) |
|
79 | + if ($number === 0) |
|
80 | 80 | { |
81 | 81 | // since it's a very small file, to get reliable results, |
82 | 82 | // we read its contents and use that to determine what |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | // that this is not practical to solve with the SplFileObject. |
85 | 85 | $content = file_get_contents($path); |
86 | 86 | |
87 | - if(empty($content)) { |
|
87 | + if (empty($content)) { |
|
88 | 88 | return 0; |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | 92 | // return the line number we were able to reach + 1 (key is zero-based) |
93 | - return $number+1; |
|
93 | + return $number + 1; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | * @return string[] |
99 | 99 | * @throws FileHelper_Exception |
100 | 100 | */ |
101 | - public function getLines(int $amount=0) : array |
|
101 | + public function getLines(int $amount = 0) : array |
|
102 | 102 | { |
103 | 103 | $this->file->requireExists(); |
104 | 104 | |
105 | 105 | $fn = fopen($this->file->getPath(), 'rb'); |
106 | 106 | |
107 | - if($fn === false) |
|
107 | + if ($fn === false) |
|
108 | 108 | { |
109 | 109 | throw new FileHelper_Exception( |
110 | 110 | 'Could not open file for reading.', |
@@ -120,19 +120,19 @@ discard block |
||
120 | 120 | $counter = 0; |
121 | 121 | $first = true; |
122 | 122 | |
123 | - while(!feof($fn)) |
|
123 | + while (!feof($fn)) |
|
124 | 124 | { |
125 | 125 | $counter++; |
126 | 126 | |
127 | 127 | $line = fgets($fn); |
128 | 128 | |
129 | 129 | // can happen with zero length files |
130 | - if($line === false) { |
|
130 | + if ($line === false) { |
|
131 | 131 | continue; |
132 | 132 | } |
133 | 133 | |
134 | 134 | // the first line may contain a unicode BOM marker. |
135 | - if($first) |
|
135 | + if ($first) |
|
136 | 136 | { |
137 | 137 | $line = ConvertHelper::stripUTFBom($line); |
138 | 138 | $first = false; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $result[] = $line; |
142 | 142 | |
143 | - if($amount > 0 && $counter === $amount) { |
|
143 | + if ($amount > 0 && $counter === $amount) { |
|
144 | 144 | break; |
145 | 145 | } |
146 | 146 | } |
@@ -49,13 +49,13 @@ |
||
49 | 49 | |
50 | 50 | $name = str_replace(array_keys($replaces), array_values($replaces), $name); |
51 | 51 | |
52 | - while(strpos($name, ' ') !== false) { |
|
52 | + while (strpos($name, ' ') !== false) { |
|
53 | 53 | $name = str_replace(' ', ' ', $name); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $name = str_replace(array_keys($replaces), array_values($replaces), $name); |
57 | 57 | |
58 | - while(strpos($name, '..') !== false) { |
|
58 | + while (strpos($name, '..') !== false) { |
|
59 | 59 | $name = str_replace('..', '.', $name); |
60 | 60 | } |
61 | 61 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param string[] $paths |
37 | 37 | * @throws FileHelper_Exception |
38 | 38 | */ |
39 | - public function __construct(array $paths=array()) |
|
39 | + public function __construct(array $paths = array()) |
|
40 | 40 | { |
41 | 41 | $this->addPaths($paths); |
42 | 42 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function addPaths(array $paths) : PathsReducer |
51 | 51 | { |
52 | - foreach($paths as $path) { |
|
52 | + foreach ($paths as $path) { |
|
53 | 53 | $this->addPath($path); |
54 | 54 | } |
55 | 55 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | $path = FileHelper::normalizePath($path); |
68 | 68 | |
69 | - if(!in_array($path, $this->paths, true)) { |
|
69 | + if (!in_array($path, $this->paths, true)) { |
|
70 | 70 | $this->paths[] = $path; |
71 | 71 | } |
72 | 72 | |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | { |
84 | 84 | $split = $this->splitPaths(); |
85 | 85 | |
86 | - if(empty($split)) { |
|
86 | + if (empty($split)) { |
|
87 | 87 | return array(); |
88 | 88 | } |
89 | 89 | |
90 | - while($this->shiftPart($split) === true) {} |
|
90 | + while ($this->shiftPart($split) === true) {} |
|
91 | 91 | |
92 | 92 | return $this->joinPaths($split); |
93 | 93 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $result = array(); |
102 | 102 | |
103 | 103 | foreach ($split as $entry) { |
104 | - if(!empty($entry)) { |
|
104 | + if (!empty($entry)) { |
|
105 | 105 | $result[] = implode('/', $entry); |
106 | 106 | } |
107 | 107 | } |
@@ -118,22 +118,22 @@ discard block |
||
118 | 118 | $current = null; |
119 | 119 | $result = array(); |
120 | 120 | |
121 | - foreach($split as $entry) |
|
121 | + foreach ($split as $entry) |
|
122 | 122 | { |
123 | - if(empty($entry)) { |
|
123 | + if (empty($entry)) { |
|
124 | 124 | return false; |
125 | 125 | } |
126 | 126 | |
127 | 127 | $part = array_shift($entry); |
128 | - if(empty($entry)) { |
|
128 | + if (empty($entry)) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
132 | - if($current === null) { |
|
132 | + if ($current === null) { |
|
133 | 133 | $current = $part; |
134 | 134 | } |
135 | 135 | |
136 | - if($part !== $current) { |
|
136 | + if ($part !== $current) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | { |
153 | 153 | $split = array(); |
154 | 154 | |
155 | - foreach($this->paths as $path) { |
|
155 | + foreach ($this->paths as $path) { |
|
156 | 156 | $entry = ConvertHelper::explodeTrim('/', $path); |
157 | - if(!empty($entry)) { |
|
157 | + if (!empty($entry)) { |
|
158 | 158 | $split[] = $entry; |
159 | 159 | } |
160 | 160 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function setTimeout(int $timeout) : FileDownloader |
42 | 42 | { |
43 | - if($timeout > 0) |
|
43 | + if ($timeout > 0) |
|
44 | 44 | { |
45 | 45 | $this->timeout = $timeout; |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param bool $enabled |
53 | 53 | * @return FileDownloader |
54 | 54 | */ |
55 | - public function setSSLEnabled(bool $enabled=true) : FileDownloader |
|
55 | + public function setSSLEnabled(bool $enabled = true) : FileDownloader |
|
56 | 56 | { |
57 | 57 | $this->SSLEnabled = $enabled; |
58 | 58 | return $this; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $output = curl_exec($ch); |
75 | 75 | |
76 | - if($output === false) |
|
76 | + if ($output === false) |
|
77 | 77 | { |
78 | 78 | throw new FileHelper_Exception( |
79 | 79 | 'Unable to open URL', |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | curl_close($ch); |
90 | 90 | |
91 | - if(is_string($output)) |
|
91 | + if (is_string($output)) |
|
92 | 92 | { |
93 | 93 | return $output; |
94 | 94 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | $ch = curl_init(); |
110 | 110 | |
111 | - if(!is_resource($ch)) |
|
111 | + if (!is_resource($ch)) |
|
112 | 112 | { |
113 | 113 | throw new FileHelper_Exception( |
114 | 114 | 'Could not initialize a new cURL instance.', |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
126 | 126 | curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); |
127 | 127 | |
128 | - if(!$this->SSLEnabled) |
|
128 | + if (!$this->SSLEnabled) |
|
129 | 129 | { |
130 | 130 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
131 | 131 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @var array<string,string>|NULL |
64 | 64 | * @see URLInfo::getTypeLabel() |
65 | 65 | */ |
66 | - protected static ?array $typeLabels = null; |
|
66 | + protected static ? array $typeLabels = null; |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @var bool |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | * @param bool $enabled |
127 | 127 | * @return URLInfo |
128 | 128 | */ |
129 | - public function setUTFEncoding(bool $enabled=true) : URLInfo |
|
129 | + public function setUTFEncoding(bool $enabled = true) : URLInfo |
|
130 | 130 | { |
131 | - if($this->encodeUTFChars !== $enabled) |
|
131 | + if ($this->encodeUTFChars !== $enabled) |
|
132 | 132 | { |
133 | 133 | $this->encodeUTFChars = $enabled; |
134 | 134 | $this->parse(); // re-parse the URL to apply the changes |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | { |
233 | 233 | $port = $this->getInfoKey('port'); |
234 | 234 | |
235 | - if(!empty($port)) { |
|
235 | + if (!empty($port)) { |
|
236 | 236 | return (int)$port; |
237 | 237 | } |
238 | 238 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | protected function getInfoKey(string $name) : string |
314 | 314 | { |
315 | - if(isset($this->info[$name])) { |
|
315 | + if (isset($this->info[$name])) { |
|
316 | 316 | return (string)$this->info[$name]; |
317 | 317 | } |
318 | 318 | |
@@ -341,13 +341,13 @@ discard block |
||
341 | 341 | return $this->normalize(false); |
342 | 342 | } |
343 | 343 | |
344 | - protected function normalize(bool $auth=true) : string |
|
344 | + protected function normalize(bool $auth = true) : string |
|
345 | 345 | { |
346 | - if(!$this->isValid()) { |
|
346 | + if (!$this->isValid()) { |
|
347 | 347 | return ''; |
348 | 348 | } |
349 | 349 | |
350 | - if(!isset($this->normalizer)) { |
|
350 | + if (!isset($this->normalizer)) { |
|
351 | 351 | $this->normalizer = new URLInfo_Normalizer($this); |
352 | 352 | } |
353 | 353 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | */ |
378 | 378 | public function getHighlighted() : string |
379 | 379 | { |
380 | - if(!$this->isValid()) { |
|
380 | + if (!$this->isValid()) { |
|
381 | 381 | return ''; |
382 | 382 | } |
383 | 383 | |
@@ -419,14 +419,14 @@ discard block |
||
419 | 419 | */ |
420 | 420 | public function getParams() : array |
421 | 421 | { |
422 | - if(!$this->paramExclusion || empty($this->excludedParams)) { |
|
422 | + if (!$this->paramExclusion || empty($this->excludedParams)) { |
|
423 | 423 | return $this->info['params']; |
424 | 424 | } |
425 | 425 | |
426 | 426 | $keep = array(); |
427 | - foreach($this->info['params'] as $name => $value) |
|
427 | + foreach ($this->info['params'] as $name => $value) |
|
428 | 428 | { |
429 | - if(!isset($this->excludedParams[$name])) { |
|
429 | + if (!isset($this->excludedParams[$name])) { |
|
430 | 430 | $keep[$name] = $value; |
431 | 431 | } |
432 | 432 | } |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | */ |
453 | 453 | public function getParam(string $name) : string |
454 | 454 | { |
455 | - if(isset($this->info['params'][$name])) { |
|
455 | + if (isset($this->info['params'][$name])) { |
|
456 | 456 | return $this->info['params'][$name]; |
457 | 457 | } |
458 | 458 | |
@@ -469,9 +469,9 @@ discard block |
||
469 | 469 | * @param string $reason A human readable explanation why this is excluded - used when highlighting links. |
470 | 470 | * @return URLInfo |
471 | 471 | */ |
472 | - public function excludeParam(string $name, string $reason='') : URLInfo |
|
472 | + public function excludeParam(string $name, string $reason = '') : URLInfo |
|
473 | 473 | { |
474 | - if(!isset($this->excludedParams[$name])) |
|
474 | + if (!isset($this->excludedParams[$name])) |
|
475 | 475 | { |
476 | 476 | $this->excludedParams[$name] = $reason; |
477 | 477 | $this->setParamExclusion(); |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | |
498 | 498 | public function getTypeLabel() : string |
499 | 499 | { |
500 | - if(!isset(self::$typeLabels)) |
|
500 | + if (!isset(self::$typeLabels)) |
|
501 | 501 | { |
502 | 502 | self::$typeLabels = array( |
503 | 503 | self::TYPE_EMAIL => t('Email'), |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | |
510 | 510 | $type = $this->getType(); |
511 | 511 | |
512 | - if(!isset(self::$typeLabels[$type])) |
|
512 | + if (!isset(self::$typeLabels[$type])) |
|
513 | 513 | { |
514 | 514 | throw new BaseException( |
515 | 515 | sprintf('Unknown URL type label for type [%s].', $type), |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | * @param bool $highlight |
530 | 530 | * @return URLInfo |
531 | 531 | */ |
532 | - public function setHighlightExcluded(bool $highlight=true) : URLInfo |
|
532 | + public function setHighlightExcluded(bool $highlight = true) : URLInfo |
|
533 | 533 | { |
534 | 534 | $this->highlightExcluded = $highlight; |
535 | 535 | return $this; |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | * @see URLInfo::isParamExclusionEnabled() |
579 | 579 | * @see URLInfo::setHighlightExcluded() |
580 | 580 | */ |
581 | - public function setParamExclusion(bool $enabled=true) : URLInfo |
|
581 | + public function setParamExclusion(bool $enabled = true) : URLInfo |
|
582 | 582 | { |
583 | 583 | $this->paramExclusion = $enabled; |
584 | 584 | return $this; |
@@ -604,13 +604,13 @@ discard block |
||
604 | 604 | */ |
605 | 605 | public function containsExcludedParams() : bool |
606 | 606 | { |
607 | - if(empty($this->excludedParams)) { |
|
607 | + if (empty($this->excludedParams)) { |
|
608 | 608 | return false; |
609 | 609 | } |
610 | 610 | |
611 | 611 | $names = array_keys($this->info['params']); |
612 | - foreach($names as $name) { |
|
613 | - if(isset($this->excludedParams[$name])) { |
|
612 | + foreach ($names as $name) { |
|
613 | + if (isset($this->excludedParams[$name])) { |
|
614 | 614 | return true; |
615 | 615 | } |
616 | 616 | } |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | |
627 | 627 | public function offsetSet($offset, $value) |
628 | 628 | { |
629 | - if(in_array($offset, $this->infoKeys)) { |
|
629 | + if (in_array($offset, $this->infoKeys)) { |
|
630 | 630 | $this->info[$offset] = $value; |
631 | 631 | } |
632 | 632 | } |
@@ -643,11 +643,11 @@ discard block |
||
643 | 643 | |
644 | 644 | public function offsetGet($offset) |
645 | 645 | { |
646 | - if($offset === 'port') { |
|
646 | + if ($offset === 'port') { |
|
647 | 647 | return $this->getPort(); |
648 | 648 | } |
649 | 649 | |
650 | - if(in_array($offset, $this->infoKeys)) { |
|
650 | + if (in_array($offset, $this->infoKeys)) { |
|
651 | 651 | return $this->getInfoKey($offset); |
652 | 652 | } |
653 | 653 | |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | * @return bool |
683 | 683 | * @throws BaseException |
684 | 684 | */ |
685 | - public function tryConnect(bool $verifySSL=true) : bool |
|
685 | + public function tryConnect(bool $verifySSL = true) : bool |
|
686 | 686 | { |
687 | 687 | return $this->createConnectionTester() |
688 | 688 | ->setVerifySSL($verifySSL) |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | */ |
726 | 726 | public function removeParam(string $param) : URLInfo |
727 | 727 | { |
728 | - if(isset($this->info['params'][$param])) |
|
728 | + if (isset($this->info['params'][$param])) |
|
729 | 729 | { |
730 | 730 | unset($this->info['params'][$param]); |
731 | 731 | } |