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.

IsBoolean   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 17
loc 17
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 8 8 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2016-11-10
7
 *
8
 */
9
10
11
namespace Chapi\Service\JobValidator\PropertyValidator;
12
13
use Chapi\Entity\Chronos\JobEntity;
14
use Chapi\Entity\JobEntityInterface;
15
use Chapi\Service\JobValidator\PropertyValidatorInterface;
16
17 View Code Duplication
class IsBoolean extends AbstractPropertyValidator implements PropertyValidatorInterface
18
{
19
    const DIC_NAME = 'BooleanValidator';
20
    const MESSAGE_TEMPLATE = '"%s" is not boolean';
21
22
    /**
23
     * @inheritDoc
24
     */
25 3
    public function isValid($property, JobEntityInterface $jobEntity)
26
    {
27 3
        return $this->returnIsValidHelper(
28 3
            is_bool($jobEntity->{$property}),
29 3
            $property,
30 3
            self::MESSAGE_TEMPLATE
31
        );
32
    }
33
}
34