Completed
Push — master ( aee42a...b52690 )
by Wim
8s
created

FooExtends   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
<?php
2
3
//namespace
4
namespace FooTest;
5
6
// abstract
7
abstract class FoobarAbstract { }
8
9
// and
10
$a = 1 and 2;
11
12
// array
13
$exampleArray = array(1, 2);
14
15
// foreach, endforeach, use and as
16
foreach (array() as $item):
17
endforeach;
18
use \Exception as SomeException;
19
20
// break and continue
21
foreach (array(1,2,3) as $number) {
22
    if ($number == 1) {
23
        continue;
24
    }
25
26
    break;
27
}
28
29
//callable
30
function doThing(callable $callback) {
31
}
32
33
// switch, case, default and endswitch
34
switch ($a):
35
    case 1:
36
        break;
37
    default:
38
        break;
39
endswitch;
40
41
// try and catch
42
// TODO: add finally (PHP 5.5)
43
try {
44
} catch (Exception $e) {
45
}
46
47
// class
48
class FoobarClass {}
49
50
// new and clone
51
$a = new FoobarClass();
52
$b = clone $a;
53
54
// const
55
const ELEPHANT = "elephant";
56
57
// declare
58
declare(ticks=1);
59
declare(ticks=1):
60
enddeclare;
61
62
// do, while and endwhile
63
do {
64
} while (false);
65
while (false):
66
endwhile;
67
68
// if else and elseif
69
if (true) {
70
} elseif (false) {
71
} else {
72
}
73
74
// endif
75
if (true):
76
endif;
77
78
// extends, final, private, protected, public
79
class FooExtends extends \Exception {
80
    private $fooPrivate;
81
    protected $fooProtected;
82
    public $fooPublic;
83
    var $fooVar;
84
    final public function __construct() {
85
    }
86
}
87
88
// for and endfor
89
for ($i = 0; $i < 2; $i++):
90
endfor;
91
92
// function
93
function abcdef() {}
94
95
// global
96
global $a;
97
98
// goto
99
goto a;
100
a:
101
102
// interface and implements
103
interface FooInterface {}
104
class FooImplements implements FooInterface {}
105
106
// instanceof
107
if ($b instanceof FoobarClass) {}
108
109
// TODO: insteadof
110
111
// or
112
$c = 1 or 2;
113
114
// throw
115
if (false) {
116
    throw new Exception("foo");
117
}
118
119
// xor
120
$d = 1 xor 2;
121