protected function assertMethod($method)
    {
        if (!is_string($method)) {
            $type = (is_object($method) ? get_class($method) . ' ' : '') . gettype($method);
            throw new \InvalidArgumentException("Method should be a string, not a $type");
        }
        
        if (preg_match('/[^a-z\-]/i', $method)) {
            $type = (is_object($method) ? get_class($method) . ' ' : '') . gettype($method);
            throw new \InvalidArgumentException("Invalid method '$method': "
                . "Method may only contain letters and dashes");
        }
    }