protected function getScriptPath() : string
    {
        $class = new \ReflectionClass($this->getClassName());
        $path = $class->getFileName();
        $path = preg_replace('/\.php$/', '.phtml', $path, -1, $count);

        if ($count !== 1) {
            throw new \RuntimeException('The class filename does not end with .php');
        }

        return $path;
    }