php-option icon indicating copy to clipboard operation
php-option copied to clipboard

Fix `foldLeft` and `foldRight` return types

Open axlon opened this issue 1 year ago • 1 comments

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")

axlon avatar Aug 14 '24 17:08 axlon

@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.

ojhaujjwal avatar Nov 05 '24 22:11 ojhaujjwal