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
19
19
*/
20
20
public function inflectPackageVars ($ vars )
21
21
{
22
+ if ($ vars ['type ' ] === 'winter-module ' ) {
23
+ return $ this ->inflectModuleVars ($ vars );
24
+ }
25
+
22
26
if ($ vars ['type ' ] === 'winter-plugin ' ) {
23
27
return $ this ->inflectPluginVars ($ vars );
24
28
}
@@ -29,18 +33,25 @@ public function inflectPackageVars($vars)
29
33
30
34
return $ vars ;
31
35
}
36
+
37
+ protected function inflectModuleVars ($ vars )
38
+ {
39
+ $ vars ['name ' ] = preg_replace ('/^wn-|-module$/ ' , '' , $ vars ['name ' ]);
40
+
41
+ return $ vars ;
42
+ }
32
43
33
44
protected function inflectPluginVars ($ vars )
34
45
{
35
- $ vars ['name ' ] = preg_replace ('/^oc -|-plugin$/ ' , '' , $ vars ['name ' ]);
46
+ $ vars ['name ' ] = preg_replace ('/^wn -|-plugin$/ ' , '' , $ vars ['name ' ]);
36
47
$ vars ['vendor ' ] = preg_replace ('/[^a-z0-9_]/i ' , '' , $ vars ['vendor ' ]);
37
48
38
49
return $ vars ;
39
50
}
40
51
41
52
protected function inflectThemeVars ($ vars )
42
53
{
43
- $ vars ['name ' ] = preg_replace ('/^oc -|-theme$/ ' , '' , $ vars ['name ' ]);
54
+ $ vars ['name ' ] = preg_replace ('/^wn -|-theme$/ ' , '' , $ vars ['name ' ]);
44
55
45
56
return $ vars ;
46
57
}
Original file line number Diff line number Diff line change @@ -84,6 +84,14 @@ public function packageNameInflectionProvider()
84
84
'acme ' ,
85
85
'someothertheme ' ,
86
86
),
87
+ // tests modules
88
+ array (
89
+ 'winter-module ' ,
90
+ 'winter ' ,
91
+ 'wn-system-module ' ,
92
+ 'winter ' ,
93
+ 'system ' ,
94
+ ),
87
95
);
88
96
}
89
97
}
You can’t perform that action at this time.
0 commit comments