public function encode(array $args)
    {
        if (!$args) {
            return $args;
        }

        $serializable = [];

        foreach ($args as $arg) {
            $serializable[] = $this->serialize($arg);
        }

        return $serializable;
    }
public function encode(array $args)
    {
        if (!$args) {
            return $args;
        }

        $serializable = [];

        foreach ($args as $arg) {
            $serializable[] = $this->serialize($arg);
        }

        return $serializable;
    }
public function encode ( array $ args ) { if ( ! $ args ) { return $ args ; } $ serializable = [ ] ; foreach ( $ args as $ arg ) { $ serializable [ ] = $ this -> serialize ( $ arg ) ; } return $ serializable ; }
Encode the arguments in a way the can be stored via json_encode or
serialize.

@param array $args

@return array
Encode the arguments in a way the can be stored via json_encode or serialize .