Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | public function run() |
||
8 | { |
||
9 | $json = $this->getJsonData(); |
||
10 | |||
11 | if (isset($json['extra'])) { |
||
12 | GeneralMethods::outputToScreen("<li> already has composer.json[extra][installer-name] </li>"); |
||
13 | |||
14 | return; |
||
15 | } else { |
||
16 | GeneralMethods::outputToScreen("<li> Adding 'extra' array to composer.json </li>"); |
||
17 | if (! isset($json['extra'])) { |
||
18 | $json['extra'] = []; |
||
19 | } |
||
20 | $json['extra']['installer-name'] = str_replace('silverstripe-', '', $this->composerJsonObj->moduleName); |
||
21 | } |
||
22 | $this->setJsonData($json); |
||
23 | } |
||
24 | } |
||
25 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.