1 | <?php |
||
10 | class Table implements DatabaseObjectInterface |
||
11 | { |
||
12 | private $name; |
||
13 | private $schema; |
||
14 | private $description; |
||
15 | protected $columns = array(); |
||
16 | protected $constraints = array(); |
||
17 | |||
18 | /** |
||
19 | * Constructor. |
||
20 | * |
||
21 | * @param string $name Table name. |
||
22 | * @param Schema $schem Schema instance. |
||
|
|||
23 | */ |
||
24 | public function __construct($name, Schema $schema = null) |
||
29 | |||
30 | /** |
||
31 | * Get table name. |
||
32 | * |
||
33 | * @return string Table name. |
||
34 | */ |
||
35 | public function getName() |
||
39 | |||
40 | /** |
||
41 | * Get qualified name (schema name + table name) |
||
42 | * |
||
43 | * @return string Qualified name. |
||
44 | */ |
||
45 | public function getQualifiedName() |
||
49 | |||
50 | /** |
||
51 | * Add column to table. |
||
52 | * |
||
53 | * @param Column $column Column instance. |
||
54 | * |
||
55 | * @return Table Table instance. |
||
56 | */ |
||
57 | public function addColumn(Column $column) |
||
63 | |||
64 | /** |
||
65 | * Get columns of table. |
||
66 | * |
||
67 | * @return Column[] Array of Column instances. |
||
68 | */ |
||
69 | public function getColumns() |
||
73 | |||
74 | /** |
||
75 | * Get column of table. |
||
76 | * |
||
77 | * @param string $name Column name. |
||
78 | * |
||
79 | * @return Column Column instance. |
||
80 | */ |
||
81 | public function getColumn($name) |
||
91 | |||
92 | /** |
||
93 | * Add contraint to table. |
||
94 | * |
||
95 | * @param ConstraintInterface $constraint Instance of class implements ConstraintInterface. |
||
96 | * |
||
97 | * @return Table Table instance. |
||
98 | */ |
||
99 | public function addConstraint(ConstraintInterface $constraint) |
||
106 | |||
107 | /** |
||
108 | * Get constraints of table. |
||
109 | * |
||
110 | * @return ConstraintInterface[] Array of instances implement ConstraintInterface. |
||
111 | */ |
||
112 | public function getConstraints() |
||
116 | |||
117 | /** |
||
118 | * Set schema name. |
||
119 | * |
||
120 | * @param string $name Schama name. |
||
121 | */ |
||
122 | public function setSchema(Schema $schema) |
||
126 | |||
127 | public function getSchema() |
||
131 | |||
132 | /** |
||
133 | * Set table description. |
||
134 | * |
||
135 | * @param string $description Table description. |
||
136 | */ |
||
137 | public function setDescription($description) |
||
141 | |||
142 | /** |
||
143 | * Get table description. |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | public function getDescription() |
||
151 | } |
||
152 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.