diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index b9dec329f73..8e68a01e292 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -16,15 +16,14 @@ return [ // PhanTypeMismatchArgumentNullable : 20+ occurrences // PhanTypeInvalidDimOffset : 15+ occurrences // PhanTypeMismatchDimFetch : 10+ occurrences - // PhanUndeclaredMethod : 8 occurrences + // PhanUndeclaredMethod : 7 occurrences // PhanPossiblyUndeclaredGlobalVariable : 6 occurrences - // PhanTypeComparisonFromArray : 6 occurrences // PhanTypeArraySuspiciousNull : 5 occurrences // PhanTypeExpectedObjectPropAccess : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences - // PhanParamTooMany : 3 occurrences // PhanPluginUndeclaredVariableIsset : 2 occurrences // PhanTypeMismatchArgumentProbablyReal : 2 occurrences + // PhanParamTooMany : 1 occurrence // PhanPossiblyUndeclaredVariable : 1 occurrence // PhanTypeExpectedObjectPropAccessButGotNull : 1 occurrence // PhanTypeMismatchReturn : 1 occurrence @@ -34,8 +33,8 @@ return [ 'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'], 'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], - 'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess'], - 'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument'], + 'htdocs/comm/action/pertype.php' => ['PhanTypeExpectedObjectPropAccess'], + 'htdocs/comm/action/peruser.php' => ['PhanTypeMismatchArgument'], 'htdocs/comm/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'], 'htdocs/comm/mailing/targetemailing.php' => ['PhanUndeclaredProperty'], diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f0733642668..c5adccd50a2 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -311,7 +311,7 @@ if ($usergroup > 0) { if ($socid > 0) { $param .= "&search_socid=".urlencode((string) ($socid)); } -if ($showbirthday) { // Always false @phpstan-suppress-current-line +if ($showbirthday) { // Always false @phpstan-ignore-line $param .= "&search_showbirthday=1"; } if ($pid) { @@ -1016,6 +1016,14 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s $cases1 = array(); // Color first half hour $cases2 = array(); // Color second half hour + /** + * @var array>> $cases1 + * @var array>> $cases2 + */ + ' + @phan-var-force array>> $cases1 + @phan-var-force array>> $cases2 + '; $i = 0; $nummytasks = 0; @@ -1236,7 +1244,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s $string2 = ' '; $title1 = ''; $title2 = ''; - if (isset($cases1[$h]) && $cases1[$h] != '') { + if (isset($cases1[$h])) { //$title1.=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events")); if (count($cases1[$h]) > 1) { $title1 .= count($cases1[$h]).' '.(count($cases1[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); @@ -1253,7 +1261,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s } } } - if (isset($cases2[$h]) && $cases2[$h] != '') { + if (isset($cases2[$h])) { //$title2.=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events")); if (count($cases2[$h]) > 1) { $title2 .= count($cases2[$h]).' '.(count($cases2[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 5099c8e8989..933f3a023dc 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -363,7 +363,7 @@ if ($usergroup > 0) { if ($socid > 0) { $param .= "&search_socid=".urlencode((string) ($socid)); } -if ($showbirthday) { // Always false @phpstan-suppress-current-line +if ($showbirthday) { // Always false @phpstan-ignore-line $param .= "&search_showbirthday=1"; } if ($pid) { @@ -1901,6 +1901,19 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases3 = array(); // Color third half hour $cases4 = array(); // Color 4th half hour + /** + * @var array>> $cases1 + * @var array>> $cases2 + * @var array>> $cases3 + * @var array>> $cases4 + */ + ' + @phan-var-force array>> $cases1 + @phan-var-force array>> $cases2 + @phan-var-force array>> $cases3 + @phan-var-force array>> $cases4 + '; + $i = 0; $numother = 0; $numbirthday = 0; @@ -2296,7 +2309,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $title2 = ''; $title3 = ''; $title4 = ''; - if (isset($cases1[$h]) && $cases1[$h] != '') { + if (isset($cases1[$h])) { //$title1.=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events")); if (count($cases1[$h]) > 1) { $title1 .= count($cases1[$h]).' '.(count($cases1[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); @@ -2316,7 +2329,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } } } - if (isset($cases2[$h]) && $cases2[$h] != '') { + if (isset($cases2[$h])) { //$title2.=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events")); if (count($cases2[$h]) > 1) { $title2 .= count($cases2[$h]).' '.(count($cases2[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); @@ -2336,7 +2349,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } } } - if (isset($cases3[$h]) && $cases3[$h] != '') { + if (isset($cases3[$h])) { //$title3.=count($cases3[$h]).' '.(count($cases3[$h])==1?$langs->trans("Event"):$langs->trans("Events")); if (count($cases3[$h]) > 1) { $title3 .= count($cases3[$h]).' '.(count($cases3[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events")); @@ -2356,7 +2369,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } } } - if (isset($cases4[$h]) && $cases4[$h] != '') { + if (isset($cases4[$h])) { //$title4.=count($cases3[$h]).' '.(count($cases3[$h])==1?$langs->trans("Event"):$langs->trans("Events")); if (count($cases4[$h]) > 1) { $title4 .= count($cases4[$h]).' '.(count($cases4[$h]) == 1 ? $langs->trans("Event") : $langs->trans("Events"));