protected function findInPaths(string $name, array $paths): array
    {
        foreach ($paths as $path) {
            foreach ($this->getPossibleViewFiles($name) as $fileInfos) {
                $viewPath = $path . \DIRECTORY_SEPARATOR . $fileInfos['file'];

                if ($this->files->has($viewPath)) {
                    return [
                        'path'      => $viewPath,
                        'name'      => $fileInfos['file'],
                        'extension' => $fileInfos['extension'],
                    ];
                }
            }
        }

        throw new InvalidArgumentException(\sprintf('View [%s] not found.', $name));
    }