1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Created by IntelliJ IDEA. |
4
|
|
|
* User: yoshi |
5
|
|
|
* Date: 27.01.16 |
6
|
|
|
* Time: 19:52 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace CodeMine\ConfluenceImporter\Parser\File; |
10
|
|
|
use CodeMine\ConfluenceImporter\Parser\Structure\Attribute\Collection\Properties; |
11
|
|
|
use CodeMine\ConfluenceImporter\Parser\Structure\Attribute\Constant; |
12
|
|
|
use CodeMine\ConfluenceImporter\Parser\Structure\Attribute\Property; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Class File |
16
|
|
|
* @package CodeMine\ConfluenceImporter\Parser\File |
17
|
|
|
*/ |
18
|
|
|
class File |
19
|
|
|
{ |
20
|
|
|
/* class, interface, trait */ |
|
|
|
|
21
|
|
|
private $type; |
22
|
|
|
|
23
|
|
|
/* |
24
|
|
|
* @attributes |
25
|
|
|
*/ |
26
|
|
|
private $path; |
27
|
|
|
private $package; |
28
|
|
|
|
29
|
|
|
/* Class */ |
30
|
|
|
/** |
31
|
|
|
* @var bool |
32
|
|
|
*/ |
33
|
|
|
private $final; |
34
|
|
|
/** |
35
|
|
|
* @var bool |
36
|
|
|
*/ |
37
|
|
|
private $abstract; |
38
|
|
|
private $namespace; |
39
|
|
|
private $namespaceAlias; |
40
|
|
|
private $extends; |
41
|
|
|
private $implements; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var Constant |
45
|
|
|
*/ |
46
|
|
|
private $constant; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var Properties |
50
|
|
|
*/ |
51
|
|
|
private $properties; |
52
|
|
|
|
53
|
|
|
public function __construct() |
54
|
|
|
{ |
55
|
|
|
$this->properties = new Properties(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @param Property $property |
60
|
|
|
*/ |
61
|
|
|
public function addProperty(Property $property) |
62
|
|
|
{ |
63
|
|
|
$this->properties->attach($property); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
|
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @param mixed $path |
70
|
|
|
*/ |
71
|
|
|
public function setPath($path) |
72
|
|
|
{ |
73
|
|
|
$this->path = $path; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param mixed $package |
78
|
|
|
*/ |
79
|
|
|
public function setPackage($package) |
80
|
|
|
{ |
81
|
|
|
$this->package = $package; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param mixed $type |
86
|
|
|
*/ |
87
|
|
|
public function setType($type) |
88
|
|
|
{ |
89
|
|
|
$this->type = $type; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @param boolean $final |
94
|
|
|
*/ |
95
|
|
|
public function setFinal($final) |
96
|
|
|
{ |
97
|
|
|
$this->final = $final; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @param boolean $abstract |
102
|
|
|
*/ |
103
|
|
|
public function setAbstract($abstract) |
104
|
|
|
{ |
105
|
|
|
$this->abstract = $abstract; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @param mixed $namespace |
110
|
|
|
*/ |
111
|
|
|
public function setNamespace($namespace) |
112
|
|
|
{ |
113
|
|
|
$this->namespace = $namespace; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param mixed $extends |
118
|
|
|
*/ |
119
|
|
|
public function setExtends($extends) |
120
|
|
|
{ |
121
|
|
|
$this->extends = $extends; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param mixed $implements |
126
|
|
|
*/ |
127
|
|
|
public function setImplements($implements) |
128
|
|
|
{ |
129
|
|
|
$this->implements = $implements; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @param mixed $namespaceAlias |
134
|
|
|
*/ |
135
|
|
|
public function setNamespaceAlias($namespaceAlias) |
136
|
|
|
{ |
137
|
|
|
$this->namespaceAlias = $namespaceAlias; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @param Constant $constant |
142
|
|
|
*/ |
143
|
|
|
public function setConstant(Constant $constant) |
144
|
|
|
{ |
145
|
|
|
$this->constant = $constant; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
|
149
|
|
|
|
150
|
|
|
|
151
|
|
|
|
152
|
|
|
|
153
|
|
|
} |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.