Passed
Push — master ( 3c4b0d...8511c4 )
by Kris
02:07 queued 25s
created
src/LogParserFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
      */
45 45
     public static function getParser(string $logType, string $format = null, LogEntryFactoryInterface $factory = null): ?SoftwareLogParser
46 46
     {
47
-        switch ($logType){
47
+        switch ($logType) {
48 48
 
49 49
             case self::TYPE_APACHE_ACCESS: 
50 50
                 return new \Kristuff\Parselog\Software\ApacheAccessLogParser($format, $factory); 
Please login to merge, or discard this patch.
src/Software/SoftwareLogParser.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      * @access protected
55 55
      * @var array 
56 56
      */
57
-    protected $knownFormats = [];
57
+    protected $knownFormats = [ ];
58 58
 
59 59
     /** 
60 60
      * The log files names
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @access protected
63 63
      * @var array 
64 64
      */
65
-    protected $files = [];
65
+    protected $files = [ ];
66 66
 
67 67
     /** 
68 68
      * The log files paths
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * @access protected
71 71
      * @var array 
72 72
      */
73
-    protected $paths = [];
73
+    protected $paths = [ ];
74 74
 
75 75
     /**
76 76
      * Constructor
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     protected function addFormat(string $name, string $format): void
123 123
     {
124
-        $this->knownFormats[$name] = $format;
124
+        $this->knownFormats[ $name ] = $format;
125 125
     }
126 126
 
127 127
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     protected function addFile(string $fileName): void
148 148
     {
149
-        $this->files[] = $fileName;
149
+        $this->files[ ] = $fileName;
150 150
     }
151 151
 
152 152
     /**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     protected function addPath(string $path): void
174 174
     {
175
-        $this->paths[] = $path;
175
+        $this->paths[ ] = $path;
176 176
     }
177 177
 
178 178
     /**
Please login to merge, or discard this patch.
src/Software/ApacheAccessLogParser.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -69,50 +69,50 @@
 block discarded – undo
69 69
         $this->addFile('apache.log');
70 70
         $this->addFile('apache_access.log');
71 71
 
72
-        $this->addFormat('apache_common',          '%h %l %u %t \"%r\" %>s %O"');  
73
-        $this->addFormat('apache_combined_vhost',  '%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"'); 
74
-        $this->addFormat('apache_combined',        '%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"');
75
-        $this->addFormat('apache_common_vhost',    '%v %l %u %t \"%r\" %>s %b');
72
+        $this->addFormat('apache_common', '%h %l %u %t \"%r\" %>s %O"');  
73
+        $this->addFormat('apache_combined_vhost', '%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"'); 
74
+        $this->addFormat('apache_combined', '%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"');
75
+        $this->addFormat('apache_common_vhost', '%v %l %u %t \"%r\" %>s %b');
76 76
 
77 77
 
78
-        $this->addNamedPattern('%%' , 'percent', '\%');
78
+        $this->addNamedPattern('%%', 'percent', '\%');
79 79
 
80 80
         // time 
81
-        $this->addPattern('%t' , '\[(?P<time>\d{2}/(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/\d{4}:\d{2}:\d{2}:\d{2} (?:-|\+)\d{4})\]');
81
+        $this->addPattern('%t', '\[(?P<time>\d{2}/(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/\d{4}:\d{2}:\d{2}:\d{2} (?:-|\+)\d{4})\]');
82 82
         
83
-        $this->addNamedPattern('%v' , 'serverName',          '([a-zA-Z0-9]+)([a-z0-9.-]*)');
84
-        $this->addNamedPattern('%V' , 'canonicalServerName', '([a-zA-Z0-9]+)([a-z0-9.-]*)');
83
+        $this->addNamedPattern('%v', 'serverName', '([a-zA-Z0-9]+)([a-z0-9.-]*)');
84
+        $this->addNamedPattern('%V', 'canonicalServerName', '([a-zA-Z0-9]+)([a-z0-9.-]*)');
85 85
         
86 86
         // port
87
-        $this->addNamedPattern('%p' , 'port', '\d+');
87
+        $this->addNamedPattern('%p', 'port', '\d+');
88 88
 
89 89
         // Client IP address of the request
90
-        $this->addNamedPattern('%a',  'remoteIp', self::PATTERN_IP_ALL);
90
+        $this->addNamedPattern('%a', 'remoteIp', self::PATTERN_IP_ALL);
91 91
         
92 92
         // Remote hostname
93
-        $this->addNamedPattern('%h' , 'host', '[a-zA-Z0-9\-\._:]+'); 
93
+        $this->addNamedPattern('%h', 'host', '[a-zA-Z0-9\-\._:]+'); 
94 94
 
95 95
         // Local IP-address
96
-        $this->addNamedPattern('%A',  'localIp', self::PATTERN_IP_ALL);
96
+        $this->addNamedPattern('%A', 'localIp', self::PATTERN_IP_ALL);
97 97
 
98 98
         // Remote user if the request was authenticated. May be bogus if return status (%s) is 401 (unauthorized).
99
-        $this->addNamedPattern('%u',  'user', '(?:-|[\w\-\.]+)');
99
+        $this->addNamedPattern('%u', 'user', '(?:-|[\w\-\.]+)');
100 100
 
101
-        $this->addNamedPattern('%l', 'logname',         '(?:-|[\w-]+)');
102
-        $this->addNamedPattern('%m', 'requestMethod',   'OPTIONS|GET|HEAD|POST|PUT|DELETE|TRACE|CONNECT|PATCH|PROPFIND');
103
-        $this->addNamedPattern('%U', 'URL',             '.+?');
101
+        $this->addNamedPattern('%l', 'logname', '(?:-|[\w-]+)');
102
+        $this->addNamedPattern('%m', 'requestMethod', 'OPTIONS|GET|HEAD|POST|PUT|DELETE|TRACE|CONNECT|PATCH|PROPFIND');
103
+        $this->addNamedPattern('%U', 'URL', '.+?');
104 104
         $this->addNamedPattern('%H', 'requestProtocol', 'HTTP/(1\.0|1\.1|2\.0)');
105
-        $this->addNamedPattern('%r', 'request',         '(?:(?:[A-Z]+) .+? HTTP/(1\.0|1\.1|2\.0))|-|');
105
+        $this->addNamedPattern('%r', 'request', '(?:(?:[A-Z]+) .+? HTTP/(1\.0|1\.1|2\.0))|-|');
106 106
         
107 107
         // Status of the final request
108 108
         $this->addNamedPattern('%>s', 'status', '\d{3}|-');
109 109
         
110 110
         // Bytes sent, including headers. May be zero in rare cases such as when a request is aborted before a 
111 111
         // response is sent. You need to enable mod_logio to use this.
112
-        $this->addNamedPattern('%O', 'sentBytes',  '[0-9]+');
112
+        $this->addNamedPattern('%O', 'sentBytes', '[0-9]+');
113 113
     
114 114
         // Size of response in bytes, excluding HTTP headers. In CLF format, i.e. a '-' rather than a 0 when no bytes are sent.
115
-        $this->addNamedPattern('%b', 'responseBytes',  '(\d+|-)');
115
+        $this->addNamedPattern('%b', 'responseBytes', '(\d+|-)');
116 116
 
117 117
         //The time taken to serve the request, in seconds.
118 118
         $this->addNamedPattern('%T', 'requestTime', '(\d+\.?\d*)');
Please login to merge, or discard this patch.
src/Core/RegexFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     const PATTERN_IP_V4         = '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]))';
33 33
    
34 34
     /** IPV6 full pattern */
35
-    const PATTERN_IP_V6_FULL    ='([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){7})'; // 1:1:1:1:1:1:1:1
35
+    const PATTERN_IP_V6_FULL    = '([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){7})'; // 1:1:1:1:1:1:1:1
36 36
     
37 37
     /** IPV6 null pattern */
38 38
     const PATTERN_IP_V6_NULL    = '(::)';
Please login to merge, or discard this patch.
src/Core/LogEntryFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         $entry = new LogEntry();
34 34
 
35 35
         foreach (array_filter(array_keys($data), 'is_string') as $key) {
36
-            $entry->{$key} = trim($data[$key]);
36
+            $entry->{$key} = trim($data[ $key ]);
37 37
         }
38 38
 
39 39
         return $entry;
Please login to merge, or discard this patch.
src/Software/SyslogParser.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $this->prettyName     = 'Syslog';
44 44
 
45 45
         $this->addFormat('default', '%t %h %s%p: %m');
46
-        $this->defaultFormat      = '%t %h %s%p: %m';
46
+        $this->defaultFormat = '%t %h %s%p: %m';
47 47
         
48 48
         $this->addPath("/var/log/");
49 49
         $this->addFile("syslog");
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
         $this->addFile("user");
57 57
         $this->addFile("messages");
58 58
 
59
-        $this->addPattern('%t',  '(?P<time>(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\s\d|\d{2}) \d{2}:\d{2}:\d{2})');
60
-        $this->addPattern('%h',  '(?P<hostname>.+?)');
61
-        $this->addPattern('%s',  '(?P<service>[^\[:]+)');
62
-        $this->addPattern('%p',  '(\[(?P<pid>\d+)\])?');
63
-        $this->addPattern('%m',  '(?P<message>.+)');
59
+        $this->addPattern('%t', '(?P<time>(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\s\d|\d{2}) \d{2}:\d{2}:\d{2})');
60
+        $this->addPattern('%h', '(?P<hostname>.+?)');
61
+        $this->addPattern('%s', '(?P<service>[^\[:]+)');
62
+        $this->addPattern('%p', '(\[(?P<pid>\d+)\])?');
63
+        $this->addPattern('%m', '(?P<message>.+)');
64 64
 
65 65
         parent::__construct($format, $factory);
66 66
     }
Please login to merge, or discard this patch.
src/Software/Fail2BanLogParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@
 block discarded – undo
41 41
         $this->software       = 'Fail2ban';
42 42
         $this->prettyName     = 'Fail2ban';
43 43
         $this->addFormat('default', '%t %s %p %l %j %m');
44
-        $this->defaultFormat      = '%t %s %p %l %j %m';
45
-        $this->timeFormat   = 'Y-m-d';
44
+        $this->defaultFormat = '%t %s %p %l %j %m';
45
+        $this->timeFormat = 'Y-m-d';
46 46
 
47 47
         $this->addPath("/var/log/");
48 48
         $this->addFile("fail2ban.log");
Please login to merge, or discard this patch.
src/LogParser.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @access protected
52 52
      * @var array 
53 53
      */
54
-    protected $patterns = [];
54
+    protected $patterns = [ ];
55 55
    
56 56
     /** 
57 57
      * The time format 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function addNamedPattern(string $placeholder, string $propertyName, string $pattern, bool $required = true): void
92 92
     {
93 93
         // First field must be a required field
94
-        if ($required === false && count($this->patterns) === 0){
94
+        if ($required === false && count($this->patterns) === 0) {
95 95
             throw new \Kristuff\Parselog\InvalidArgumentException(
96 96
                 "Invalid value 'false' for argument 'required' given: First pattern must be a required pattern.");
97 97
         }
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
         // Adjust pattern for nullable columns and add space before placeholder
101 101
         // - $format = '%t %l %P %E: %a %M';
102 102
         // + $format = '%t %l( %P)?( %E:)?(%a)? %M';
103
-        $key = $required ? $placeholder :  ' ' . $placeholder ; 
104
-        $val = '(?P<'. $propertyName . '>' . ($required ? $pattern : '( ' . $pattern . ')?') . ')'; 
103
+        $key = $required ? $placeholder : ' '.$placeholder; 
104
+        $val = '(?P<'.$propertyName.'>'.($required ? $pattern : '( '.$pattern.')?').')'; 
105 105
 
106 106
         $this->addPattern($key, $val);
107 107
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function addPattern(string $placeholder, string $pattern): void
120 120
     {
121
-        $this->patterns[$placeholder] = $pattern;
121
+        $this->patterns[ $placeholder ] = $pattern;
122 122
     }
123 123
 
124 124
     /**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         $format = str_replace("\\", '', $format);
149 149
 
150 150
         // store log format update IP pattern
151
-        $this->logFormat = $format ;
151
+        $this->logFormat = $format;
152 152
         $this->updateIpPatterns();
153 153
 
154 154
         // strtr won't work for "complex" header patterns
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     protected function getTimestamp($time): ?int
209 209
     {
210 210
         // try to get stamp from string
211
-        if (isset($this->timeFormat)){
211
+        if (isset($this->timeFormat)) {
212 212
             $dateTime = DateTime::createFromFormat($this->timeFormat, $time);
213 213
 
214 214
             if (false !== $dateTime) {
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
         // Set IPv4 & IPv6 recognition patterns 
237 237
         $ipPatterns = implode('|', [
238 238
             'ipv4'          => self::PATTERN_IP_V4,
239
-            'ipv6full'      => self::PATTERN_IP_V6_FULL,        // 1:1:1:1:1:1:1:1
240
-            'ipv6null'      => self::PATTERN_IP_V6_NULL,        // ::
241
-            'ipv6leading'   => self::PATTERN_IP_V6_LEADING,     // ::1:1:1:1:1:1:1
242
-            'ipv6mid'       => self::PATTERN_IP_V6_MID,         // 1:1:1::1:1:1
243
-            'ipv6trailing'  => self::PATTERN_IP_V6_TRAILING,    // 1:1:1:1:1:1:1::
239
+            'ipv6full'      => self::PATTERN_IP_V6_FULL, // 1:1:1:1:1:1:1:1
240
+            'ipv6null'      => self::PATTERN_IP_V6_NULL, // ::
241
+            'ipv6leading'   => self::PATTERN_IP_V6_LEADING, // ::1:1:1:1:1:1:1
242
+            'ipv6mid'       => self::PATTERN_IP_V6_MID, // 1:1:1::1:1:1
243
+            'ipv6trailing'  => self::PATTERN_IP_V6_TRAILING, // 1:1:1:1:1:1:1::
244 244
         ]);
245 245
 
246 246
         foreach ($this->patterns as &$value) {
Please login to merge, or discard this patch.
src/Software/ApacheErrorLogParser.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -179,23 +179,23 @@  discard block
 block discarded – undo
179 179
         // set 2.2 format by default. Will be changed to 2.4 format, ie:
180 180
         // $this->timeFormat        = 'D M d H:i:s.u Y';
181 181
         // , if the format contains %{u} instead of %t  
182
-        $this->timeFormat        = 'D M d H:i:s Y';
182
+        $this->timeFormat = 'D M d H:i:s Y';
183 183
 
184
-        $this->addFormat('default',                         self::FORMAT_APACHE_2_4_DEFAULT);  
185
-        $this->addFormat('apache2.2 default',               self::FORMAT_APACHE_2_2_DEFAULT);  
186
-        $this->addFormat('apache2.2 extented',              self::FORMAT_APACHE_2_2_EXTENDED);  
187
-        $this->addFormat('apache2.2 referer',               self::FORMAT_APACHE_2_2_REFERER);  
188
-        $this->addFormat('apache2.2 extented referer',      self::FORMAT_APACHE_2_2_EXTENDED_REFERER);  
189
-        $this->addFormat('apache2.4 default',               self::FORMAT_APACHE_2_4_DEFAULT);  
190
-        $this->addFormat('apache2.4 extented',              self::FORMAT_APACHE_2_4_EXTENDED);  
191
-        $this->addFormat('apache2.4 referer',               self::FORMAT_APACHE_2_4_REFEFER);  
192
-        $this->addFormat('apache2.4 extented referer',      self::FORMAT_APACHE_2_4_EXTENDED_REFERER);  
193
-        $this->addFormat('apache2.4 mpm',                   self::FORMAT_APACHE_2_4_MPM);  
194
-        $this->addFormat('apache2.4 mpm extented',          self::FORMAT_APACHE_2_4_MPM_EXTENDED);  
195
-        $this->addFormat('apache2.4 mpm referer',           self::FORMAT_APACHE_2_4_MPM_REFERER);  
184
+        $this->addFormat('default', self::FORMAT_APACHE_2_4_DEFAULT);  
185
+        $this->addFormat('apache2.2 default', self::FORMAT_APACHE_2_2_DEFAULT);  
186
+        $this->addFormat('apache2.2 extented', self::FORMAT_APACHE_2_2_EXTENDED);  
187
+        $this->addFormat('apache2.2 referer', self::FORMAT_APACHE_2_2_REFERER);  
188
+        $this->addFormat('apache2.2 extented referer', self::FORMAT_APACHE_2_2_EXTENDED_REFERER);  
189
+        $this->addFormat('apache2.4 default', self::FORMAT_APACHE_2_4_DEFAULT);  
190
+        $this->addFormat('apache2.4 extented', self::FORMAT_APACHE_2_4_EXTENDED);  
191
+        $this->addFormat('apache2.4 referer', self::FORMAT_APACHE_2_4_REFEFER);  
192
+        $this->addFormat('apache2.4 extented referer', self::FORMAT_APACHE_2_4_EXTENDED_REFERER);  
193
+        $this->addFormat('apache2.4 mpm', self::FORMAT_APACHE_2_4_MPM);  
194
+        $this->addFormat('apache2.4 mpm extented', self::FORMAT_APACHE_2_4_MPM_EXTENDED);  
195
+        $this->addFormat('apache2.4 mpm referer', self::FORMAT_APACHE_2_4_MPM_REFERER);  
196 196
         $this->addFormat('apache2.4 mpm extented referer ', self::FORMAT_APACHE_2_4_MPM_EXTENDED_REFERER);  
197
-        $this->addFormat('apache2.4 mpm tid',               self::FORMAT_APACHE_2_4_MPM_TID);  
198
-        $this->addFormat('apache2.4 mpm tid referer',       self::FORMAT_APACHE_2_4_MPM_TID_REFERER);  
197
+        $this->addFormat('apache2.4 mpm tid', self::FORMAT_APACHE_2_4_MPM_TID);  
198
+        $this->addFormat('apache2.4 mpm tid referer', self::FORMAT_APACHE_2_4_MPM_TID_REFERER);  
199 199
 
200 200
         $this->addPath("/var/log/");
201 201
         $this->addPath("/var/log/apache/");
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         // define patterns
218 218
         // ***************
219 219
 
220
-        $this->addNamedPattern('%%' , 'percent', '\%');
220
+        $this->addNamedPattern('%%', 'percent', '\%');
221 221
                 
222 222
         // %t 	        The current time
223 223
         // %{u}t 	The current time including micro-seconds
@@ -228,29 +228,29 @@  discard block
 block discarded – undo
228 228
         
229 229
         // %a 	Client IP address and port of the request (port is not registered by parser). 
230 230
         //      That column may be missing depending of error
231
-        $clientIpPattern = '( \[client (?P<remoteIp>' . self::PATTERN_IP_ALL . ')(:[\d]+|)?\])?';
232
-        $this->addPattern(' \[client %a\]' , $clientIpPattern);
233
-        $this->addPattern(' \[%a\]' ,  $clientIpPattern);
234
-        $this->addPattern(' %a' , $clientIpPattern);
231
+        $clientIpPattern = '( \[client (?P<remoteIp>'.self::PATTERN_IP_ALL.')(:[\d]+|)?\])?';
232
+        $this->addPattern(' \[client %a\]', $clientIpPattern);
233
+        $this->addPattern(' \[%a\]', $clientIpPattern);
234
+        $this->addPattern(' %a', $clientIpPattern);
235 235
 
236 236
         // %A 	Local IP-address and port
237 237
         //      That column may be missing depending of error
238
-        $this->addNamedPattern('%A',  'localIP', self::PATTERN_IP_ALL, false);
238
+        $this->addNamedPattern('%A', 'localIP', self::PATTERN_IP_ALL, false);
239 239
         
240 240
         // %m 	Name of the module logging the message
241 241
         // %l 	Loglevel of the message
242
-        $this->addPattern('\[%m:%l\]',  '\[(?<module>.+?)?:(?P<level>[\w]+)\]');
242
+        $this->addPattern('\[%m:%l\]', '\[(?<module>.+?)?:(?P<level>[\w]+)\]');
243 243
         $this->addPattern('\[%-m:%l\]', '\[(?<module>.+?)?:(?P<level>[\w]+)\]');
244
-        $this->addPattern('\[%l\]',     '\[(?P<level>[\w:]+)\]');
245
-        $this->addPattern('%l',         '\[(?P<level>[\w:]+)\]');
244
+        $this->addPattern('\[%l\]', '\[(?P<level>[\w:]+)\]');
245
+        $this->addPattern('%l', '\[(?P<level>[\w:]+)\]');
246 246
 
247 247
         // %P 	Process ID of current process (since apache 2.4?)
248 248
         // %T 	Thread ID of current thread
249 249
         $this->addPattern('\[pid %P:tid %T\]', '\[pid (?P<pid>\d+):tid (?P<tid>\d+)\]'); 
250
-        $this->addPattern('%P %T',             '\[pid (?P<pid>\d+):tid (?P<tid>\d+)\]');
250
+        $this->addPattern('%P %T', '\[pid (?P<pid>\d+):tid (?P<tid>\d+)\]');
251 251
         $this->addPattern('\[pid %P\]', '\[pid (?P<pid>\d+)\]');
252
-        $this->addPattern('\[%P\]',     '\[pid (?P<pid>\d+)\]');   
253
-        $this->addPattern('%P',         '\[pid (?P<pid>\d+)\]');
252
+        $this->addPattern('\[%P\]', '\[pid (?P<pid>\d+)\]');   
253
+        $this->addPattern('%P', '\[pid (?P<pid>\d+)\]');
254 254
         
255 255
         // %E 	APR/OS error status code and string
256 256
         //      That column may be missing depending of error
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
         $this->addPattern(' %F:', '( (?P<fileName>[^ ]+\([\d]+\)):)?');              
262 262
 
263 263
         // %M 	The actual log message
264
-        $this->addNamedPattern('%M',  'message', '.+?');
264
+        $this->addNamedPattern('%M', 'message', '.+?');
265 265
 
266 266
         // referer (may be empty)
267
-        $this->addPattern(' , referer %{Referer}i',   '(, referer: (?P<referer>[^ ]+))?');
268
-        $this->addPattern(', referer %{Referer}i',    '(, referer: (?P<referer>[^ ]+))?');
267
+        $this->addPattern(' , referer %{Referer}i', '(, referer: (?P<referer>[^ ]+))?');
268
+        $this->addPattern(', referer %{Referer}i', '(, referer: (?P<referer>[^ ]+))?');
269 269
 
270 270
         // now let default constructor
271 271
         parent::__construct($format, $factory);
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
         parent::setFormat($format);
285 285
 
286 286
         // set the correct time format
287
-        if (strpos($this->logFormat, '%{u}t') !== false){
287
+        if (strpos($this->logFormat, '%{u}t') !== false) {
288 288
             $this->timeFormat = 'D M d H:i:s.u Y';
289 289
         }
290 290
     }
Please login to merge, or discard this patch.