From 09a953d18f9b18ae7b5e760b8d6bb4f0c7d4038b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 17 Mar 2024 22:04:10 +0100 Subject: [PATCH] fix phpstan --- dev/tools/apstats.php | 3 ++- htdocs/hrm/class/evaluation.class.php | 10 ++++----- htdocs/hrm/class/job.class.php | 29 ++++++++++++++------------- htdocs/hrm/class/skill.class.php | 29 ++++++++++++++------------- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index eb737b9690e..3a31b4b232b 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -3,6 +3,7 @@ /* * Copyright (C) 2023 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -708,7 +709,7 @@ if (count($output_phan_json) != 0) { $tmpphan .= ''; $tmpphan .= ''.$line_range_txt.''; $tmpphan .= ''; - $tmpphan .= ''.dolPrintLabel($notice['description']).''; + $tmpphan .= ''.dolPrintLabel($notice['description']).''; $tmpphan .= ''; $tmpphan .= "\n"; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 7bf46c30b86..75debfda98a 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -161,11 +161,11 @@ class Evaluation extends CommonObject // */ // protected $childtables = array(); - // /** - // * @var array List of child tables. To know object to delete on cascade. - // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will - // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object - // */ + /** + * @var array List of child tables. To know object to delete on cascade. + * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will + * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + */ protected $childtablesoncascade = array('@EvaluationLine:hrm/class/evaluationdet.class.php:fk_evaluation'); /** diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index e1a355b54cd..2befee8a138 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -122,8 +122,6 @@ class Job extends CommonObject public $date_creation; public $deplacement; - public $note_public; - public $note_private; public $fk_user_creat; public $fk_user_modif; // END MODULEBUILDER PROPERTIES @@ -136,9 +134,9 @@ class Job extends CommonObject // */ // public $table_element_line = 'hrm_jobline'; - // /** - // * @var string Field with ID of parent key if this object has a parent - // */ + /** + * @var string Field with ID of parent key if this object has a parent + */ public $fk_element = 'fk_job'; // /** @@ -146,16 +144,19 @@ class Job extends CommonObject // */ // public $class_element_line = 'Jobline'; - // /** - // * @var string[] List of child tables. To test if we can delete object. - // */ - protected $childtables = array('hrm_evaluation', 'hrm_job_user'); + /** + * @var array List of child tables. To test if we can delete object. + */ + protected $childtables = array( + 'hrm_evaluation' => ['name' => 'Evaluation'], + 'hrm_job_user' => ['name' => 'Job'], + ); - // /** - // * @var array List of child tables. To know object to delete on cascade. - // * If name matches '@ClassNAme:FilePathClass:ParentFkFieldName' it will - // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object - // */ + /** + * @var string[] List of child tables. To know object to delete on cascade. + * If name matches '@ClassNAme:FilePathClass:ParentFkFieldName' it will + * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + */ protected $childtablesoncascade = array("@SkillRank:hrm/class/skillrank.class.php:fk_object:(objecttype:=:'job')"); // /** diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 256956d55de..9f0defee0f6 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -133,8 +133,6 @@ class Skill extends CommonObject public $date_validite; public $temps_theorique; public $skill_type; - public $note_public; - public $note_private; // END MODULEBUILDER PROPERTIES @@ -145,9 +143,9 @@ class Skill extends CommonObject // */ // public $table_element_line = 'hrm_skillline'; - // /** - // * @var string Field with ID of parent key if this object has a parent - // */ + /** + * @var string Field with ID of parent key if this object has a parent + */ public $fk_element = 'fk_skill'; // /** @@ -155,16 +153,19 @@ class Skill extends CommonObject // */ // public $class_element_line = 'Skillline'; - // /** - // * @var array List of child tables. To test if we can delete object. - // */ - protected $childtables = array('hrm_skillrank', 'hrm_evaluationdet'); + /** + * @var array List of child tables. To test if we can delete object. + */ + protected $childtables = array( + 'hrm_skillrank' => ['name' => 'SkillRank'], + 'hrm_evaluationdet' => ['name' => 'EvaluationDet'], + ); - // /** - // * @var array List of child tables. To know object to delete on cascade. - // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will - // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object - // */ + /** + * @var string[] List of child tables. To know object to delete on cascade. + * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will + * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + */ protected $childtablesoncascade = array('hrm_skilldet'); // /**