Open TysonAndre opened 5 years ago
https://github.com/zendframework/zend-code/blob/master/src/Generator/ClassGenerator.php#L476-L482 has the following snippet
array_map(function ($implementedInterface) { return (string) TypeGenerator::fromTypeString($implementedInterface); }, $implementedInterfaces); $this->implementedInterfaces = $implementedInterfaces;
That's a no-op, since the return value of the array_map isn't used. I think that the array_map should be removed, replaced with array_walk (probably pointless unless it would throw), or (probably) be changed to:
$this->implementedInterfaces = array_map(function ($implementedInterface) { return (string) TypeGenerator::fromTypeString($implementedInterface); }, $implementedInterfaces);
The latter seems likely given the rest of the changes in https://github.com/zendframework/zend-code/commit/ec09875ecc89347a6109e0eaea4a75e4d54dd8c3
This was detected via static analysis, I'm not sure of the impact of fixing this.
http://php.net/array_map
This repository has been closed and moved to laminas/laminas-code; a new issue has been opened at https://github.com/laminas/laminas-code/issues/3.
https://github.com/zendframework/zend-code/blob/master/src/Generator/ClassGenerator.php#L476-L482 has the following snippet
That's a no-op, since the return value of the array_map isn't used. I think that the array_map should be removed, replaced with array_walk (probably pointless unless it would throw), or (probably) be changed to:
The latter seems likely given the rest of the changes in https://github.com/zendframework/zend-code/commit/ec09875ecc89347a6109e0eaea4a75e4d54dd8c3
This was detected via static analysis, I'm not sure of the impact of fixing this.
http://php.net/array_map