Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Questions] Final or inheritance possible + add methode "value" #43

Open
Gounlaf opened this issue Sep 1, 2020 · 0 comments
Open

[Questions] Final or inheritance possible + add methode "value" #43

Gounlaf opened this issue Sep 1, 2020 · 0 comments

Comments

@Gounlaf
Copy link

Gounlaf commented Sep 1, 2020

Hi,

  1. Question about inheritance: is it allowed? Cause the class is not final, but properties are private, and static methods use & return self instead of static, making inheritance not really possible (parent class will be returned instead of child)

  2. Asking 1. because I just need a method that return the value. Using valueOr is a bit disturbing when using hasValue.

$data = [];
$some = Option::some('value');
if ($some->hasValue()) {
    $data[] = $some->valueOr(null); // this is disturbing
}

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant