Skip to content

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

Description

@Gounlaf

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,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions