Completed
Push — master ( 03a881...28de70 )
by Damian
09:16
created

MyTest2::SecondClassMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace TestNamespace\Testing;
4
5
use TestNamespace\{Test1, Test2, Test3};
6
7
if (class_exists('Class')) {
8
9
    class MyTest extends Test1 implements Test2
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type TestNamespace\Testing\MyTest has been defined more than once; this definition is ignored, only the first definition in tests/php/Core/Manifest/...ContentRemoverTestA.php (L7-28) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
10
    {
11
12
        public function MyMethod()
13
        {
14
            //We shouldn't see anything in here
15
            $var = 1;
16
            $var += 1;
17
18
            return $var;
19
        }
20
21
        public function MyNestedMethod()
22
        {
23
            $var = 1;
24
            for ($i = 0; $i < 5; ++$i) {
25
                if ($i % 2) {
26
                    $var += $i;
27
                }
28
            }
29
        }
30
31
    }
32
33
    class MyTest2
34
    {
35
36
        public function SecondClassMethod() {
37
            return 'witty remark';
38
        }
39
40
    }
41
42
}
43