File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
tests/Composer/Installers/Test Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ class WinterInstaller extends BaseInstaller
1919 */
2020 public function inflectPackageVars ($ vars )
2121 {
22+ if ($ vars ['type ' ] === 'winter-module ' ) {
23+ return $ this ->inflectModuleVars ($ vars );
24+ }
25+
2226 if ($ vars ['type ' ] === 'winter-plugin ' ) {
2327 return $ this ->inflectPluginVars ($ vars );
2428 }
@@ -29,18 +33,25 @@ public function inflectPackageVars($vars)
2933
3034 return $ vars ;
3135 }
36+
37+ protected function inflectModuleVars ($ vars )
38+ {
39+ $ vars ['name ' ] = preg_replace ('/^wn-|-module$/ ' , '' , $ vars ['name ' ]);
40+
41+ return $ vars ;
42+ }
3243
3344 protected function inflectPluginVars ($ vars )
3445 {
35- $ vars ['name ' ] = preg_replace ('/^oc -|-plugin$/ ' , '' , $ vars ['name ' ]);
46+ $ vars ['name ' ] = preg_replace ('/^wn -|-plugin$/ ' , '' , $ vars ['name ' ]);
3647 $ vars ['vendor ' ] = preg_replace ('/[^a-z0-9_]/i ' , '' , $ vars ['vendor ' ]);
3748
3849 return $ vars ;
3950 }
4051
4152 protected function inflectThemeVars ($ vars )
4253 {
43- $ vars ['name ' ] = preg_replace ('/^oc -|-theme$/ ' , '' , $ vars ['name ' ]);
54+ $ vars ['name ' ] = preg_replace ('/^wn -|-theme$/ ' , '' , $ vars ['name ' ]);
4455
4556 return $ vars ;
4657 }
Original file line number Diff line number Diff line change @@ -84,6 +84,14 @@ public function packageNameInflectionProvider()
8484 'acme ' ,
8585 'someothertheme ' ,
8686 ),
87+ // tests modules
88+ array (
89+ 'winter-module ' ,
90+ 'winter ' ,
91+ 'wn-system-module ' ,
92+ 'winter ' ,
93+ 'system ' ,
94+ ),
8795 );
8896 }
8997}
You can’t perform that action at this time.
0 commit comments