Fatal error: Uncaught TypeError: Argument 1 passed to WsdlToPhp\PackageBase\AbstractStructArrayBase::initInternArray() must be of the type array, null given, called in /var/www/html/vendor/wsdltophp/packagebase/src/AbstractStructArrayBase.php on line 270 and defined in /var/www/html/vendor/wsdltophp/packagebase/src/AbstractStructArrayBase.php:262
Stack trace:
#0 /var/www/html/vendor/wsdltophp/packagebase/src/AbstractStructArrayBase.php(270): WsdlToPhp\PackageBase\AbstractStructArrayBase->initInternArray(NULL, true)
#1 /var/www/html/vendor/wsdltophp/packagebase/src/AbstractStructArrayBase.php(149): WsdlToPhp\PackageBase\AbstractStructArrayBase->initInternArray()
#2 /var/www/html/packages/guardianjobs/src/Maple/GuardianJobs/ArrayType/ArrayOfWSHierarchicalTerm.php(123): WsdlToPhp\PackageBase\AbstractStructArrayBase->first()
#3 /var/www/html/jbengine/JobBoards/GuardianJobs.class(105): Maple\GuardianJobs\ArrayType\ArrayOfWSHierarchicalTerm->first()
#4 /var/www/html/jbengine/JobBoards/GuardianJobs.class(129): GuardianJobs->toKe in /var/www/html/vendor/wsdltophp/packagebase/src/AbstractStructArrayBase.php on line 262
To Reproduce
Generate the package from the WSDL (will email the URL). I'm using PHP 7.4
Authenticate
Fetch the category terms for a category
foreach ($terms as $categoryTerm) {
$result[$categoryTerm->getID()] = $valuePrefix . $categoryTerm->getName();
/** @var ArrayOfWSHierarchicalTerm $children */
if ($children = $categoryTerm->getChildren()) {
// This is where it goes wrong and the TypeError is thrown when I try to do anything with $children
//dump($children->count());
//$result += $this->toKeyValue($categoryTerm->getChildren(), $valuePrefix . $categoryTerm->getName() . ' > ');
}
}
Expected behavior
No TypeError.
Additional context
Add any other context about the problem here.
wsdltophp/domhandler 2.0.6 Decorative design pattern to ease DOM handling
wsdltophp/packagebase 5.0.2 Contains the base classes to be used by classes generated by wsdltophp/packagegenerator
wsdltophp/packagegenerator 4.1.5 Generate hierarchical PHP classes based on a WSDL
wsdltophp/phpgenerator 4.1.1 Generate php source file
wsdltophp/wsdlhandler 1.0.5 Decorative design pattern to ease WSDL handling
Describe the bug
To Reproduce Generate the package from the WSDL (will email the URL). I'm using PHP 7.4 Authenticate Fetch the category terms for a category
Iterate over the terms and their children
Expected behavior No TypeError.
Additional context Add any other context about the problem here.
A
var_export()
of$terms
is posted at https://gist.github.com/pbowyer/d9831be7d08af4060eb9a1b4a1f3218bI presume this error is related to https://github.com/WsdlToPhp/PackageBase/pull/38 and https://github.com/WsdlToPhp/PackageGenerator/issues/248.