# Qual: Fix phan/stan notices in relation with UnknownObjectMethodCall
Fix notices in classes with UnknownObjectMethodCall notices or classes
related with these.
* Qual: Fix notifications multiple files
# Qual: Fix notifications multiple files
Fixes to files with UnknownObject notices, fixing other
notices in these files as well
* Improve boxes typing
* Qual: Extend accepted types to reduce notices
* Fix type for GET/POST arguments of GETPOST* calls
* NEW: method to help declare dictionaries more easily
* Example use of `declareNewDictionary()` method (redeclaring dictionaries of module Ticket with the new method)
* minor fixes: $this->db->prefix() in modTicket.class.php
* NEW module user rights enhancement
* FIX syntax error
* FIX fuck
* FIX syntax error
* FIX Add label with the current language (key or with PermissionXXX)
* FIX wrong test
* FIX optimize
* FIX doc
* FIX add class "Rights" for constant
* FIX replace with constants
* FIX missing constant
* FIX wrong check
* TODO sql error : data too long for column 'libelle'
* FIX syntax error
* FIX synax error "the return"... i'll be back
* FIX use operator with double question mark
* FIX add comment
* FIX just remplace integer with constant
* FIX remove unused code
* FIX add an example
* FIX remove the possibility to have entity = 0 (too complicated)
* FIX perms must not be empty
* FIX sql syntax error
* FIX phpstan undefined property DolibarrModules::$modules
* FIX same fix of frederic34
* Update llx_rights_def.sql
* Update DolibarrModules.class.php
* Update DolibarrModules.class.php
* Update DolibarrModules.class.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
# Fix nullable return with if($ok == 1) in stead of if($ok)
This seems to be a bug in Phan where if($ok) changes the type of $ok.
Testing with '$ok == 1' instead fixes the issue.
This has been reported to the phan team.
# Qual: Fix typing - moduleparts['hooks'] may be empty
PHPstan reported on initialisation mismatch when module_parts['hooks']
is initialised to empty array. This change makes the fields optional.
# Qual: Typing : make all $module_parts fields optional and add missing
According to the initialisations of the modules all fields for $module_parts are optional
and some keys were missing in the definition.
This is updated.
* Qual: Force typing on variable fixing several phan notices
# Qual: Force typing on variable fixing several phan notices
Forcing DolibarrModules on $objMod after assignment to fix typing checks
* Qual: Fix typing on import_label/export_label
* Qual: Add typing to fix PhanTypeMismatchDimAssignment notice
* Fix: Initialise array for code in somme
* Qual: Update type hint for argument in _Set_Format
* Qual: Update type hint for childtables
* Qual: Add typing to attributes
* Qual: Add typing for _msgContent
* Qual: Suppress PhanTypeMismatchDimAssignment
* Qual: Add typing for liste
* Qual: Add typing to fields
* Qual: Add typing hint for $objMod
* Qual: Modify assignment of array with bool keys for phan typing
Demonstration:
```
php -r '$a=[true=>"yes",false=>"no"];var_dump($a);'
# Result demonstrates bool keys are converted to int.
Command line code:1:
array(2) {
[1] =>
string(3) "yes"
[0] =>
string(2) "no"
}
```
* Qual: Add typing hint to indicate value is not null
* Force non-null type on $paramname
* Qual: Add typing hint to getCats()
* Update inc.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>