nette / docs

đź“– The Nette documentation
https://nette.org/en/writing
116 stars 281 forks source link

Custom latte linter - code doesn't work #1029

Closed Gappa closed 10 months ago

Gappa commented 10 months ago

Docs affected:

Bug Description

The code doesn't work - $engine is undefined (but that works as null), $path is also undefined and that fails. $linter is overwritten a few lines below.

$ bin/test app/
PHP Fatal error:  Uncaught TypeError: Latte\Tools\Linter::scanDirectory(): Argument #1 ($path) must be of type string, null given, called in /{path_to_project}/bin/test on line 8 and defined in /{path_to_project}/vendor/latte/latte/src/Tools/Linter.php:28
Stack trace:
#0 /{path_to_project}/bin/test(8): Latte\Tools\Linter->scanDirectory()
#1 {main}
  thrown in /{path_to_project}/vendor/latte/latte/src/Tools/Linter.php on line 28 

Steps To Reproduce

Create the custom latte-lint file and run it (minding the example addExtension code - either add some or disable it).

Expected Behavior

Linter runs and reports found errors.

Possible Solution

Remove those two lines.

dg commented 10 months ago

fixed