GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

CriteriaGenerator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getRootNamespace() 0 4 1
A getPathConfigNode() 0 4 1
A getPath() 0 4 1
A getBasePath() 0 4 1
1
<?php
2
3
namespace Milkmeowo\Framework\Repository\Generators;
4
5
class CriteriaGenerator extends Generator
6
{
7
    /**
8
     * Get stub name.
9
     *
10
     * @var string
11
     */
12
    protected $stub = 'criteria/criteria';
13
14
    /**
15
     * Get root namespace.
16
     *
17
     * @return string
18
     */
19
    public function getRootNamespace()
20
    {
21
        return parent::getRootNamespace().parent::getConfigGeneratorClassPath($this->getPathConfigNode());
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getConfigGeneratorClassPath() instead of getRootNamespace()). Are you sure this is correct? If so, you might want to change this to $this->getConfigGeneratorClassPath().

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...
22
    }
23
24
    /**
25
     * Get generator path config node.
26
     * @return string
27
     */
28
    public function getPathConfigNode()
29
    {
30
        return 'criteria';
31
    }
32
33
    /**
34
     * Get destination path for generated file.
35
     *
36
     * @return string
37
     */
38
    public function getPath()
39
    {
40
        return $this->getBasePath().'/'.parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true).'/'.$this->getName().'Criteria.php';
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getConfigGeneratorClassPath() instead of getPath()). Are you sure this is correct? If so, you might want to change this to $this->getConfigGeneratorClassPath().

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...
41
    }
42
43
    /**
44
     * Get base path of destination file.
45
     *
46
     * @return string
47
     */
48
    public function getBasePath()
49
    {
50
        return config('repository.generator.basePath', app()->path());
51
    }
52
}
53