Skip to content

Commit

Permalink
allow nette/utils 4.0, remove support for latte 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Gappa committed Jan 23, 2023
1 parent 3757fa6 commit b15cb90
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 63 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"nette/di": "^3.0",
"nette/http": "^3.1",
"nette/schema": "^1.0",
"nette/utils": "^3.2",
"nette/utils": "^3.2 || ^4.0",
"imagine/imagine": "^1.2.3"
},
"require-dev": {
Expand All @@ -29,8 +29,8 @@
"psr-4": { "Nelson\\Resizer\\Tests\\": "tests/" }
},
"scripts": {
"phpstan": "./phpstan/phpstan",
"tests": "./vendor/bin/phpunit --configuration tests/phpunit.xml tests"
"phpstan": "@php ./vendor/bin/phpstan analyse --configuration ./phpstan/phpstan.neon --memory-limit 512M",
"tests": "@php ./vendor/bin/phpunit --configuration tests/phpunit.xml tests"
},
"config": {
"allow-plugins": {
Expand Down
3 changes: 0 additions & 3 deletions phpstan/phpstan

This file was deleted.

9 changes: 2 additions & 7 deletions src/DI/ResizerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ public function beforeCompile(): void
$latteFactoryDef = $this->getLatteFactoryDefinition();
$latteFactoryDef->addSetup('addFilter', ['resize', [$this->prefix('@default'), 'resize']]);

if (version_compare(Engine::VERSION, '3', '<')) {
// Latte 2.x
$latteFactoryDef->addSetup('Nelson\Resizer\Latte\Macros::install(?->getCompiler())', ['@self']);
} else {
// Latte 3.x
$latteFactoryDef->addSetup('addExtension', [new LatteResizerExtension]);
}
// Latte 3.x
$latteFactoryDef->addSetup('addExtension', [new LatteResizerExtension]);

// Presenter mappings
$mapping = [self::PRESENTER_MAPPING => '\Nelson\Resizer\Presenters\*Presenter'];
Expand Down
50 changes: 0 additions & 50 deletions src/Latte/Macros.php

This file was deleted.

0 comments on commit b15cb90

Please sign in to comment.