private static function loadDefinitionsFromFile(string $file): array
    {
        if (!\is_file($file) || !\is_readable($file)) {
            // @codeCoverageIgnoreStart
            throw new \RuntimeException(\sprintf('"%s" must be a readable file', $file));
            // @codeCoverageIgnoreEnd
        }

        $definitions = require $file;

        if (!\is_array($definitions)) {
            throw new \RuntimeException(
                \sprintf('Definitions file should return an array. "%s" returned', \gettype($definitions))
            );
        }

        return $definitions;
    }