@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | // Construct the regex pattern |
| 62 | 62 | $this->regex = |
| 63 | - '/' . // Starting regex pattern delimiter |
|
| 64 | - self::ESCAPE_CHAR . // Character which marks the start of the conversion pattern |
|
| 63 | + '/' . // Starting regex pattern delimiter |
|
| 64 | + self::ESCAPE_CHAR . // Character which marks the start of the conversion pattern |
|
| 65 | 65 | '(?P<modifiers>[0-9.-]*)' . // Format modifiers (optional) |
| 66 | - '(?P<word>[a-zA-Z]+)' . // The conversion word |
|
| 67 | - '(?P<option>{[^}]*})?' . // Conversion option in braces (optional) |
|
| 68 | - '/'; // Ending regex pattern delimiter |
|
| 66 | + '(?P<word>[a-zA-Z]+)' . // The conversion word |
|
| 67 | + '(?P<option>{[^}]*})?' . // Conversion option in braces (optional) |
|
| 68 | + '/'; // Ending regex pattern delimiter |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $prevEnd = 0; |
| 93 | 93 | |
| 94 | - foreach($matches[0] as $key => $item) { |
|
| 94 | + foreach ($matches[0] as $key => $item) { |
|
| 95 | 95 | |
| 96 | 96 | // Locate where the conversion command starts and ends |
| 97 | 97 | $length = strlen($item[0]); |
@@ -172,12 +172,12 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | $converterClass = $this->converterMap[$word]; |
| 175 | - if(!class_exists($converterClass)) { |
|
| 175 | + if (!class_exists($converterClass)) { |
|
| 176 | 176 | throw new Payone_Log4php_LoggerException("Class '$converterClass' does not exist."); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | $converter = new $converterClass($info, $option); |
| 180 | - if(!($converter instanceof Payone_Log4php_LoggerPatternConverter)) { |
|
| 180 | + if (!($converter instanceof Payone_Log4php_LoggerPatternConverter)) { |
|
| 181 | 181 | throw new Payone_Log4php_LoggerException("Class '$converterClass' is not an instance of Payone_Log4php_LoggerPatternConverter."); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -221,13 +221,13 @@ discard block |
||
| 221 | 221 | $parts = explode('.', $modifiers); |
| 222 | 222 | |
| 223 | 223 | if (!empty($parts[0])) { |
| 224 | - $minPart = (integer) $parts[0]; |
|
| 224 | + $minPart = (integer)$parts[0]; |
|
| 225 | 225 | $info->min = abs($minPart); |
| 226 | 226 | $info->padLeft = ($minPart > 0); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | if (!empty($parts[1])) { |
| 230 | - $maxPart = (integer) $parts[1]; |
|
| 230 | + $maxPart = (integer)$parts[1]; |
|
| 231 | 231 | $info->max = abs($maxPart); |
| 232 | 232 | $info->trimLeft = ($maxPart > 0); |
| 233 | 233 | } |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | protected $htmlLineBreaks = false; |
| 52 | 52 | |
| 53 | 53 | public function close() { |
| 54 | - if($this->closed != true) { |
|
| 55 | - if(!$this->firstAppend) { |
|
| 54 | + if ($this->closed != true) { |
|
| 55 | + if (!$this->firstAppend) { |
|
| 56 | 56 | echo $this->layout->getFooter(); |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
| 63 | - if($this->layout !== null) { |
|
| 64 | - if($this->firstAppend) { |
|
| 63 | + if ($this->layout !== null) { |
|
| 64 | + if ($this->firstAppend) { |
|
| 65 | 65 | echo $this->layout->getHeader(); |
| 66 | 66 | $this->firstAppend = false; |
| 67 | 67 | } |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | * @param $filter - the filter to add to this chain |
| 109 | 109 | */ |
| 110 | 110 | public function addNext($filter) { |
| 111 | - if($this->next !== null) { |
|
| 111 | + if ($this->next !== null) { |
|
| 112 | 112 | $this->next->addNext($filter); |
| 113 | 113 | } else { |
| 114 | 114 | $this->next = $filter; |
@@ -92,8 +92,8 @@ |
||
| 92 | 92 | /** Setter function for string type. */ |
| 93 | 93 | protected function setString($property, $value, $nullable = false) { |
| 94 | 94 | if ($value === null) { |
| 95 | - if($nullable) { |
|
| 96 | - $this->$property= null; |
|
| 95 | + if ($nullable) { |
|
| 96 | + $this->$property = null; |
|
| 97 | 97 | } else { |
| 98 | 98 | $this->warn("Null value given for '$property' property. Expected a string. Property not changed."); |
| 99 | 99 | } |
@@ -109,15 +109,15 @@ discard block |
||
| 109 | 109 | public function decide(Payone_Log4php_LoggerLoggingEvent $event) { |
| 110 | 110 | $level = $event->getLevel(); |
| 111 | 111 | |
| 112 | - if($this->levelMin !== null) { |
|
| 113 | - if($level->isGreaterOrEqual($this->levelMin) == false) { |
|
| 112 | + if ($this->levelMin !== null) { |
|
| 113 | + if ($level->isGreaterOrEqual($this->levelMin) == false) { |
|
| 114 | 114 | // level of event is less than minimum |
| 115 | 115 | return Payone_Log4php_LoggerFilter::DENY; |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - if($this->levelMax !== null) { |
|
| 120 | - if($level->toInt() > $this->levelMax->toInt()) { |
|
| 119 | + if ($this->levelMax !== null) { |
|
| 120 | + if ($level->toInt() > $this->levelMax->toInt()) { |
|
| 121 | 121 | // level of event is greater than maximum |
| 122 | 122 | // Alas, there is no Level.isGreater method. and using |
| 123 | 123 | // a combo of isGreaterOrEqual && !Equal seems worse than |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - if($this->acceptOnMatch) { |
|
| 129 | + if ($this->acceptOnMatch) { |
|
| 130 | 130 | // this filter set up to bypass later filters and always return |
| 131 | 131 | // accept if level in range |
| 132 | 132 | return Payone_Log4php_LoggerFilter::ACCEPT; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public function activateOptions() { |
| 39 | 39 | // Parse the option (desired output length) |
| 40 | 40 | if (isset($this->option) && is_numeric($this->option) && $this->option >= 0) { |
| 41 | - $this->length = (integer) $this->option; |
|
| 41 | + $this->length = (integer)$this->option; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | return $name; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - foreach($fragments as $key => &$fragment) { |
|
| 88 | + foreach ($fragments as $key => &$fragment) { |
|
| 89 | 89 | |
| 90 | 90 | // Never shorten last fragment |
| 91 | 91 | if ($key == $count - 1) { |
@@ -87,11 +87,11 @@ |
||
| 87 | 87 | * @return integer |
| 88 | 88 | */ |
| 89 | 89 | public function decide(Payone_Log4php_LoggerLoggingEvent $event) { |
| 90 | - if($this->levelToMatch === null) { |
|
| 90 | + if ($this->levelToMatch === null) { |
|
| 91 | 91 | return Payone_Log4php_LoggerFilter::NEUTRAL; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if($this->levelToMatch->equals($event->getLevel())) { |
|
| 94 | + if ($this->levelToMatch->equals($event->getLevel())) { |
|
| 95 | 95 | return $this->acceptOnMatch ? Payone_Log4php_LoggerFilter::ACCEPT : Payone_Log4php_LoggerFilter::DENY; |
| 96 | 96 | } else { |
| 97 | 97 | return Payone_Log4php_LoggerFilter::NEUTRAL; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | class Payone_Log4php_LoggerAppenderPool { |
| 33 | 33 | |
| 34 | 34 | /** Holds appenders indexed by their name */ |
| 35 | - public static $appenders = array(); |
|
| 35 | + public static $appenders = array(); |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Adds an appender to the pool. |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $name = $appender->getName(); |
| 45 | 45 | |
| 46 | - if(empty($name)) { |
|
| 46 | + if (empty($name)) { |
|
| 47 | 47 | trigger_error('log4php: Cannot add unnamed appender to pool.', E_USER_WARNING); |
| 48 | 48 | return; |
| 49 | 49 | } |
@@ -94,6 +94,6 @@ discard block |
||
| 94 | 94 | * Clears all appenders from the pool. |
| 95 | 95 | */ |
| 96 | 96 | public static function clear() { |
| 97 | - self::$appenders = array(); |
|
| 97 | + self::$appenders = array(); |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | \ No newline at end of file |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | public function setSubject($subject) { |
| 114 | - $this->setString('subject', $subject); |
|
| 114 | + $this->setString('subject', $subject); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | public function setTo($to) { |
| 118 | - $this->setString('to', $to); |
|
| 118 | + $this->setString('to', $to); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | public function setDry($dry) { |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | public function append(Payone_Log4php_LoggerLoggingEvent $event) { |
| 126 | 126 | $smtpHost = $this->smtpHost; |
| 127 | 127 | $prevSmtpHost = ini_get('SMTP'); |
| 128 | - if(!empty($smtpHost)) { |
|
| 128 | + if (!empty($smtpHost)) { |
|
| 129 | 129 | ini_set('SMTP', $smtpHost); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | $smtpPort = $this->port; |
| 133 | - $prevSmtpPort= ini_get('smtp_port'); |
|
| 134 | - if($smtpPort > 0 and $smtpPort < 65535) { |
|
| 133 | + $prevSmtpPort = ini_get('smtp_port'); |
|
| 134 | + if ($smtpPort > 0 and $smtpPort < 65535) { |
|
| 135 | 135 | ini_set('smtp_port', $smtpPort); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $addHeader = empty($this->from) ? '' : "From: {$this->from}\r\n"; |
| 141 | 141 | |
| 142 | - if(!$this->dry) { |
|
| 142 | + if (!$this->dry) { |
|
| 143 | 143 | $result = mail($this->to, $this->subject, $this->layout->getHeader() . $this->layout->format($event) . $this->layout->getFooter($event), $addHeader); |
| 144 | 144 | } else { |
| 145 | - echo "DRY MODE OF MAIL APP.: Send mail to: ".$this->to." with additional headers '".trim($addHeader)."' and content: ".$this->layout->format($event); |
|
| 145 | + echo "DRY MODE OF MAIL APP.: Send mail to: " . $this->to . " with additional headers '" . trim($addHeader) . "' and content: " . $this->layout->format($event); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | ini_set('SMTP', $prevSmtpHost); |