1 | <?php |
||
13 | class Property extends \SwaggerGen\Swagger\AbstractObject |
||
14 | { |
||
15 | |||
16 | private static $classTypes = array( |
||
17 | 'integer' => 'Integer', |
||
18 | 'int' => 'Integer', |
||
19 | 'int32' => 'Integer', |
||
20 | 'int64' => 'Integer', |
||
21 | 'long' => 'Integer', |
||
22 | 'float' => 'Number', |
||
23 | 'double' => 'Number', |
||
24 | 'string' => 'String', |
||
25 | 'uuid' => 'StringUuid', |
||
26 | 'byte' => 'String', |
||
27 | 'binary' => 'String', |
||
28 | 'password' => 'String', |
||
29 | 'enum' => 'String', |
||
30 | 'boolean' => 'Boolean', |
||
31 | 'bool' => 'Boolean', |
||
32 | 'array' => 'Array', |
||
33 | 'csv' => 'Array', |
||
34 | 'ssv' => 'Array', |
||
35 | 'tsv' => 'Array', |
||
36 | 'pipes' => 'Array', |
||
37 | 'multi' => 'Array', |
||
38 | 'date' => 'Date', |
||
39 | 'datetime' => 'Date', |
||
40 | 'date-time' => 'Date', |
||
41 | 'object' => 'Object', |
||
42 | 'refobject' => 'ReferenceObject', |
||
43 | ); |
||
44 | |||
45 | /** |
||
46 | * Description of this property |
||
47 | * @var string |
||
48 | */ |
||
49 | private $description; |
||
50 | |||
51 | /** |
||
52 | * Whether property is read only |
||
53 | * @var bool |
||
54 | */ |
||
55 | private $readOnly; |
||
56 | |||
57 | /** |
||
58 | * Type definition of this property |
||
59 | * @var \SwaggerGen\Swagger\Type\AbstractType |
||
60 | */ |
||
61 | private $Type; |
||
62 | |||
63 | /** |
||
64 | * Create a new property |
||
65 | * @param \SwaggerGen\Swagger\AbstractObject $parent |
||
66 | * @param string $definition Either a built-in type or a definition name |
||
67 | * @param string $description description of the property |
||
68 | * @param bool $readOnly Whether the property is read only |
||
69 | * @throws \SwaggerGen\Exception |
||
70 | */ |
||
71 | public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition, $description = null, $readOnly = null) |
||
98 | |||
99 | /** |
||
100 | * @param string $command The comment command |
||
101 | * @param string $data Any data added after the command |
||
102 | * @return \SwaggerGen\Swagger\Type\AbstractType|boolean |
||
103 | */ |
||
104 | public function handleCommand($command, $data = null) |
||
113 | |||
114 | public function toArray() |
||
136 | |||
137 | public function __toString() |
||
141 | |||
142 | } |
||
143 |
This check looks for the bodies of
if
statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
if
bodies can be removed. If you have an empty if but statements in theelse
branch, consider inverting the condition.could be turned into
This is much more concise to read.