Skip to content

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

Open
@Gounlaf

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,

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