# 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>