diff --git a/README.md b/README.md index 710e519..5304f67 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # Laravel Blade Lint -[![Laravel 5.7](https://img.shields.io/badge/Laravel-5.7-green.svg)](https://github.com/laravel/framework/tree/5.7) -[![Laravel 5.6](https://img.shields.io/badge/Laravel-5.6-green.svg)](https://github.com/laravel/framework/tree/5.6) -[![Laravel 5.5](https://img.shields.io/badge/Laravel-5.5-green.svg)](https://github.com/laravel/framework/tree/5.5) -[![Laravel 5.4](https://img.shields.io/badge/Laravel-5.4-green.svg)](https://github.com/laravel/framework/tree/5.4) +[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-green.svg)](https://github.com/laravel/framework/tree/10.x) +[![Laravel 9.x](https://img.shields.io/badge/Laravel-9.x-green.svg)](https://github.com/laravel/framework/tree/9.x) +[![Laravel 8.x](https://img.shields.io/badge/Laravel-8.x-green.svg)](https://github.com/laravel/framework/tree/8.x) +[![Laravel 7.x](https://img.shields.io/badge/Laravel-7.x-green.svg)](https://github.com/laravel/framework/tree/7.x) +[![Laravel 6.x](https://img.shields.io/badge/Laravel-6.x-green.svg)](https://github.com/laravel/framework/tree/6.x) +[![Laravel 5.x](https://img.shields.io/badge/Laravel-5.x-green.svg)](https://github.com/laravel/framework/tree/5.8) Laravel console command to check syntax of blade templates. @@ -18,7 +20,7 @@ Perhaps it works with lesser versions as well, but this is untested. Add package via composer: - composer require magentron/laravel-blade-lint + composer require --dev magentron/laravel-blade-lint For Laravel version < 5.5, edit `config/app.php`, add the following to the `providers` array: diff --git a/src/Magentron/BladeLint/Console/Commands/BladeLint.php b/src/Magentron/BladeLint/Console/Commands/BladeLint.php index b5bb7fc..b95a037 100644 --- a/src/Magentron/BladeLint/Console/Commands/BladeLint.php +++ b/src/Magentron/BladeLint/Console/Commands/BladeLint.php @@ -29,7 +29,9 @@ class BladeLint extends Command * * @var string */ - protected $signature = 'blade:lint {path?*}'; + protected $signature = 'blade:lint + {--debug : Enable debug output, which consists of the compiled templates (PHP code)} + {path?*}'; /** * The console command description. @@ -142,10 +144,13 @@ protected function checkBladeSyntaxFiles(array $blades) // compile the file and send it to the linter process $compiled = Blade::compileString(file_get_contents($file)); + if ($this->input->getOption('debug')) { + $this->comment($compiled, OutputInterface::VERBOSITY_QUIET); + } if (! $this->lint($compiled, $output, $error)) { ++$errorCount; - $error = str_replace("Standard input code", $file->getPathname(), rtrim($error)); + $error = str_replace("Standard input code", $file, rtrim($error)); $this->error($error, OutputInterface::VERBOSITY_QUIET); $maxMessageLength = 0; }