Completed
Push — feature/issue-54 ( 0869de...548adc )
by Mikaël
31:27
created

StructArrayReservedKeywords   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A instance() 0 4 2
A getDefaultArrayConfigurationPath() 0 4 1
1
<?php
2
3
namespace WsdlToPhp\PackageGenerator\ConfigurationReader;
4
5
class StructArrayReservedKeywords extends StructReservedKeywords
6
{
7
    /**
8
     * @param string $filename
9
     */
10
    protected function __construct($filename)
11
    {
12
        parent::__construct($filename);
13
        $this->parseReservedKeywords(parent::getDefaultConfigurationPath());
1 ignored issue
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getDefaultConfigurationPath() instead of __construct()). Are you sure this is correct? If so, you might want to change this to $this->getDefaultConfigurationPath().

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...
14
    }
15
    /**
16
     * @throws \InvalidArgumentException
17
     * @param string options's file to parse
18
     * @return StructArrayReservedKeywords
19
     */
20
    public static function instance($filename = null)
21
    {
22
        return parent::instance(empty($filename) ? self::getDefaultArrayConfigurationPath() : $filename);
23
    }
24
    /**
25
     * @return string
26
     */
27
    public static function getDefaultArrayConfigurationPath()
28
    {
29
        return dirname(__FILE__) . '/../resources/config/struct_array_reserved_keywords.yml';
30
    }
31
}
32