@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function __construct($pattern) { |
92 | 92 | $this->pattern = $pattern; |
93 | - $this->patternLength = strlen($pattern); |
|
93 | + $this->patternLength = strlen($pattern); |
|
94 | 94 | $this->formattingInfo = new LoggerFormattingInfo(); |
95 | 95 | $this->state = self::LITERAL_STATE; |
96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param LoggerPatternConverter $pc |
100 | 100 | */ |
101 | 101 | public function addToList($pc) { |
102 | - if($this->head == null) { |
|
102 | + if ($this->head == null) { |
|
103 | 103 | $this->head = $pc; |
104 | 104 | $this->tail = $this->head; |
105 | 105 | } else { |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | * @return string |
113 | 113 | */ |
114 | 114 | public function extractOption() { |
115 | - if(($this->i < $this->patternLength) and ($this->pattern{$this->i} == '{')) { |
|
116 | - $end = strpos($this->pattern, '}' , $this->i); |
|
117 | - if($end !== false) { |
|
115 | + if (($this->i < $this->patternLength) and ($this->pattern{$this->i} == '{')) { |
|
116 | + $end = strpos($this->pattern, '}', $this->i); |
|
117 | + if ($end !== false) { |
|
118 | 118 | $r = substr($this->pattern, ($this->i + 1), ($end - $this->i - 1)); |
119 | - $this->i= $end + 1; |
|
119 | + $this->i = $end + 1; |
|
120 | 120 | return $r; |
121 | 121 | } |
122 | 122 | } |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | public function extractPrecisionOption() { |
131 | 131 | $opt = $this->extractOption(); |
132 | 132 | $r = 0; |
133 | - if($opt !== null) { |
|
134 | - if(is_numeric($opt)) { |
|
135 | - $r = (int)$opt; |
|
136 | - if($r <= 0) { |
|
133 | + if ($opt !== null) { |
|
134 | + if (is_numeric($opt)) { |
|
135 | + $r = (int) $opt; |
|
136 | + if ($r <= 0) { |
|
137 | 137 | $r = 0; |
138 | 138 | } |
139 | 139 | } |
@@ -150,19 +150,19 @@ discard block |
||
150 | 150 | $c = ''; |
151 | 151 | $this->i = 0; |
152 | 152 | $this->currentLiteral = ''; |
153 | - while($this->i < $this->patternLength) { |
|
153 | + while ($this->i < $this->patternLength) { |
|
154 | 154 | $c = $this->pattern{$this->i++}; |
155 | 155 | |
156 | - switch($this->state) { |
|
156 | + switch ($this->state) { |
|
157 | 157 | case self::LITERAL_STATE: |
158 | 158 | // In literal state, the last char is always a literal. |
159 | - if($this->i == $this->patternLength) { |
|
159 | + if ($this->i == $this->patternLength) { |
|
160 | 160 | $this->currentLiteral .= $c; |
161 | 161 | continue; |
162 | 162 | } |
163 | - if($c == self::ESCAPE_CHAR) { |
|
163 | + if ($c == self::ESCAPE_CHAR) { |
|
164 | 164 | // peek at the next char. |
165 | - switch($this->pattern{$this->i}) { |
|
165 | + switch ($this->pattern{$this->i}) { |
|
166 | 166 | case self::ESCAPE_CHAR: |
167 | 167 | $this->currentLiteral .= $c; |
168 | 168 | $this->i++; // move pointer |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $this->i++; // move pointer |
173 | 173 | break; |
174 | 174 | default: |
175 | - if(strlen($this->currentLiteral) != 0) { |
|
175 | + if (strlen($this->currentLiteral) != 0) { |
|
176 | 176 | $this->addToList(new LoggerLiteralPatternConverter($this->currentLiteral)); |
177 | 177 | } |
178 | 178 | $this->currentLiteral = $c; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | break; |
186 | 186 | case self::CONVERTER_STATE: |
187 | 187 | $this->currentLiteral .= $c; |
188 | - switch($c) { |
|
188 | + switch ($c) { |
|
189 | 189 | case '-': |
190 | 190 | $this->formattingInfo->leftAlign = true; |
191 | 191 | break; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->state = self::DOT_STATE; |
194 | 194 | break; |
195 | 195 | default: |
196 | - if(ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
196 | + if (ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
197 | 197 | $this->formattingInfo->min = ord($c) - ord('0'); |
198 | 198 | $this->state = self::MIN_STATE; |
199 | 199 | } else { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | break; |
204 | 204 | case self::MIN_STATE: |
205 | 205 | $this->currentLiteral .= $c; |
206 | - if(ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
206 | + if (ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
207 | 207 | $this->formattingInfo->min = ($this->formattingInfo->min * 10) + (ord($c) - ord('0')); |
208 | 208 | } else if ($c == '.') { |
209 | 209 | $this->state = self::DOT_STATE; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | break; |
214 | 214 | case self::DOT_STATE: |
215 | 215 | $this->currentLiteral .= $c; |
216 | - if(ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
216 | + if (ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
217 | 217 | $this->formattingInfo->max = ord($c) - ord('0'); |
218 | 218 | $this->state = self::MAX_STATE; |
219 | 219 | } else { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | break; |
223 | 223 | case self::MAX_STATE: |
224 | 224 | $this->currentLiteral .= $c; |
225 | - if(ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
225 | + if (ord($c) >= ord('0') and ord($c) <= ord('9')) { |
|
226 | 226 | $this->formattingInfo->max = ($this->formattingInfo->max * 10) + (ord($c) - ord('0')); |
227 | 227 | } else { |
228 | 228 | $this->finalizeConverter($c); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | break; |
232 | 232 | } // switch |
233 | 233 | } // while |
234 | - if(strlen($this->currentLiteral) != 0) { |
|
234 | + if (strlen($this->currentLiteral) != 0) { |
|
235 | 235 | $this->addToList(new LoggerLiteralPatternConverter($this->currentLiteral)); |
236 | 236 | } |
237 | 237 | return $this->head; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | |
240 | 240 | public function finalizeConverter($c) { |
241 | 241 | $pc = null; |
242 | - switch($c) { |
|
242 | + switch ($c) { |
|
243 | 243 | case 'c': |
244 | 244 | $pc = new LoggerCategoryPatternConverter($this->formattingInfo, $this->extractPrecisionOption()); |
245 | 245 | $this->currentLiteral = ''; |
@@ -252,18 +252,18 @@ discard block |
||
252 | 252 | $dateFormatStr = self::DATE_FORMAT_ISO8601; // ISO8601_DATE_FORMAT; |
253 | 253 | $dOpt = $this->extractOption(); |
254 | 254 | |
255 | - if($dOpt !== null) |
|
255 | + if ($dOpt !== null) |
|
256 | 256 | $dateFormatStr = $dOpt; |
257 | 257 | |
258 | - if($dateFormatStr == 'ISO8601') { |
|
258 | + if ($dateFormatStr == 'ISO8601') { |
|
259 | 259 | $df = self::DATE_FORMAT_ISO8601; |
260 | - } else if($dateFormatStr == 'ABSOLUTE') { |
|
260 | + } else if ($dateFormatStr == 'ABSOLUTE') { |
|
261 | 261 | $df = self::DATE_FORMAT_ABSOLUTE; |
262 | - } else if($dateFormatStr == 'DATE') { |
|
262 | + } else if ($dateFormatStr == 'DATE') { |
|
263 | 263 | $df = self::DATE_FORMAT_DATE; |
264 | 264 | } else { |
265 | 265 | $df = $dateFormatStr; |
266 | - if($df == null) { |
|
266 | + if ($df == null) { |
|
267 | 267 | $df = self::DATE_FORMAT_ISO8601; |
268 | 268 | } |
269 | 269 | } |
@@ -303,10 +303,10 @@ discard block |
||
303 | 303 | $this->currentLiteral = ''; |
304 | 304 | break; |
305 | 305 | case 'u': |
306 | - if($this->i < $this->patternLength) { |
|
306 | + if ($this->i < $this->patternLength) { |
|
307 | 307 | $cNext = $this->pattern{$this->i}; |
308 | - if(ord($cNext) >= ord('0') and ord($cNext) <= ord('9')) { |
|
309 | - $pc = new LoggerUserFieldPatternConverter($this->formattingInfo, (string)(ord($cNext) - ord('0'))); |
|
308 | + if (ord($cNext) >= ord('0') and ord($cNext) <= ord('9')) { |
|
309 | + $pc = new LoggerUserFieldPatternConverter($this->formattingInfo, (string) (ord($cNext) - ord('0'))); |
|
310 | 310 | $this->currentLiteral = ''; |
311 | 311 | $this->i++; |
312 | 312 | } |
@@ -45,11 +45,11 @@ |
||
45 | 45 | * @return string |
46 | 46 | */ |
47 | 47 | public function convert($event) { |
48 | - switch($this->type) { |
|
48 | + switch ($this->type) { |
|
49 | 49 | case LoggerPatternParser::RELATIVE_TIME_CONVERTER: |
50 | 50 | $timeStamp = $event->getTimeStamp(); |
51 | 51 | $startTime = LoggerLoggingEvent::getStartTime(); |
52 | - return (string)(int)($timeStamp * 1000 - $startTime * 1000); |
|
52 | + return (string) (int) ($timeStamp * 1000 - $startTime * 1000); |
|
53 | 53 | |
54 | 54 | case LoggerPatternParser::THREAD_CONVERTER: |
55 | 55 | return $event->getThreadName(); |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | * @static |
51 | 51 | */ |
52 | 52 | public static function getSystemProperty($key, $def) { |
53 | - if(defined($key)) { |
|
54 | - return (string)constant($key); |
|
55 | - } else if(isset($_SERVER[$key])) { |
|
56 | - return (string)$_SERVER[$key]; |
|
57 | - } else if(isset($_ENV[$key])) { |
|
58 | - return (string)$_ENV[$key]; |
|
53 | + if (defined($key)) { |
|
54 | + return (string) constant($key); |
|
55 | + } else if (isset($_SERVER[$key])) { |
|
56 | + return (string) $_SERVER[$key]; |
|
57 | + } else if (isset($_ENV[$key])) { |
|
58 | + return (string) $_ENV[$key]; |
|
59 | 59 | } else { |
60 | 60 | return $def; |
61 | 61 | } |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @static |
77 | 77 | */ |
78 | - public static function toBoolean($value, $default=true) { |
|
78 | + public static function toBoolean($value, $default = true) { |
|
79 | 79 | if (is_null($value)) { |
80 | 80 | return $default; |
81 | 81 | } elseif (is_string($value)) { |
82 | 82 | $trimmedVal = strtolower(trim($value)); |
83 | 83 | |
84 | - if("1" == $trimmedVal or "true" == $trimmedVal or "yes" == $trimmedVal or "on" == $trimmedVal) { |
|
84 | + if ("1" == $trimmedVal or "true" == $trimmedVal or "yes" == $trimmedVal or "on" == $trimmedVal) { |
|
85 | 85 | return true; |
86 | 86 | } else if ("" == $trimmedVal or "0" == $trimmedVal or "false" == $trimmedVal or "no" == $trimmedVal or "off" == $trimmedVal) { |
87 | 87 | return false; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return !($value == 0); // true is everything but 0 like in C |
93 | 93 | } |
94 | 94 | |
95 | - trigger_error("Could not convert ".var_export($value,1)." to boolean!", E_USER_WARNING); |
|
95 | + trigger_error("Could not convert ".var_export($value, 1)." to boolean!", E_USER_WARNING); |
|
96 | 96 | return $default; |
97 | 97 | } |
98 | 98 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public static function toInt($value, $default) { |
106 | 106 | $value = trim($value); |
107 | - if(is_numeric($value)) { |
|
108 | - return (int)$value; |
|
107 | + if (is_numeric($value)) { |
|
108 | + return (int) $value; |
|
109 | 109 | } else { |
110 | 110 | return $default; |
111 | 111 | } |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | * @static |
140 | 140 | */ |
141 | 141 | public static function toLevel($value, $defaultValue) { |
142 | - if($value === null) { |
|
142 | + if ($value === null) { |
|
143 | 143 | return $defaultValue; |
144 | 144 | } |
145 | 145 | $hashIndex = strpos($value, '#'); |
146 | - if($hashIndex === false) { |
|
147 | - if("NULL" == strtoupper($value)) { |
|
146 | + if ($hashIndex === false) { |
|
147 | + if ("NULL" == strtoupper($value)) { |
|
148 | 148 | return null; |
149 | 149 | } else { |
150 | 150 | // no class name specified : use standard Level class |
@@ -158,15 +158,15 @@ discard block |
||
158 | 158 | $levelName = substr($value, 0, $hashIndex); |
159 | 159 | |
160 | 160 | // This is degenerate case but you never know. |
161 | - if("NULL" == strtoupper($levelName)) { |
|
161 | + if ("NULL" == strtoupper($levelName)) { |
|
162 | 162 | return null; |
163 | 163 | } |
164 | 164 | |
165 | 165 | $clazz = basename($clazz); |
166 | 166 | |
167 | - if(class_exists($clazz)) { |
|
167 | + if (class_exists($clazz)) { |
|
168 | 168 | $result = @call_user_func(array($clazz, 'toLevel'), $levelName, $defaultValue); |
169 | - if(!$result instanceof LoggerLevel) { |
|
169 | + if (!$result instanceof LoggerLevel) { |
|
170 | 170 | $result = $defaultValue; |
171 | 171 | } |
172 | 172 | } |
@@ -181,24 +181,24 @@ discard block |
||
181 | 181 | * @static |
182 | 182 | */ |
183 | 183 | public static function toFileSize($value, $default) { |
184 | - if($value === null) { |
|
184 | + if ($value === null) { |
|
185 | 185 | return $default; |
186 | 186 | } |
187 | 187 | |
188 | 188 | $s = strtoupper(trim($value)); |
189 | - $multiplier = (float)1; |
|
190 | - if(($index = strpos($s, 'KB')) !== false) { |
|
189 | + $multiplier = (float) 1; |
|
190 | + if (($index = strpos($s, 'KB')) !== false) { |
|
191 | 191 | $multiplier = 1024; |
192 | 192 | $s = substr($s, 0, $index); |
193 | - } else if(($index = strpos($s, 'MB')) !== false) { |
|
193 | + } else if (($index = strpos($s, 'MB')) !== false) { |
|
194 | 194 | $multiplier = 1024 * 1024; |
195 | 195 | $s = substr($s, 0, $index); |
196 | - } else if(($index = strpos($s, 'GB')) !== false) { |
|
196 | + } else if (($index = strpos($s, 'GB')) !== false) { |
|
197 | 197 | $multiplier = 1024 * 1024 * 1024; |
198 | 198 | $s = substr($s, 0, $index); |
199 | 199 | } |
200 | - if(is_numeric($s)) { |
|
201 | - return (float)$s * $multiplier; |
|
200 | + if (is_numeric($s)) { |
|
201 | + return (float) $s * $multiplier; |
|
202 | 202 | } |
203 | 203 | return $default; |
204 | 204 | } |
@@ -277,11 +277,11 @@ discard block |
||
277 | 277 | public static function substVars($val, $props = null) { |
278 | 278 | $sbuf = ''; |
279 | 279 | $i = 0; |
280 | - while(true) { |
|
280 | + while (true) { |
|
281 | 281 | $j = strpos($val, self::DELIM_START, $i); |
282 | - if($j === false) { |
|
282 | + if ($j === false) { |
|
283 | 283 | // no more variables |
284 | - if($i == 0) { // this is a simple string |
|
284 | + if ($i == 0) { // this is a simple string |
|
285 | 285 | return $val; |
286 | 286 | } else { // add the tail string which contails no variables and return the result. |
287 | 287 | $sbuf .= substr($val, $i); |
@@ -289,9 +289,9 @@ discard block |
||
289 | 289 | } |
290 | 290 | } else { |
291 | 291 | |
292 | - $sbuf .= substr($val, $i, $j-$i); |
|
292 | + $sbuf .= substr($val, $i, $j - $i); |
|
293 | 293 | $k = strpos($val, self::DELIM_STOP, $j); |
294 | - if($k === false) { |
|
294 | + if ($k === false) { |
|
295 | 295 | // LoggerOptionConverter::substVars() has no closing brace. Opening brace |
296 | 296 | return ''; |
297 | 297 | } else { |
@@ -300,11 +300,11 @@ discard block |
||
300 | 300 | // first try in System properties |
301 | 301 | $replacement = LoggerOptionConverter::getSystemProperty($key, null); |
302 | 302 | // then try props parameter |
303 | - if($replacement == null and $props !== null) { |
|
303 | + if ($replacement == null and $props !== null) { |
|
304 | 304 | $replacement = @$props[$key]; |
305 | 305 | } |
306 | 306 | |
307 | - if(!empty($replacement)) { |
|
307 | + if (!empty($replacement)) { |
|
308 | 308 | // Do variable substitution on the replacement string |
309 | 309 | // such that we can solve "Hello ${x2}" as "Hello p1" |
310 | 310 | // the where the properties are |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function convert($event) { |
48 | 48 | $locationInfo = $event->getLocationInformation(); |
49 | - switch($this->type) { |
|
49 | + switch ($this->type) { |
|
50 | 50 | case LoggerPatternParser::FULL_LOCATION_CONVERTER: |
51 | 51 | return $locationInfo->getFullInfo(); |
52 | 52 | case LoggerPatternParser::METHOD_LOCATION_CONVERTER: |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function __construct($formattingInfo, $precision) { |
40 | 40 | parent::__construct($formattingInfo); |
41 | - $this->precision = $precision; |
|
41 | + $this->precision = $precision; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -57,17 +57,17 @@ discard block |
||
57 | 57 | */ |
58 | 58 | function convert($event) { |
59 | 59 | $n = $this->getFullyQualifiedName($event); |
60 | - if($this->precision <= 0) { |
|
60 | + if ($this->precision <= 0) { |
|
61 | 61 | return $n; |
62 | 62 | } else { |
63 | 63 | $len = strlen($n); |
64 | 64 | // We substract 1 from 'len' when assigning to 'end' to avoid out of |
65 | 65 | // bounds exception in return r.substring(end+1, len). This can happen if |
66 | 66 | // precision is 1 and the category name ends with a dot. |
67 | - $end = $len -1 ; |
|
68 | - for($i = $this->precision; $i > 0; $i--) { |
|
67 | + $end = $len - 1; |
|
68 | + for ($i = $this->precision; $i > 0; $i--) { |
|
69 | 69 | $end = strrpos(substr($n, 0, ($end - 1)), '.'); |
70 | - if($end == false) { |
|
70 | + if ($end == false) { |
|
71 | 71 | return $n; |
72 | 72 | } |
73 | 73 | } |
@@ -69,8 +69,8 @@ |
||
69 | 69 | $this->fileName = isset($trace['file']) ? $trace['file'] : null; |
70 | 70 | $this->className = isset($trace['class']) ? $trace['class'] : null; |
71 | 71 | $this->methodName = isset($trace['function']) ? $trace['function'] : null; |
72 | - $this->fullInfo = $this->getClassName() . '.' . $this->getMethodName() . |
|
73 | - '(' . $this->getFileName() . ':' . $this->getLineNumber() . ')'; |
|
72 | + $this->fullInfo = $this->getClassName().'.'.$this->getMethodName(). |
|
73 | + '('.$this->getFileName().':'.$this->getLineNumber().')'; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function getClassName() { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param string $l the level min to match |
91 | 91 | */ |
92 | 92 | public function setLevelMin($l) { |
93 | - if($l instanceof LoggerLevel) { |
|
93 | + if ($l instanceof LoggerLevel) { |
|
94 | 94 | $this->levelMin = $l; |
95 | 95 | } else { |
96 | 96 | $this->levelMin = LoggerOptionConverter::toLevel($l, null); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param string $l the level max to match |
102 | 102 | */ |
103 | 103 | public function setLevelMax($l) { |
104 | - if($l instanceof LoggerLevel) { |
|
104 | + if ($l instanceof LoggerLevel) { |
|
105 | 105 | $this->levelMax = $l; |
106 | 106 | } else { |
107 | 107 | $this->levelMax = LoggerOptionConverter::toLevel($l, null); |
@@ -117,15 +117,15 @@ discard block |
||
117 | 117 | public function decide(LoggerLoggingEvent $event) { |
118 | 118 | $level = $event->getLevel(); |
119 | 119 | |
120 | - if($this->levelMin !== null) { |
|
121 | - if($level->isGreaterOrEqual($this->levelMin) == false) { |
|
120 | + if ($this->levelMin !== null) { |
|
121 | + if ($level->isGreaterOrEqual($this->levelMin) == false) { |
|
122 | 122 | // level of event is less than minimum |
123 | 123 | return LoggerFilter::DENY; |
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - if($this->levelMax !== null) { |
|
128 | - if($level->toInt() > $this->levelMax->toInt()) { |
|
127 | + if ($this->levelMax !== null) { |
|
128 | + if ($level->toInt() > $this->levelMax->toInt()) { |
|
129 | 129 | // level of event is greater than maximum |
130 | 130 | // Alas, there is no Level.isGreater method. and using |
131 | 131 | // a combo of isGreaterOrEqual && !Equal seems worse than |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | - if($this->acceptOnMatch) { |
|
137 | + if ($this->acceptOnMatch) { |
|
138 | 138 | // this filter set up to bypass later filters and always return |
139 | 139 | // accept if level in range |
140 | 140 | return LoggerFilter::ACCEPT; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param mixed $acceptOnMatch a boolean or a string ('true' or 'false') |
62 | 62 | */ |
63 | 63 | public function setAcceptOnMatch($acceptOnMatch) { |
64 | - $this->acceptOnMatch = is_bool($acceptOnMatch) ? $acceptOnMatch : (bool)(strtolower($acceptOnMatch) == 'true'); |
|
64 | + $this->acceptOnMatch = is_bool($acceptOnMatch) ? $acceptOnMatch : (bool) (strtolower($acceptOnMatch) == 'true'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | public function decide(LoggerLoggingEvent $event) { |
78 | 78 | $msg = $event->getRenderedMessage(); |
79 | 79 | |
80 | - if($msg === null or $this->stringToMatch === null) { |
|
80 | + if ($msg === null or $this->stringToMatch === null) { |
|
81 | 81 | return LoggerFilter::NEUTRAL; |
82 | 82 | } |
83 | 83 | |
84 | - if(strpos($msg, $this->stringToMatch) !== false ) { |
|
84 | + if (strpos($msg, $this->stringToMatch) !== false) { |
|
85 | 85 | return ($this->acceptOnMatch) ? LoggerFilter::ACCEPT : LoggerFilter::DENY; |
86 | 86 | } |
87 | 87 | return LoggerFilter::NEUTRAL; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param string $l the level to match |
71 | 71 | */ |
72 | 72 | public function setLevelToMatch($l) { |
73 | - if($l instanceof LoggerLevel) { |
|
73 | + if ($l instanceof LoggerLevel) { |
|
74 | 74 | $this->levelToMatch = $l; |
75 | 75 | } else { |
76 | 76 | $this->levelToMatch = LoggerOptionConverter::toLevel($l, null); |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | * @return integer |
92 | 92 | */ |
93 | 93 | public function decide(LoggerLoggingEvent $event) { |
94 | - if($this->levelToMatch === null) { |
|
94 | + if ($this->levelToMatch === null) { |
|
95 | 95 | return LoggerFilter::NEUTRAL; |
96 | 96 | } |
97 | 97 | |
98 | - if($this->levelToMatch->equals($event->getLevel())) { |
|
98 | + if ($this->levelToMatch->equals($event->getLevel())) { |
|
99 | 99 | return $this->acceptOnMatch ? LoggerFilter::ACCEPT : LoggerFilter::DENY; |
100 | 100 | } else { |
101 | 101 | return LoggerFilter::NEUTRAL; |