1 | <?php |
||
24 | class JsonModelSchema |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * @var \EEM_Base |
||
29 | */ |
||
30 | protected $model; |
||
31 | |||
32 | /** |
||
33 | * JsonModelSchema constructor. |
||
34 | * |
||
35 | * @param \EEM_Base $model |
||
36 | */ |
||
37 | public function __construct(EEM_Base $model){ |
||
40 | |||
41 | /** |
||
42 | * Return the schema for a given model from a given model. |
||
43 | * @param \EEM_Base $model |
||
|
|||
44 | * @return array |
||
45 | */ |
||
46 | public function getModelSchema() |
||
56 | |||
57 | |||
58 | /** |
||
59 | * Get the schema for a given set of model fields. |
||
60 | * @param \EE_Model_Field_Base[] $model_fields |
||
61 | * @return array |
||
62 | */ |
||
63 | public function getModelSchemaForFields(array $model_fields, array $schema) |
||
87 | |||
88 | |||
89 | /** |
||
90 | * Get the schema for a given set of model relations |
||
91 | * @param EE_Model_Relation_Base[] $relations_on_model |
||
92 | * @return array |
||
93 | */ |
||
94 | public function getModelSchemaForRelations(array $relations_on_model, array $schema) |
||
108 | |||
109 | |||
110 | /** |
||
111 | * Outputs the schema header for a model. |
||
112 | * @param \EEM_Base $model |
||
113 | * @return array |
||
114 | */ |
||
115 | public function getInitialSchemaStructure() |
||
124 | |||
125 | |||
126 | /** |
||
127 | * Allows one to just use the object as a string to get the json. |
||
128 | * eg. |
||
129 | * |
||
130 | * $json_schema = new JsonModelSchema(EEM_Event::instance()); |
||
131 | * echo $json_schema; //outputs the schema as a json formatted string. |
||
132 | * |
||
133 | * @return bool|false|mixed|string |
||
134 | */ |
||
135 | public function __toString() |
||
139 | } |
||
140 |
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.