AbstractHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Inbounder;
4
5
use Inbounder\Parsers\Contracts\ParserInterface;
6
7
abstract class AbstractHandler
8
{
9
    /**
10
     * @var ParserInterface
11
     */
12
    protected $parser;
13
14
    /**
15
     * Constructor.
16
     *
17
     * @param ParserInterface $parser
18
     */
19
    public function __construct(ParserInterface $parser)
20
    {
21
        $this->parser = $parser;
22
    }
23
24
    /**
25
     * Access the parser.
26
     *
27
     * @return ParserInterface
28
     */
29
    public function parser()
30
    {
31
        return $this->parser;
32
    }
33
34
    /**
35
     * Run the handler.
36
     *
37
     * @param mixed $parsed
38
     *
39
     * @return mixed
40
     */
41
    abstract public function run($parsed);
42
}
43