File tree Expand file tree Collapse file tree 4 files changed +44
-3
lines changed
Expand file tree Collapse file tree 4 files changed +44
-3
lines changed Original file line number Diff line number Diff line change 2222 "source" : " https://github.com/cakephp/twig-view"
2323 },
2424 "require" : {
25+ "php" : " >=8.1" ,
2526 "cakephp/cakephp" : " ^5.0.0" ,
2627 "jasny/twig-extensions" : " ^1.3" ,
2728 "twig/markdown-extra" : " ^3.0" ,
5051 }
5152 },
5253 "scripts" : {
53- "cs-check" : " phpcs --colors --parallel=16 -p src/ tests/ " ,
54- "cs-fix" : " phpcbf --colors --parallel=16 -p src/ tests/ " ,
54+ "cs-check" : " phpcs --colors --parallel=16 -p" ,
55+ "cs-fix" : " phpcbf --colors --parallel=16 -p" ,
5556 "phpstan" : " tools/phpstan analyse" ,
5657 "stan" : " @phpstan" ,
5758 "phpstan-baseline" : " tools/phpstan --generate-baseline" ,
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * CakePHP TwigView Plugin - Example Configuration
4+ *
5+ * Copy the relevant settings to your application's config/app.php or config/app_local.php.
6+ *
7+ * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
8+ * @link https://cakephp.org CakePHP(tm) Project
9+ * @license https://opensource.org/licenses/mit-license.php MIT License
10+ */
11+
12+ return [
13+ /**
14+ * TwigView Plugin Configuration
15+ *
16+ * These settings control the behavior of the TwigView plugin.
17+ */
18+ 'TwigView ' => [
19+ /**
20+ * Use underscore command names.
21+ *
22+ * When `true`, registers `twig_view compile` (with underscore).
23+ * When `false` or not set, registers `twig-view compile` (deprecated, with hyphen).
24+ *
25+ * Upgrade path:
26+ * 1. Update your scripts/CI to use `twig_view compile`
27+ * 2. Set this to `true`
28+ */
29+ 'useUnderscoreCommands ' => true ,
30+ ],
31+ ];
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
22<ruleset name =" TwigView" >
3+ <file >src/</file >
4+ <file >tests/</file >
5+
36 <rule ref =" CakePHP" />
47</ruleset >
Original file line number Diff line number Diff line change 2020
2121use Cake \Console \CommandCollection ;
2222use Cake \Core \BasePlugin ;
23+ use Cake \Core \Configure ;
2324use Cake \TwigView \Command \CompileCommand ;
2425
2526/**
@@ -46,7 +47,12 @@ class TwigViewPlugin extends BasePlugin
4647 */
4748 public function console (CommandCollection $ commands ): CommandCollection
4849 {
49- $ commands ->add ('twig-view compile ' , CompileCommand::class);
50+ if (Configure::read ('TwigView.useUnderscoreCommands ' )) {
51+ $ commands ->add ('twig_view compile ' , CompileCommand::class);
52+ } else {
53+ // Deprecated: use `'TwigView.useUnderscoreCommands' => true` to switch to `twig_view compile`
54+ $ commands ->add ('twig-view compile ' , CompileCommand::class);
55+ }
5056
5157 return $ commands ;
5258 }
You can’t perform that action at this time.
0 commit comments