Skip to content

Commit

Permalink
TexyExtension: compatibility with Nette 3
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Dec 2, 2018
1 parent 5628815 commit fa9ed02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Bridges/TexyDI/TexyExtension.php
Expand Up @@ -56,12 +56,8 @@ public function beforeCompile(): void
if (!class_exists(Nepada\TemplateFactory\TemplateConfigurator::class)) {
return;
}
$templateConfigurator = $container->getByType(Nepada\TemplateFactory\TemplateConfigurator::class);
if ($templateConfigurator === null) {
throw new \LogicException('Could not find TemplateConfigurator service, did you register TemplateFactoryExtension in your configuration?');
}
$container->getDefinition($templateConfigurator)
->addSetup('addFilter', ['texy', [$this->prefix('@latteFilters'), 'process']])
$templateConfigurator = $container->getDefinitionByType(Nepada\TemplateFactory\TemplateConfigurator::class);
$templateConfigurator->addSetup('addFilter', ['texy', [$this->prefix('@latteFilters'), 'process']])
->addSetup('addFilter', ['texyLine', [$this->prefix('@latteFilters'), 'processLine']])
->addSetup('addFilter', ['texyTypo', [$this->prefix('@latteFilters'), 'processTypo']])
->addSetup('addProvider', ['texy', $this->prefix('@multiplier')])
Expand Down
5 changes: 5 additions & 0 deletions tests/phpstan.neon
Expand Up @@ -11,3 +11,8 @@ parameters:
ignoredExceptions:
- LogicException
- Nette\InvalidStateException

ignoreErrors:
- '#Call to an undefined method Nette\\DI\\Definitions\\Definition::addSetup\(\)#' # it's actually ServiceDefinition, cannot use phpdoc hint because of BC with Nette 2.4

reportUnmatchedIgnoredErrors: false

0 comments on commit fa9ed02

Please sign in to comment.