Completed
Push — master ( 06e75e...4dd477 )
by Florian
06:57
created
lib/Payone/Log4php/LoggerRendererException.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@
 block discarded – undo
27 27
  */
28 28
 class Payone_Log4php_LoggerRendererException implements Payone_Log4php_LoggerRendererObject {
29 29
 
30
-	public function render($o) {
31
-		$strRep  = 'Throwable('.get_class($o).'): '.$o->getMessage().' in '.$o->getFile().' on line '.$o->getLine();
32
-		$strRep .= PHP_EOL.$o->getTraceAsString();
30
+    public function render($o) {
31
+        $strRep  = 'Throwable('.get_class($o).'): '.$o->getMessage().' in '.$o->getFile().' on line '.$o->getLine();
32
+        $strRep .= PHP_EOL.$o->getTraceAsString();
33 33
 		
34
-		if (method_exists($o, 'getPrevious') && $o->getPrevious() !== null) {
35
-			$strRep .= PHP_EOL.'Caused by: '.$this->render($o->getPrevious());
36
-		}
34
+        if (method_exists($o, 'getPrevious') && $o->getPrevious() !== null) {
35
+            $strRep .= PHP_EOL.'Caused by: '.$this->render($o->getPrevious());
36
+        }
37 37
 		
38
-		return $strRep;		
39
-	}
38
+        return $strRep;		
39
+    }
40 40
 }
41 41
 ?>
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@
 block discarded – undo
28 28
 class Payone_Log4php_LoggerRendererException implements Payone_Log4php_LoggerRendererObject {
29 29
 
30 30
 	public function render($o) {
31
-		$strRep  = 'Throwable('.get_class($o).'): '.$o->getMessage().' in '.$o->getFile().' on line '.$o->getLine();
32
-		$strRep .= PHP_EOL.$o->getTraceAsString();
31
+		$strRep  = 'Throwable(' . get_class($o) . '): ' . $o->getMessage() . ' in ' . $o->getFile() . ' on line ' . $o->getLine();
32
+		$strRep .= PHP_EOL . $o->getTraceAsString();
33 33
 		
34 34
 		if (method_exists($o, 'getPrevious') && $o->getPrevious() !== null) {
35
-			$strRep .= PHP_EOL.'Caused by: '.$this->render($o->getPrevious());
35
+			$strRep .= PHP_EOL . 'Caused by: ' . $this->render($o->getPrevious());
36 36
 		}
37 37
 		
38 38
 		return $strRep;		
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterMethod.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
  */
28 28
 class Payone_Log4php_LoggerPatternConverterMethod extends Payone_Log4php_LoggerPatternConverter {
29 29
 
30
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
31
-		return $event->getLocationInformation()->getMethodName();
32
-	}
30
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
31
+        return $event->getLocationInformation()->getMethodName();
32
+    }
33 33
 }
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerAppenderPDO.php 2 patches
Indentation   +201 added lines, -201 removed lines patch added patch discarded remove patch
@@ -49,246 +49,246 @@
 block discarded – undo
49 49
  */
50 50
 class Payone_Log4php_LoggerAppenderPDO extends Payone_Log4php_LoggerAppender {
51 51
 
52
-	// ******************************************
53
-	// *** Configurable parameters            ***
54
-	// ******************************************
52
+    // ******************************************
53
+    // *** Configurable parameters            ***
54
+    // ******************************************
55 55
 	
56
-	/** 
57
-	 * DSN string used to connect to the database.
58
-	 * @see http://www.php.net/manual/en/pdo.construct.php
59
-	 */
60
-	protected $dsn;
56
+    /** 
57
+     * DSN string used to connect to the database.
58
+     * @see http://www.php.net/manual/en/pdo.construct.php
59
+     */
60
+    protected $dsn;
61 61
 
62
-	/** Database user name. */
63
-	protected $user;
62
+    /** Database user name. */
63
+    protected $user;
64 64
 	
65
-	/** Database password. */
66
-	protected $password;
65
+    /** Database password. */
66
+    protected $password;
67 67
 	
68
-	/** 
69
-	 * The insert query.
70
-	 * 
71
-	 * The __TABLE__ placeholder will be replaced by the table name from 
72
-	 * {@link $table}.
73
-	 *  
74
-	 * The questionmarks are part of the prepared statement, and they must 
75
-	 * match the number of conversion specifiers in {@link insertPattern}.
76
-	 */
77
-	protected $insertSQL = "INSERT INTO __TABLE__ (timestamp, logger, level, message, thread, file, line) VALUES (?, ?, ?, ?, ?, ?, ?)";
68
+    /** 
69
+     * The insert query.
70
+     * 
71
+     * The __TABLE__ placeholder will be replaced by the table name from 
72
+     * {@link $table}.
73
+     *  
74
+     * The questionmarks are part of the prepared statement, and they must 
75
+     * match the number of conversion specifiers in {@link insertPattern}.
76
+     */
77
+    protected $insertSQL = "INSERT INTO __TABLE__ (timestamp, logger, level, message, thread, file, line) VALUES (?, ?, ?, ?, ?, ?, ?)";
78 78
 
79
-	/** 
80
-	 * A comma separated list of {@link Payone_Log4php_LoggerPatternLayout} format strings
81
-	 * which replace the "?" in {@link $insertSQL}.
82
-	 * 
83
-	 * Must contain the same number of comma separated conversion patterns as 
84
-	 * there are question marks in {@link insertSQL}.
85
- 	 * 
86
- 	 * @see Payone_Log4php_LoggerPatternLayout For conversion patterns.
87
-	 */
88
-	protected $insertPattern = "%date{Y-m-d H:i:s},%logger,%level,%message,%pid,%file,%line";
79
+    /** 
80
+     * A comma separated list of {@link Payone_Log4php_LoggerPatternLayout} format strings
81
+     * which replace the "?" in {@link $insertSQL}.
82
+     * 
83
+     * Must contain the same number of comma separated conversion patterns as 
84
+     * there are question marks in {@link insertSQL}.
85
+     * 
86
+     * @see Payone_Log4php_LoggerPatternLayout For conversion patterns.
87
+     */
88
+    protected $insertPattern = "%date{Y-m-d H:i:s},%logger,%level,%message,%pid,%file,%line";
89 89
 
90
-	/** Name of the table to which to append log events. */
91
-	protected $table = 'log4php_log';
90
+    /** Name of the table to which to append log events. */
91
+    protected $table = 'log4php_log';
92 92
 	
93
-	/** The number of recconect attempts to make on failed append. */
94
-	protected $reconnectAttempts = 3;
93
+    /** The number of recconect attempts to make on failed append. */
94
+    protected $reconnectAttempts = 3;
95 95
 	
96 96
 	
97
-	// ******************************************
98
-	// *** Private memebers                   ***
99
-	// ******************************************
97
+    // ******************************************
98
+    // *** Private memebers                   ***
99
+    // ******************************************
100 100
 	
101
-	/** 
102
-	 * The PDO instance.
103
-	 * @var PDO 
104
-	 */
105
-	protected $db;
101
+    /** 
102
+     * The PDO instance.
103
+     * @var PDO 
104
+     */
105
+    protected $db;
106 106
 	
107
-	/** 
108
-	 * Prepared statement for the insert query.
109
-	 * @var PDOStatement 
110
-	 */
111
-	protected $preparedInsert;
107
+    /** 
108
+     * Prepared statement for the insert query.
109
+     * @var PDOStatement 
110
+     */
111
+    protected $preparedInsert;
112 112
 	
113
-	/** This appender does not require a layout. */
114
-	protected $requiresLayout = false;
113
+    /** This appender does not require a layout. */
114
+    protected $requiresLayout = false;
115 115
 	
116 116
 
117
-	// ******************************************
118
-	// *** Appender methods                   ***
119
-	// ******************************************
117
+    // ******************************************
118
+    // *** Appender methods                   ***
119
+    // ******************************************
120 120
 	
121
-	/**
122
-	 * Acquires a database connection based on parameters.
123
-	 * Parses the insert pattern to create a chain of converters which will be
124
-	 * used in forming query parameters from logging events.
125
-	 */
126
-	public function activateOptions() {
127
-		try {
128
-			$this->establishConnection();
129
-		} catch (PDOException $e) {
130
-			$this->warn("Failed connecting to database: " . $e->getMessage());
131
-			$this->close();
132
-			return;
133
-		}
121
+    /**
122
+     * Acquires a database connection based on parameters.
123
+     * Parses the insert pattern to create a chain of converters which will be
124
+     * used in forming query parameters from logging events.
125
+     */
126
+    public function activateOptions() {
127
+        try {
128
+            $this->establishConnection();
129
+        } catch (PDOException $e) {
130
+            $this->warn("Failed connecting to database: " . $e->getMessage());
131
+            $this->close();
132
+            return;
133
+        }
134 134
 
135
-		// Parse the insert patterns; pattern parts are comma delimited
136
-		$pieces = explode(',', $this->insertPattern);
137
-		$converterMap = Payone_Log4php_LoggerLayoutPattern::getDefaultConverterMap();
138
-		foreach($pieces as $pattern) {
139
-			$parser = new Payone_Log4php_LoggerPatternParser($pattern, $converterMap);
140
-			$this->converters[] = $parser->parse(); 
141
-		}
135
+        // Parse the insert patterns; pattern parts are comma delimited
136
+        $pieces = explode(',', $this->insertPattern);
137
+        $converterMap = Payone_Log4php_LoggerLayoutPattern::getDefaultConverterMap();
138
+        foreach($pieces as $pattern) {
139
+            $parser = new Payone_Log4php_LoggerPatternParser($pattern, $converterMap);
140
+            $this->converters[] = $parser->parse(); 
141
+        }
142 142
 		
143
-		$this->closed = false;
144
-	}
143
+        $this->closed = false;
144
+    }
145 145
 	
146
-	/** 
147
-	 * Connects to the database, and prepares the insert query.
148
-	 * @throws PDOException If connect or prepare fails.  
149
-	 */
150
-	protected function establishConnection() {
151
-		// Acquire database connection
152
-		$this->db = new PDO($this->dsn, $this->user, $this->password);
153
-		$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
146
+    /** 
147
+     * Connects to the database, and prepares the insert query.
148
+     * @throws PDOException If connect or prepare fails.  
149
+     */
150
+    protected function establishConnection() {
151
+        // Acquire database connection
152
+        $this->db = new PDO($this->dsn, $this->user, $this->password);
153
+        $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
154 154
 		
155
-		// Prepare the insert statement
156
-		$insertSQL = str_replace('__TABLE__', $this->table, $this->insertSQL);
157
-		$this->preparedInsert = $this->db->prepare($insertSQL);
158
-	}
155
+        // Prepare the insert statement
156
+        $insertSQL = str_replace('__TABLE__', $this->table, $this->insertSQL);
157
+        $this->preparedInsert = $this->db->prepare($insertSQL);
158
+    }
159 159
 	
160
-	/**
161
-	 * Appends a new event to the database.
162
-	 * 
163
-	 * If writing to database fails, it will retry by re-establishing the 
164
-	 * connection up to $reconnectAttempts times. If writing still fails, 
165
-	 * the appender will close.
166
-	 */
167
-	public function append(Payone_Log4php_LoggerLoggingEvent $event) {
160
+    /**
161
+     * Appends a new event to the database.
162
+     * 
163
+     * If writing to database fails, it will retry by re-establishing the 
164
+     * connection up to $reconnectAttempts times. If writing still fails, 
165
+     * the appender will close.
166
+     */
167
+    public function append(Payone_Log4php_LoggerLoggingEvent $event) {
168 168
 		
169
-		for ($attempt = 1; $attempt <= $this->reconnectAttempts; $attempt++) {
170
-			try {
171
-				// If it's a retry, reestablish the connection
172
-				if ($attempt > 1) {
173
-					$this->establishConnection();
174
-				}
169
+        for ($attempt = 1; $attempt <= $this->reconnectAttempts; $attempt++) {
170
+            try {
171
+                // If it's a retry, reestablish the connection
172
+                if ($attempt > 1) {
173
+                    $this->establishConnection();
174
+                }
175 175
 				
176
-				// Write to database
177
-				@$this->preparedInsert->execute($this->format($event));
178
-				@$this->preparedInsert->closeCursor();
179
-				break;
180
-			} catch (PDOException $e) {
181
-				$this->warn("Failed writing to database: ". $e->getMessage());
176
+                // Write to database
177
+                @$this->preparedInsert->execute($this->format($event));
178
+                @$this->preparedInsert->closeCursor();
179
+                break;
180
+            } catch (PDOException $e) {
181
+                $this->warn("Failed writing to database: ". $e->getMessage());
182 182
 				
183
-				// Close the appender if it's the last attempt
184
-				if ($attempt == $this->reconnectAttempts) {
185
-					$this->warn("Failed after {$this->reconnectAttempts} attempts. Closing appender.");
186
-					$this->close();
187
-				} else {
188
-					$this->warn("Attempting a reconnect (attempt $attempt of {$this->reconnectAttempts}).");
189
-				}
190
-			}
191
-		}
192
-	}
183
+                // Close the appender if it's the last attempt
184
+                if ($attempt == $this->reconnectAttempts) {
185
+                    $this->warn("Failed after {$this->reconnectAttempts} attempts. Closing appender.");
186
+                    $this->close();
187
+                } else {
188
+                    $this->warn("Attempting a reconnect (attempt $attempt of {$this->reconnectAttempts}).");
189
+                }
190
+            }
191
+        }
192
+    }
193 193
 	
194
-	/**
195
-	 * Converts the logging event to a series of database parameters by using 
196
-	 * the converter chain which was set up on activation. 
197
-	 */
198
-	protected function format(Payone_Log4php_LoggerLoggingEvent $event) {
199
-		$params = array();
200
-		foreach($this->converters as $converter) {
201
-			$buffer = '';
202
-			while ($converter !== null) {
203
-				$converter->format($buffer, $event);
204
-				$converter = $converter->next;
205
-			}
206
-			$params[] = $buffer;
207
-		}
208
-		return $params;
209
-	}
194
+    /**
195
+     * Converts the logging event to a series of database parameters by using 
196
+     * the converter chain which was set up on activation. 
197
+     */
198
+    protected function format(Payone_Log4php_LoggerLoggingEvent $event) {
199
+        $params = array();
200
+        foreach($this->converters as $converter) {
201
+            $buffer = '';
202
+            while ($converter !== null) {
203
+                $converter->format($buffer, $event);
204
+                $converter = $converter->next;
205
+            }
206
+            $params[] = $buffer;
207
+        }
208
+        return $params;
209
+    }
210 210
 	
211
-	/**
212
-	 * Closes the connection to the logging database
213
-	 */
214
-	public function close() {
215
-		// Close the connection (if any)
216
-		$this->db = null;
211
+    /**
212
+     * Closes the connection to the logging database
213
+     */
214
+    public function close() {
215
+        // Close the connection (if any)
216
+        $this->db = null;
217 217
 		
218
-		// Close the appender
219
-		$this->closed = true;
220
-	}
218
+        // Close the appender
219
+        $this->closed = true;
220
+    }
221 221
 	
222
-	// ******************************************
223
-	// *** Accessor methods                   ***
224
-	// ******************************************
222
+    // ******************************************
223
+    // *** Accessor methods                   ***
224
+    // ******************************************
225 225
 	
226
-	/**
227
-	 * Returns the active database handle or null if not established.
228
-	 * @return PDO
229
-	 */
230
-	public function getDatabaseHandle() {
231
-		return $this->db;
232
-	}
226
+    /**
227
+     * Returns the active database handle or null if not established.
228
+     * @return PDO
229
+     */
230
+    public function getDatabaseHandle() {
231
+        return $this->db;
232
+    }
233 233
 	
234
-	/** Sets the username. */
235
-	public function setUser($user) {
236
-		$this->setString('user', $user);
237
-	}
234
+    /** Sets the username. */
235
+    public function setUser($user) {
236
+        $this->setString('user', $user);
237
+    }
238 238
 	
239
-	/** Returns the username. */
240
-	public function getUser($user) {
241
-		return $this->user;
242
-	}
239
+    /** Returns the username. */
240
+    public function getUser($user) {
241
+        return $this->user;
242
+    }
243 243
 	
244
-	/** Sets the password. */
245
-	public function setPassword($password) {
246
-		$this->setString('password', $password);
247
-	}
244
+    /** Sets the password. */
245
+    public function setPassword($password) {
246
+        $this->setString('password', $password);
247
+    }
248 248
 	
249
-	/** Returns the password. */
250
-	public function getPassword($password) {
251
-		return $this->password;
252
-	}
249
+    /** Returns the password. */
250
+    public function getPassword($password) {
251
+        return $this->password;
252
+    }
253 253
 	
254
-	/** Sets the insert SQL. */
255
-	public function setInsertSQL($sql) {
256
-		$this->setString('insertSQL', $sql);
257
-	}
254
+    /** Sets the insert SQL. */
255
+    public function setInsertSQL($sql) {
256
+        $this->setString('insertSQL', $sql);
257
+    }
258 258
 	
259
-	/** Returns the insert SQL. */
260
-	public function getInsertSQL($sql) {
261
-		return $this->insertSQL;
262
-	}
259
+    /** Returns the insert SQL. */
260
+    public function getInsertSQL($sql) {
261
+        return $this->insertSQL;
262
+    }
263 263
 
264
-	/** Sets the insert pattern. */
265
-	public function setInsertPattern($pattern) {
266
-		$this->setString('insertPattern', $pattern);
267
-	}
264
+    /** Sets the insert pattern. */
265
+    public function setInsertPattern($pattern) {
266
+        $this->setString('insertPattern', $pattern);
267
+    }
268 268
 	
269
-	/** Returns the insert pattern. */
270
-	public function getInsertPattern($pattern) {
271
-		return $this->insertPattern;
272
-	}
269
+    /** Returns the insert pattern. */
270
+    public function getInsertPattern($pattern) {
271
+        return $this->insertPattern;
272
+    }
273 273
 
274
-	/** Sets the table name. */
275
-	public function setTable($table) {
276
-		$this->setString('table', $table);
277
-	}
274
+    /** Sets the table name. */
275
+    public function setTable($table) {
276
+        $this->setString('table', $table);
277
+    }
278 278
 	
279
-	/** Returns the table name. */
280
-	public function getTable($table) {
281
-		return $this->table;
282
-	}
279
+    /** Returns the table name. */
280
+    public function getTable($table) {
281
+        return $this->table;
282
+    }
283 283
 	
284
-	/** Sets the DSN string. */
285
-	public function setDSN($dsn) {
286
-		$this->setString('dsn', $dsn);
287
-	}
284
+    /** Sets the DSN string. */
285
+    public function setDSN($dsn) {
286
+        $this->setString('dsn', $dsn);
287
+    }
288 288
 	
289
-	/** Returns the DSN string. */
290
-	public function getDSN($dsn) {
291
-		return $this->setString('dsn', $dsn);
292
-	}	
289
+    /** Returns the DSN string. */
290
+    public function getDSN($dsn) {
291
+        return $this->setString('dsn', $dsn);
292
+    }	
293 293
 }
294 294
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		// Parse the insert patterns; pattern parts are comma delimited
136 136
 		$pieces = explode(',', $this->insertPattern);
137 137
 		$converterMap = Payone_Log4php_LoggerLayoutPattern::getDefaultConverterMap();
138
-		foreach($pieces as $pattern) {
138
+		foreach ($pieces as $pattern) {
139 139
 			$parser = new Payone_Log4php_LoggerPatternParser($pattern, $converterMap);
140 140
 			$this->converters[] = $parser->parse(); 
141 141
 		}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 				@$this->preparedInsert->closeCursor();
179 179
 				break;
180 180
 			} catch (PDOException $e) {
181
-				$this->warn("Failed writing to database: ". $e->getMessage());
181
+				$this->warn("Failed writing to database: " . $e->getMessage());
182 182
 				
183 183
 				// Close the appender if it's the last attempt
184 184
 				if ($attempt == $this->reconnectAttempts) {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	protected function format(Payone_Log4php_LoggerLoggingEvent $event) {
199 199
 		$params = array();
200
-		foreach($this->converters as $converter) {
200
+		foreach ($this->converters as $converter) {
201 201
 			$buffer = '';
202 202
 			while ($converter !== null) {
203 203
 				$converter->format($buffer, $event);
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterLiteral.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
  */
27 27
 class Payone_Log4php_LoggerPatternConverterLiteral extends Payone_Log4php_LoggerPatternConverter {
28 28
 
29
-	private $literalValue;
29
+    private $literalValue;
30 30
 	
31
-	public function __construct($literalValue) {
32
-		$this->literalValue = $literalValue;
33
-	}
31
+    public function __construct($literalValue) {
32
+        $this->literalValue = $literalValue;
33
+    }
34 34
 	
35
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
36
-		return $this->literalValue;
37
-	}
35
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
36
+        return $this->literalValue;
37
+    }
38 38
 }
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterNDC.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
  */
27 27
 class Payone_Log4php_LoggerPatternConverterNDC extends Payone_Log4php_LoggerPatternConverter {
28 28
 
29
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
-		return $event->getNDC();
31
-	}
29
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
+        return $event->getNDC();
31
+    }
32 32
 }
33
- 
34 33
\ No newline at end of file
34
+    
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterDate.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -32,58 +32,58 @@
 block discarded – undo
32 32
  */
33 33
 class Payone_Log4php_LoggerPatternConverterDate extends Payone_Log4php_LoggerPatternConverter {
34 34
 
35
-	const DATE_FORMAT_ISO8601 = 'c';
35
+    const DATE_FORMAT_ISO8601 = 'c';
36 36
 	
37
-	const DATE_FORMAT_ABSOLUTE = 'H:i:s';
37
+    const DATE_FORMAT_ABSOLUTE = 'H:i:s';
38 38
 	
39
-	const DATE_FORMAT_DATE = 'd M Y H:i:s.u';
39
+    const DATE_FORMAT_DATE = 'd M Y H:i:s.u';
40 40
 	
41
-	private $format = self::DATE_FORMAT_ISO8601;
41
+    private $format = self::DATE_FORMAT_ISO8601;
42 42
 	
43
-	private $specials = array(
44
-		'ISO8601' => self::DATE_FORMAT_ISO8601,
45
-		'ABSOLUTE' => self::DATE_FORMAT_ABSOLUTE,
46
-		'DATE' => self::DATE_FORMAT_DATE,
47
-	);
43
+    private $specials = array(
44
+        'ISO8601' => self::DATE_FORMAT_ISO8601,
45
+        'ABSOLUTE' => self::DATE_FORMAT_ABSOLUTE,
46
+        'DATE' => self::DATE_FORMAT_DATE,
47
+    );
48 48
 	
49
-	private $useLocalDate = false;
49
+    private $useLocalDate = false;
50 50
 	
51
-	public function activateOptions() {
51
+    public function activateOptions() {
52 52
 		
53
-		// Parse the option (date format)
54
-		if (isset($this->option)) {
55
-			if(isset($this->specials[$this->option])) {
56
-				$this->format = $this->specials[$this->option];
57
-			} else {
58
-				$this->format = $this->option;
59
-			}
60
-		}
53
+        // Parse the option (date format)
54
+        if (isset($this->option)) {
55
+            if(isset($this->specials[$this->option])) {
56
+                $this->format = $this->specials[$this->option];
57
+            } else {
58
+                $this->format = $this->option;
59
+            }
60
+        }
61 61
 		
62
-		// Check whether the pattern contains milliseconds (u)
63
-		if (preg_match('/(?<!\\\\)u/', $this->format)) {
64
-			$this->useLocalDate = true;
65
-		}
66
-	}
62
+        // Check whether the pattern contains milliseconds (u)
63
+        if (preg_match('/(?<!\\\\)u/', $this->format)) {
64
+            $this->useLocalDate = true;
65
+        }
66
+    }
67 67
 	
68
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
69
-		if ($this->useLocalDate) {
70
-			return $this->date($this->format, $event->getTimeStamp());
71
-		}
72
-		return date($this->format, $event->getTimeStamp());
73
-	}
68
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
69
+        if ($this->useLocalDate) {
70
+            return $this->date($this->format, $event->getTimeStamp());
71
+        }
72
+        return date($this->format, $event->getTimeStamp());
73
+    }
74 74
 	
75
-	/**
76
-	 * Currently, PHP date() function always returns zeros for milliseconds (u)
77
-	 * on Windows. This is a replacement function for date() which correctly 
78
-	 * displays milliseconds on all platforms. 
79
-	 * 
80
-	 * It is slower than PHP date() so it should only be used if necessary. 
81
-	 */
82
-	private function date($format, $utimestamp) {
83
-		$timestamp = floor($utimestamp);
84
-		$ms = floor(($utimestamp - $timestamp) * 1000);
85
-		$ms = str_pad($ms, 3, '0', STR_PAD_LEFT);
75
+    /**
76
+     * Currently, PHP date() function always returns zeros for milliseconds (u)
77
+     * on Windows. This is a replacement function for date() which correctly 
78
+     * displays milliseconds on all platforms. 
79
+     * 
80
+     * It is slower than PHP date() so it should only be used if necessary. 
81
+     */
82
+    private function date($format, $utimestamp) {
83
+        $timestamp = floor($utimestamp);
84
+        $ms = floor(($utimestamp - $timestamp) * 1000);
85
+        $ms = str_pad($ms, 3, '0', STR_PAD_LEFT);
86 86
 	
87
-		return date(preg_replace('`(?<!\\\\)u`', $ms, $format), $timestamp);
88
-	}
87
+        return date(preg_replace('`(?<!\\\\)u`', $ms, $format), $timestamp);
88
+    }
89 89
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 		
53 53
 		// Parse the option (date format)
54 54
 		if (isset($this->option)) {
55
-			if(isset($this->specials[$this->option])) {
55
+			if (isset($this->specials[$this->option])) {
56 56
 				$this->format = $this->specials[$this->option];
57 57
 			} else {
58 58
 				$this->format = $this->option;
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterLine.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
  */
28 28
 class Payone_Log4php_LoggerPatternConverterLine extends Payone_Log4php_LoggerPatternConverter {
29 29
 
30
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
31
-		return $event->getLocationInformation()->getLineNumber();
32
-	}
30
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
31
+        return $event->getLocationInformation()->getLineNumber();
32
+    }
33 33
 }
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterMDC.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -29,25 +29,25 @@
 block discarded – undo
29 29
  */
30 30
 class Payone_Log4php_LoggerPatternConverterMDC extends Payone_Log4php_LoggerPatternConverter {
31 31
 
32
-	private $key;
32
+    private $key;
33 33
 
34
-	public function activateOptions() {
35
-		if (isset($this->option) && $this->option !== '') {
36
-			$this->key = $this->option;
37
-		}
38
-	}
34
+    public function activateOptions() {
35
+        if (isset($this->option) && $this->option !== '') {
36
+            $this->key = $this->option;
37
+        }
38
+    }
39 39
 	
40
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
41
-		if (isset($this->key)) {
42
-			return $event->getMDC($this->key);
43
-		} else {
44
-			$buff = array();
45
-			$map = $event->getMDCMap();
46
-			foreach($map as $key => $value) {
47
-				$buff []= "$key=$value";
48
-			}
49
-			return implode(', ', $buff);
50
-		}
51
-	}
40
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
41
+        if (isset($this->key)) {
42
+            return $event->getMDC($this->key);
43
+        } else {
44
+            $buff = array();
45
+            $map = $event->getMDCMap();
46
+            foreach($map as $key => $value) {
47
+                $buff []= "$key=$value";
48
+            }
49
+            return implode(', ', $buff);
50
+        }
51
+    }
52 52
 }
53
- 
54 53
\ No newline at end of file
54
+    
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@
 block discarded – undo
43 43
 		} else {
44 44
 			$buff = array();
45 45
 			$map = $event->getMDCMap();
46
-			foreach($map as $key => $value) {
47
-				$buff []= "$key=$value";
46
+			foreach ($map as $key => $value) {
47
+				$buff [] = "$key=$value";
48 48
 			}
49 49
 			return implode(', ', $buff);
50 50
 		}
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerLayoutSerialized.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -32,24 +32,24 @@
 block discarded – undo
32 32
  */  
33 33
 class Payone_Log4php_LoggerLayoutSerialized extends Payone_Log4php_LoggerLayout {
34 34
 	
35
-	/** Whether to include the event's location information (slow). */
36
-	protected $locationInfo = false;
35
+    /** Whether to include the event's location information (slow). */
36
+    protected $locationInfo = false;
37 37
 	
38
-	/** Sets the location information flag. */
39
-	public function setLocationInfo($value) {
40
-		$this->setBoolean('locationInfo', $value);
41
-	}
38
+    /** Sets the location information flag. */
39
+    public function setLocationInfo($value) {
40
+        $this->setBoolean('locationInfo', $value);
41
+    }
42 42
 	
43
-	/** Returns the location information flag. */
44
-	public function getLocationInfo() {
45
-		return $this->locationInfo;
46
-	}
43
+    /** Returns the location information flag. */
44
+    public function getLocationInfo() {
45
+        return $this->locationInfo;
46
+    }
47 47
 	
48
-	public function format(Payone_Log4php_LoggerLoggingEvent $event) {
49
-		// If required, initialize the location data
50
-		if($this->locationInfo) {
51
-			$event->getLocationInformation();
52
-		}
53
-		return serialize($event) . PHP_EOL;
54
-	}
48
+    public function format(Payone_Log4php_LoggerLoggingEvent $event) {
49
+        // If required, initialize the location data
50
+        if($this->locationInfo) {
51
+            $event->getLocationInformation();
52
+        }
53
+        return serialize($event) . PHP_EOL;
54
+    }
55 55
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 	
48 48
 	public function format(Payone_Log4php_LoggerLoggingEvent $event) {
49 49
 		// If required, initialize the location data
50
-		if($this->locationInfo) {
50
+		if ($this->locationInfo) {
51 51
 			$event->getLocationInformation();
52 52
 		}
53 53
 		return serialize($event) . PHP_EOL;
Please login to merge, or discard this patch.