@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace SKien\XLogger; |
| 5 | 5 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | protected function openLogfile() : void |
| 122 | 122 | { |
| 123 | - if (!$this->xmlDoc || !$this->xmlRoot) { |
|
| 123 | + if (!$this->xmlDoc || !$this->xmlRoot) { |
|
| 124 | 124 | $strFullPath = $this->getFullpath(); |
| 125 | 125 | if (!file_exists($strFullPath)) { |
| 126 | 126 | $this->createLogfile(); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * @param \DOMElement $oParent |
| 176 | 176 | * @return \DOMElement |
| 177 | 177 | */ |
| 178 | - public function addChildToDoc(string $strName, string $strValue='', \DOMElement $oParent=null) : ?\DOMElement |
|
| 178 | + public function addChildToDoc(string $strName, string $strValue = '', \DOMElement $oParent = null) : ?\DOMElement |
|
| 179 | 179 | { |
| 180 | 180 | $oChild = null; |
| 181 | 181 | if ($this->xmlDoc) { |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | ChromePhp::log($strMessage); |
| 71 | 71 | break; |
| 72 | 72 | } |
| 73 | - if (count($context) >0) { |
|
| 73 | + if (count($context) > 0) { |
|
| 74 | 74 | ChromePhp::group(); |
| 75 | 75 | foreach ($context as $key => $value) { |
| 76 | 76 | // only add, if not included as placeholder in the mesage |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // timestamp |
| 77 | - $strLine = date('Y-m-d H:i:s'); |
|
| 77 | + $strLine = date('Y-m-d H:i:s'); |
|
| 78 | 78 | // IP adress |
| 79 | - if (($this->iOptions & self::LOG_IP) != 0 ) { |
|
| 79 | + if (($this->iOptions & self::LOG_IP) != 0) { |
|
| 80 | 80 | $strIP = $_SERVER['REMOTE_ADDR']; |
| 81 | 81 | if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
| 82 | 82 | $strIP = $_SERVER['HTTP_X_FORWARDED_FOR']; |
@@ -84,18 +84,18 @@ discard block |
||
| 84 | 84 | $strLine .= $this->strSep . $strIP; |
| 85 | 85 | } |
| 86 | 86 | // user |
| 87 | - if (($this->iOptions & self::LOG_USER) != 0 ) { |
|
| 87 | + if (($this->iOptions & self::LOG_USER) != 0) { |
|
| 88 | 88 | $strLine .= $this->strSep . $this->prepareText($this->strUser); |
| 89 | 89 | } |
| 90 | 90 | // backtrace - caller |
| 91 | - if (($this->iOptions & self::LOG_BT) != 0 ) { |
|
| 91 | + if (($this->iOptions & self::LOG_BT) != 0) { |
|
| 92 | 92 | $strLine .= $this->strSep . $this->getCaller(); |
| 93 | 93 | } |
| 94 | 94 | // the message |
| 95 | 95 | $strMessage = $this->replaceContext($message, $context); |
| 96 | 96 | $strLine .= $this->strSep . $this->prepareText(strtoupper($level) . ': ' . $strMessage); |
| 97 | 97 | // user agent |
| 98 | - if (($this->iOptions & self::LOG_BT) != 0 ) { |
|
| 98 | + if (($this->iOptions & self::LOG_BT) != 0) { |
|
| 99 | 99 | $strLine .= $this->strSep . $this->prepareText($_SERVER["HTTP_USER_AGENT"]); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | case 'csv': |
| 121 | 121 | case 'txt': |
| 122 | 122 | $this->strSep = ";"; |
| 123 | - $this->strReplace =","; |
|
| 123 | + $this->strReplace = ","; |
|
| 124 | 124 | break; |
| 125 | 125 | case 'log': |
| 126 | 126 | default: |
| 127 | 127 | $this->strSep = "\t"; |
| 128 | - $this->strReplace =" "; |
|
| 128 | + $this->strReplace = " "; |
|
| 129 | 129 | break; |
| 130 | 130 | } |
| 131 | 131 | $this->logfile = fopen($strFullPath, 'a'); |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | $this->fb->log($strMessage); |
| 81 | 81 | break; |
| 82 | 82 | } |
| 83 | - if (count($context) >0) { |
|
| 83 | + if (count($context) > 0) { |
|
| 84 | 84 | // $this->fb->group('context'); |
| 85 | 85 | foreach ($context as $key => $value) { |
| 86 | 86 | // only add, if not included as placeholder in the mesage |
@@ -204,7 +204,7 @@ |
||
| 204 | 204 | if ($aCaller) { |
| 205 | 205 | // the base path on server isn't from interest.. |
| 206 | 206 | $strFile = str_replace($_SERVER['DOCUMENT_ROOT'], '', $aCaller['file']); |
| 207 | - $strCaller = $strFile . ' ('.$aCaller['line'].')'; |
|
| 207 | + $strCaller = $strFile . ' (' . $aCaller['line'] . ')'; |
|
| 208 | 208 | } |
| 209 | 209 | return $strCaller; |
| 210 | 210 | } |