This PR might be considered a minor refactor/improvement.
Currently in RuntimeDefinition::__construct() a test for truthiness of $explicitClasses is done. This means that RuntimeDefinition::setExplicitClasses() is only called whenever the constructor argument$explicitClasses is not null and not an empty array.
This means that after construction, RuntimeDefinition::$explicitClasses can be null, and hence the tests for truthiness throughout some of the methods is required to account for that.
This pull request normalizes the null value to an empty array in the constructor, simplifying some methods and ensuring that users do not have to deal with tests for null in code in case they extend the class.
Description
This PR might be considered a minor refactor/improvement.
Currently in RuntimeDefinition::__construct() a test for truthiness of
$explicitClasses
is done. This means that RuntimeDefinition::setExplicitClasses() is only called whenever the constructor argument$explicitClasses
is notnull
and not an emptyarray
. This means that after construction, RuntimeDefinition::$explicitClasses can be null, and hence the tests for truthiness throughout some of the methods is required to account for that. This pull request normalizes thenull
value to anempty
array in the constructor, simplifying some methods and ensuring that users do not have to deal with tests fornull
in code in case they extend the class.