Completed
Branch master (d77618)
by Florian
06:00
created
lib/Payone/Log4php/LoggerAppenderRollingFile.php 3 patches
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -48,184 +48,184 @@
 block discarded – undo
48 48
  */
49 49
 class Payone_Log4php_LoggerAppenderRollingFile extends Payone_Log4php_LoggerAppenderFile {
50 50
 
51
-	/**
52
-	 * Set the maximum size that the output file is allowed to reach
53
-	 * before being rolled over to backup files.
54
-	 *
55
-	 * <p>In configuration files, the <var>MaxFileSize</var> option takes a
56
-	 * long integer in the range 0 - 2^63. You can specify the value
57
-	 * with the suffixes "KB", "MB" or "GB" so that the integer is
58
-	 * interpreted being expressed respectively in kilobytes, megabytes
59
-	 * or gigabytes. For example, the value "10KB" will be interpreted
60
-	 * as 10240.</p>
61
-	 * <p>The default maximum file size is 10MB.</p>
62
-	 *
63
-	 * <p>Note that MaxFileSize cannot exceed <b>2 GB</b>.</p>
64
-	 *
65
-	 * @var integer
66
-	 */
67
-	protected $maxFileSize = 10485760;
51
+    /**
52
+     * Set the maximum size that the output file is allowed to reach
53
+     * before being rolled over to backup files.
54
+     *
55
+     * <p>In configuration files, the <var>MaxFileSize</var> option takes a
56
+     * long integer in the range 0 - 2^63. You can specify the value
57
+     * with the suffixes "KB", "MB" or "GB" so that the integer is
58
+     * interpreted being expressed respectively in kilobytes, megabytes
59
+     * or gigabytes. For example, the value "10KB" will be interpreted
60
+     * as 10240.</p>
61
+     * <p>The default maximum file size is 10MB.</p>
62
+     *
63
+     * <p>Note that MaxFileSize cannot exceed <b>2 GB</b>.</p>
64
+     *
65
+     * @var integer
66
+     */
67
+    protected $maxFileSize = 10485760;
68 68
 	
69
-	/**
70
-	 * Set the maximum number of backup files to keep around.
71
-	 * 
72
-	 * <p>The <var>MaxBackupIndex</var> option determines how many backup
73
-	 * files are kept before the oldest is erased. This option takes
74
-	 * a positive integer value. If set to zero, then there will be no
75
-	 * backup files and the log file will be truncated when it reaches
76
-	 * MaxFileSize.</p>
77
-	 * <p>There is one backup file by default.</p>
78
-	 *
79
-	 * @var integer 
80
-	 */
81
-	protected $maxBackupIndex = 1;
69
+    /**
70
+     * Set the maximum number of backup files to keep around.
71
+     * 
72
+     * <p>The <var>MaxBackupIndex</var> option determines how many backup
73
+     * files are kept before the oldest is erased. This option takes
74
+     * a positive integer value. If set to zero, then there will be no
75
+     * backup files and the log file will be truncated when it reaches
76
+     * MaxFileSize.</p>
77
+     * <p>There is one backup file by default.</p>
78
+     *
79
+     * @var integer 
80
+     */
81
+    protected $maxBackupIndex = 1;
82 82
 	
83
-	/**
84
-	 * @var string the filename expanded
85
-	 */
86
-	private $expandedFileName = null;
83
+    /**
84
+     * @var string the filename expanded
85
+     */
86
+    private $expandedFileName = null;
87 87
 
88
-	/**
89
-	 * Returns the value of the MaxBackupIndex option.
90
-	 * @return integer 
91
-	 */
92
-	private function getExpandedFileName() {
93
-		return $this->expandedFileName;
94
-	}
88
+    /**
89
+     * Returns the value of the MaxBackupIndex option.
90
+     * @return integer 
91
+     */
92
+    private function getExpandedFileName() {
93
+        return $this->expandedFileName;
94
+    }
95 95
 
96
-	/**
97
-	 * Get the maximum size that the output file is allowed to reach
98
-	 * before being rolled over to backup files.
99
-	 * @return integer
100
-	 */
101
-	public function getMaximumFileSize() {
102
-		return $this->maxFileSize;
103
-	}
96
+    /**
97
+     * Get the maximum size that the output file is allowed to reach
98
+     * before being rolled over to backup files.
99
+     * @return integer
100
+     */
101
+    public function getMaximumFileSize() {
102
+        return $this->maxFileSize;
103
+    }
104 104
 
105
-	/**
106
-	 * Implements the usual roll over behaviour.
107
-	 *
108
-	 * <p>If MaxBackupIndex is positive, then files File.1, ..., File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex. 
109
-	 * Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
110
-	 * 
111
-	 * <p>If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.
112
-	 * 
113
-	 * Rollover must be called while the file is locked so that it is safe for concurrent access. 
114
-	 */
115
-	private function rollOver() {
116
-		// If maxBackups <= 0, then there is no file renaming to be done.
117
-		if($this->maxBackupIndex > 0) {
118
-			$fileName = $this->getExpandedFileName();
105
+    /**
106
+     * Implements the usual roll over behaviour.
107
+     *
108
+     * <p>If MaxBackupIndex is positive, then files File.1, ..., File.MaxBackupIndex -1 are renamed to File.2, ..., File.MaxBackupIndex. 
109
+     * Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
110
+     * 
111
+     * <p>If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.
112
+     * 
113
+     * Rollover must be called while the file is locked so that it is safe for concurrent access. 
114
+     */
115
+    private function rollOver() {
116
+        // If maxBackups <= 0, then there is no file renaming to be done.
117
+        if($this->maxBackupIndex > 0) {
118
+            $fileName = $this->getExpandedFileName();
119 119
 
120
-			// Delete the oldest file, to keep Windows happy.
121
-			$file = $fileName . '.' . $this->maxBackupIndex;
122
-			if(is_writable($file))
123
-				unlink($file);
120
+            // Delete the oldest file, to keep Windows happy.
121
+            $file = $fileName . '.' . $this->maxBackupIndex;
122
+            if(is_writable($file))
123
+                unlink($file);
124 124
 
125
-			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
126
-			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
127
-				$file = $fileName . "." . $i;
128
-				if(is_readable($file)) {
129
-					$target = $fileName . '.' . ($i + 1);
130
-					rename($file, $target);
131
-				}
132
-			}
125
+            // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
126
+            for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
127
+                $file = $fileName . "." . $i;
128
+                if(is_readable($file)) {
129
+                    $target = $fileName . '.' . ($i + 1);
130
+                    rename($file, $target);
131
+                }
132
+            }
133 133
 	
134
-			// Backup the active file
135
-			copy($fileName, "$fileName.1");
136
-		}
134
+            // Backup the active file
135
+            copy($fileName, "$fileName.1");
136
+        }
137 137
 		
138
-		// Truncate the active file
139
-		ftruncate($this->fp, 0);
140
-		rewind($this->fp);
141
-	}
138
+        // Truncate the active file
139
+        ftruncate($this->fp, 0);
140
+        rewind($this->fp);
141
+    }
142 142
 	
143
-	public function setFile($fileName) {
144
-		$this->file = $fileName;
145
-		// As Payone_Log4php_LoggerAppenderFile does not create the directory, it has to exist.
146
-		// realpath() fails if the argument does not exist so the filename is separated.
147
-		$this->expandedFileName = realpath(dirname($fileName));
148
-		if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
149
-		$this->expandedFileName .= DIRECTORY_SEPARATOR . basename($fileName);
150
-	}
143
+    public function setFile($fileName) {
144
+        $this->file = $fileName;
145
+        // As Payone_Log4php_LoggerAppenderFile does not create the directory, it has to exist.
146
+        // realpath() fails if the argument does not exist so the filename is separated.
147
+        $this->expandedFileName = realpath(dirname($fileName));
148
+        if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
149
+        $this->expandedFileName .= DIRECTORY_SEPARATOR . basename($fileName);
150
+    }
151 151
 
152 152
 
153
-	/**
154
-	 * Set the maximum number of backup files to keep around.
155
-	 * 
156
-	 * <p>The <b>MaxBackupIndex</b> option determines how many backup
157
-	 * files are kept before the oldest is erased. This option takes
158
-	 * a positive integer value. If set to zero, then there will be no
159
-	 * backup files and the log file will be truncated when it reaches
160
-	 * MaxFileSize.
161
-	 *
162
-	 * @param mixed $maxBackups
163
-	 */
164
-	public function setMaxBackupIndex($maxBackups) {
165
-		$this->setPositiveInteger('maxBackupIndex', $maxBackups);
166
-	}
153
+    /**
154
+     * Set the maximum number of backup files to keep around.
155
+     * 
156
+     * <p>The <b>MaxBackupIndex</b> option determines how many backup
157
+     * files are kept before the oldest is erased. This option takes
158
+     * a positive integer value. If set to zero, then there will be no
159
+     * backup files and the log file will be truncated when it reaches
160
+     * MaxFileSize.
161
+     *
162
+     * @param mixed $maxBackups
163
+     */
164
+    public function setMaxBackupIndex($maxBackups) {
165
+        $this->setPositiveInteger('maxBackupIndex', $maxBackups);
166
+    }
167 167
 
168
-	/**
169
-	 * Set the maximum size that the output file is allowed to reach
170
-	 * before being rolled over to backup files.
171
-	 *
172
-	 * @param mixed $maxFileSize
173
-	 * @see setMaxFileSize()
174
-	 * @deprecated
175
-	 */
176
-	public function setMaximumFileSize($maxFileSize) {
177
-		return $this->setMaxFileSize($maxFileSize);
178
-	}
168
+    /**
169
+     * Set the maximum size that the output file is allowed to reach
170
+     * before being rolled over to backup files.
171
+     *
172
+     * @param mixed $maxFileSize
173
+     * @see setMaxFileSize()
174
+     * @deprecated
175
+     */
176
+    public function setMaximumFileSize($maxFileSize) {
177
+        return $this->setMaxFileSize($maxFileSize);
178
+    }
179 179
 
180
-	/**
181
-	 * Set the maximum size that the output file is allowed to reach
182
-	 * before being rolled over to backup files.
183
-	 * <p>In configuration files, the <b>maxFileSize</b> option takes an
184
-	 * long integer in the range 0 - 2^63. You can specify the value
185
-	 * with the suffixes "KB", "MB" or "GB" so that the integer is
186
-	 * interpreted being expressed respectively in kilobytes, megabytes
187
-	 * or gigabytes. For example, the value "10KB" will be interpreted
188
-	 * as 10240.
189
-	 *
190
-	 * @param mixed $value
191
-	 * @return the actual file size set
192
-	 */
193
-	public function setMaxFileSize($value) {
194
-		$this->setFileSize('maxFileSize', $value);
195
-	}
180
+    /**
181
+     * Set the maximum size that the output file is allowed to reach
182
+     * before being rolled over to backup files.
183
+     * <p>In configuration files, the <b>maxFileSize</b> option takes an
184
+     * long integer in the range 0 - 2^63. You can specify the value
185
+     * with the suffixes "KB", "MB" or "GB" so that the integer is
186
+     * interpreted being expressed respectively in kilobytes, megabytes
187
+     * or gigabytes. For example, the value "10KB" will be interpreted
188
+     * as 10240.
189
+     *
190
+     * @param mixed $value
191
+     * @return the actual file size set
192
+     */
193
+    public function setMaxFileSize($value) {
194
+        $this->setFileSize('maxFileSize', $value);
195
+    }
196 196
 
197
-	public function append(Payone_Log4php_LoggerLoggingEvent $event) {
198
-		if($this->fp and $this->layout !== null) {
199
-			if(flock($this->fp, LOCK_EX)) {
200
-				fwrite($this->fp, $this->layout->format($event));
197
+    public function append(Payone_Log4php_LoggerLoggingEvent $event) {
198
+        if($this->fp and $this->layout !== null) {
199
+            if(flock($this->fp, LOCK_EX)) {
200
+                fwrite($this->fp, $this->layout->format($event));
201 201
 
202
-				// Stats cache must be cleared, otherwise filesize() returns cached results
203
-				clearstatcache();
202
+                // Stats cache must be cleared, otherwise filesize() returns cached results
203
+                clearstatcache();
204 204
 				
205
-				// Rollover if needed
206
-				if (filesize($this->expandedFileName) > $this->maxFileSize) {
207
-					$this->rollOver();
208
-				}
205
+                // Rollover if needed
206
+                if (filesize($this->expandedFileName) > $this->maxFileSize) {
207
+                    $this->rollOver();
208
+                }
209 209
 				
210
-				flock($this->fp, LOCK_UN);
211
-			} else {
212
-				$this->closed = true;
213
-			}
214
-		} 
215
-	}
210
+                flock($this->fp, LOCK_UN);
211
+            } else {
212
+                $this->closed = true;
213
+            }
214
+        } 
215
+    }
216 216
 	
217
-	/**
218
-	 * @return Returns the maximum number of backup files to keep around.
219
-	 */
220
-	public function getMaxBackupIndex() {
221
-		return $this->maxBackupIndex;
222
-	}
217
+    /**
218
+     * @return Returns the maximum number of backup files to keep around.
219
+     */
220
+    public function getMaxBackupIndex() {
221
+        return $this->maxBackupIndex;
222
+    }
223 223
 	
224
-	/**
225
-	 * @return Returns the maximum size that the output file is allowed to reach
226
-	 * before being rolled over to backup files.
227
-	 */
228
-	public function getMaxFileSize() {
229
-		return $this->maxFileSize;
230
-	}
224
+    /**
225
+     * @return Returns the maximum size that the output file is allowed to reach
226
+     * before being rolled over to backup files.
227
+     */
228
+    public function getMaxFileSize() {
229
+        return $this->maxFileSize;
230
+    }
231 231
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	private function rollOver() {
116 116
 		// If maxBackups <= 0, then there is no file renaming to be done.
117
-		if($this->maxBackupIndex > 0) {
117
+		if ($this->maxBackupIndex > 0) {
118 118
 			$fileName = $this->getExpandedFileName();
119 119
 
120 120
 			// Delete the oldest file, to keep Windows happy.
121 121
 			$file = $fileName . '.' . $this->maxBackupIndex;
122
-			if(is_writable($file))
122
+			if (is_writable($file))
123 123
 				unlink($file);
124 124
 
125 125
 			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
126
-			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
126
+			for ($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
127 127
 				$file = $fileName . "." . $i;
128
-				if(is_readable($file)) {
128
+				if (is_readable($file)) {
129 129
 					$target = $fileName . '.' . ($i + 1);
130 130
 					rename($file, $target);
131 131
 				}
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 	}
196 196
 
197 197
 	public function append(Payone_Log4php_LoggerLoggingEvent $event) {
198
-		if($this->fp and $this->layout !== null) {
199
-			if(flock($this->fp, LOCK_EX)) {
198
+		if ($this->fp and $this->layout !== null) {
199
+			if (flock($this->fp, LOCK_EX)) {
200 200
 				fwrite($this->fp, $this->layout->format($event));
201 201
 
202 202
 				// Stats cache must be cleared, otherwise filesize() returns cached results
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -119,8 +119,9 @@  discard block
 block discarded – undo
119 119
 
120 120
 			// Delete the oldest file, to keep Windows happy.
121 121
 			$file = $fileName . '.' . $this->maxBackupIndex;
122
-			if(is_writable($file))
123
-				unlink($file);
122
+			if(is_writable($file)) {
123
+							unlink($file);
124
+			}
124 125
 
125 126
 			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
126 127
 			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
@@ -145,7 +146,9 @@  discard block
 block discarded – undo
145 146
 		// As Payone_Log4php_LoggerAppenderFile does not create the directory, it has to exist.
146 147
 		// realpath() fails if the argument does not exist so the filename is separated.
147 148
 		$this->expandedFileName = realpath(dirname($fileName));
148
-		if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
149
+		if ($this->expandedFileName === false) {
150
+		    throw new Exception("Directory of $fileName does not exist!");
151
+		}
149 152
 		$this->expandedFileName .= DIRECTORY_SEPARATOR . basename($fileName);
150 153
 	}
151 154
 
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerAppenderSyslog.php 2 patches
Indentation   +201 added lines, -201 removed lines patch added patch discarded remove patch
@@ -73,233 +73,233 @@
 block discarded – undo
73 73
  */ 
74 74
 class Payone_Log4php_LoggerAppenderSyslog extends Payone_Log4php_LoggerAppender {
75 75
 	
76
-	/**
77
-	 * The ident string is added to each message. Typically the name of your application.
78
-	 * 
79
-	 * @var string 
80
-	 */
81
-	protected $ident = "Apache log4php";
76
+    /**
77
+     * The ident string is added to each message. Typically the name of your application.
78
+     * 
79
+     * @var string 
80
+     */
81
+    protected $ident = "Apache log4php";
82 82
 
83
-	/**
84
-	 * The syslog priority to use when overriding priority. This setting is 
85
-	 * required if {@link overridePriority} is set to true. 
86
-	 * 
87
-	 * @var string 
88
-	 */
89
-	protected $priority;
83
+    /**
84
+     * The syslog priority to use when overriding priority. This setting is 
85
+     * required if {@link overridePriority} is set to true. 
86
+     * 
87
+     * @var string 
88
+     */
89
+    protected $priority;
90 90
 	
91
-	/**
92
-	 * The option used when opening the syslog connection.
93
-	 * 
94
-	 * @var string
95
-	 */
96
-	protected $option = 'PID|CONS';
91
+    /**
92
+     * The option used when opening the syslog connection.
93
+     * 
94
+     * @var string
95
+     */
96
+    protected $option = 'PID|CONS';
97 97
 	
98
-	/**
99
-	 * The facility value indicates the source of the message.
100
-	 *
101
-	 * @var string
102
-	 */
103
-	protected $facility = 'USER';
98
+    /**
99
+     * The facility value indicates the source of the message.
100
+     *
101
+     * @var string
102
+     */
103
+    protected $facility = 'USER';
104 104
 	
105
-	/**
106
-	 * If set to true, the message priority will always use the value defined 
107
-	 * in {@link $priority}, otherwise the priority will be determined by the 
108
-	 * message's log level.
109
-	 *
110
-	 * @var string
111
-	 */
112
-	protected $overridePriority = false;
105
+    /**
106
+     * If set to true, the message priority will always use the value defined 
107
+     * in {@link $priority}, otherwise the priority will be determined by the 
108
+     * message's log level.
109
+     *
110
+     * @var string
111
+     */
112
+    protected $overridePriority = false;
113 113
 
114
-	/**
115
-	 * Holds the int value of the {@link $priority}.
116
-	 * @var int
117
-	 */
118
-	private $intPriority;
114
+    /**
115
+     * Holds the int value of the {@link $priority}.
116
+     * @var int
117
+     */
118
+    private $intPriority;
119 119
 	
120
-	/**
121
-	 * Holds the int value of the {@link $facility}.
122
-	 * @var int
123
-	 */
124
-	private $intFacility;
120
+    /**
121
+     * Holds the int value of the {@link $facility}.
122
+     * @var int
123
+     */
124
+    private $intFacility;
125 125
 	
126
-	/**
127
-	 * Holds the int value of the {@link $option}.
128
-	 * @var int
129
-	 */
130
-	private $intOption;
126
+    /**
127
+     * Holds the int value of the {@link $option}.
128
+     * @var int
129
+     */
130
+    private $intOption;
131 131
 
132
-	/**
133
-	 * Sets the {@link $ident}.
134
-	 *
135
-	 * @param string $ident
136
-	 */
137
-	public function setIdent($ident) {
138
-		$this->ident = $ident; 
139
-	}
132
+    /**
133
+     * Sets the {@link $ident}.
134
+     *
135
+     * @param string $ident
136
+     */
137
+    public function setIdent($ident) {
138
+        $this->ident = $ident; 
139
+    }
140 140
 	
141
-	/**
142
-	 * Sets the {@link $priority}.
143
-	 *
144
-	 * @param string $priority
145
-	 */
146
-	public function setPriority($priority) {
147
-		$this->priority = $priority;
148
-	}
141
+    /**
142
+     * Sets the {@link $priority}.
143
+     *
144
+     * @param string $priority
145
+     */
146
+    public function setPriority($priority) {
147
+        $this->priority = $priority;
148
+    }
149 149
 	
150
-	/**
151
-	 * Sets the {@link $facility}.
152
-	 *
153
-	 * @param string $facility
154
-	 */
155
-	public function setFacility($facility) {
156
-		$this->facility = $facility;
157
-	} 
150
+    /**
151
+     * Sets the {@link $facility}.
152
+     *
153
+     * @param string $facility
154
+     */
155
+    public function setFacility($facility) {
156
+        $this->facility = $facility;
157
+    } 
158 158
 	
159
-	/**
160
-	 * Sets the {@link $overridePriority}.
161
-	 *
162
-	 * @param string $overridePriority
163
-	 */
164
-	public function setOverridePriority($overridePriority) {
165
-		$this->overridePriority = $overridePriority;
166
-	} 
159
+    /**
160
+     * Sets the {@link $overridePriority}.
161
+     *
162
+     * @param string $overridePriority
163
+     */
164
+    public function setOverridePriority($overridePriority) {
165
+        $this->overridePriority = $overridePriority;
166
+    } 
167 167
 	
168
-	/**
169
-	* Sets the {@link $option}.
170
-	*
171
-	* @param string $option
172
-	*/
173
-	public function setOption($option) {
174
-		$this->option = $option;
175
-	}
168
+    /**
169
+     * Sets the {@link $option}.
170
+     *
171
+     * @param string $option
172
+     */
173
+    public function setOption($option) {
174
+        $this->option = $option;
175
+    }
176 176
 	
177
-	/**
178
-	* Returns the {@link $ident}.
179
-	*
180
-	* @return string $ident
181
-	*/
182
-	public function getIdent() {
183
-		return $this->ident;
184
-	}
177
+    /**
178
+     * Returns the {@link $ident}.
179
+     *
180
+     * @return string $ident
181
+     */
182
+    public function getIdent() {
183
+        return $this->ident;
184
+    }
185 185
 	
186
-	/**
187
-	 * Returns the {@link $priority}.
188
-	 *
189
-	 * @return string
190
-	 */
191
-	public function getPriority() {
192
-		return $this->priority;
193
-	}
186
+    /**
187
+     * Returns the {@link $priority}.
188
+     *
189
+     * @return string
190
+     */
191
+    public function getPriority() {
192
+        return $this->priority;
193
+    }
194 194
 	
195
-	/**
196
-	 * Returns the {@link $facility}.
197
-	 *
198
-	 * @return string
199
-	 */
200
-	public function getFacility() {
201
-		return $this->facility;
202
-	}
195
+    /**
196
+     * Returns the {@link $facility}.
197
+     *
198
+     * @return string
199
+     */
200
+    public function getFacility() {
201
+        return $this->facility;
202
+    }
203 203
 	
204
-	/**
205
-	 * Returns the {@link $overridePriority}.
206
-	 *
207
-	 * @return string
208
-	 */
209
-	public function getOverridePriority() {
210
-		return $this->overridePriority;
211
-	}
204
+    /**
205
+     * Returns the {@link $overridePriority}.
206
+     *
207
+     * @return string
208
+     */
209
+    public function getOverridePriority() {
210
+        return $this->overridePriority;
211
+    }
212 212
 	
213
-	/**
214
-	 * Returns the {@link $option}.
215
-	 *
216
-	 * @return string
217
-	 */
218
-	public function getOption() {
219
-		return $this->option;
220
-	}
213
+    /**
214
+     * Returns the {@link $option}.
215
+     *
216
+     * @return string
217
+     */
218
+    public function getOption() {
219
+        return $this->option;
220
+    }
221 221
 	
222 222
 	
223
-	public function activateOptions() {
224
-		$this->intPriority = $this->parsePriority();
225
-		$this->intOption   = $this->parseOption();
226
-		$this->intFacility = $this->parseFacility();
223
+    public function activateOptions() {
224
+        $this->intPriority = $this->parsePriority();
225
+        $this->intOption   = $this->parseOption();
226
+        $this->intFacility = $this->parseFacility();
227 227
 		
228
-		$this->closed = false;
229
-	}
228
+        $this->closed = false;
229
+    }
230 230
 	
231
-	public function close() {
232
-		if($this->closed != true) {
233
-			closelog();
234
-			$this->closed = true;
235
-		}
236
-	}
231
+    public function close() {
232
+        if($this->closed != true) {
233
+            closelog();
234
+            $this->closed = true;
235
+        }
236
+    }
237 237
 
238
-	/** 
239
-	 * Appends the event to syslog.
240
-	 * 
241
-	 * Log is opened and closed each time because if it is not closed, it
242
-	 * can cause the Apache httpd server to log to whatever ident/facility 
243
-	 * was used in openlog().
244
-	 *
245
-	 * @see http://www.php.net/manual/en/function.syslog.php#97843
246
-	 */
247
-	public function append(Payone_Log4php_LoggerLoggingEvent $event) {
248
-		$priority = $this->getSyslogPriority($event->getLevel());
249
-		$message = $this->layout->format($event);
238
+    /** 
239
+     * Appends the event to syslog.
240
+     * 
241
+     * Log is opened and closed each time because if it is not closed, it
242
+     * can cause the Apache httpd server to log to whatever ident/facility 
243
+     * was used in openlog().
244
+     *
245
+     * @see http://www.php.net/manual/en/function.syslog.php#97843
246
+     */
247
+    public function append(Payone_Log4php_LoggerLoggingEvent $event) {
248
+        $priority = $this->getSyslogPriority($event->getLevel());
249
+        $message = $this->layout->format($event);
250 250
 	
251
-		openlog($this->ident, $this->intOption, $this->intFacility);
252
-		syslog($priority, $message);
253
-		closelog();
254
-	}
251
+        openlog($this->ident, $this->intOption, $this->intFacility);
252
+        syslog($priority, $message);
253
+        closelog();
254
+    }
255 255
 	
256
-	/** Determines which syslog priority to use based on the given level. */
257
-	private function getSyslogPriority(Payone_Log4php_LoggerLevel $level) {
258
-		if($this->overridePriority) {
259
-			return $this->intPriority;
260
-		}
261
-		return $level->getSyslogEquivalent();
262
-	}
256
+    /** Determines which syslog priority to use based on the given level. */
257
+    private function getSyslogPriority(Payone_Log4php_LoggerLevel $level) {
258
+        if($this->overridePriority) {
259
+            return $this->intPriority;
260
+        }
261
+        return $level->getSyslogEquivalent();
262
+    }
263 263
 	
264
-	/** Parses a syslog option string and returns the correspodning int value. */
265
-	private function parseOption() {
266
-		$value = 0;
267
-		$options = explode('|', $this->option);
264
+    /** Parses a syslog option string and returns the correspodning int value. */
265
+    private function parseOption() {
266
+        $value = 0;
267
+        $options = explode('|', $this->option);
268 268
 	
269
-		foreach($options as $option) {
270
-			if (!empty($option)) {
271
-				$constant = "LOG_" . trim($option);
272
-				if (defined($constant)) {
273
-					$value |= constant($constant);
274
-				} else {
275
-					trigger_error("log4php: Invalid syslog option provided: $option. Whole option string: {$this->option}.", E_USER_WARNING);
276
-				}
277
-			}
278
-		}
279
-		return $value;
280
-	}
269
+        foreach($options as $option) {
270
+            if (!empty($option)) {
271
+                $constant = "LOG_" . trim($option);
272
+                if (defined($constant)) {
273
+                    $value |= constant($constant);
274
+                } else {
275
+                    trigger_error("log4php: Invalid syslog option provided: $option. Whole option string: {$this->option}.", E_USER_WARNING);
276
+                }
277
+            }
278
+        }
279
+        return $value;
280
+    }
281 281
 	
282
-	/** Parses the facility string and returns the corresponding int value. */
283
-	private function parseFacility() {
284
-		if (!empty($this->facility)) {   
285
-			$constant = "LOG_" . trim($this->facility);
286
-			if (defined($constant)) {
287
-				return constant($constant);
288
-			} else {
289
-				trigger_error("log4php: Invalid syslog facility provided: {$this->facility}.", E_USER_WARNING);
290
-			}
291
-		}
292
-	}
282
+    /** Parses the facility string and returns the corresponding int value. */
283
+    private function parseFacility() {
284
+        if (!empty($this->facility)) {   
285
+            $constant = "LOG_" . trim($this->facility);
286
+            if (defined($constant)) {
287
+                return constant($constant);
288
+            } else {
289
+                trigger_error("log4php: Invalid syslog facility provided: {$this->facility}.", E_USER_WARNING);
290
+            }
291
+        }
292
+    }
293 293
 
294
-	/** Parses the priority string and returns the corresponding int value. */
295
-	private function parsePriority() {
296
-		if (!empty($this->priority)) {
297
-			$constant = "LOG_" . trim($this->priority);
298
-			if (defined($constant)) {
299
-				return constant($constant);
300
-			} else {
301
-				trigger_error("log4php: Invalid syslog priority provided: {$this->priority}.", E_USER_WARNING);
302
-			}
303
-		}	
304
-	}
294
+    /** Parses the priority string and returns the corresponding int value. */
295
+    private function parsePriority() {
296
+        if (!empty($this->priority)) {
297
+            $constant = "LOG_" . trim($this->priority);
298
+            if (defined($constant)) {
299
+                return constant($constant);
300
+            } else {
301
+                trigger_error("log4php: Invalid syslog priority provided: {$this->priority}.", E_USER_WARNING);
302
+            }
303
+        }	
304
+    }
305 305
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	}
230 230
 	
231 231
 	public function close() {
232
-		if($this->closed != true) {
232
+		if ($this->closed != true) {
233 233
 			closelog();
234 234
 			$this->closed = true;
235 235
 		}
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	
256 256
 	/** Determines which syslog priority to use based on the given level. */
257 257
 	private function getSyslogPriority(Payone_Log4php_LoggerLevel $level) {
258
-		if($this->overridePriority) {
258
+		if ($this->overridePriority) {
259 259
 			return $this->intPriority;
260 260
 		}
261 261
 		return $level->getSyslogEquivalent();
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		$value = 0;
267 267
 		$options = explode('|', $this->option);
268 268
 	
269
-		foreach($options as $option) {
269
+		foreach ($options as $option) {
270 270
 			if (!empty($option)) {
271 271
 				$constant = "LOG_" . trim($option);
272 272
 				if (defined($constant)) {
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerAutoloader.php 2 patches
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 
21 21
 if (function_exists('__autoload')) {
22
-	//trigger_error("log4php: It looks like your code is using an __autoload() function. log4php uses spl_autoload_register() which will bypass your __autoload() function and may break autoloading.", E_USER_WARNING);
22
+    //trigger_error("log4php: It looks like your code is using an __autoload() function. log4php uses spl_autoload_register() which will bypass your __autoload() function and may break autoloading.", E_USER_WARNING);
23 23
 }
24 24
 
25 25
 spl_autoload_register(array('Payone_Log4php_LoggerAutoloader', 'autoload'));
@@ -33,108 +33,108 @@  discard block
 block discarded – undo
33 33
  */
34 34
 class Payone_Log4php_LoggerAutoloader {
35 35
 	
36
-	/** Maps classnames to files containing the class. */
37
-	private static $classes = array(
36
+    /** Maps classnames to files containing the class. */
37
+    private static $classes = array(
38 38
 	
39
-		// Base
40
-		'Payone_Log4php_LoggerAppender' => '/LoggerAppender.php',
41
-		'Payone_Log4php_LoggerAppenderPool' => '/LoggerAppenderPool.php',
42
-		'Payone_Log4php_LoggerConfigurable' => '/LoggerConfigurable.php',
43
-		'Payone_Log4php_LoggerConfigurator' => '/LoggerConfigurator.php',
44
-		'Payone_Log4php_LoggerException' => '/LoggerException.php',
45
-		'Payone_Log4php_LoggerFilter' => '/LoggerFilter.php',
46
-		'Payone_Log4php_LoggerHierarchy' => '/LoggerHierarchy.php',
47
-		'Payone_Log4php_LoggerLevel' => '/LoggerLevel.php',
48
-		'Payone_Log4php_LoggerLocationInfo' => '/LoggerLocationInfo.php',
49
-		'Payone_Log4php_LoggerLoggingEvent' => '/LoggerLoggingEvent.php',
50
-		'Payone_Log4php_LoggerMDC' => '/LoggerMDC.php',
51
-		'Payone_Log4php_LoggerNDC' => '/LoggerNDC.php',
52
-		'Payone_Log4php_LoggerLayout' => '/LoggerLayout.php',
53
-		'Payone_Log4php_LoggerReflectionUtils' => '/LoggerReflectionUtils.php',
54
-		'Payone_Log4php_LoggerRoot' => '/LoggerRoot.php',
55
-		'Payone_Log4php_LoggerThrowableInformation' => '/LoggerThrowableInformation.php',
39
+        // Base
40
+        'Payone_Log4php_LoggerAppender' => '/LoggerAppender.php',
41
+        'Payone_Log4php_LoggerAppenderPool' => '/LoggerAppenderPool.php',
42
+        'Payone_Log4php_LoggerConfigurable' => '/LoggerConfigurable.php',
43
+        'Payone_Log4php_LoggerConfigurator' => '/LoggerConfigurator.php',
44
+        'Payone_Log4php_LoggerException' => '/LoggerException.php',
45
+        'Payone_Log4php_LoggerFilter' => '/LoggerFilter.php',
46
+        'Payone_Log4php_LoggerHierarchy' => '/LoggerHierarchy.php',
47
+        'Payone_Log4php_LoggerLevel' => '/LoggerLevel.php',
48
+        'Payone_Log4php_LoggerLocationInfo' => '/LoggerLocationInfo.php',
49
+        'Payone_Log4php_LoggerLoggingEvent' => '/LoggerLoggingEvent.php',
50
+        'Payone_Log4php_LoggerMDC' => '/LoggerMDC.php',
51
+        'Payone_Log4php_LoggerNDC' => '/LoggerNDC.php',
52
+        'Payone_Log4php_LoggerLayout' => '/LoggerLayout.php',
53
+        'Payone_Log4php_LoggerReflectionUtils' => '/LoggerReflectionUtils.php',
54
+        'Payone_Log4php_LoggerRoot' => '/LoggerRoot.php',
55
+        'Payone_Log4php_LoggerThrowableInformation' => '/LoggerThrowableInformation.php',
56 56
 		
57
-		// Appenders
58
-		'Payone_Log4php_LoggerAppenderConsole' => '/LoggerAppenderConsole.php',
59
-		'Payone_Log4php_LoggerAppenderDailyFile' => '/LoggerAppenderDailyFile.php',
60
-		'Payone_Log4php_LoggerAppenderEcho' => '/LoggerAppenderEcho.php',
61
-		'Payone_Log4php_LoggerAppenderFile' => '/LoggerAppenderFile.php',
62
-		'Payone_Log4php_LoggerAppenderMail' => '/LoggerAppenderMail.php',
63
-		'Payone_Log4php_LoggerAppenderMailEvent' => '/LoggerAppenderMailEvent.php',
64
-		'Payone_Log4php_LoggerAppenderMongoDB' => '/LoggerAppenderMongoDB.php',
65
-		'Payone_Log4php_LoggerAppenderNull' => '/LoggerAppenderNull.php',
66
-		'Payone_Log4php_LoggerAppenderPDO' => '/LoggerAppenderPDO.php',
67
-		'Payone_Log4php_LoggerAppenderPhp' => '/LoggerAppenderPhp.php',
68
-		'Payone_Log4php_LoggerAppenderRollingFile' => '/LoggerAppenderRollingFile.php',
69
-		'Payone_Log4php_LoggerAppenderSocket' => '/LoggerAppenderSocket.php',
70
-		'Payone_Log4php_LoggerAppenderSyslog' => '/LoggerAppenderSyslog.php',
57
+        // Appenders
58
+        'Payone_Log4php_LoggerAppenderConsole' => '/LoggerAppenderConsole.php',
59
+        'Payone_Log4php_LoggerAppenderDailyFile' => '/LoggerAppenderDailyFile.php',
60
+        'Payone_Log4php_LoggerAppenderEcho' => '/LoggerAppenderEcho.php',
61
+        'Payone_Log4php_LoggerAppenderFile' => '/LoggerAppenderFile.php',
62
+        'Payone_Log4php_LoggerAppenderMail' => '/LoggerAppenderMail.php',
63
+        'Payone_Log4php_LoggerAppenderMailEvent' => '/LoggerAppenderMailEvent.php',
64
+        'Payone_Log4php_LoggerAppenderMongoDB' => '/LoggerAppenderMongoDB.php',
65
+        'Payone_Log4php_LoggerAppenderNull' => '/LoggerAppenderNull.php',
66
+        'Payone_Log4php_LoggerAppenderPDO' => '/LoggerAppenderPDO.php',
67
+        'Payone_Log4php_LoggerAppenderPhp' => '/LoggerAppenderPhp.php',
68
+        'Payone_Log4php_LoggerAppenderRollingFile' => '/LoggerAppenderRollingFile.php',
69
+        'Payone_Log4php_LoggerAppenderSocket' => '/LoggerAppenderSocket.php',
70
+        'Payone_Log4php_LoggerAppenderSyslog' => '/LoggerAppenderSyslog.php',
71 71
 		
72
-		// Configurators
73
-		'Payone_Log4php_LoggerConfigurationAdapter' => '/LoggerConfigurationAdapter.php',
74
-		'Payone_Log4php_LoggerConfigurationAdapterINI' => '/LoggerConfigurationAdapterINI.php',
75
-		'Payone_Log4php_LoggerConfigurationAdapterPHP' => '/LoggerConfigurationAdapterPHP.php',
76
-		'Payone_Log4php_LoggerConfigurationAdapterXML' => '/LoggerConfigurationAdapterXML.php',
77
-		'Payone_Log4php_LoggerConfiguratorDefault' => '/LoggerConfiguratorDefault.php',
72
+        // Configurators
73
+        'Payone_Log4php_LoggerConfigurationAdapter' => '/LoggerConfigurationAdapter.php',
74
+        'Payone_Log4php_LoggerConfigurationAdapterINI' => '/LoggerConfigurationAdapterINI.php',
75
+        'Payone_Log4php_LoggerConfigurationAdapterPHP' => '/LoggerConfigurationAdapterPHP.php',
76
+        'Payone_Log4php_LoggerConfigurationAdapterXML' => '/LoggerConfigurationAdapterXML.php',
77
+        'Payone_Log4php_LoggerConfiguratorDefault' => '/LoggerConfiguratorDefault.php',
78 78
 
79
-		// Filters
80
-		'Payone_Log4php_LoggerFilterDenyAll' => '/LoggerFilterDenyAll.php',
81
-		'Payone_Log4php_LoggerFilterLevelMatch' => '/LoggerFilterLevelMatch.php',
82
-		'Payone_Log4php_LoggerFilterLevelRange' => '/LoggerFilterLevelRange.php',
83
-		'Payone_Log4php_LoggerFilterStringMatch' => '/LoggerFilterStringMatch.php',
79
+        // Filters
80
+        'Payone_Log4php_LoggerFilterDenyAll' => '/LoggerFilterDenyAll.php',
81
+        'Payone_Log4php_LoggerFilterLevelMatch' => '/LoggerFilterLevelMatch.php',
82
+        'Payone_Log4php_LoggerFilterLevelRange' => '/LoggerFilterLevelRange.php',
83
+        'Payone_Log4php_LoggerFilterStringMatch' => '/LoggerFilterStringMatch.php',
84 84
 
85
-		// Helpers
86
-		'Payone_Log4php_LoggerFormattingInfo' => '/LoggerFormattingInfo.php',
87
-		'Payone_Log4php_LoggerOptionConverter' => '/LoggerOptionConverter.php',
88
-		'Payone_Log4php_LoggerPatternParser' => '/LoggerPatternParser.php',
89
-		'Payone_Log4php_LoggerUtils' => '/LoggerUtils.php',
85
+        // Helpers
86
+        'Payone_Log4php_LoggerFormattingInfo' => '/LoggerFormattingInfo.php',
87
+        'Payone_Log4php_LoggerOptionConverter' => '/LoggerOptionConverter.php',
88
+        'Payone_Log4php_LoggerPatternParser' => '/LoggerPatternParser.php',
89
+        'Payone_Log4php_LoggerUtils' => '/LoggerUtils.php',
90 90
 	
91
-		// Pattern converters
92
-		'Payone_Log4php_LoggerPatternConverter' => '/LoggerPatternConverter.php',
93
-		'Payone_Log4php_LoggerPatternConverterClass' => '/LoggerPatternConverterClass.php',
94
-		'Payone_Log4php_LoggerPatternConverterCookie' => '/LoggerPatternConverterCookie.php',
95
-		'Payone_Log4php_LoggerPatternConverterDate' => '/LoggerPatternConverterDate.php',
96
-		'Payone_Log4php_LoggerPatternConverterEnvironment' => '/LoggerPatternConverterEnvironment.php',
97
-		'Payone_Log4php_LoggerPatternConverterFile' => '/LoggerPatternConverterFile.php',
98
-		'Payone_Log4php_LoggerPatternConverterLevel' => '/LoggerPatternConverterLevel.php',
99
-		'Payone_Log4php_LoggerPatternConverterLine' => '/LoggerPatternConverterLine.php',
100
-		'Payone_Log4php_LoggerPatternConverterLiteral' => '/LoggerPatternConverterLiteral.php',
101
-		'Payone_Log4php_LoggerPatternConverterLogger' => '/LoggerPatternConverterLogger.php',
102
-		'Payone_Log4php_LoggerPatternConverterMDC' => '/LoggerPatternConverterMDC.php',
103
-		'Payone_Log4php_LoggerPatternConverterMessage' => '/LoggerPatternConverterMessage.php',
104
-		'Payone_Log4php_LoggerPatternConverterMethod' => '/LoggerPatternConverterMethod.php',
105
-		'Payone_Log4php_LoggerPatternConverterNDC' => '/LoggerPatternConverterNDC.php',
106
-		'Payone_Log4php_LoggerPatternConverterNewLine' => '/LoggerPatternConverterNewLine.php',
107
-		'Payone_Log4php_LoggerPatternConverterProcess' => '/LoggerPatternConverterProcess.php',
108
-		'Payone_Log4php_LoggerPatternConverterRelative' => '/LoggerPatternConverterRelative.php',
109
-		'Payone_Log4php_LoggerPatternConverterRequest' => '/LoggerPatternConverterRequest.php',
110
-		'Payone_Log4php_LoggerPatternConverterServer' => '/LoggerPatternConverterServer.php',
111
-		'Payone_Log4php_LoggerPatternConverterSession' => '/LoggerPatternConverterSession.php',
112
-		'Payone_Log4php_LoggerPatternConverterSessionID' => '/LoggerPatternConverterSessionID.php',
113
-		'Payone_Log4php_LoggerPatternConverterSuperglobal' => '/LoggerPatternConverterSuperglobal.php',
114
-		'Payone_Log4php_LoggerPatternConverterThrowable' => '/LoggerPatternConverterThrowable.php',
91
+        // Pattern converters
92
+        'Payone_Log4php_LoggerPatternConverter' => '/LoggerPatternConverter.php',
93
+        'Payone_Log4php_LoggerPatternConverterClass' => '/LoggerPatternConverterClass.php',
94
+        'Payone_Log4php_LoggerPatternConverterCookie' => '/LoggerPatternConverterCookie.php',
95
+        'Payone_Log4php_LoggerPatternConverterDate' => '/LoggerPatternConverterDate.php',
96
+        'Payone_Log4php_LoggerPatternConverterEnvironment' => '/LoggerPatternConverterEnvironment.php',
97
+        'Payone_Log4php_LoggerPatternConverterFile' => '/LoggerPatternConverterFile.php',
98
+        'Payone_Log4php_LoggerPatternConverterLevel' => '/LoggerPatternConverterLevel.php',
99
+        'Payone_Log4php_LoggerPatternConverterLine' => '/LoggerPatternConverterLine.php',
100
+        'Payone_Log4php_LoggerPatternConverterLiteral' => '/LoggerPatternConverterLiteral.php',
101
+        'Payone_Log4php_LoggerPatternConverterLogger' => '/LoggerPatternConverterLogger.php',
102
+        'Payone_Log4php_LoggerPatternConverterMDC' => '/LoggerPatternConverterMDC.php',
103
+        'Payone_Log4php_LoggerPatternConverterMessage' => '/LoggerPatternConverterMessage.php',
104
+        'Payone_Log4php_LoggerPatternConverterMethod' => '/LoggerPatternConverterMethod.php',
105
+        'Payone_Log4php_LoggerPatternConverterNDC' => '/LoggerPatternConverterNDC.php',
106
+        'Payone_Log4php_LoggerPatternConverterNewLine' => '/LoggerPatternConverterNewLine.php',
107
+        'Payone_Log4php_LoggerPatternConverterProcess' => '/LoggerPatternConverterProcess.php',
108
+        'Payone_Log4php_LoggerPatternConverterRelative' => '/LoggerPatternConverterRelative.php',
109
+        'Payone_Log4php_LoggerPatternConverterRequest' => '/LoggerPatternConverterRequest.php',
110
+        'Payone_Log4php_LoggerPatternConverterServer' => '/LoggerPatternConverterServer.php',
111
+        'Payone_Log4php_LoggerPatternConverterSession' => '/LoggerPatternConverterSession.php',
112
+        'Payone_Log4php_LoggerPatternConverterSessionID' => '/LoggerPatternConverterSessionID.php',
113
+        'Payone_Log4php_LoggerPatternConverterSuperglobal' => '/LoggerPatternConverterSuperglobal.php',
114
+        'Payone_Log4php_LoggerPatternConverterThrowable' => '/LoggerPatternConverterThrowable.php',
115 115
 		
116
-		// Layouts
117
-		'Payone_Log4php_LoggerLayoutHtml' => '/LoggerLayoutHtml.php',
118
-		'Payone_Log4php_LoggerLayoutPattern' => '/LoggerLayoutPattern.php',
119
-		'Payone_Log4php_LoggerLayoutSerialized' => '/LoggerLayoutSerialized.php',
120
-		'Payone_Log4php_LoggerLayoutSimple' => '/LoggerLayoutSimple.php',
121
-		'Payone_Log4php_LoggerLayoutTTCC' => '/LoggerLayoutTTCC.php',
122
-		'Payone_Log4php_LoggerLayoutXml' => '/LoggerLayoutXml.php',
116
+        // Layouts
117
+        'Payone_Log4php_LoggerLayoutHtml' => '/LoggerLayoutHtml.php',
118
+        'Payone_Log4php_LoggerLayoutPattern' => '/LoggerLayoutPattern.php',
119
+        'Payone_Log4php_LoggerLayoutSerialized' => '/LoggerLayoutSerialized.php',
120
+        'Payone_Log4php_LoggerLayoutSimple' => '/LoggerLayoutSimple.php',
121
+        'Payone_Log4php_LoggerLayoutTTCC' => '/LoggerLayoutTTCC.php',
122
+        'Payone_Log4php_LoggerLayoutXml' => '/LoggerLayoutXml.php',
123 123
 		
124
-		// Renderers
125
-		'Payone_Log4php_LoggerRendererDefault' => '/LoggerRendererDefault.php',
126
-		'Payone_Log4php_LoggerRendererException' => '/LoggerRendererException.php',
127
-		'Payone_Log4php_LoggerRendererMap' => '/LoggerRendererMap.php',
128
-		'Payone_Log4php_LoggerRendererObject' => '/LoggerRendererObject.php',
129
-	);
124
+        // Renderers
125
+        'Payone_Log4php_LoggerRendererDefault' => '/LoggerRendererDefault.php',
126
+        'Payone_Log4php_LoggerRendererException' => '/LoggerRendererException.php',
127
+        'Payone_Log4php_LoggerRendererMap' => '/LoggerRendererMap.php',
128
+        'Payone_Log4php_LoggerRendererObject' => '/LoggerRendererObject.php',
129
+    );
130 130
 	
131
-	/**
132
-	 * Loads a class.
133
-	 * @param string $className The name of the class to load.
134
-	 */
135
-	public static function autoload($className) {
136
-		if(isset(self::$classes[$className])) {
137
-			require_once dirname(__FILE__) . self::$classes[$className];
138
-		}
139
-	}
131
+    /**
132
+     * Loads a class.
133
+     * @param string $className The name of the class to load.
134
+     */
135
+    public static function autoload($className) {
136
+        if(isset(self::$classes[$className])) {
137
+            require_once dirname(__FILE__) . self::$classes[$className];
138
+        }
139
+    }
140 140
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
 	 * @param string $className The name of the class to load.
134 134
 	 */
135 135
 	public static function autoload($className) {
136
-		if(isset(self::$classes[$className])) {
136
+		if (isset(self::$classes[$className])) {
137 137
 			require_once dirname(__FILE__) . self::$classes[$className];
138 138
 		}
139 139
 	}
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerLayoutXml.php 2 patches
Indentation   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -54,157 +54,157 @@
 block discarded – undo
54 54
  * @subpackage layouts
55 55
  */
56 56
 class Payone_Log4php_LoggerLayoutXml extends Payone_Log4php_LoggerLayout {
57
-	const LOG4J_NS_PREFIX ='log4j';
58
-	const LOG4J_NS = 'http://jakarta.apache.org/log4j/';
57
+    const LOG4J_NS_PREFIX ='log4j';
58
+    const LOG4J_NS = 'http://jakarta.apache.org/log4j/';
59 59
 	
60
-	const LOG4PHP_NS_PREFIX = 'log4php';
61
-	const LOG4PHP_NS = 'http://logging.apache.org/log4php/';
60
+    const LOG4PHP_NS_PREFIX = 'log4php';
61
+    const LOG4PHP_NS = 'http://logging.apache.org/log4php/';
62 62
 	
63
-	const CDATA_START = '<![CDATA[';
64
-	const CDATA_END = ']]>';
65
-	const CDATA_PSEUDO_END = ']]&gt;';
66
-	const CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA[';
63
+    const CDATA_START = '<![CDATA[';
64
+    const CDATA_END = ']]>';
65
+    const CDATA_PSEUDO_END = ']]&gt;';
66
+    const CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA[';
67 67
 
68
-	/**
69
-	 * If set to true then the file name and line number of the origin of the
70
-	 * log statement will be output.
71
-	 * @var boolean
72
-	 */
73
-	protected $locationInfo = true;
68
+    /**
69
+     * If set to true then the file name and line number of the origin of the
70
+     * log statement will be output.
71
+     * @var boolean
72
+     */
73
+    protected $locationInfo = true;
74 74
   
75
-	/**
76
-	 * If set to true, log4j namespace will be used instead of the log4php 
77
-	 * namespace.
78
-	 * @var boolean 
79
-	 */
80
-	protected $log4jNamespace = false;
75
+    /**
76
+     * If set to true, log4j namespace will be used instead of the log4php 
77
+     * namespace.
78
+     * @var boolean 
79
+     */
80
+    protected $log4jNamespace = false;
81 81
 	
82
-	/** The namespace in use. */
83
-	protected $namespace = self::LOG4PHP_NS;
82
+    /** The namespace in use. */
83
+    protected $namespace = self::LOG4PHP_NS;
84 84
 	
85
-	/** The namespace prefix in use */
86
-	protected $namespacePrefix = self::LOG4PHP_NS_PREFIX;
85
+    /** The namespace prefix in use */
86
+    protected $namespacePrefix = self::LOG4PHP_NS_PREFIX;
87 87
 	 
88
-	public function activateOptions() {
89
-		if ($this->getLog4jNamespace()) {
90
-			$this->namespace        = self::LOG4J_NS;
91
-			$this->namespacePrefix  = self::LOG4J_NS_PREFIX;
92
-		} else {
93
-			$this->namespace        = self::LOG4PHP_NS;
94
-			$this->namespacePrefix  = self::LOG4PHP_NS_PREFIX;
95
-		}
96
-	}
88
+    public function activateOptions() {
89
+        if ($this->getLog4jNamespace()) {
90
+            $this->namespace        = self::LOG4J_NS;
91
+            $this->namespacePrefix  = self::LOG4J_NS_PREFIX;
92
+        } else {
93
+            $this->namespace        = self::LOG4PHP_NS;
94
+            $this->namespacePrefix  = self::LOG4PHP_NS_PREFIX;
95
+        }
96
+    }
97 97
 	
98
-	/**
99
-	 * @return string
100
-	 */
101
-	public function getHeader() {
102
-		return "<{$this->namespacePrefix}:eventSet ".
103
-			"xmlns:{$this->namespacePrefix}=\"{$this->namespace}\" ".
104
-			"version=\"0.3\" ".
105
-			"includesLocationInfo=\"".($this->getLocationInfo() ? "true" : "false")."\"".
106
-			">" . PHP_EOL;
107
-	}
98
+    /**
99
+     * @return string
100
+     */
101
+    public function getHeader() {
102
+        return "<{$this->namespacePrefix}:eventSet ".
103
+            "xmlns:{$this->namespacePrefix}=\"{$this->namespace}\" ".
104
+            "version=\"0.3\" ".
105
+            "includesLocationInfo=\"".($this->getLocationInfo() ? "true" : "false")."\"".
106
+            ">" . PHP_EOL;
107
+    }
108 108
 
109
-	/**
110
-	 * Formats a {@link LoggerLoggingEvent} in conformance with the log4php.dtd.
111
-	 *
112
-	 * @param Payone_Log4php_LoggerLoggingEvent $event
113
-	 * @return string
114
-	 */
115
-	public function format(Payone_Log4php_LoggerLoggingEvent $event) {
116
-		$ns = $this->namespacePrefix;
109
+    /**
110
+     * Formats a {@link LoggerLoggingEvent} in conformance with the log4php.dtd.
111
+     *
112
+     * @param Payone_Log4php_LoggerLoggingEvent $event
113
+     * @return string
114
+     */
115
+    public function format(Payone_Log4php_LoggerLoggingEvent $event) {
116
+        $ns = $this->namespacePrefix;
117 117
 		
118
-		$loggerName = $event->getLoggerName();
119
-		$timeStamp = number_format((float)($event->getTimeStamp() * 1000), 0, '', '');
120
-		$thread = $event->getThreadName();
121
-		$level = $event->getLevel()->toString();
118
+        $loggerName = $event->getLoggerName();
119
+        $timeStamp = number_format((float)($event->getTimeStamp() * 1000), 0, '', '');
120
+        $thread = $event->getThreadName();
121
+        $level = $event->getLevel()->toString();
122 122
 
123
-		$buf  = "<$ns:event logger=\"{$loggerName}\" level=\"{$level}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
124
-		$buf .= "<$ns:message>"; 
125
-		$buf .= $this->encodeCDATA($event->getRenderedMessage()); 
126
-		$buf .= "</$ns:message>".PHP_EOL;
123
+        $buf  = "<$ns:event logger=\"{$loggerName}\" level=\"{$level}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
124
+        $buf .= "<$ns:message>"; 
125
+        $buf .= $this->encodeCDATA($event->getRenderedMessage()); 
126
+        $buf .= "</$ns:message>".PHP_EOL;
127 127
 
128
-		$ndc = $event->getNDC();
129
-		if(!empty($ndc)) {
130
-			$buf .= "<$ns:NDC><![CDATA[";
131
-			$buf .= $this->encodeCDATA($ndc);
132
-			$buf .= "]]></$ns:NDC>".PHP_EOL;
133
-		}
128
+        $ndc = $event->getNDC();
129
+        if(!empty($ndc)) {
130
+            $buf .= "<$ns:NDC><![CDATA[";
131
+            $buf .= $this->encodeCDATA($ndc);
132
+            $buf .= "]]></$ns:NDC>".PHP_EOL;
133
+        }
134 134
 		
135
-		$mdcMap = $event->getMDCMap();
136
-		if (!empty($mdcMap)) {
137
-			$buf .= "<$ns:properties>".PHP_EOL;
138
-			foreach ($mdcMap as $name=>$value) {
139
-				$buf .= "<$ns:data name=\"$name\" value=\"$value\" />".PHP_EOL;
140
-			}
141
-			$buf .= "</$ns:properties>".PHP_EOL;
142
-		}
135
+        $mdcMap = $event->getMDCMap();
136
+        if (!empty($mdcMap)) {
137
+            $buf .= "<$ns:properties>".PHP_EOL;
138
+            foreach ($mdcMap as $name=>$value) {
139
+                $buf .= "<$ns:data name=\"$name\" value=\"$value\" />".PHP_EOL;
140
+            }
141
+            $buf .= "</$ns:properties>".PHP_EOL;
142
+        }
143 143
 
144
-		if ($this->getLocationInfo()) {
145
-			$locationInfo = $event->getLocationInformation();
146
-			$buf .= "<$ns:locationInfo ". 
147
-					"class=\"" . $locationInfo->getClassName() . "\" ".
148
-					"file=\"" .  htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" ".
149
-					"line=\"" .  $locationInfo->getLineNumber() . "\" ".
150
-					"method=\"" . $locationInfo->getMethodName() . "\" ";
151
-			$buf .= "/>".PHP_EOL;
152
-		}
144
+        if ($this->getLocationInfo()) {
145
+            $locationInfo = $event->getLocationInformation();
146
+            $buf .= "<$ns:locationInfo ". 
147
+                    "class=\"" . $locationInfo->getClassName() . "\" ".
148
+                    "file=\"" .  htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" ".
149
+                    "line=\"" .  $locationInfo->getLineNumber() . "\" ".
150
+                    "method=\"" . $locationInfo->getMethodName() . "\" ";
151
+            $buf .= "/>".PHP_EOL;
152
+        }
153 153
 
154
-		$buf .= "</$ns:event>".PHP_EOL;
154
+        $buf .= "</$ns:event>".PHP_EOL;
155 155
 		
156
-		return $buf;
157
-	}
156
+        return $buf;
157
+    }
158 158
 	
159
-	/**
160
-	 * @return string
161
-	 */
162
-	public function getFooter() {
163
-		return "</{$this->namespacePrefix}:eventSet>" . PHP_EOL;
164
-	}
159
+    /**
160
+     * @return string
161
+     */
162
+    public function getFooter() {
163
+        return "</{$this->namespacePrefix}:eventSet>" . PHP_EOL;
164
+    }
165 165
 	
166 166
 	
167
-	/** 
168
-	 * Whether or not file name and line number will be included in the output.
169
-	 * @return boolean
170
-	 */
171
-	public function getLocationInfo() {
172
-		return $this->locationInfo;
173
-	}
167
+    /** 
168
+     * Whether or not file name and line number will be included in the output.
169
+     * @return boolean
170
+     */
171
+    public function getLocationInfo() {
172
+        return $this->locationInfo;
173
+    }
174 174
   
175
-	/**
176
-	 * The {@link $locationInfo} option takes a boolean value. By default,
177
-	 * it is set to false which means there will be no location
178
-	 * information output by this layout. If the the option is set to
179
-	 * true, then the file name and line number of the statement at the
180
-	 * origin of the log statement will be output.
181
-	 */
182
-	public function setLocationInfo($flag) {
183
-		$this->setBoolean('locationInfo', $flag);
184
-	}
175
+    /**
176
+     * The {@link $locationInfo} option takes a boolean value. By default,
177
+     * it is set to false which means there will be no location
178
+     * information output by this layout. If the the option is set to
179
+     * true, then the file name and line number of the statement at the
180
+     * origin of the log statement will be output.
181
+     */
182
+    public function setLocationInfo($flag) {
183
+        $this->setBoolean('locationInfo', $flag);
184
+    }
185 185
   
186
-	/**
187
-	 * @return boolean
188
-	 */
189
-	 public function getLog4jNamespace() {
190
-	 	return $this->log4jNamespace;
191
-	 }
186
+    /**
187
+     * @return boolean
188
+     */
189
+        public function getLog4jNamespace() {
190
+            return $this->log4jNamespace;
191
+        }
192 192
 
193
-	/**
194
-	 * @param boolean
195
-	 */
196
-	public function setLog4jNamespace($flag) {
197
-		$this->setBoolean('log4jNamespace', $flag);
198
-	}
193
+    /**
194
+     * @param boolean
195
+     */
196
+    public function setLog4jNamespace($flag) {
197
+        $this->setBoolean('log4jNamespace', $flag);
198
+    }
199 199
 	
200
-	/** 
201
-	 * Encases a string in CDATA tags, and escapes any existing CDATA end 
202
-	 * tags already present in the string.
203
-	 * @param string $string 
204
-	 */
205
-	private function encodeCDATA($string) {
206
-		$string = str_replace(self::CDATA_END, self::CDATA_EMBEDDED_END, $string);
207
-		return self::CDATA_START . $string . self::CDATA_END;
208
-	}
200
+    /** 
201
+     * Encases a string in CDATA tags, and escapes any existing CDATA end 
202
+     * tags already present in the string.
203
+     * @param string $string 
204
+     */
205
+    private function encodeCDATA($string) {
206
+        $string = str_replace(self::CDATA_END, self::CDATA_EMBEDDED_END, $string);
207
+        return self::CDATA_START . $string . self::CDATA_END;
208
+    }
209 209
 }
210 210
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  * @subpackage layouts
55 55
  */
56 56
 class Payone_Log4php_LoggerLayoutXml extends Payone_Log4php_LoggerLayout {
57
-	const LOG4J_NS_PREFIX ='log4j';
57
+	const LOG4J_NS_PREFIX = 'log4j';
58 58
 	const LOG4J_NS = 'http://jakarta.apache.org/log4j/';
59 59
 	
60 60
 	const LOG4PHP_NS_PREFIX = 'log4php';
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 	 * @return string
100 100
 	 */
101 101
 	public function getHeader() {
102
-		return "<{$this->namespacePrefix}:eventSet ".
103
-			"xmlns:{$this->namespacePrefix}=\"{$this->namespace}\" ".
104
-			"version=\"0.3\" ".
105
-			"includesLocationInfo=\"".($this->getLocationInfo() ? "true" : "false")."\"".
102
+		return "<{$this->namespacePrefix}:eventSet " .
103
+			"xmlns:{$this->namespacePrefix}=\"{$this->namespace}\" " .
104
+			"version=\"0.3\" " .
105
+			"includesLocationInfo=\"" . ($this->getLocationInfo() ? "true" : "false") . "\"" .
106 106
 			">" . PHP_EOL;
107 107
 	}
108 108
 
@@ -120,38 +120,38 @@  discard block
 block discarded – undo
120 120
 		$thread = $event->getThreadName();
121 121
 		$level = $event->getLevel()->toString();
122 122
 
123
-		$buf  = "<$ns:event logger=\"{$loggerName}\" level=\"{$level}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
123
+		$buf  = "<$ns:event logger=\"{$loggerName}\" level=\"{$level}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">" . PHP_EOL;
124 124
 		$buf .= "<$ns:message>"; 
125 125
 		$buf .= $this->encodeCDATA($event->getRenderedMessage()); 
126
-		$buf .= "</$ns:message>".PHP_EOL;
126
+		$buf .= "</$ns:message>" . PHP_EOL;
127 127
 
128 128
 		$ndc = $event->getNDC();
129
-		if(!empty($ndc)) {
129
+		if (!empty($ndc)) {
130 130
 			$buf .= "<$ns:NDC><![CDATA[";
131 131
 			$buf .= $this->encodeCDATA($ndc);
132
-			$buf .= "]]></$ns:NDC>".PHP_EOL;
132
+			$buf .= "]]></$ns:NDC>" . PHP_EOL;
133 133
 		}
134 134
 		
135 135
 		$mdcMap = $event->getMDCMap();
136 136
 		if (!empty($mdcMap)) {
137
-			$buf .= "<$ns:properties>".PHP_EOL;
137
+			$buf .= "<$ns:properties>" . PHP_EOL;
138 138
 			foreach ($mdcMap as $name=>$value) {
139
-				$buf .= "<$ns:data name=\"$name\" value=\"$value\" />".PHP_EOL;
139
+				$buf .= "<$ns:data name=\"$name\" value=\"$value\" />" . PHP_EOL;
140 140
 			}
141
-			$buf .= "</$ns:properties>".PHP_EOL;
141
+			$buf .= "</$ns:properties>" . PHP_EOL;
142 142
 		}
143 143
 
144 144
 		if ($this->getLocationInfo()) {
145 145
 			$locationInfo = $event->getLocationInformation();
146
-			$buf .= "<$ns:locationInfo ". 
147
-					"class=\"" . $locationInfo->getClassName() . "\" ".
148
-					"file=\"" .  htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" ".
149
-					"line=\"" .  $locationInfo->getLineNumber() . "\" ".
146
+			$buf .= "<$ns:locationInfo " . 
147
+					"class=\"" . $locationInfo->getClassName() . "\" " .
148
+					"file=\"" . htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" " .
149
+					"line=\"" . $locationInfo->getLineNumber() . "\" " .
150 150
 					"method=\"" . $locationInfo->getMethodName() . "\" ";
151
-			$buf .= "/>".PHP_EOL;
151
+			$buf .= "/>" . PHP_EOL;
152 152
 		}
153 153
 
154
-		$buf .= "</$ns:event>".PHP_EOL;
154
+		$buf .= "</$ns:event>" . PHP_EOL;
155 155
 		
156 156
 		return $buf;
157 157
 	}
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerAppenderNull.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,17 +35,17 @@
 block discarded – undo
35 35
  */
36 36
 class Payone_Log4php_LoggerAppenderNull extends Payone_Log4php_LoggerAppender {
37 37
 
38
-	/** 
39
-	 * This appender does not require a layout. 
40
-	 */
41
-	protected $requiresLayout = false;
38
+    /** 
39
+     * This appender does not require a layout. 
40
+     */
41
+    protected $requiresLayout = false;
42 42
 	
43
-	/**
44
-	 * Do nothing. 
45
-	 * 
46
-	 * @param Payone_Log4php_LoggerLoggingEvent $event
47
-	 */
48
-	public function append(Payone_Log4php_LoggerLoggingEvent $event) {
49
-	}
43
+    /**
44
+     * Do nothing. 
45
+     * 
46
+     * @param Payone_Log4php_LoggerLoggingEvent $event
47
+     */
48
+    public function append(Payone_Log4php_LoggerLoggingEvent $event) {
49
+    }
50 50
 }
51 51
 
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerMDC.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -49,70 +49,70 @@
 block discarded – undo
49 49
  */
50 50
 class Payone_Log4php_LoggerMDC {
51 51
 	
52
-	/** Holds the context map. */
53
-	private static $map = array();
52
+    /** Holds the context map. */
53
+    private static $map = array();
54 54
 		
55
-	/**
56
-	 * Stores a context value as identified with the key parameter into the 
57
-	 * context map.
58
-	 *
59
-	 * @param string $key the key
60
-	 * @param string $value the value
61
-	 */
62
-	public static function put($key, $value) {
63
-		self::$map[$key] = $value;
64
-	}
55
+    /**
56
+     * Stores a context value as identified with the key parameter into the 
57
+     * context map.
58
+     *
59
+     * @param string $key the key
60
+     * @param string $value the value
61
+     */
62
+    public static function put($key, $value) {
63
+        self::$map[$key] = $value;
64
+    }
65 65
   
66
-	/**
67
-	 * Returns the context value identified by the key parameter.
68
-	 *
69
-	 * Special key identifiers can be used to map values in the global $_SERVER
70
-	 * and $_ENV vars. To access them, use 'server.' or 'env.' followed by the 
71
-	 * desired var name as the key.
72
-	 *
73
-	 * @param string $key The key.
74
-	 * @return string The context or an empty string if no context found
75
-	 * 	for given key.
76
-	 */
77
-	public static function get($key) {
78
-		if(!empty($key)) {
79
-			if(strpos($key, 'server.') === 0) {
80
-				$varName = substr($key, 7);
81
-				return isset($_SERVER[$varName]) ? $_SERVER[$varName] : '';
82
-			} else if(strpos($key, 'env.') === 0) {
83
-				$varName = substr($key, 4);
84
-				$value = getenv($varName);
85
-				return ($value !== false) ? $value : '';
86
-			} else {
87
-				return isset(self::$map[$key]) ? self::$map[$key] : '';
88
-			}
89
-		}
90
-		return '';
91
-	}
66
+    /**
67
+     * Returns the context value identified by the key parameter.
68
+     *
69
+     * Special key identifiers can be used to map values in the global $_SERVER
70
+     * and $_ENV vars. To access them, use 'server.' or 'env.' followed by the 
71
+     * desired var name as the key.
72
+     *
73
+     * @param string $key The key.
74
+     * @return string The context or an empty string if no context found
75
+     * 	for given key.
76
+     */
77
+    public static function get($key) {
78
+        if(!empty($key)) {
79
+            if(strpos($key, 'server.') === 0) {
80
+                $varName = substr($key, 7);
81
+                return isset($_SERVER[$varName]) ? $_SERVER[$varName] : '';
82
+            } else if(strpos($key, 'env.') === 0) {
83
+                $varName = substr($key, 4);
84
+                $value = getenv($varName);
85
+                return ($value !== false) ? $value : '';
86
+            } else {
87
+                return isset(self::$map[$key]) ? self::$map[$key] : '';
88
+            }
89
+        }
90
+        return '';
91
+    }
92 92
 
93
-	/**
94
-	 * Returns the contex map as an array.
95
-	 * @return array The MDC context map.
96
-	 */
97
-	public static function getMap() {
98
-		return self::$map;
99
-	}
93
+    /**
94
+     * Returns the contex map as an array.
95
+     * @return array The MDC context map.
96
+     */
97
+    public static function getMap() {
98
+        return self::$map;
99
+    }
100 100
 
101
-	/**
102
-	 * Removes the the context identified by the key parameter. 
103
-	 *
104
-	 * Only affects user mappings, not $_ENV or $_SERVER.
105
-	 *
106
-	 * @param string $key The key to be removed.
107
-	 */
108
-	public static function remove($key) {
109
-		unset(self::$map[$key]);
110
-	}
101
+    /**
102
+     * Removes the the context identified by the key parameter. 
103
+     *
104
+     * Only affects user mappings, not $_ENV or $_SERVER.
105
+     *
106
+     * @param string $key The key to be removed.
107
+     */
108
+    public static function remove($key) {
109
+        unset(self::$map[$key]);
110
+    }
111 111
 	
112
-	/**
113
-	 * Clears the mapped diagnostic context.
114
-	 */
115
-	public static function clear() {
116
-		self::$map = array();
117
-	}
112
+    /**
113
+     * Clears the mapped diagnostic context.
114
+     */
115
+    public static function clear() {
116
+        self::$map = array();
117
+    }
118 118
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,11 +75,11 @@
 block discarded – undo
75 75
 	 * 	for given key.
76 76
 	 */
77 77
 	public static function get($key) {
78
-		if(!empty($key)) {
79
-			if(strpos($key, 'server.') === 0) {
78
+		if (!empty($key)) {
79
+			if (strpos($key, 'server.') === 0) {
80 80
 				$varName = substr($key, 7);
81 81
 				return isset($_SERVER[$varName]) ? $_SERVER[$varName] : '';
82
-			} else if(strpos($key, 'env.') === 0) {
82
+			} else if (strpos($key, 'env.') === 0) {
83 83
 				$varName = substr($key, 4);
84 84
 				$value = getenv($varName);
85 85
 				return ($value !== false) ? $value : '';
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterProcess.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
  */
27 27
 class Payone_Log4php_LoggerPatternConverterProcess extends Payone_Log4php_LoggerPatternConverter {
28 28
 
29
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
-		return getmypid();
31
-	}
29
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
+        return getmypid();
31
+    }
32 32
 }
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerLayoutPattern.php 1 patch
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -27,128 +27,128 @@
 block discarded – undo
27 27
  */
28 28
 class Payone_Log4php_LoggerLayoutPattern extends Payone_Log4php_LoggerLayout {
29 29
 	
30
-	/** Default conversion pattern */
31
-	const DEFAULT_CONVERSION_PATTERN = '%m%n';
30
+    /** Default conversion pattern */
31
+    const DEFAULT_CONVERSION_PATTERN = '%m%n';
32 32
 
33
-	/** Default conversion TTCC Pattern */
34
-	const TTCC_CONVERSION_PATTERN = '%d [%t] %p %c %x - %m%n';
33
+    /** Default conversion TTCC Pattern */
34
+    const TTCC_CONVERSION_PATTERN = '%d [%t] %p %c %x - %m%n';
35 35
 
36
-	/** The conversion pattern. */ 
37
-	protected $pattern = self::DEFAULT_CONVERSION_PATTERN;
36
+    /** The conversion pattern. */ 
37
+    protected $pattern = self::DEFAULT_CONVERSION_PATTERN;
38 38
 	
39
-	/** Maps conversion keywords to the relevant converter. */
40
-	protected static $defaultConverterMap = array(
41
-		'c' => 'LoggerPatternConverterLogger',
42
-		'lo' => 'LoggerPatternConverterLogger',
43
-		'logger' => 'LoggerPatternConverterLogger',
39
+    /** Maps conversion keywords to the relevant converter. */
40
+    protected static $defaultConverterMap = array(
41
+        'c' => 'LoggerPatternConverterLogger',
42
+        'lo' => 'LoggerPatternConverterLogger',
43
+        'logger' => 'LoggerPatternConverterLogger',
44 44
 		
45
-		'C' => 'LoggerPatternConverterClass',
46
-		'class' => 'LoggerPatternConverterClass',
45
+        'C' => 'LoggerPatternConverterClass',
46
+        'class' => 'LoggerPatternConverterClass',
47 47
 		
48
-		'cookie' => 'LoggerPatternConverterCookie',
48
+        'cookie' => 'LoggerPatternConverterCookie',
49 49
 		
50
-		'd' => 'LoggerPatternConverterDate',
51
-		'date' => 'LoggerPatternConverterDate',
50
+        'd' => 'LoggerPatternConverterDate',
51
+        'date' => 'LoggerPatternConverterDate',
52 52
 		
53
-		'e' => 'LoggerPatternConverterEnvironment',
54
-		'env' => 'LoggerPatternConverterEnvironment',
53
+        'e' => 'LoggerPatternConverterEnvironment',
54
+        'env' => 'LoggerPatternConverterEnvironment',
55 55
 		
56
-		'ex' => 'LoggerPatternConverterThrowable',
57
-		'throwable' => 'LoggerPatternConverterThrowable',
56
+        'ex' => 'LoggerPatternConverterThrowable',
57
+        'throwable' => 'LoggerPatternConverterThrowable',
58 58
 		
59
-		'F' => 'LoggerPatternConverterFile',
60
-		'file' => 'LoggerPatternConverterFile',
59
+        'F' => 'LoggerPatternConverterFile',
60
+        'file' => 'LoggerPatternConverterFile',
61 61
 		
62
-		'L' => 'LoggerPatternConverterLine',
63
-		'line' => 'LoggerPatternConverterLine',
62
+        'L' => 'LoggerPatternConverterLine',
63
+        'line' => 'LoggerPatternConverterLine',
64 64
 		
65
-		'm' => 'LoggerPatternConverterMessage',
66
-		'msg' => 'LoggerPatternConverterMessage',
67
-		'message' => 'LoggerPatternConverterMessage',
65
+        'm' => 'LoggerPatternConverterMessage',
66
+        'msg' => 'LoggerPatternConverterMessage',
67
+        'message' => 'LoggerPatternConverterMessage',
68 68
 		
69
-		'M' => 'LoggerPatternConverterMethod',
70
-		'method' => 'LoggerPatternConverterMethod',
69
+        'M' => 'LoggerPatternConverterMethod',
70
+        'method' => 'LoggerPatternConverterMethod',
71 71
 		
72
-		'n' => 'LoggerPatternConverterNewLine',
73
-		'newline' => 'LoggerPatternConverterNewLine',
72
+        'n' => 'LoggerPatternConverterNewLine',
73
+        'newline' => 'LoggerPatternConverterNewLine',
74 74
 		
75
-		'p' => 'LoggerPatternConverterLevel',
76
-		'le' => 'LoggerPatternConverterLevel',
77
-		'level' => 'LoggerPatternConverterLevel',
75
+        'p' => 'LoggerPatternConverterLevel',
76
+        'le' => 'LoggerPatternConverterLevel',
77
+        'level' => 'LoggerPatternConverterLevel',
78 78
 	
79
-		'r' => 'LoggerPatternConverterRelative',
80
-		'relative' => 'LoggerPatternConverterRelative',
79
+        'r' => 'LoggerPatternConverterRelative',
80
+        'relative' => 'LoggerPatternConverterRelative',
81 81
 		
82
-		'req' => 'LoggerPatternConverterRequest',
83
-		'request' => 'LoggerPatternConverterRequest',
82
+        'req' => 'LoggerPatternConverterRequest',
83
+        'request' => 'LoggerPatternConverterRequest',
84 84
 		
85
-		's' => 'LoggerPatternConverterServer',
86
-		'server' => 'LoggerPatternConverterServer',
85
+        's' => 'LoggerPatternConverterServer',
86
+        'server' => 'LoggerPatternConverterServer',
87 87
 		
88
-		'ses' => 'LoggerPatternConverterSession',
89
-		'session' => 'LoggerPatternConverterSession',
88
+        'ses' => 'LoggerPatternConverterSession',
89
+        'session' => 'LoggerPatternConverterSession',
90 90
 		
91
-		'sid' => 'LoggerPatternConverterSessionID',
92
-		'sessionid' => 'LoggerPatternConverterSessionID',
91
+        'sid' => 'LoggerPatternConverterSessionID',
92
+        'sessionid' => 'LoggerPatternConverterSessionID',
93 93
 	
94
-		't' => 'LoggerPatternConverterProcess',
95
-		'pid' => 'LoggerPatternConverterProcess',
96
-		'process' => 'LoggerPatternConverterProcess',
94
+        't' => 'LoggerPatternConverterProcess',
95
+        'pid' => 'LoggerPatternConverterProcess',
96
+        'process' => 'LoggerPatternConverterProcess',
97 97
 		
98
-		'x' => 'LoggerPatternConverterNDC',
99
-		'ndc' => 'LoggerPatternConverterNDC',
98
+        'x' => 'LoggerPatternConverterNDC',
99
+        'ndc' => 'LoggerPatternConverterNDC',
100 100
 			
101
-		'X' => 'LoggerPatternConverterMDC',
102
-		'mdc' => 'LoggerPatternConverterMDC',
103
-	);
101
+        'X' => 'LoggerPatternConverterMDC',
102
+        'mdc' => 'LoggerPatternConverterMDC',
103
+    );
104 104
 
105
-	protected $converterMap = array();
105
+    protected $converterMap = array();
106 106
 	
107
-	/** 
108
-	 * Head of a chain of Converters.
109
-	 * @var Payone_Log4php_LoggerPatternConverter
110
-	 */
111
-	private $head;
107
+    /** 
108
+     * Head of a chain of Converters.
109
+     * @var Payone_Log4php_LoggerPatternConverter
110
+     */
111
+    private $head;
112 112
 
113
-	public static function getDefaultConverterMap() {
114
-		return self::$defaultConverterMap;
115
-	}
113
+    public static function getDefaultConverterMap() {
114
+        return self::$defaultConverterMap;
115
+    }
116 116
 	
117
-	public function __construct() {
118
-		$this->converterMap = self::$defaultConverterMap;
119
-	}
117
+    public function __construct() {
118
+        $this->converterMap = self::$defaultConverterMap;
119
+    }
120 120
 	
121
-	/**
122
-	 * Set the <b>ConversionPattern</b> option. This is the string which
123
-	 * controls formatting and consists of a mix of literal content and
124
-	 * conversion specifiers.
125
-	 */
126
-	public function setConversionPattern($conversionPattern) {
127
-		$this->pattern = $conversionPattern;
128
-	}
121
+    /**
122
+     * Set the <b>ConversionPattern</b> option. This is the string which
123
+     * controls formatting and consists of a mix of literal content and
124
+     * conversion specifiers.
125
+     */
126
+    public function setConversionPattern($conversionPattern) {
127
+        $this->pattern = $conversionPattern;
128
+    }
129 129
 	
130
-	public function activateOptions() {
131
-		if (!isset($this->pattern)) {
132
-			throw new Payone_Log4php_LoggerException("Mandatory parameter 'conversionPattern' is not set.");
133
-		}
134
-		
135
-		$parser = new Payone_Log4php_LoggerPatternParser($this->pattern, $this->converterMap);
136
-		$this->head = $parser->parse();
137
-	}
130
+    public function activateOptions() {
131
+        if (!isset($this->pattern)) {
132
+            throw new Payone_Log4php_LoggerException("Mandatory parameter 'conversionPattern' is not set.");
133
+        }
134
+		
135
+        $parser = new Payone_Log4php_LoggerPatternParser($this->pattern, $this->converterMap);
136
+        $this->head = $parser->parse();
137
+    }
138 138
 	
139
-	/**
140
-	 * Produces a formatted string as specified by the conversion pattern.
141
-	 *
142
-	 * @param Payone_Log4php_LoggerLoggingEvent $event
143
-	 * @return string
144
-	 */
145
-	public function format(Payone_Log4php_LoggerLoggingEvent $event) {
146
-		$sbuf = '';
147
-		$converter = $this->head;
148
-		while ($converter !== null) {
149
-			$converter->format($sbuf, $event);
150
-			$converter = $converter->next;
151
-		}
152
-		return $sbuf;
153
-	}
139
+    /**
140
+     * Produces a formatted string as specified by the conversion pattern.
141
+     *
142
+     * @param Payone_Log4php_LoggerLoggingEvent $event
143
+     * @return string
144
+     */
145
+    public function format(Payone_Log4php_LoggerLoggingEvent $event) {
146
+        $sbuf = '';
147
+        $converter = $this->head;
148
+        while ($converter !== null) {
149
+            $converter->format($sbuf, $event);
150
+            $converter = $converter->next;
151
+        }
152
+        return $sbuf;
153
+    }
154 154
 }
155 155
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerAppender.php 2 patches
Indentation   +229 added lines, -229 removed lines patch added patch discarded remove patch
@@ -26,262 +26,262 @@
 block discarded – undo
26 26
  */
27 27
 abstract class Payone_Log4php_LoggerAppender extends Payone_Log4php_LoggerConfigurable {
28 28
 	
29
-	/**
30
-	 * Set to true when the appender is closed. A closed appender will not 
31
-	 * accept any logging requests. 
32
-	 * @var boolean 
33
-	 */
34
-	protected $closed = false;
29
+    /**
30
+     * Set to true when the appender is closed. A closed appender will not 
31
+     * accept any logging requests. 
32
+     * @var boolean 
33
+     */
34
+    protected $closed = false;
35 35
 	
36
-	/**
37
-	 * The first filter in the filter chain.
38
-	 * @var LoggerFilter
39
-	 */
40
-	protected $filter;
36
+    /**
37
+     * The first filter in the filter chain.
38
+     * @var LoggerFilter
39
+     */
40
+    protected $filter;
41 41
 			
42
-	/**
43
-	 * The appender's layout. Can be null if the appender does not use 
44
-	 * a layout.
45
-	 * @var Payone_Log4php_LoggerLayout
46
-	 */
47
-	protected $layout; 
42
+    /**
43
+     * The appender's layout. Can be null if the appender does not use 
44
+     * a layout.
45
+     * @var Payone_Log4php_LoggerLayout
46
+     */
47
+    protected $layout; 
48 48
 	
49
-	/**
50
-	 * Appender name. Used by other components to identify this appender.
51
-	 * @var string
52
-	 */
53
-	protected $name;
49
+    /**
50
+     * Appender name. Used by other components to identify this appender.
51
+     * @var string
52
+     */
53
+    protected $name;
54 54
 	
55
-	/**
56
-	 * Appender threshold level. Events whose level is below the threshold 
57
-	 * will not be logged.
58
-	 * @var Payone_Log4php_LoggerLevel
59
-	 */
60
-	protected $threshold;
55
+    /**
56
+     * Appender threshold level. Events whose level is below the threshold 
57
+     * will not be logged.
58
+     * @var Payone_Log4php_LoggerLevel
59
+     */
60
+    protected $threshold;
61 61
 	
62
-	/**
63
-	 * Set to true if the appender requires a layout.
64
-	 * 
65
-	 * True by default, appenders which do not use a layout should override 
66
-	 * this property to false.
67
-	 * 
68
-	 * @var boolean
69
-	 */
70
-	protected $requiresLayout = true;
62
+    /**
63
+     * Set to true if the appender requires a layout.
64
+     * 
65
+     * True by default, appenders which do not use a layout should override 
66
+     * this property to false.
67
+     * 
68
+     * @var boolean
69
+     */
70
+    protected $requiresLayout = true;
71 71
 	
72
-	/**
73
-	 * Default constructor.
74
-	 * @param string $name Appender name
75
-	 */
76
-	public function __construct($name = '') {
77
-		$this->name = $name;
72
+    /**
73
+     * Default constructor.
74
+     * @param string $name Appender name
75
+     */
76
+    public function __construct($name = '') {
77
+        $this->name = $name;
78 78
 		
79
-		// Closes the appender on shutdown. Better than a destructor because
80
-		// it will be called even if a fatal error occurs (destructor won't).
81
-		register_shutdown_function(array($this, 'close'));
79
+        // Closes the appender on shutdown. Better than a destructor because
80
+        // it will be called even if a fatal error occurs (destructor won't).
81
+        register_shutdown_function(array($this, 'close'));
82 82
 		
83
-		if ($this->requiresLayout) {
84
-			$this->layout = $this->getDefaultLayout();
85
-		}
86
-	}
83
+        if ($this->requiresLayout) {
84
+            $this->layout = $this->getDefaultLayout();
85
+        }
86
+    }
87 87
 	
88
-	/**
89
-	 * Returns the default layout for this appender. Can be overriden by 
90
-	 * derived appenders.
91
-	 * 
92
-	 * @return Payone_Log4php_LoggerLayout
93
-	 */
94
-	public function getDefaultLayout()
95
-	{
96
-		return new Payone_Log4php_LoggerLayoutSimple();
97
-	}
88
+    /**
89
+     * Returns the default layout for this appender. Can be overriden by 
90
+     * derived appenders.
91
+     * 
92
+     * @return Payone_Log4php_LoggerLayout
93
+     */
94
+    public function getDefaultLayout()
95
+    {
96
+        return new Payone_Log4php_LoggerLayoutSimple();
97
+    }
98 98
 	
99
-	/**
100
-	 * Adds a filter to the end of the filter chain.
101
-	 * @param LoggerFilter $filter add a new LoggerFilter
102
-	 */
103
-	public function addFilter($filter) {
104
-		if($this->filter === null) {
105
-			$this->filter = $filter;
106
-		} else {
107
-			$this->filter->addNext($filter);
108
-		}
109
-	}
99
+    /**
100
+     * Adds a filter to the end of the filter chain.
101
+     * @param LoggerFilter $filter add a new LoggerFilter
102
+     */
103
+    public function addFilter($filter) {
104
+        if($this->filter === null) {
105
+            $this->filter = $filter;
106
+        } else {
107
+            $this->filter->addNext($filter);
108
+        }
109
+    }
110 110
 	
111
-	/**
112
-	 * Clears the filter chain by removing all the filters in it.
113
-	 */
114
-	public function clearFilters() {
115
-		$this->filter = null;
116
-	}
111
+    /**
112
+     * Clears the filter chain by removing all the filters in it.
113
+     */
114
+    public function clearFilters() {
115
+        $this->filter = null;
116
+    }
117 117
 
118
-	/**
119
-	 * Returns the first filter in the filter chain. 
120
-	 * The return value may be <i>null</i> if no is filter is set.
121
-	 * @return LoggerFilter
122
-	 */
123
-	public function getFilter() {
124
-		return $this->filter;
125
-	} 
118
+    /**
119
+     * Returns the first filter in the filter chain. 
120
+     * The return value may be <i>null</i> if no is filter is set.
121
+     * @return LoggerFilter
122
+     */
123
+    public function getFilter() {
124
+        return $this->filter;
125
+    } 
126 126
 	
127
-	/** 
128
-	 * Returns the first filter in the filter chain. 
129
-	 * The return value may be <i>null</i> if no is filter is set.
130
-	 * @return LoggerFilter
131
-	 */
132
-	public function getFirstFilter() {
133
-		return $this->filter;
134
-	}
127
+    /** 
128
+     * Returns the first filter in the filter chain. 
129
+     * The return value may be <i>null</i> if no is filter is set.
130
+     * @return LoggerFilter
131
+     */
132
+    public function getFirstFilter() {
133
+        return $this->filter;
134
+    }
135 135
 	
136
-	/**
137
-	 * Performs threshold checks and invokes filters before delegating logging 
138
-	 * to the subclass' specific <i>append()</i> method.
139
-	 * @see Payone_Log4php_LoggerAppender::append()
140
-	 * @param Payone_Log4php_LoggerLoggingEvent $event
141
-	 */
142
-	public function doAppend(Payone_Log4php_LoggerLoggingEvent $event) {
143
-		if($this->closed) {
144
-			return;
145
-		}
136
+    /**
137
+     * Performs threshold checks and invokes filters before delegating logging 
138
+     * to the subclass' specific <i>append()</i> method.
139
+     * @see Payone_Log4php_LoggerAppender::append()
140
+     * @param Payone_Log4php_LoggerLoggingEvent $event
141
+     */
142
+    public function doAppend(Payone_Log4php_LoggerLoggingEvent $event) {
143
+        if($this->closed) {
144
+            return;
145
+        }
146 146
 		
147
-		if(!$this->isAsSevereAsThreshold($event->getLevel())) {
148
-			return;
149
-		}
147
+        if(!$this->isAsSevereAsThreshold($event->getLevel())) {
148
+            return;
149
+        }
150 150
 
151
-		$f = $this->getFirstFilter();
152
-		while($f !== null) {
153
-			switch ($f->decide($event)) {
154
-				case Payone_Log4php_LoggerFilter::DENY: return;
155
-				case Payone_Log4php_LoggerFilter::ACCEPT: return $this->append($event);
156
-				case Payone_Log4php_LoggerFilter::NEUTRAL: $f = $f->getNext();
157
-			}
158
-		}
159
-		$this->append($event);
160
-	}	 
151
+        $f = $this->getFirstFilter();
152
+        while($f !== null) {
153
+            switch ($f->decide($event)) {
154
+                case Payone_Log4php_LoggerFilter::DENY: return;
155
+                case Payone_Log4php_LoggerFilter::ACCEPT: return $this->append($event);
156
+                case Payone_Log4php_LoggerFilter::NEUTRAL: $f = $f->getNext();
157
+            }
158
+        }
159
+        $this->append($event);
160
+    }	 
161 161
 
162
-	/**
163
-	 * Sets the appender layout.
164
-	 * @param Payone_Log4php_LoggerLayout $layout
165
-	 */
166
-	public function setLayout($layout) {
167
-		if($this->requiresLayout()) {
168
-			$this->layout = $layout;
169
-		}
170
-	} 
162
+    /**
163
+     * Sets the appender layout.
164
+     * @param Payone_Log4php_LoggerLayout $layout
165
+     */
166
+    public function setLayout($layout) {
167
+        if($this->requiresLayout()) {
168
+            $this->layout = $layout;
169
+        }
170
+    } 
171 171
 	
172
-	/**
173
-	 * Returns the appender layout.
174
-	 * @return Payone_Log4php_LoggerLayout
175
-	 */
176
-	public function getLayout() {
177
-		return $this->layout;
178
-	}
172
+    /**
173
+     * Returns the appender layout.
174
+     * @return Payone_Log4php_LoggerLayout
175
+     */
176
+    public function getLayout() {
177
+        return $this->layout;
178
+    }
179 179
 	
180
-	/**
181
-	 * Configurators call this method to determine if the appender
182
-	 * requires a layout. 
183
-	 *
184
-	 * <p>If this method returns <i>true</i>, meaning that layout is required, 
185
-	 * then the configurator will configure a layout using the configuration 
186
-	 * information at its disposal.	 If this method returns <i>false</i>, 
187
-	 * meaning that a layout is not required, then layout configuration will be
188
-	 * skipped even if there is available layout configuration
189
-	 * information at the disposal of the configurator.</p>
190
-	 *
191
-	 * <p>In the rather exceptional case, where the appender
192
-	 * implementation admits a layout but can also work without it, then
193
-	 * the appender should return <i>true</i>.</p>
194
-	 * 
195
-	 * @return boolean
196
-	 */
197
-	public function requiresLayout() {
198
-		return $this->requiresLayout;
199
-	}
180
+    /**
181
+     * Configurators call this method to determine if the appender
182
+     * requires a layout. 
183
+     *
184
+     * <p>If this method returns <i>true</i>, meaning that layout is required, 
185
+     * then the configurator will configure a layout using the configuration 
186
+     * information at its disposal.	 If this method returns <i>false</i>, 
187
+     * meaning that a layout is not required, then layout configuration will be
188
+     * skipped even if there is available layout configuration
189
+     * information at the disposal of the configurator.</p>
190
+     *
191
+     * <p>In the rather exceptional case, where the appender
192
+     * implementation admits a layout but can also work without it, then
193
+     * the appender should return <i>true</i>.</p>
194
+     * 
195
+     * @return boolean
196
+     */
197
+    public function requiresLayout() {
198
+        return $this->requiresLayout;
199
+    }
200 200
 	
201
-	/**
202
-	 * Retruns the appender name.
203
-	 * @return string
204
-	 */
205
-	public function getName() {
206
-		return $this->name;
207
-	}
201
+    /**
202
+     * Retruns the appender name.
203
+     * @return string
204
+     */
205
+    public function getName() {
206
+        return $this->name;
207
+    }
208 208
 	
209
-	/**
210
-	 * Sets the appender name.
211
-	 * @param string $name
212
-	 */
213
-	public function setName($name) {
214
-		$this->name = $name;	
215
-	}
209
+    /**
210
+     * Sets the appender name.
211
+     * @param string $name
212
+     */
213
+    public function setName($name) {
214
+        $this->name = $name;	
215
+    }
216 216
 	
217
-	/**
218
-	 * Returns the appender's threshold level. 
219
-	 * @return Payone_Log4php_LoggerLevel
220
-	 */
221
-	public function getThreshold() { 
222
-		return $this->threshold;
223
-	}
217
+    /**
218
+     * Returns the appender's threshold level. 
219
+     * @return Payone_Log4php_LoggerLevel
220
+     */
221
+    public function getThreshold() { 
222
+        return $this->threshold;
223
+    }
224 224
 	
225
-	/**
226
-	 * Sets the appender threshold.
227
-	 * 
228
-	 * @param Payone_Log4php_LoggerLevel|string $threshold Either a {@link LoggerLevel}
229
-	 *   object or a string equivalent.
230
-	 * @see LoggerOptionConverter::toLevel()
231
-	 */
232
-	public function setThreshold($threshold) {
233
-		$this->setLevel('threshold', $threshold);
234
-	}
225
+    /**
226
+     * Sets the appender threshold.
227
+     * 
228
+     * @param Payone_Log4php_LoggerLevel|string $threshold Either a {@link LoggerLevel}
229
+     *   object or a string equivalent.
230
+     * @see LoggerOptionConverter::toLevel()
231
+     */
232
+    public function setThreshold($threshold) {
233
+        $this->setLevel('threshold', $threshold);
234
+    }
235 235
 	
236
-	/**
237
-	 * Checks whether the message level is below the appender's threshold. 
238
-	 *
239
-	 * If there is no threshold set, then the return value is always <i>true</i>.
240
-	 * 
241
-	 * @param Payone_Log4php_LoggerLevel $level
242
-	 * @return boolean Returns true if level is greater or equal than 
243
-	 *   threshold, or if the threshold is not set. Otherwise returns false.
244
-	 */
245
-	public function isAsSevereAsThreshold($level) {
246
-		if($this->threshold === null) {
247
-			return true;
248
-		}
249
-		return $level->isGreaterOrEqual($this->getThreshold());
250
-	}
236
+    /**
237
+     * Checks whether the message level is below the appender's threshold. 
238
+     *
239
+     * If there is no threshold set, then the return value is always <i>true</i>.
240
+     * 
241
+     * @param Payone_Log4php_LoggerLevel $level
242
+     * @return boolean Returns true if level is greater or equal than 
243
+     *   threshold, or if the threshold is not set. Otherwise returns false.
244
+     */
245
+    public function isAsSevereAsThreshold($level) {
246
+        if($this->threshold === null) {
247
+            return true;
248
+        }
249
+        return $level->isGreaterOrEqual($this->getThreshold());
250
+    }
251 251
 
252
-	/**
253
-	 * Prepares the appender for logging.
254
-	 * 
255
-	 * Derived appenders should override this method if option structure
256
-	 * requires it.
257
-	 */
258
-	public function activateOptions() {
259
-		$this->closed = false;
260
-	}
252
+    /**
253
+     * Prepares the appender for logging.
254
+     * 
255
+     * Derived appenders should override this method if option structure
256
+     * requires it.
257
+     */
258
+    public function activateOptions() {
259
+        $this->closed = false;
260
+    }
261 261
 	
262
-	/**
263
-	 * Forwards the logging event to the destination.
264
-	 * 
265
-	 * Derived appenders should implement this method to perform actual logging.
266
-	 * 
267
-	 * @param Payone_Log4php_LoggerLoggingEvent $event
268
-	 */
269
-	abstract protected function append(Payone_Log4php_LoggerLoggingEvent $event);
262
+    /**
263
+     * Forwards the logging event to the destination.
264
+     * 
265
+     * Derived appenders should implement this method to perform actual logging.
266
+     * 
267
+     * @param Payone_Log4php_LoggerLoggingEvent $event
268
+     */
269
+    abstract protected function append(Payone_Log4php_LoggerLoggingEvent $event);
270 270
 
271
-	/**
272
-	 * Releases any resources allocated by the appender.
273
-	 * 
274
-	 * Derived appenders should override this method to perform proper closing
275
-	 * procedures.
276
-	 */
277
-	public function close() {
278
-		$this->closed = true;
279
-	}
271
+    /**
272
+     * Releases any resources allocated by the appender.
273
+     * 
274
+     * Derived appenders should override this method to perform proper closing
275
+     * procedures.
276
+     */
277
+    public function close() {
278
+        $this->closed = true;
279
+    }
280 280
 	
281
-	/** Triggers a warning for this logger with the given message. */
282
-	protected function warn($message) {
283
-		$id = get_class($this) . (empty($this->name) ? '' : ":{$this->name}");
284
-		trigger_error("log4php: [$id]: $message", E_USER_WARNING);
285
-	}
281
+    /** Triggers a warning for this logger with the given message. */
282
+    protected function warn($message) {
283
+        $id = get_class($this) . (empty($this->name) ? '' : ":{$this->name}");
284
+        trigger_error("log4php: [$id]: $message", E_USER_WARNING);
285
+    }
286 286
 	
287 287
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @param LoggerFilter $filter add a new LoggerFilter
102 102
 	 */
103 103
 	public function addFilter($filter) {
104
-		if($this->filter === null) {
104
+		if ($this->filter === null) {
105 105
 			$this->filter = $filter;
106 106
 		} else {
107 107
 			$this->filter->addNext($filter);
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
 	 * @param Payone_Log4php_LoggerLoggingEvent $event
141 141
 	 */
142 142
 	public function doAppend(Payone_Log4php_LoggerLoggingEvent $event) {
143
-		if($this->closed) {
143
+		if ($this->closed) {
144 144
 			return;
145 145
 		}
146 146
 		
147
-		if(!$this->isAsSevereAsThreshold($event->getLevel())) {
147
+		if (!$this->isAsSevereAsThreshold($event->getLevel())) {
148 148
 			return;
149 149
 		}
150 150
 
151 151
 		$f = $this->getFirstFilter();
152
-		while($f !== null) {
152
+		while ($f !== null) {
153 153
 			switch ($f->decide($event)) {
154 154
 				case Payone_Log4php_LoggerFilter::DENY: return;
155 155
 				case Payone_Log4php_LoggerFilter::ACCEPT: return $this->append($event);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 * @param Payone_Log4php_LoggerLayout $layout
165 165
 	 */
166 166
 	public function setLayout($layout) {
167
-		if($this->requiresLayout()) {
167
+		if ($this->requiresLayout()) {
168 168
 			$this->layout = $layout;
169 169
 		}
170 170
 	} 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 *   threshold, or if the threshold is not set. Otherwise returns false.
244 244
 	 */
245 245
 	public function isAsSevereAsThreshold($level) {
246
-		if($this->threshold === null) {
246
+		if ($this->threshold === null) {
247 247
 			return true;
248 248
 		}
249 249
 		return $level->isGreaterOrEqual($this->getThreshold());
Please login to merge, or discard this patch.