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 — master (#651)
by Reginaldo
07:37 queued 03:05
created

AbstractCreditCardBrand::verifyIfCardIsBrand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
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
abstract class AbstractCreditCardBrand extends CreditCard
15
{
16
    protected $pattern;
17
18
    private function verifyIfCardIsBrand($input)
19
    {
20
        return (preg_match($this->pattern, $input) > 0);
21
    }
22
23
    public function validate($input)
24
    {
25
        $input = preg_replace('([^0-9])', '', $input);
26
27
        return parent::verifyMod10($input) && $this->verifyIfCardIsBrand($input);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (verifyMod10() instead of validate()). Are you sure this is correct? If so, you might want to change this to $this->verifyMod10().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
28
    }
29
30
}
31