示例#1
0
 public function offsetGet($offset)
 {
     return $this->offsetExists($offset) ? Option::Some($this->get()[$offset]) : Option::None();
 }
示例#2
0
 /**
  * @param \Closure $producer
  * @return Option
  */
 public function otherwise(\Closure $producer)
 {
     return Option::Some($producer());
 }