Completed
Push — master ( dd8ca6...ed1ab1 )
by Antonio Carlos
06:33 queued 01:44
created

Base::defineConstants()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 11
ccs 7
cts 7
cp 1
crap 2
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
namespace PragmaRX\Countries\Package\Support;
4
5
class Base
6
{
7 34
    public function defineConstants()
8
    {
9 34
        if (! \defined('__COUNTRIES_DIR__')) {
10 1
            \define(
11 1
                '__COUNTRIES_DIR__',
12 1
                realpath(
13 1
                    __DIR__.$this->helper->toDir('/../../../')
0 ignored issues
show
Bug introduced by
The property helper does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
14
                )
15
            );
16
        }
17 34
    }
18
}
19