Completed
Push — master ( 06e75e...4dd477 )
by Florian
06:57
created
lib/Payone/Log4php/LoggerAppenderDailyFile.php 2 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -52,59 +52,59 @@
 block discarded – undo
52 52
  */
53 53
 class Payone_Log4php_LoggerAppenderDailyFile extends Payone_Log4php_LoggerAppenderFile {
54 54
 
55
-	/**
56
-	 * Format date. 
57
-	 * It follows the {@link PHP_MANUAL#date()} formatting rules and <b>should always be set before {@link $file} param</b>.
58
-	 * @var string
59
-	 */
60
-	protected $datePattern = "Ymd";
55
+    /**
56
+     * Format date. 
57
+     * It follows the {@link PHP_MANUAL#date()} formatting rules and <b>should always be set before {@link $file} param</b>.
58
+     * @var string
59
+     */
60
+    protected $datePattern = "Ymd";
61 61
 	
62
-	/**
63
-	 * Sets date format for the file name.
64
-	 * @param string $datePattern a regular date() string format
65
-	 */
66
-	public function setDatePattern($datePattern) {
67
-		$this->setString('datePattern', $datePattern);
68
-	}
62
+    /**
63
+     * Sets date format for the file name.
64
+     * @param string $datePattern a regular date() string format
65
+     */
66
+    public function setDatePattern($datePattern) {
67
+        $this->setString('datePattern', $datePattern);
68
+    }
69 69
 	
70
-	/**
71
-	 * @return string returns date format for the filename
72
-	 */
73
-	public function getDatePattern() {
74
-		return $this->datePattern;
75
-	}
70
+    /**
71
+     * @return string returns date format for the filename
72
+     */
73
+    public function getDatePattern() {
74
+        return $this->datePattern;
75
+    }
76 76
 	
77
-	/** 
78
-	 * Similar to parent method, but but replaces "%s" in the file name with 
79
-	 * the current date in format specified by the 'datePattern' parameter.
80
-	 */ 
81
-	public function activateOptions() {
82
-		$fileName = $this->getFile();
83
-		$date = date($this->getDatePattern());
84
-		$fileName = sprintf($fileName, $date);
77
+    /** 
78
+     * Similar to parent method, but but replaces "%s" in the file name with 
79
+     * the current date in format specified by the 'datePattern' parameter.
80
+     */ 
81
+    public function activateOptions() {
82
+        $fileName = $this->getFile();
83
+        $date = date($this->getDatePattern());
84
+        $fileName = sprintf($fileName, $date);
85 85
 		
86
-		if(!is_file($fileName)) {
87
-			$dir = dirname($fileName);
88
-			if(!is_dir($dir)) {
89
-				mkdir($dir, 0777, true);
90
-			}
91
-		}
86
+        if(!is_file($fileName)) {
87
+            $dir = dirname($fileName);
88
+            if(!is_dir($dir)) {
89
+                mkdir($dir, 0777, true);
90
+            }
91
+        }
92 92
 	
93
-		$this->fp = fopen($fileName, ($this->getAppend()? 'a':'w'));
94
-		if($this->fp) {
95
-			if(flock($this->fp, LOCK_EX)) {
96
-				if($this->getAppend()) {
97
-					fseek($this->fp, 0, SEEK_END);
98
-				}
99
-				fwrite($this->fp, $this->layout->getHeader());
100
-				flock($this->fp, LOCK_UN);
101
-				$this->closed = false;
102
-			} else {
103
-				// TODO: should we take some action in this case?
104
-				$this->closed = true;
105
-			}
106
-		} else {
107
-			$this->closed = true;
108
-		}
109
-	}
93
+        $this->fp = fopen($fileName, ($this->getAppend()? 'a':'w'));
94
+        if($this->fp) {
95
+            if(flock($this->fp, LOCK_EX)) {
96
+                if($this->getAppend()) {
97
+                    fseek($this->fp, 0, SEEK_END);
98
+                }
99
+                fwrite($this->fp, $this->layout->getHeader());
100
+                flock($this->fp, LOCK_UN);
101
+                $this->closed = false;
102
+            } else {
103
+                // TODO: should we take some action in this case?
104
+                $this->closed = true;
105
+            }
106
+        } else {
107
+            $this->closed = true;
108
+        }
109
+    }
110 110
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -83,17 +83,17 @@
 block discarded – undo
83 83
 		$date = date($this->getDatePattern());
84 84
 		$fileName = sprintf($fileName, $date);
85 85
 		
86
-		if(!is_file($fileName)) {
86
+		if (!is_file($fileName)) {
87 87
 			$dir = dirname($fileName);
88
-			if(!is_dir($dir)) {
88
+			if (!is_dir($dir)) {
89 89
 				mkdir($dir, 0777, true);
90 90
 			}
91 91
 		}
92 92
 	
93
-		$this->fp = fopen($fileName, ($this->getAppend()? 'a':'w'));
94
-		if($this->fp) {
95
-			if(flock($this->fp, LOCK_EX)) {
96
-				if($this->getAppend()) {
93
+		$this->fp = fopen($fileName, ($this->getAppend() ? 'a' : 'w'));
94
+		if ($this->fp) {
95
+			if (flock($this->fp, LOCK_EX)) {
96
+				if ($this->getAppend()) {
97 97
 					fseek($this->fp, 0, SEEK_END);
98 98
 				}
99 99
 				fwrite($this->fp, $this->layout->getHeader());
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterLevel.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_LoggerPatternConverterLevel extends Payone_Log4php_LoggerPatternConverter {
28 28
 
29
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
-		return $event->getLevel()->toString();
31
-	}
29
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
+        return $event->getLevel()->toString();
31
+    }
32 32
 }
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterRequest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,5 +29,5 @@
 block discarded – undo
29 29
  * @subpackage pattern
30 30
  */
31 31
 class Payone_Log4php_LoggerPatternConverterRequest extends Payone_Log4php_LoggerPatternConverterSuperglobal {
32
-	protected $name = '_REQUEST';
32
+    protected $name = '_REQUEST';
33 33
 }
34 34
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerThrowableInformation.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -26,51 +26,51 @@
 block discarded – undo
26 26
  */
27 27
 class Payone_Log4php_LoggerThrowableInformation {
28 28
 	
29
-	/** @var Exception Throwable to log */
30
-	private $throwable;
29
+    /** @var Exception Throwable to log */
30
+    private $throwable;
31 31
 	
32
-	/** @var array Array of throwable messages */
33
-	private $throwableArray;
32
+    /** @var array Array of throwable messages */
33
+    private $throwableArray;
34 34
 	
35
-	/** @var Logger reference */
36
-	private $logger;
35
+    /** @var Logger reference */
36
+    private $logger;
37 37
 	
38
-	/**
39
-	 * Create a new instance
40
-	 * 
41
-	 * @param $throwable - a throwable as a exception
42
-	 * @param $logger - Logger reference
43
-	 */
44
-	public function __construct(Exception $throwable)  {
45
-		$this->throwable = $throwable;
46
-	}
38
+    /**
39
+     * Create a new instance
40
+     * 
41
+     * @param $throwable - a throwable as a exception
42
+     * @param $logger - Logger reference
43
+     */
44
+    public function __construct(Exception $throwable)  {
45
+        $this->throwable = $throwable;
46
+    }
47 47
 	
48
-	/**
49
-	* Return source exception
50
-	* 
51
-	* @return Exception
52
-	*/
53
-	public function getThrowable() {
54
-		return $this->throwable;
55
-	}
48
+    /**
49
+     * Return source exception
50
+     * 
51
+     * @return Exception
52
+     */
53
+    public function getThrowable() {
54
+        return $this->throwable;
55
+    }
56 56
 	
57
-	/**
58
-	 * @desc Returns string representation of throwable
59
-	 * 
60
-	 * @return array 
61
-	 */
62
-	public function getStringRepresentation() {
63
-		if (!is_array($this->throwableArray)) {
64
-			$renderer = Payone_Log4php_Logger::getHierarchy()->getRendererMap()->getByClassName(get_class($this->throwable));
57
+    /**
58
+     * @desc Returns string representation of throwable
59
+     * 
60
+     * @return array 
61
+     */
62
+    public function getStringRepresentation() {
63
+        if (!is_array($this->throwableArray)) {
64
+            $renderer = Payone_Log4php_Logger::getHierarchy()->getRendererMap()->getByClassName(get_class($this->throwable));
65 65
 			
66
-			// TODO: why this?
67
-			if ($renderer instanceof Payone_Log4php_LoggerRendererDefault) {
68
-				$renderer = new Payone_Log4php_LoggerRendererException();
69
-			}
70
-			$this->throwableArray = explode("\n", $renderer->render($this->throwable));
71
-		}
66
+            // TODO: why this?
67
+            if ($renderer instanceof Payone_Log4php_LoggerRendererDefault) {
68
+                $renderer = new Payone_Log4php_LoggerRendererException();
69
+            }
70
+            $this->throwableArray = explode("\n", $renderer->render($this->throwable));
71
+        }
72 72
 		
73
-		return $this->throwableArray;
74
-	}
73
+        return $this->throwableArray;
74
+    }
75 75
 }
76 76
 ?>
77 77
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	 * @param $throwable - a throwable as a exception
42 42
 	 * @param $logger - Logger reference
43 43
 	 */
44
-	public function __construct(Exception $throwable)  {
44
+	public function __construct(Exception $throwable) {
45 45
 		$this->throwable = $throwable;
46 46
 	}
47 47
 	
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterMessage.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_LoggerPatternConverterMessage extends Payone_Log4php_LoggerPatternConverter {
28 28
 
29
-	public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
-		return $event->getRenderedMessage();
31
-	}
29
+    public function convert(Payone_Log4php_LoggerLoggingEvent $event) {
30
+        return $event->getRenderedMessage();
31
+    }
32 32
 }
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerAppenderEcho.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -41,45 +41,45 @@
 block discarded – undo
41 41
  * @subpackage appenders
42 42
  */
43 43
 class Payone_Log4php_LoggerAppenderEcho extends Payone_Log4php_LoggerAppender {
44
-	/** boolean used internally to mark first append */
45
-	protected $firstAppend = true;
44
+    /** boolean used internally to mark first append */
45
+    protected $firstAppend = true;
46 46
 	
47
-	/** 
48
-	 * If set to true, a <br /> element will be inserted before each line
49
-	 * break in the logged message. Default value is false. @var boolean 
50
-	 */
51
-	protected $htmlLineBreaks = false;
47
+    /** 
48
+     * If set to true, a <br /> element will be inserted before each line
49
+     * break in the logged message. Default value is false. @var boolean 
50
+     */
51
+    protected $htmlLineBreaks = false;
52 52
 	
53
-	public function close() {
54
-		if($this->closed != true) {
55
-			if(!$this->firstAppend) {
56
-				echo $this->layout->getFooter();
57
-			}
58
-		}
59
-		$this->closed = true;
60
-	}
53
+    public function close() {
54
+        if($this->closed != true) {
55
+            if(!$this->firstAppend) {
56
+                echo $this->layout->getFooter();
57
+            }
58
+        }
59
+        $this->closed = true;
60
+    }
61 61
 
62
-	public function append(Payone_Log4php_LoggerLoggingEvent $event) {
63
-		if($this->layout !== null) {
64
-			if($this->firstAppend) {
65
-				echo $this->layout->getHeader();
66
-				$this->firstAppend = false;
67
-			}
68
-			$text = $this->layout->format($event);
62
+    public function append(Payone_Log4php_LoggerLoggingEvent $event) {
63
+        if($this->layout !== null) {
64
+            if($this->firstAppend) {
65
+                echo $this->layout->getHeader();
66
+                $this->firstAppend = false;
67
+            }
68
+            $text = $this->layout->format($event);
69 69
 			
70
-			if ($this->htmlLineBreaks) {
71
-				$text = nl2br($text);
72
-			}
73
-			echo $text;
74
-		} 
75
-	}
70
+            if ($this->htmlLineBreaks) {
71
+                $text = nl2br($text);
72
+            }
73
+            echo $text;
74
+        } 
75
+    }
76 76
 	
77
-	public function setHtmlLineBreaks($value) {
78
-		$this->setBoolean('htmlLineBreaks', $value);
79
-	}
77
+    public function setHtmlLineBreaks($value) {
78
+        $this->setBoolean('htmlLineBreaks', $value);
79
+    }
80 80
 
81
-	public function getHtmlLineBreaks() {
82
-		return $this->htmlLineBreaks;
83
-	}
81
+    public function getHtmlLineBreaks() {
82
+        return $this->htmlLineBreaks;
83
+    }
84 84
 }
85 85
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	protected $htmlLineBreaks = false;
52 52
 	
53 53
 	public function close() {
54
-		if($this->closed != true) {
55
-			if(!$this->firstAppend) {
54
+		if ($this->closed != true) {
55
+			if (!$this->firstAppend) {
56 56
 				echo $this->layout->getFooter();
57 57
 			}
58 58
 		}
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	public function append(Payone_Log4php_LoggerLoggingEvent $event) {
63
-		if($this->layout !== null) {
64
-			if($this->firstAppend) {
63
+		if ($this->layout !== null) {
64
+			if ($this->firstAppend) {
65 65
 				echo $this->layout->getHeader();
66 66
 				$this->firstAppend = false;
67 67
 			}
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerFilterDenyAll.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@
 block discarded – undo
43 43
  */
44 44
 class Payone_Log4php_LoggerFilterDenyAll extends Payone_Log4php_LoggerFilter {
45 45
 
46
-	/**
47
-	 * Always returns the integer constant {@link LoggerFilter::DENY}
48
-	 * regardless of the {@link LoggerLoggingEvent} parameter.
49
-	 * 
50
-	 * @param Payone_Log4php_LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to filter.
51
-	 * @return LoggerFilter::DENY Always returns {@link LoggerFilter::DENY}
52
-	 */
53
-	public function decide(Payone_Log4php_LoggerLoggingEvent $event) {
54
-		return Payone_Log4php_LoggerFilter::DENY;
55
-	}
46
+    /**
47
+     * Always returns the integer constant {@link LoggerFilter::DENY}
48
+     * regardless of the {@link LoggerLoggingEvent} parameter.
49
+     * 
50
+     * @param Payone_Log4php_LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to filter.
51
+     * @return LoggerFilter::DENY Always returns {@link LoggerFilter::DENY}
52
+     */
53
+    public function decide(Payone_Log4php_LoggerLoggingEvent $event) {
54
+        return Payone_Log4php_LoggerFilter::DENY;
55
+    }
56 56
 }
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerFilter.php 2 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -55,72 +55,72 @@
 block discarded – undo
55 55
  */
56 56
 abstract class Payone_Log4php_LoggerFilter extends Payone_Log4php_LoggerConfigurable {
57 57
 
58
-	/**
59
-	 * The log event must be logged immediately without consulting with
60
-	 * the remaining filters, if any, in the chain.	 
61
-	 */
62
-	const ACCEPT = 1;
58
+    /**
59
+     * The log event must be logged immediately without consulting with
60
+     * the remaining filters, if any, in the chain.	 
61
+     */
62
+    const ACCEPT = 1;
63 63
 	
64
-	/**
65
-	 * This filter is neutral with respect to the log event. The
66
-	 * remaining filters, if any, should be consulted for a final decision.
67
-	 */
68
-	const NEUTRAL = 0;
64
+    /**
65
+     * This filter is neutral with respect to the log event. The
66
+     * remaining filters, if any, should be consulted for a final decision.
67
+     */
68
+    const NEUTRAL = 0;
69 69
 	
70
-	/**
71
-	 * The log event must be dropped immediately without consulting
72
-	 * with the remaining filters, if any, in the chain.
73
-	 */
74
-	const DENY = -1;
70
+    /**
71
+     * The log event must be dropped immediately without consulting
72
+     * with the remaining filters, if any, in the chain.
73
+     */
74
+    const DENY = -1;
75 75
 
76
-	/**
77
-	 * @var LoggerFilter Points to the next {@link LoggerFilter} in the filter chain.
78
-	 */
79
-	protected $next;
76
+    /**
77
+     * @var LoggerFilter Points to the next {@link LoggerFilter} in the filter chain.
78
+     */
79
+    protected $next;
80 80
 
81
-	/**
82
-	 * Usually filters options become active when set. We provide a
83
-	 * default do-nothing implementation for convenience.
84
-	*/
85
-	public function activateOptions() {
86
-	}
81
+    /**
82
+     * Usually filters options become active when set. We provide a
83
+     * default do-nothing implementation for convenience.
84
+     */
85
+    public function activateOptions() {
86
+    }
87 87
 
88
-	/**
89
-	 * Decide what to do.
90
-	 * <p>If the decision is {@link LoggerFilter::DENY}, then the event will be
91
-	 * dropped. If the decision is {@link LoggerFilter::NEUTRAL}, then the next
92
-	 * filter, if any, will be invoked. If the decision is {@link LoggerFilter::ACCEPT} then
93
-	 * the event will be logged without consulting with other filters in
94
-	 * the chain.
95
-	 *
96
-	 * @param Payone_Log4php_LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to decide upon.
97
-	 * @return integer {@link LoggerFilter::NEUTRAL} or {@link LoggerFilter::DENY}|{@link LoggerFilter::ACCEPT}
98
-	 */
99
-	public function decide(Payone_Log4php_LoggerLoggingEvent $event) {
100
-		return self::NEUTRAL;
101
-	}
88
+    /**
89
+     * Decide what to do.
90
+     * <p>If the decision is {@link LoggerFilter::DENY}, then the event will be
91
+     * dropped. If the decision is {@link LoggerFilter::NEUTRAL}, then the next
92
+     * filter, if any, will be invoked. If the decision is {@link LoggerFilter::ACCEPT} then
93
+     * the event will be logged without consulting with other filters in
94
+     * the chain.
95
+     *
96
+     * @param Payone_Log4php_LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to decide upon.
97
+     * @return integer {@link LoggerFilter::NEUTRAL} or {@link LoggerFilter::DENY}|{@link LoggerFilter::ACCEPT}
98
+     */
99
+    public function decide(Payone_Log4php_LoggerLoggingEvent $event) {
100
+        return self::NEUTRAL;
101
+    }
102 102
 
103
-	/**
104
-	 * Adds a new filter to the filter chain this filter is a part of.
105
-	 * If this filter has already and follow up filter, the param filter
106
-	 * is passed on until it is the last filter in chain.
107
-	 * 
108
-	 * @param $filter - the filter to add to this chain
109
-	 */
110
-	public function addNext($filter) {
111
-		if($this->next !== null) {
112
-			$this->next->addNext($filter);
113
-		} else {
114
-			$this->next = $filter;
115
-		}
116
-	}
103
+    /**
104
+     * Adds a new filter to the filter chain this filter is a part of.
105
+     * If this filter has already and follow up filter, the param filter
106
+     * is passed on until it is the last filter in chain.
107
+     * 
108
+     * @param $filter - the filter to add to this chain
109
+     */
110
+    public function addNext($filter) {
111
+        if($this->next !== null) {
112
+            $this->next->addNext($filter);
113
+        } else {
114
+            $this->next = $filter;
115
+        }
116
+    }
117 117
 	
118
-	/**
119
-	 * Returns the next filter in this chain
120
-	 * @return the next filter
121
-	 */
122
-	public function getNext() {
123
-		return $this->next;
124
-	}
118
+    /**
119
+     * Returns the next filter in this chain
120
+     * @return the next filter
121
+     */
122
+    public function getNext() {
123
+        return $this->next;
124
+    }
125 125
 
126 126
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 	 * @param $filter - the filter to add to this chain
109 109
 	 */
110 110
 	public function addNext($filter) {
111
-		if($this->next !== null) {
111
+		if ($this->next !== null) {
112 112
 			$this->next->addNext($filter);
113 113
 		} else {
114 114
 			$this->next = $filter;
Please login to merge, or discard this patch.
lib/Payone/Log4php/LoggerPatternConverterEnvironment.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,5 +29,5 @@
 block discarded – undo
29 29
  * @subpackage pattern
30 30
  */
31 31
 class Payone_Log4php_LoggerPatternConverterEnvironment extends Payone_Log4php_LoggerPatternConverterSuperglobal {
32
-	protected $name = '_ENV';
32
+    protected $name = '_ENV';
33 33
 }
Please login to merge, or discard this patch.