2
0
forked from Wavyzz/dolibarr

Qual: Fix several phan & stan notices (#31308)

* Qual: Fix several phan & stan notices

# Qual: Fix several phan & stan notices

Several fixes in files while fixing UnknownClass notices

* Qual: Update prepare_head PHPDoc return types

# Qual: Update prepare_head PHPDoc return types

Provide detailed array return types for prepare_head functions.

* Fix new phan notice

* Better loadLangs typing and fix call to loadLangs

* Fix new issues (stats)

* Other fixes of new issues

* Qual: update phan baseline
This commit is contained in:
MDW
2024-10-14 01:59:44 +02:00
committed by GitHub
parent 995f131ad2
commit 53cfbc35be
114 changed files with 737 additions and 472 deletions

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@@ -150,7 +151,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array with number by month
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array with number by month
*/
public function getNbByMonth($year, $format = 0)
{
@@ -174,7 +175,7 @@ class CommandeStats extends Stats
/**
* Return orders number per year
*
* @return array Array with number by year
* @return array<array{0:int,1:int}> Array of nb each year
*
*/
public function getNbByYear()
@@ -199,7 +200,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return array Array with amount by month
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array with amount by month
*/
public function getAmountByMonth($year, $format = 0)
{
@@ -224,7 +225,7 @@ class CommandeStats extends Stats
* Return the orders amount average by month for a year
*
* @param int $year year for stats
* @return array array with number by month
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array with number by month
*/
public function getAverageByMonth($year)
{
@@ -247,7 +248,7 @@ class CommandeStats extends Stats
/**
* Return nb, total and average
*
* @return array Array of values
* @return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array of values
*/
public function getAllByYear()
{
@@ -271,7 +272,7 @@ class CommandeStats extends Stats
*
* @param int $year Year to scan
* @param int $limit Limit
* @return array Array of values
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values
*/
public function getAllByProduct($year, $limit = 10)
{