Completed
Push — master ( 959e53...d74161 )
by Vladimir
12:00
created

Driver::getTemplateRenderer()   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
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Channels;
6
7
use Illuminate\Support\Collection;
8
use FondBot\Drivers\TemplateRenderer;
9
use FondBot\Contracts\Channels\Driver as DriverContract;
10
11
abstract class Driver implements DriverContract
12
{
13
    /**
14
     * Get driver short name.
15
     *
16
     * This name is used as an alias for configuration.
17
     *
18
     * @return string
19
     */
20 1
    public function getShortName(): string
21
    {
22 1
        return class_basename($this);
23
    }
24
25
    /**
26
     * Initialize driver.
27
     *
28
     * @param Collection $parameters
29
     *
30
     * @return Driver|DriverContract|static
31
     */
32 2
    public function initialize(Collection $parameters): DriverContract
33
    {
34
        $parameters->each(function ($value, $key) {
35 2
            $this->$key = $value;
36 2
        });
37
38 2
        return $this;
39
    }
40
41
    /**
42
     * Get template compiler instance.
43
     *
44
     * @return TemplateRenderer|null
45
     */
46
    public function getTemplateRenderer(): ?TemplateRenderer
47
    {
48
        return null;
49
    }
50
}
51