systopia / Custom-Data-Helper

Helper class for CiviCRM Extensions
GNU Affero General Public License v3.0
0 stars 0 forks source link

PHPStan Static Code Analysis: Level 3 #6

Open jofranz opened 11 months ago

jofranz commented 11 months ago
➜  Custom-Data-Helper (0.10) phpstan analyse -c ~/repositories/ext/phpstan.general.neon.dist -l 3 .
------ ------------------------------------------------------------------------------------------------------------------ 
Line   CustomData.php                                                                                                    
------ ------------------------------------------------------------------------------------------------------------------ 
408    Method CRM_YOURPROJECTNSHERE_CustomData::getFieldSpecs() should return array but returns null.                    
427    Method CRM_YOURPROJECTNSHERE_CustomData::getGroupSpecs() should return array but returns null.                    
666    Variable $unpacked_value in empty() always exists and is not falsy.                                               
794    Method CRM_YOURPROJECTNSHERE_CustomData::generatePreHookCustomDataRecord() should return array but returns null.  
840    PHPDoc tag @param references unknown parameter: $groupName                                                        
843    Method CRM_YOURPROJECTNSHERE_CustomData::getOptionValue() should return string but returns null.                  
------ ------------------------------------------------------------------------------------------------------------------
bjendres commented 11 months ago

getFieldSpecs and getGroupSpecs should be easy to fix (return [];), but the others I'm not too sure about.

jofranz commented 11 months ago

Let's wait until there is a demand to fix this. Level 3 and above are quite a strict levels which show rather optional fixes