Completed
Push — master ( 4502f4...b0a705 )
by raphael
01:30
created

Pattern   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
1
<?php
2
3
namespace Rap2hpoutre\LaravelLogViewer;
4
5
/**
6
 * Class Pattern
7
 * @property array patterns
8
 * @package Rap2hpoutre\LaravelLogViewer
9
 */
10
11
class Pattern
12
{
13
14
    /**
15
     * @var array
16
     */
17
    private static $patterns = [
18
        'logs' => '/\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}([\+-]\d{4})?\].*/',
19
        'current_log' => [
20
            '/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}([\+-]\d{4})?)\](?:.*?(\w+)\.|.*?)',
21
            ': (.*?)( in .*?:[0-9]+)?$/i'
22
        ],
23
        'files' => '/\{.*?\,.*?\}/i',
24
    ];
25
26
    /**
27
     * @return array
28
     */
29
    public function all()
30
    {
31
        return array_keys($this->patterns);
32
    }
33
34
}