@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | $urlInfo = parse_url($url); |
41 | 41 | |
42 | 42 | if (!isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) { |
43 | - throw new \UnexpectedValueException('URL "'.$url.'" is not valid'); |
|
43 | + throw new \UnexpectedValueException('URL "' . $url . '" is not valid'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) { |
47 | 47 | throw new \UnexpectedValueException( |
48 | - 'Invalid protocol (' . $urlInfo['scheme'] . ').' |
|
48 | + 'Invalid protocol (' . $urlInfo['scheme'] . ').' |
|
49 | 49 | . ' Valid options are ' . implode(', ', $this->acceptedSchemes)); |
50 | 50 | } |
51 | 51 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler'); |
89 | 89 | } |
90 | 90 | |
91 | - $this->httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put'); |
|
91 | + $this->httpConnection = curl_init('http://' . $this->host . ':' . $this->port . '/1.0/event/put'); |
|
92 | 92 | |
93 | 93 | if (!$this->httpConnection) { |
94 | 94 | throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port); |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | $this->connectHttp(); |
141 | 141 | } |
142 | 142 | |
143 | - curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']'); |
|
143 | + curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '[' . $data . ']'); |
|
144 | 144 | curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array( |
145 | 145 | 'Content-Type: application/json', |
146 | - 'Content-Length: ' . strlen('['.$data.']'), |
|
146 | + 'Content-Length: ' . strlen('[' . $data . ']'), |
|
147 | 147 | )); |
148 | 148 | |
149 | 149 | Curl\Util::execute($this->httpConnection, 5, false); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | { |
157 | 157 | $args = array(self::quote('font-weight: normal')); |
158 | 158 | $format = '%c' . $formatted; |
159 | - preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); |
|
159 | + preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE|PREG_SET_ORDER); |
|
160 | 160 | |
161 | 161 | foreach (array_reverse($matches) as $match) { |
162 | 162 | $args[] = self::quote(self::handleCustomStyles($match[2][0], $match[1][0])); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey'); |
177 | 177 | static $labels = array(); |
178 | 178 | |
179 | - return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function ($m) use ($string, &$colors, &$labels) { |
|
179 | + return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function($m) use ($string, &$colors, &$labels) { |
|
180 | 180 | if (trim($m[1]) === 'autolabel') { |
181 | 181 | // Format the string as a label with consistent auto assigned background color |
182 | 182 | if (!isset($labels[$string])) { |
@@ -187,7 +187,7 @@ |
||
187 | 187 | public function isConnected() |
188 | 188 | { |
189 | 189 | return is_resource($this->resource) |
190 | - && !feof($this->resource); // on TCP - other party can close connection. |
|
190 | + && !feof($this->resource); // on TCP - other party can close connection. |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | public function __get($property) |
176 | 176 | { |
177 | 177 | if ('sendHeaders' !== $property) { |
178 | - throw new \InvalidArgumentException('Undefined property '.$property); |
|
178 | + throw new \InvalidArgumentException('Undefined property ' . $property); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | return static::$sendHeaders; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | public function __set($property, $value) |
188 | 188 | { |
189 | 189 | if ('sendHeaders' !== $property) { |
190 | - throw new \InvalidArgumentException('Undefined property '.$property); |
|
190 | + throw new \InvalidArgumentException('Undefined property ' . $property); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | static::$sendHeaders = $value; |
@@ -92,7 +92,7 @@ |
||
92 | 92 | */ |
93 | 93 | protected function filterEmptyFields(array $record) |
94 | 94 | { |
95 | - return array_filter($record, function ($value) { |
|
95 | + return array_filter($record, function($value) { |
|
96 | 96 | return !empty($value) || false === $value || 0 === $value; |
97 | 97 | }); |
98 | 98 | } |
@@ -90,21 +90,21 @@ |
||
90 | 90 | $record = $record['message']; |
91 | 91 | } |
92 | 92 | |
93 | - return $this->hasRecordThatPasses(function ($rec) use ($record) { |
|
93 | + return $this->hasRecordThatPasses(function($rec) use ($record) { |
|
94 | 94 | return $rec['message'] === $record; |
95 | 95 | }, $level); |
96 | 96 | } |
97 | 97 | |
98 | 98 | public function hasRecordThatContains($message, $level) |
99 | 99 | { |
100 | - return $this->hasRecordThatPasses(function ($rec) use ($message) { |
|
100 | + return $this->hasRecordThatPasses(function($rec) use ($message) { |
|
101 | 101 | return strpos($rec['message'], $message) !== false; |
102 | 102 | }, $level); |
103 | 103 | } |
104 | 104 | |
105 | 105 | public function hasRecordThatMatches($regex, $level) |
106 | 106 | { |
107 | - return $this->hasRecordThatPasses(function ($rec) use ($regex) { |
|
107 | + return $this->hasRecordThatPasses(function($rec) use ($regex) { |
|
108 | 108 | return preg_match($regex, $rec['message']) > 0; |
109 | 109 | }, $level); |
110 | 110 | } |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | { |
71 | 71 | if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { |
72 | 72 | trigger_error( |
73 | - 'Invalid date format - format must be one of '. |
|
74 | - 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '. |
|
75 | - 'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the '. |
|
73 | + 'Invalid date format - format must be one of ' . |
|
74 | + 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") ' . |
|
75 | + 'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the ' . |
|
76 | 76 | 'date formats using slashes, underscores and/or dots instead of dashes.', |
77 | 77 | E_USER_DEPRECATED |
78 | 78 | ); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | // Sorting the files by name to remove the older ones |
131 | - usort($logFiles, function ($a, $b) { |
|
131 | + usort($logFiles, function($a, $b) { |
|
132 | 132 | return strcmp($b, $a); |
133 | 133 | }); |
134 | 134 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if (is_writable($file)) { |
137 | 137 | // suppress errors here as unlink() might fail if two processes |
138 | 138 | // are cleaning up/rotating at the same time |
139 | - set_error_handler(function ($errno, $errstr, $errfile, $errline) {}); |
|
139 | + set_error_handler(function($errno, $errstr, $errfile, $errline) {}); |
|
140 | 140 | unlink($file); |
141 | 141 | restore_error_handler(); |
142 | 142 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ); |
156 | 156 | |
157 | 157 | if (!empty($fileInfo['extension'])) { |
158 | - $timedFilename .= '.'.$fileInfo['extension']; |
|
158 | + $timedFilename .= '.' . $fileInfo['extension']; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return $timedFilename; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $fileInfo['dirname'] . '/' . $this->filenameFormat |
171 | 171 | ); |
172 | 172 | if (!empty($fileInfo['extension'])) { |
173 | - $glob .= '.'.$fileInfo['extension']; |
|
173 | + $glob .= '.' . $fileInfo['extension']; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | return $glob; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']); |
47 | 47 | } |
48 | 48 | |
49 | - $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname']; |
|
49 | + $url = 'http://' . $basicAuth . $this->options['host'] . ':' . $this->options['port'] . '/' . $this->options['dbname']; |
|
50 | 50 | $context = stream_context_create(array( |
51 | 51 | 'http' => array( |
52 | 52 | 'method' => 'POST', |
@@ -94,6 +94,6 @@ |
||
94 | 94 | return $this->buildMessage(null, array()); |
95 | 95 | } |
96 | 96 | |
97 | - throw new \InvalidArgumentException('Invalid property '.$name); |
|
97 | + throw new \InvalidArgumentException('Invalid property ' . $name); |
|
98 | 98 | } |
99 | 99 | } |