Skip to content

Commit dfed560

Browse files
committed
Replace dot-twigrenderer with mezzio-twigrenderer
Signed-off-by: arhimede <[email protected]>
1 parent d43a91e commit dfed560

File tree

9 files changed

+32
-73
lines changed

9 files changed

+32
-73
lines changed

composer.json

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,48 +20,32 @@
2020
"sort-packages": true,
2121
"allow-plugins": {
2222
"dotkernel/*": true,
23-
"laminas/laminas-component-installer": true,
2423
"composer/package-versions-deprecated": true,
25-
"dealerdirect/phpcodesniffer-composer-installer": true
26-
}
27-
},
28-
"extra": {
29-
"laminas": {
30-
"component-whitelist": [
31-
"laminas/laminas-httphandlerrunner"
32-
]
33-
},
34-
"mezzio": {
35-
"component-whitelist": [
36-
"mezzio/mezzio",
37-
"mezzio/mezzio-helpers",
38-
"mezzio/mezzio-router",
39-
"mezzio/mezzio-fastroute",
40-
"mezzio/mezzio-twigrenderer"
41-
]
24+
"dealerdirect/phpcodesniffer-composer-installer": true,
25+
"laminas/laminas-component-installer": true
4226
}
4327
},
4428
"require": {
4529
"php": "~8.3.0",
4630
"dotkernel/dot-controller": "^3.4.3",
4731
"dotkernel/dot-errorhandler": "^4.0.0",
48-
"dotkernel/dot-twigrenderer": "^3.4.3",
4932
"friendsofphp/proxy-manager-lts": "^1.0.16",
5033
"laminas/laminas-component-installer": "^3.4.0",
5134
"laminas/laminas-config-aggregator": "^1.14.0",
5235
"mezzio/mezzio": "^3.18.0",
53-
"mezzio/mezzio-fastroute": "^3.11.0"
36+
"mezzio/mezzio-fastroute": "^3.11.0",
37+
"mezzio/mezzio-twigrenderer": "^2.12"
5438
},
5539
"require-dev": {
56-
"filp/whoops": "^2.15.4",
40+
"filp/whoops": "^2.16.0",
5741
"laminas/laminas-coding-standard": "^3.0",
5842
"laminas/laminas-development-mode": "^3.12.0",
59-
"phpunit/phpunit": "^10.5",
60-
"roave/security-advisories": "dev-master",
61-
"vincentlanglet/twig-cs-fixer": "^2.12",
6243
"phpstan/phpstan": "^2.0",
6344
"phpstan/phpstan-phpunit": "^2.0",
64-
"symfony/var-dumper": "^7.1"
45+
"phpunit/phpunit": "^10.5",
46+
"roave/security-advisories": "dev-master",
47+
"symfony/var-dumper": "^7.1",
48+
"vincentlanglet/twig-cs-fixer": "^3.5"
6549
},
6650
"autoload": {
6751
"psr-4": {
@@ -71,7 +55,7 @@
7155
},
7256
"autoload-dev": {
7357
"psr-4": {
74-
"LightTest\\Unit\\": "test/Unit"
58+
"LightTest\\Unit\\": "test/Unit/"
7559
}
7660
},
7761
"scripts": {
@@ -98,4 +82,4 @@
9882
"twig-cs-check": "vendor/bin/twig-cs-fixer lint --config=config/twig-cs-fixer.php",
9983
"twig-cs-fix": "vendor/bin/twig-cs-fixer lint --config=config/twig-cs-fixer.php --fix"
10084
}
101-
}
85+
}

config/autoload/local.php.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ $baseUrl = 'http://light.dotkernel.localhost';
1313

1414
return [
1515
'application' => [
16-
'name' => 'Dotkernel',
1716
'url' => $baseUrl,
1817
],
1918
];

config/autoload/templates.global.php

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,20 @@
22

33
declare(strict_types=1);
44

5-
use Dot\Twig\Extension\DateExtension;
6-
use Laminas\ServiceManager\Factory\InvokableFactory;
7-
use Mezzio\Template\TemplateRendererInterface;
8-
use Mezzio\Twig\TwigEnvironmentFactory;
9-
use Mezzio\Twig\TwigRendererFactory;
10-
use Twig\Environment;
11-
125
return [
13-
'dependencies' => [
14-
'factories' => [
15-
Environment::class => TwigEnvironmentFactory::class,
16-
TemplateRendererInterface::class => TwigRendererFactory::class,
17-
DateExtension::class => InvokableFactory::class,
18-
],
19-
],
20-
'debug' => false,
21-
'templates' => [
6+
'templates' => [
227
'extension' => 'html.twig',
238
],
24-
'twig' => [
9+
'twig' => [
2510
'assets_url' => '/',
2611
'assets_version' => null,
2712
'autoescape' => 'html',
2813
'auto_reload' => true,
2914
'cache_dir' => 'data/cache/twig',
30-
'extensions' => [
31-
DateExtension::class,
32-
],
15+
'extensions' => [],
16+
'globals' => [],
3317
'optimizations' => -1,
3418
'runtime_loaders' => [],
35-
//'timezone' => '',
36-
'globals' => [
37-
'appName' => $app['name'],
38-
],
19+
'timezone' => 'UTC',
3920
],
40-
];
21+
];

config/config.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
'config_cache_path' => 'data/cache/config-cache.php',
1313
];
1414

15+
// phpcs:disable SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName
16+
1517
$aggregator = new ConfigAggregator([
1618
// Include cache configuration
1719
new ArrayProvider($cacheConfig),
1820
\Laminas\Diactoros\ConfigProvider::class,
1921
\Mezzio\ConfigProvider::class,
2022
\Mezzio\Helper\ConfigProvider::class,
2123
\Mezzio\Router\ConfigProvider::class,
22-
\Mezzio\Twig\ConfigProvider::class,
2324
\Mezzio\Router\FastRouteRouter\ConfigProvider::class,
25+
\Mezzio\Twig\ConfigProvider::class,
2426

2527
// Dotkernel packages
2628
\Dot\ErrorHandler\ConfigProvider::class,
2729
\Dot\Log\ConfigProvider::class,
28-
\Dot\Twig\ConfigProvider::class,
29-
\Dot\FlashMessenger\ConfigProvider::class,
3030

3131
// Default App module config
3232
\Light\App\ConfigProvider::class,
@@ -44,4 +44,6 @@
4444
new PhpFileProvider(realpath(__DIR__) . '/development.config.php'),
4545
], $cacheConfig['config_cache_path']);
4646

47-
return $aggregator->getMergedConfig();
47+
// phpcs:enable SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName
48+
49+
return $aggregator->getMergedConfig();

config/twig-cs-fixer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
declare(strict_types=1);
44

5-
$config = new TwigCsFixer\Config\Config();
6-
$config->addTwigExtension(new Dot\Twig\Extension\DateExtension());
5+
use TwigCsFixer\Config\Config;
76

8-
return $config;
7+
return new Config();

phpcs.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,5 @@
1919
<file>test</file>
2020

2121
<!-- Include all rules from the Laminas Coding Standard -->
22-
<rule ref="LaminasCodingStandard">
23-
<!-- Exclude rule -->
24-
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" />
25-
</rule>
26-
</ruleset>
22+
<rule ref="LaminasCodingStandard" />
23+
</ruleset>

phpstan.neon

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ includes:
33
parameters:
44
level: 5
55
paths:
6+
- bin
7+
- config
68
- src
79
- test
8-
treatPhpDocTypesAsCertain: false
9-
ignoreErrors:
10-
-
11-
message: '#Call to method PHPUnit\\Framework\\Assert::assertInstanceOf\(\) with .* will always evaluate to true.#'
12-
path: test
13-
10+
treatPhpDocTypesAsCertain: false

src/App/templates/layout/default.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</li>
6868
<li class="nav-item">
6969
<a class="nav-link" target="_blank" href="https://www.dotkernel.com/">Dotkernel
70-
Applications</a>
70+
Applications(Skeletons)</a>
7171
</li>
7272
<li class="nav-item">
7373
<a class="nav-link" target="_blank" href="https://www.dotkernel.com/blog/">Blog</a>

test/Unit/Page/RoutesDelegatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ function () {
2525
}
2626
);
2727

28-
$this->assertInstanceOf(Application::class, $application);
28+
$this->assertContainsOnlyInstancesOf(Application::class, [$application]);
2929
}
3030
}

0 commit comments

Comments
 (0)