1 | <?php |
||
13 | class ScalarBeanPropertyDescriptor extends AbstractBeanPropertyDescriptor |
||
14 | { |
||
15 | /** |
||
16 | * @var Column |
||
17 | */ |
||
18 | private $column; |
||
19 | |||
20 | |||
21 | public function __construct(Table $table, Column $column) { |
||
22 | parent::__construct($table); |
||
23 | $this->table = $table; |
||
24 | $this->column = $column; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Returns the foreignkey the column is part of, if any. null otherwise. |
||
29 | * |
||
30 | * @param Column $column |
||
|
|||
31 | * @return ForeignKeyConstraint|null |
||
32 | */ |
||
33 | public function getForeignKey() { |
||
36 | |||
37 | /** |
||
38 | * Returns the param annotation for this property (useful for constructor). |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | public function getParamAnnotation() { |
||
43 | $className = $this->getClassName(); |
||
44 | $paramType = $className ?: TDBMDaoGenerator::dbalTypeToPhpType($this->column->getType()); |
||
45 | |||
46 | $str = " * @param %s %s"; |
||
47 | return sprintf($str, $paramType, $this->getVariableName()); |
||
48 | } |
||
49 | |||
50 | public function getUpperCamelCaseName() { |
||
53 | |||
54 | /** |
||
55 | * Returns the name of the class linked to this property or null if this is not a foreign key |
||
56 | * @return null|string |
||
57 | */ |
||
58 | public function getClassName() { |
||
61 | |||
62 | /** |
||
63 | * Returns true if the property is compulsory (and therefore should be fetched in the constructor). |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function isCompulsory() { |
||
69 | |||
70 | /** |
||
71 | * Returns true if the property is the primary key |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function isPrimaryKey() { |
||
77 | |||
78 | /** |
||
79 | * Returns the PHP code for getters and setters |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getGetterSetterCode() { |
||
134 | |||
135 | /** |
||
136 | * Returns the part of code useful when doing json serialization. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getJsonSerializeCode() |
||
151 | } |
||
152 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.