Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — 0.9 (#694)
by
unknown
03:32
created

AbstractWrapper   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 34
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A assert() 0 4 1
A check() 0 4 1
A validate() 0 4 1
A getValidatable() 0 8 2
A setName() 0 5 1
1
<?php
2
namespace Respect\Validation\Rules;
3
4
use Respect\Validation\Validatable;
5
use Respect\Validation\Exceptions\ComponentException;
6
7
abstract class AbstractWrapper extends AbstractRule
8
{
9
    protected $validatable;
10
11 6
    public function getValidatable()
12
    {
13 6
        if (!$this->validatable instanceof Validatable) {
14 1
            throw new ComponentException('There is no defined validatable');
15
        }
16
17 5
        return $this->validatable;
18
    }
19
20 1
    public function assert($input)
21
    {
22 1
        return $this->getValidatable()->assert($input);
23
    }
24
25 1
    public function check($input)
26
    {
27 1
        return $this->getValidatable()->check($input);
28
    }
29
30 1
    public function validate($input)
31
    {
32 1
        return $this->getValidatable()->validate($input);
33
    }
34
35 1
    public function setName($name)
36
    {
37 1
        $this->getValidatable()->setName($name);
38 1
        return parent::setName($name);
39
    }
40
}
41