php-option
php-option copied to clipboard
Fix `foldLeft` and `foldRight` return types
The following code is valid, but not allowed by template types currently. This PR fixes that.
$some = new Some(5);
$result = $some->foldLeft(1, function($a, $b) { return (string) ($a + $b) }); // string("6")
@GrahamCampbell Can we get this merged please if all okay?
plus my PR too https://github.com/schmittjoh/php-option/pull/78 around the same issue.