GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#61)
by Marc
04:35
created

AbstractPropertyValidator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 36
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
isValid() 0 1 ?
A getLastErrorMessage() 0 4 1
A returnIsValidHelper() 0 11 2
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2016-11-10
7
 */
8
9
10
namespace Chapi\Service\JobValidator\PropertyValidator;
11
12
13
use Chapi\Entity\Chronos\JobEntity;
14
use Chapi\Service\JobValidator\PropertyValidatorInterface;
15
16
abstract class AbstractPropertyValidator implements PropertyValidatorInterface
17
{
18
    /** @var string  */
19
    protected $sLastErrMsg = '';
20
21
    /**
22
     * @inheritDoc
23
     */
24
    abstract public function isValid($sProperty, JobEntity $oJobEntity);
25
    
26
    /**
27
     * @inheritDoc
28
     */
29 32
    public function getLastErrorMessage()
30
    {
31 32
        return $this->sLastErrMsg;
32
    }
33
34
    /**
35
     * @param boolean $bIsValid
36
     * @param string $sProperty
37
     * @param string $sErrMsgTpl
38
     * @return bool
39
     */
40 32
    protected function returnIsValidHelper($bIsValid, $sProperty, $sErrMsgTpl)
41
    {
42 32
        if (!$bIsValid)
43 32
        {
44 22
            $this->sLastErrMsg = sprintf($sErrMsgTpl, $sProperty);
45 22
            return false;
46
        }
47
48 20
        $this->sLastErrMsg = '';
49 20
        return true;
50
    }
51
}