Skip to content

Commit

Permalink
LatteExtension: added options strictParsing & phpLinter
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 27, 2023
1 parent fc1ff9b commit 85e0340
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"nette/di": "<3.0.7",
"nette/forms": "<3.0",
"nette/schema": "<1.2",
"latte/latte": "<2.7.1 || >=3.0.0 <3.0.5 || >=3.1",
"latte/latte": "<2.7.1 || >=3.0.0 <3.0.8 || >=3.1",
"tracy/tracy": "<2.5"
},
"autoload": {
Expand Down
5 changes: 5 additions & 0 deletions src/Bridges/ApplicationDI/LatteExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function getConfigSchema(): Nette\Schema\Schema
'extensions' => Expect::arrayOf('string|Nette\DI\Definitions\Statement'),
'templateClass' => Expect::string(),
'strictTypes' => Expect::bool(false),
'strictParsing' => Expect::bool(false),
'phpLinter' => Expect::string(),
]);
}

Expand Down Expand Up @@ -74,6 +76,9 @@ public function loadConfiguration()
$this->addMacro($macro);
}
} else {
$latteFactory->addSetup('setStrictParsing', [$config->strictParsing])
->addSetup('enablePhpLinter', [$config->phpLinter]);

foreach ($config->extensions as $extension) {
$this->addExtension($extension);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationLatte/Nodes/ControlNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use Latte;
use Latte\Compiler\Escaper;
use Latte\Compiler\Nodes\Php\Expression\ArrayItemNode;
use Latte\Compiler\Nodes\Php\ArrayItemNode;
use Latte\Compiler\Nodes\Php\Expression\ArrayNode;
use Latte\Compiler\Nodes\Php\ExpressionNode;
use Latte\Compiler\Nodes\Php\ModifierNode;
Expand Down

0 comments on commit 85e0340

Please sign in to comment.