@@ -69,6 +69,7 @@ class Auto
6969 private Plugins $ plugins ;
7070 private Db $ zdb ;
7171
72+ /** @var array<string, string> */
7273 private array $ fields = [
7374 'id_car ' => 'integer ' ,
7475 'car_name ' => 'string ' ,
@@ -92,6 +93,7 @@ class Auto
9293 Adherent::PK => 'integer '
9394 ];
9495
96+ /** @var array<string, int> */
9597 private array $ required = [
9698 'name ' => 1 ,
9799 'model ' => 1 ,
@@ -145,7 +147,9 @@ class Auto
145147 //do we have to fire a history entry?
146148 private bool $ fire_history = false ;
147149
148- //internal properties (not updatable outside the object)
150+ /**
151+ * @var array<string> internal properties (not updatable outside the object)
152+ */
149153 private array $ internals = [
150154 'id ' ,
151155 'creation_date ' ,
@@ -158,14 +162,15 @@ class Auto
158162 'plugins ' ,
159163 'zdb '
160164 ];
165+ /** @var array<int, string> */
161166 private array $ errors = [];
162167
163168 /**
164169 * Default constructor
165170 *
166- * @param Plugins $plugins Plugins
167- * @param Db $zdb Database instance
168- * @param ?ArrayObject $args A resultset row to load
171+ * @param Plugins $plugins Plugins
172+ * @param Db $zdb Database instance
173+ * @param ?ArrayObject<string, int|string> $args A resultset row to load
169174 */
170175 public function __construct (Plugins $ plugins , Db $ zdb , ?ArrayObject $ args = null )
171176 {
@@ -241,7 +246,7 @@ public function load(int $id): bool
241246 /**
242247 * Populate object from a resultset row
243248 *
244- * @param ArrayObject $r a resultset row
249+ * @param ArrayObject<string, int|string> $r a resultset row
245250 */
246251 private function loadFromRS (ArrayObject $ r ): void
247252 {
@@ -281,6 +286,8 @@ private function loadFromRS(ArrayObject $r): void
281286
282287 /**
283288 * Return the list of available fuels
289+ *
290+ * @return array<int, string> List of fuels
284291 */
285292 public function listFuels (): array
286293 {
@@ -448,11 +455,13 @@ public function store(bool $new = false): bool
448455 *
449456 * @param bool $restrict true to exclude $this->internals from returned
450457 * result, false otherwise. Default to false
458+ *
459+ * @return array<string> List of properties
451460 */
452461 private function getAllProperties (bool $ restrict = false ): array
453462 {
454463 $ result = [];
455- foreach (get_class_vars (static ::class) as $ key => $ value ) {
464+ foreach (array_keys ( get_class_vars (static ::class)) as $ key ) {
456465 if (
457466 !$ restrict
458467 || !in_array ($ key , $ this ->internals )
@@ -466,6 +475,8 @@ private function getAllProperties(bool $restrict = false): array
466475 /**
467476 * Get object's properties. List only properties that can be modified
468477 * externally (ie. not in $this->internals)
478+ *
479+ * @return array<string> List of properties
469480 */
470481 public function getProperties (): array
471482 {
@@ -637,8 +648,8 @@ public function __isset(string $name): bool
637648 /**
638649 * Check posted values validity
639650 *
640- * @param array $post All values to check, basically the $_POST array
641- * after sending the form
651+ * @param array<string,mixed> $post All values to check, basically the $_POST array
652+ * after sending the form
642653 */
643654 public function check (array $ post ): bool
644655 {
@@ -787,6 +798,8 @@ public function check(array $post): bool
787798
788799 /**
789800 * Get errors
801+ *
802+ * @return array<string>
790803 */
791804 public function getErrors (): array
792805 {
@@ -795,6 +808,8 @@ public function getErrors(): array
795808
796809 /**
797810 * Get required fields
811+ *
812+ * @return array<string,int>
798813 */
799814 public function getRequired (): array
800815 {
0 commit comments