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
Push — master ( ce3f88...78449c )
by Henrique
13:36 queued 08:13
created

AbstractWrapper::getValidatable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of Respect/Validation.
5
 *
6
 * (c) Alexandre Gomes Gaigalas <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the "LICENSE.md"
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Respect\Validation\Rules;
13
14
use Respect\Validation\Exceptions\ComponentException;
15
use Respect\Validation\Validatable;
16
17
abstract class AbstractWrapper extends AbstractRule
18
{
19
    protected $validatable;
20
21 6
    public function getValidatable()
22
    {
23 6
        if (!$this->validatable instanceof Validatable) {
24 1
            throw new ComponentException('There is no defined validatable');
25
        }
26
27 5
        return $this->validatable;
28
    }
29
30 1
    public function assert($input)
31
    {
32 1
        return $this->getValidatable()->assert($input);
33
    }
34
35 1
    public function check($input)
36
    {
37 1
        return $this->getValidatable()->check($input);
38
    }
39
40 1
    public function validate($input)
41
    {
42 1
        return $this->getValidatable()->validate($input);
43
    }
44
45 1
    public function setName($name)
46
    {
47 1
        $this->getValidatable()->setName($name);
48 1
        return parent::setName($name);
49
    }
50
}
51