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

MyTest2   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A SecondClassMethod() 0 3 1
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