@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function addRenderer($renderedClassName, $renderingClassName) { |
| 66 | 66 | $renderer = Payone_Log4php_LoggerReflectionUtils::createObject($renderingClassName); |
| 67 | - if($renderer == null) { |
|
| 67 | + if ($renderer == null) { |
|
| 68 | 68 | return; |
| 69 | 69 | } else { |
| 70 | 70 | $this->put($renderedClassName, $renderer); |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | * @return string |
| 86 | 86 | */ |
| 87 | 87 | public function findAndRender($o) { |
| 88 | - if($o == null) { |
|
| 88 | + if ($o == null) { |
|
| 89 | 89 | return null; |
| 90 | 90 | } else { |
| 91 | - if(is_object($o)) { |
|
| 91 | + if (is_object($o)) { |
|
| 92 | 92 | $renderer = $this->getByObject($o); |
| 93 | - if($renderer !== null) { |
|
| 93 | + if ($renderer !== null) { |
|
| 94 | 94 | return $renderer->render($o); |
| 95 | 95 | } else { |
| 96 | 96 | return null; |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function getByClassName($class) { |
| 127 | 127 | $r = null; |
| 128 | - for($c = $class; !empty($c); $c = get_parent_class($c)) { |
|
| 128 | + for ($c = $class; !empty($c); $c = get_parent_class($c)) { |
|
| 129 | 129 | $c = strtolower($c); |
| 130 | - if(isset($this->map[$c])) { |
|
| 130 | + if (isset($this->map[$c])) { |
|
| 131 | 131 | return $this->map[$c]; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public function __construct($level = null) { |
| 35 | 35 | parent::__construct('root'); |
| 36 | 36 | |
| 37 | - if($level == null) { |
|
| 37 | + if ($level == null) { |
|
| 38 | 38 | $level = Payone_Log4php_LoggerLevel::getLevelAll(); |
| 39 | 39 | } |
| 40 | 40 | $this->setLevel($level); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @param Payone_Log4php_LoggerLevel $level |
| 53 | 53 | */ |
| 54 | 54 | public function setLevel($level) { |
| 55 | - if($level != null) { |
|
| 55 | + if ($level != null) { |
|
| 56 | 56 | parent::setLevel($level); |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * @return string The innermost diagnostic context. |
| 139 | 139 | */ |
| 140 | 140 | public static function pop() { |
| 141 | - if(count(self::$stack) > 0) { |
|
| 141 | + if (count(self::$stack) > 0) { |
|
| 142 | 142 | return array_pop(self::$stack); |
| 143 | 143 | } else { |
| 144 | 144 | return ''; |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | * context is available, then the empty string "" is returned.</p> |
| 154 | 154 | * @return string The innermost diagnostic context. |
| 155 | 155 | */ |
| 156 | - public static function peek(){ |
|
| 157 | - if(count(self::$stack) > 0) { |
|
| 156 | + public static function peek() { |
|
| 157 | + if (count(self::$stack) > 0) { |
|
| 158 | 158 | return end(self::$stack); |
| 159 | 159 | } else { |
| 160 | 160 | return ''; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public static function setMaxDepth($maxDepth) { |
| 198 | 198 | $maxDepth = (int)$maxDepth; |
| 199 | - if(Payone_Log4php_LoggerNDC::getDepth() > $maxDepth) { |
|
| 199 | + if (Payone_Log4php_LoggerNDC::getDepth() > $maxDepth) { |
|
| 200 | 200 | self::$stack = array_slice(self::$stack, 0, $maxDepth); |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -28,11 +28,11 @@ |
||
| 28 | 28 | class Payone_Log4php_LoggerRendererException implements Payone_Log4php_LoggerRendererObject { |
| 29 | 29 | |
| 30 | 30 | public function render($o) { |
| 31 | - $strRep = 'Throwable('.get_class($o).'): '.$o->getMessage().' in '.$o->getFile().' on line '.$o->getLine(); |
|
| 32 | - $strRep .= PHP_EOL.$o->getTraceAsString(); |
|
| 31 | + $strRep = 'Throwable(' . get_class($o) . '): ' . $o->getMessage() . ' in ' . $o->getFile() . ' on line ' . $o->getLine(); |
|
| 32 | + $strRep .= PHP_EOL . $o->getTraceAsString(); |
|
| 33 | 33 | |
| 34 | 34 | if (method_exists($o, 'getPrevious') && $o->getPrevious() !== null) { |
| 35 | - $strRep .= PHP_EOL.'Caused by: '.$this->render($o->getPrevious()); |
|
| 35 | + $strRep .= PHP_EOL . 'Caused by: ' . $this->render($o->getPrevious()); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | return $strRep; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | // Parse the insert patterns; pattern parts are comma delimited |
| 136 | 136 | $pieces = explode(',', $this->insertPattern); |
| 137 | 137 | $converterMap = Payone_Log4php_LoggerLayoutPattern::getDefaultConverterMap(); |
| 138 | - foreach($pieces as $pattern) { |
|
| 138 | + foreach ($pieces as $pattern) { |
|
| 139 | 139 | $parser = new Payone_Log4php_LoggerPatternParser($pattern, $converterMap); |
| 140 | 140 | $this->converters[] = $parser->parse(); |
| 141 | 141 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | @$this->preparedInsert->closeCursor(); |
| 179 | 179 | break; |
| 180 | 180 | } catch (PDOException $e) { |
| 181 | - $this->warn("Failed writing to database: ". $e->getMessage()); |
|
| 181 | + $this->warn("Failed writing to database: " . $e->getMessage()); |
|
| 182 | 182 | |
| 183 | 183 | // Close the appender if it's the last attempt |
| 184 | 184 | if ($attempt == $this->reconnectAttempts) { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | protected function format(Payone_Log4php_LoggerLoggingEvent $event) { |
| 199 | 199 | $params = array(); |
| 200 | - foreach($this->converters as $converter) { |
|
| 200 | + foreach ($this->converters as $converter) { |
|
| 201 | 201 | $buffer = ''; |
| 202 | 202 | while ($converter !== null) { |
| 203 | 203 | $converter->format($buffer, $event); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | // Parse the option (date format) |
| 54 | 54 | if (isset($this->option)) { |
| 55 | - if(isset($this->specials[$this->option])) { |
|
| 55 | + if (isset($this->specials[$this->option])) { |
|
| 56 | 56 | $this->format = $this->specials[$this->option]; |
| 57 | 57 | } else { |
| 58 | 58 | $this->format = $this->option; |
@@ -43,8 +43,8 @@ |
||
| 43 | 43 | } else { |
| 44 | 44 | $buff = array(); |
| 45 | 45 | $map = $event->getMDCMap(); |
| 46 | - foreach($map as $key => $value) { |
|
| 47 | - $buff []= "$key=$value"; |
|
| 46 | + foreach ($map as $key => $value) { |
|
| 47 | + $buff [] = "$key=$value"; |
|
| 48 | 48 | } |
| 49 | 49 | return implode(', ', $buff); |
| 50 | 50 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | public function format(Payone_Log4php_LoggerLoggingEvent $event) { |
| 49 | 49 | // If required, initialize the location data |
| 50 | - if($this->locationInfo) { |
|
| 50 | + if ($this->locationInfo) { |
|
| 51 | 51 | $event->getLocationInformation(); |
| 52 | 52 | } |
| 53 | 53 | return serialize($event) . PHP_EOL; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | $appenders = array(); |
| 100 | 100 | |
| 101 | - foreach($properties as $key => $value) { |
|
| 101 | + foreach ($properties as $key => $value) { |
|
| 102 | 102 | // Parse loggers |
| 103 | 103 | if ($this->beginsWith($key, self::LOGGER_PREFIX)) { |
| 104 | 104 | $name = substr($key, strlen(self::LOGGER_PREFIX)); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | // The remaining values are appender references |
| 151 | 151 | $appenders = array(); |
| 152 | - while($appender = array_shift($parts)) { |
|
| 152 | + while ($appender = array_shift($parts)) { |
|
| 153 | 153 | $appender = trim($appender); |
| 154 | 154 | if (!empty($appender)) { |
| 155 | 155 | $appenders[] = trim($appender); |