Passed
Push — dev ( 8f807e...d72849 )
by Yan
02:28
created

ColonParser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Lincable\Parsers;
4
5
use Illuminate\Contracts\Container\Container;
6
use Lincable\Contracts\Parsers\ParameterInterface;
7
8
class ColonParser extends Parser
9
{
10
    /**
11
     * Create a new class instance.
12
     * 
13
     * @parama Illuminate\Contracts\Container\Container $app
14
     * @return void
15
     */
16
    public function __construct(Container $app)
17
    {
18
        $this->boot($app);
19
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24
    protected function parseMatches(array $matches): ParameterInterface
25
    {
26
        return new Options(head($matches));
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    protected function getDynamicPattern(): string
33
    {
34
        return '/^\:([a-zA-Z_-]+)$/';
35
    }
36
}