Passed
Push — master ( 068bff...27cbbc )
by Kirill
03:24
created

Generic::match()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\Console\Language;
11
12
use Railt\Io\Readable;
13
14
/**
15
 * Class Generic
16
 */
17
class Generic extends Language
18
{
19
    /**
20
     * @return array
21
     */
22
    public function tokens(): array
23
    {
24
        return [
25
            'T_COMMENT'       => '//[^\\n]*',
26
            'T_BLOCK_COMMENT' => '/\\*.*?\\*/',
27
            'T_STRING'        => '("[^"\\\\]+(\\\\.[^"\\\\]*)*"|\'[^\'\\\\]+(\\\\.[^\'\\\\]*)*\')',
28
            'T_DIGIT'         => '\d+',
29
            'T_VARIABLE'      => '[\$\w]+\b'
30
        ];
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function colors(): array
37
    {
38
        return [];
39
    }
40
41
    /**
42
     * @param Readable $file
43
     * @return bool
44
     */
45
    public function match(Readable $file): bool
46
    {
47
        return true;
48
    }
49
}
50