Option::orElse( PhpOptionOption $else )

Returns this option if non-empty, or the passed option otherwise.


Description

This can be used to try multiple alternatives, and is especially useful with lazy evaluating options:

    $repo->findSomething()         ->orElse(new LazyOption(array($repo, 'findSomethingElse')))         ->orElse(new LazyOption(array($repo, 'createSomething')));

Parameters

$else

(Required)


Return

(PhpOptionOption)


Source

File: vendor/phpoption/phpoption/src/PhpOption/Option.php

    abstract public function orElse(Option $else);