Skip to content

Commit

Permalink
Fix issue in proxy generation
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Oct 14, 2022
1 parent 6fd8595 commit 25f920b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proxy-generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
}

$methodCode = $methodTemplate;
$methodCode = str_replace('function _TEMPLATE_()', $reflectionTools->exportFunction($method, \ReflectionMethod::IS_ABSTRACT), $methodCode);
$functionSignature = $reflectionTools->exportFunction($method, \ReflectionMethod::IS_ABSTRACT);
// fix for abstract classes that only inherit from IteratorAggregate (GeometryProxy, CurveProxy, SurfaceProxy)
if (str_ends_with($functionSignature, 'getIterator()')) {
$functionSignature .= ' : \Traversable';
}
$methodCode = str_replace('function _TEMPLATE_()', $functionSignature, $methodCode);

$parameterCode = $method->getShortName() . '(';

Expand Down

0 comments on commit 25f920b

Please sign in to comment.