src/DataCollector/ViewCollector.php
public function addView(View $view)
    {
        $name = $view->getName();
        $path = $view->getPath();

        if (!is_object($path)) {
            if ($path) {
                $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
            }

            if (substr($path, -10) == '.blade.php') {
                $type = 'blade';
            } else {
                $type = pathinfo($path, PATHINFO_EXTENSION);
            }
        } else {
            $type = get_class($view);
            $path = '';
        }

        if (!$this->collect_data) {
            $params = array_keys($view->getData());
        } else {
            $data = [];
            foreach ($view->getData() as $key => $value) {
                $data[$key] = $this->exporter->exportValue($value);
            }
            $params = $data;
        }

        $this->templates[] = [
            'name'        => $path ? sprintf('%s (%s)', $name, $path) : $name,
            'param_count' => count($params),
            'params'      => $params,
            'type'        => $type,
        ];
    }
public function addView(View $view)
    {
        $name = $view->getName();
        $path = $view->getPath();

        if (!is_object($path)) {
            if ($path) {
                $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
            }

            if (substr($path, -10) == '.blade.php') {
                $type = 'blade';
            } else {
                $type = pathinfo($path, PATHINFO_EXTENSION);
            }
        } else {
            $type = get_class($view);
            $path = '';
        }

        if (!$this->collect_data) {
            $params = array_keys($view->getData());
        } else {
            $data = [];
            foreach ($view->getData() as $key => $value) {
                $data[$key] = $this->exporter->exportValue($value);
            }
            $params = $data;
        }

        $this->templates[] = [
            'name'        => $path ? sprintf('%s (%s)', $name, $path) : $name,
            'param_count' => count($params),
            'params'      => $params,
            'type'        => $type,
        ];
    }
public function addView ( View $ view ) { $ name = $ view -> getName ( ) ; $ path = $ view -> getPath ( ) ; if ( ! is_object ( $ path ) ) { if ( $ path ) { $ path = ltrim ( str_replace ( base_path ( ) , '' , realpath ( $ path ) ) , '/' ) ; } if ( substr ( $ path , - 10 ) == '.blade.php' ) { $ type = 'blade' ; } else { $ type = pathinfo ( $ path , PATHINFO_EXTENSION ) ; } } else { $ type = get_class ( $ view ) ; $ path = '' ; } if ( ! $ this -> collect_data ) { $ params = array_keys ( $ view -> getData ( ) ) ; } else { $ data = [ ] ; foreach ( $ view -> getData ( ) as $ key => $ value ) { $ data [ $ key ] = $ this -> exporter -> exportValue ( $ value ) ; } $ params = $ data ; } $ this -> templates [ ] = [ 'name' => $ path ? sprintf ( '%s (%s)' , $ name , $ path ) : $ name , 'param_count' => count ( $ params ) , 'params' => $ params , 'type' => $ type , ] ; }
Add a View instance to the Collector

@param \Illuminate\View\View $view
Add a View instance to the Collector