static function toOption($outcome)
 {
     switch ($outcome->index) {
         case 0:
             $data = _hx_deref($outcome)->params[0];
             return haxe_ds_Option::Some($data);
             break;
         case 1:
             return haxe_ds_Option::$None;
             break;
     }
 }
 public function getTemplateString($viewRelativePath)
 {
     $fullPath = _hx_string_or_null($this->get_viewDirectory()) . _hx_string_or_null($viewRelativePath);
     try {
         if (file_exists($fullPath)) {
             return tink_core__Future_Future_Impl_::sync(tink_core_Outcome::Success(haxe_ds_Option::Some(sys_io_File::getContent($fullPath))));
         } else {
             return tink_core__Future_Future_Impl_::sync(tink_core_Outcome::Success(haxe_ds_Option::$None));
         }
     } catch (Exception $__hx__e) {
         $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
         $e = $_ex_;
         return $e->asSurpriseError("Failed to load template " . _hx_string_or_null($viewRelativePath));
     }
 }
예제 #3
0
<?php

class haxe_ds_Option extends Enum
{
    public static $None;
    public static function Some($v)
    {
        return new haxe_ds_Option("Some", 0, array($v));
    }
    public static $__constructors = array(1 => 'None', 0 => 'Some');
}
haxe_ds_Option::$None = new haxe_ds_Option("None", 1);