protected function displayJson(array $details)
    {
        $errors = 0;

        array_walk(
            $details,
            function (&$info) use (&$errors) {
                $info['file'] = (string) $info['file'];
                unset($info['template']);

                if (!$info['valid']) {
                    $info['message'] = $info['exception']->getMessage();
                    unset($info['exception']);
                    $errors++;
                }
            }
        );

        $this->line(json_encode($details, JSON_PRETTY_PRINT));

        return min($errors, 1);
    }
protected function displayJson(array $details)
    {
        $errors = 0;

        array_walk(
            $details,
            function (&$info) use (&$errors) {
                $info['file'] = (string) $info['file'];
                unset($info['template']);

                if (!$info['valid']) {
                    $info['message'] = $info['exception']->getMessage();
                    unset($info['exception']);
                    $errors++;
                }
            }
        );

        $this->line(json_encode($details, JSON_PRETTY_PRINT));

        return min($errors, 1);
    }
protected function displayJson ( array $ details ) { $ errors = 0 ; array_walk ( $ details , function ( & $ info ) use ( & $ errors ) { $ info [ 'file' ] = ( string ) $ info [ 'file' ] ; unset ( $ info [ 'template' ] ) ; if ( ! $ info [ 'valid' ] ) { $ info [ 'message' ] = $ info [ 'exception' ] -> getMessage ( ) ; unset ( $ info [ 'exception' ] ) ; $ errors ++ ; } } ) ; $ this -> line ( json_encode ( $ details , JSON_PRETTY_PRINT ) ) ; return min ( $ errors , 1 ) ; }
Output the results as json.

@param array $details Validation results from all linted files.

@return int
Output the results as json .