src/Leevel/View/Console/Cache.php
protected function composerPaths(): array
    {
        $path = $this->app->path().'/composer.json';

        if (!is_file($path)) {
            return [];
        }

        $options = $this->getFileContent($path);

        $paths = !empty($options['extra']['leevel-console']['view-cache']['paths']) ?
            $options['extra']['leevel-console']['view-cache']['paths'] : [];

        $path = $this->app->path();

        $paths = array_map(function (string $value) use ($path) {
            if (!is_file($value)) {
                $value = $path.'/'.$value;
            }

            if (!is_dir($value)) {
                throw new RuntimeException(
                    sprintf('View dir %s is not exist.', $value)
                );
            }

            return $value;
        }, $paths);

        return $paths;
    }
protected function composerPaths(): array
    {
        $path = $this->app->path().'/composer.json';

        if (!is_file($path)) {
            return [];
        }

        $options = $this->getFileContent($path);

        $paths = !empty($options['extra']['leevel-console']['view-cache']['paths']) ?
            $options['extra']['leevel-console']['view-cache']['paths'] : [];

        $path = $this->app->path();

        $paths = array_map(function (string $value) use ($path) {
            if (!is_file($value)) {
                $value = $path.'/'.$value;
            }

            if (!is_dir($value)) {
                throw new RuntimeException(
                    sprintf('View dir %s is not exist.', $value)
                );
            }

            return $value;
        }, $paths);

        return $paths;
    }
取得应用的 composer 配置.

@return array