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::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
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