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

Pattern::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}