Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Read the [documentation](https://doc.maybe.texthtml.net) full API description, d
* @return Option<float>
*/
function divide(float $numerator, float $denominator): Option {
return match ($denomintor) {
return match ($denominator) {
0.0 => Option\none(),
default => Option\some($numerator / $denominator),
};
Expand All @@ -40,7 +40,7 @@ $result = divide(2.0, 3.0);
// Pattern match to retrieve the value
if ($result->isSome()) {
// The division was valid
echo "Result: {$option->unwrap()}";
echo "Result: {$result->unwrap()}";
} else {
// The division was invalid
echo "Cannot divide by 0";
Expand Down
6 changes: 3 additions & 3 deletions tools/apigen/theme/pages/index.latte
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
* @param Option<float>
*/
function divide(float $numerator, float $denominator): Option {
return match ($denomintor) {
return match ($denominator) {
0.0 => Option\none(),
_ => Option\some($numerator / $denominator)
default => Option\some($numerator / $denominator),
};
}

Expand All @@ -53,7 +53,7 @@ $result = divide(2.0, 3.0);
// Pattern match to retrieve the value
if ($result instanceof Option\Some) {
// The division was valid
echo "Result: {$option->unwrap()}");
echo "Result: {$result->unwrap()}";
} else {
// The division was invalid
echo "Cannot divide by 0";
Expand Down