Completed
Push — master ( 344091...41b0ff )
by Pablo
04:39
created

PreCommitExecutor::getMessages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace PhpGitHooks\Infrastructure\Common;
4
5
use PhpGitHooks\Application\Config\HookConfigInterface;
6
7
/**
8
 * Class PreCommitExecutor.
9
 */
10
abstract class PreCommitExecutor
11
{
12
    /** @var HookConfigInterface  */
13
    protected $preCommitConfig;
14
15
    /**
16
     * @return bool
17
     */
18
    protected function isEnabled()
19
    {
20
        return $this->preCommitConfig->isEnabled($this->commandName());
21
    }
22
23
    /**
24
     * @return array
25
     */
26
    protected function getMessages()
27
    {
28
        return $this->preCommitConfig->getMessages();
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    abstract protected function commandName();
35
}
36