Dotink\Parody\Mime::__callStatic PHP Method

__callStatic() public static method

Allow us to call certain method statically, specifically create
public static __callStatic ( string $method, array $args ) : mixed
$method string The method that was called
$args array The arguments passed to the method
return mixed The return value for the called method
    public static function __callStatic($method, $args)
    {
        if ($method == 'create') {
            if (!count($args)) {
                throw new \Exception(sprintf('Cannot call static create() without a class argument'));
            }
            return new self(self::create($args[0]));
        } else {
            throw new \Exception(sprintf('Call to unsupported method %s on %s', $method, __CLASS__));
        }
    }