public static function encode($array)
    {
        $array = static::asArray($array);

        if (is_array($array) && count($array) < 1) {
            return "";
        }

        try {
            $string = serialize($array);
        } catch (\Exception $e) {
            throw new PhpException("Serialize Error: " . $e->getMessage());
        }

        return $string;
    }
public static function encode($array)
    {
        $array = static::asArray($array);

        if (is_array($array) && count($array) < 1) {
            return "";
        }

        try {
            $string = serialize($array);
        } catch (\Exception $e) {
            throw new PhpException("Serialize Error: " . $e->getMessage());
        }

        return $string;
    }
public static function encode ( $ array ) { $ array = static :: asArray ( $ array ) ; if ( is_array ( $ array ) && count ( $ array ) < 1 ) { return "" ; } try { $ string = serialize ( $ array ) ; } catch ( \ Exception $ e ) { throw new PhpException ( "Serialize Error: " . $ e -> getMessage ( ) ) ; } return $ string ; }
Convert an array to a php serialized string.

{@inheritDoc}
Convert an array to a php serialized string .