protected function assertValidPath($path)
    {
        $translator = $this->translator();

        if (empty($path) && !is_numeric($path)) {
            $message = $translator->translate(
                '{{ parameter }} required and must be a {{ expectedType }}',
                [
                    '{{ parameter }}'    => '"path"',
                    '{{ expectedType }}' => 'string',
                ]
            );

            throw new InvalidArgumentException($message, 400);
        } elseif (!is_string($path)) {
            $actualType = is_object($path) ? get_class($path) : gettype($path);
            $message = $translator->translate(
                '{{ parameter }} must be a {{ expectedType }}, received {{ actualType }}',
                [
                    '{{ parameter }}'    => '"path"',
                    '{{ expectedType }}' => 'string',
                    '{{ actualType }}'   => $actualType,
                ]
            );

            throw new InvalidArgumentException($message, 400);
        }
    }