@@ -39,8 +39,9 @@ |
||
39 | 39 | */ |
40 | 40 | public static function hasElement($array, $element): bool |
41 | 41 | { |
42 | - if (! is_array($array)) |
|
43 | - return false; |
|
42 | + if (! is_array($array)) { |
|
43 | + return false; |
|
44 | + } |
|
44 | 45 | |
45 | 46 | return isset($array[$element]) && strlen($array[$element]) > 0; |
46 | 47 | } |
@@ -80,7 +80,8 @@ discard block |
||
80 | 80 | throw new NoAccessException("Cannot write to file $file"); |
81 | 81 | } |
82 | 82 | $mode = "ab"; |
83 | - } else { |
|
83 | + } |
|
84 | + else { |
|
84 | 85 | if (! is_writable(dirname($file))) { |
85 | 86 | throw new NoAccessException("Cannot write to file {file}", array( |
86 | 87 | 'file' => $file |
@@ -145,7 +146,8 @@ discard block |
||
145 | 146 | throw new StreamException("Could not write memory stream into file"); |
146 | 147 | } |
147 | 148 | } |
148 | - } else { |
|
149 | + } |
|
150 | + else { |
|
149 | 151 | $buffer = strval($buffer); |
150 | 152 | if (fwrite($this->handle, $buffer) != strlen($buffer)) { |
151 | 153 | throw new StreamException("Could not write buffer into file"); |
@@ -234,7 +234,8 @@ |
||
234 | 234 | |
235 | 235 | if (is_dir($caPath)) { |
236 | 236 | $opts['ssl']['capath'] = $caPath; |
237 | - } else { |
|
237 | + } |
|
238 | + else { |
|
238 | 239 | $opts['ssl']['cafile'] = $caPath; |
239 | 240 | } |
240 | 241 |
@@ -174,7 +174,8 @@ |
||
174 | 174 | if ($code != 0) { |
175 | 175 | if ($code != 10053) { |
176 | 176 | throw new SocketException(socket_strerror($code), array(), $code); |
177 | - } else { |
|
177 | + } |
|
178 | + else { |
|
178 | 179 | $this->handle = null; |
179 | 180 | } |
180 | 181 | } |
@@ -104,7 +104,8 @@ |
||
104 | 104 | if ($iter->isDir()) { |
105 | 105 | $dir = new Directory($iter->getPathname()); |
106 | 106 | $dir->remove(true); |
107 | - } else { |
|
107 | + } |
|
108 | + else { |
|
108 | 109 | unlink($iter->getPathname()); |
109 | 110 | } |
110 | 111 |
@@ -33,7 +33,8 @@ |
||
33 | 33 | |
34 | 34 | if ($ex instanceof ErrorException) { |
35 | 35 | $level = LogLevel::ERROR; |
36 | - } elseif ($ex instanceof RuntimeException) { |
|
36 | + } |
|
37 | + elseif ($ex instanceof RuntimeException) { |
|
37 | 38 | $level = LogLevel::EMERGENCY; |
38 | 39 | } |
39 | 40 |
@@ -93,7 +93,8 @@ discard block |
||
93 | 93 | if (! array_key_exists('Accept-Encoding', $this->headers)) { |
94 | 94 | if (function_exists('gzinflate')) { |
95 | 95 | $encoding = 'gzip, deflate'; |
96 | - } else { |
|
96 | + } |
|
97 | + else { |
|
97 | 98 | $encoding = 'identity'; |
98 | 99 | } |
99 | 100 | $this->setHeader('Accept-Encoding', $encoding); |
@@ -110,7 +111,8 @@ discard block |
||
110 | 111 | { |
111 | 112 | if ($requestType == 'HEAD') { |
112 | 113 | $this->setHeader('Connection', 'close'); |
113 | - } else { |
|
114 | + } |
|
115 | + else { |
|
114 | 116 | $this->setHeader('Connection', 'keep-alive'); |
115 | 117 | } |
116 | 118 | } |
@@ -124,7 +126,8 @@ discard block |
||
124 | 126 | { |
125 | 127 | if (strpos($line, ':') === false) { |
126 | 128 | $this->responseCode = HttpStatus::parseStatus($line)->getCode(); |
127 | - } else { |
|
129 | + } |
|
130 | + else { |
|
128 | 131 | $line = trim($line); |
129 | 132 | list ($headerName, $headerValue) = explode(':', $line, 2); |
130 | 133 | $this->headers[$headerName] = trim($headerValue); |
@@ -20,7 +20,8 @@ discard block |
||
20 | 20 | * @see \Generics\Streams\Interceptor\StreamInterceptor::onClose() |
21 | 21 | */ |
22 | 22 | public function onClose() |
23 | - {} |
|
23 | + { |
|
24 | +} |
|
24 | 25 | |
25 | 26 | /** |
26 | 27 | * |
@@ -28,5 +29,6 @@ discard block |
||
28 | 29 | * @see \Generics\Streams\Interceptor\StreamInterceptor::onCreate() |
29 | 30 | */ |
30 | 31 | public function onCreate() |
31 | - {} |
|
32 | + { |
|
33 | +} |
|
32 | 34 | } |
33 | 35 | \ No newline at end of file |