src/SellerLabs/Nucleus/Support/Flick.php
public function go($input)
    {
        Arguments::define(Boa::readMap())->define($input);

        $map = ComplexFactory::toReadMap($this->functions);

        if ($map->member($input)) {
            /** @var callable $function */
            $function = Maybe::fromJust($map->lookup($input));

            return $function();
        } elseif ($map->member($this->default)) {
            /** @var callable $function */
            $function = Maybe::fromJust($map->lookup($this->default));

            return $function();
        }

        throw new UnknownKeyException();
    }
public function go($input)
    {
        Arguments::define(Boa::readMap())->define($input);

        $map = ComplexFactory::toReadMap($this->functions);

        if ($map->member($input)) {
            /** @var callable $function */
            $function = Maybe::fromJust($map->lookup($input));

            return $function();
        } elseif ($map->member($this->default)) {
            /** @var callable $function */
            $function = Maybe::fromJust($map->lookup($this->default));

            return $function();
        }

        throw new UnknownKeyException();
    }
public function go ( $ input ) { Arguments :: define ( Boa :: readMap ( ) ) -> define ( $ input ) ; $ map = ComplexFactory :: toReadMap ( $ this -> functions ) ; if ( $ map -> member ( $ input ) ) { /** @var callable $function */ $ function = Maybe :: fromJust ( $ map -> lookup ( $ input ) ) ; return $ function ( ) ; } elseif ( $ map -> member ( $ this -> default ) ) { /** @var callable $function */ $ function = Maybe :: fromJust ( $ map -> lookup ( $ this -> default ) ) ; return $ function ( ) ; } throw new UnknownKeyException ( ) ; }
Run the flick on input.

@param string|int $input

@throws UnknownKeyException
@return mixed
Run the flick on input .