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 (#691)
by
unknown
07:33
created

AbstractSearcher   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 91.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 32
ccs 11
cts 12
cp 0.9167
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A validateEquals() 0 8 2
A validateIdentical() 0 8 2
A validate() 0 8 2
1
<?php
2
namespace Respect\Validation\Rules;
3
4
abstract class AbstractSearcher extends AbstractRule
5
{
6
    public $haystack;
7
    public $compareIdentical;
8
9 10
    protected function validateEquals($input)
10
    {
11 10
        if (is_array($this->haystack)) {
12 4
            return in_array($input, $this->haystack);
13
        }
14
15 6
        return (false !== mb_stripos($this->haystack, $input, 0, mb_detect_encoding($input)));
16
    }
17
18 1
    protected function validateIdentical($input)
19
    {
20 1
        if (is_array($this->haystack)) {
21 1
            return in_array($input, $this->haystack, true);
22
        }
23
24
        return (false !== mb_strpos($this->haystack, $input, 0, mb_detect_encoding($input)));
25
    }
26
27 11
    public function validate($input)
28
    {
29 11
        if ($this->compareIdentical) {
30 1
            return $this->validateIdentical($input);
31
        }
32
33 10
        return $this->validateEquals($input);
34
    }
35
}
36