Passed
Push — master ( 1d60eb...03dff3 )
by Stiofan
06:44 queued 03:02
created

PlentymarketsInstaller::inflectPackageVars()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 1
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
1
<?php
2
namespace Composer\Installers;
3
4
class PlentymarketsInstaller extends BaseInstaller
5
{
6
    protected $locations = array(
7
        'plugin'   => '{$name}/'
8
    );
9
10
    /**
11
     * Remove hyphen, "plugin" and format to camelcase
12
     * @param array $vars
13
     *
14
     * @return array
15
     */
16
    public function inflectPackageVars($vars)
17
    {
18
        $vars['name'] = explode("-", $vars['name']);
19
        foreach ($vars['name'] as $key => $name) {
20
            $vars['name'][$key] = ucfirst($vars['name'][$key]);
21
            if (strcasecmp($name, "Plugin") == 0) {
22
                unset($vars['name'][$key]);
23
            }
24
        }
25
        $vars['name'] = implode("",$vars['name']);
26
27
        return $vars;
28
    }
29
}
30