Passed
Pull Request — master (#183)
by
unknown
03:23
created

MauticInstaller   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A inflectPackageVars() 0 10 2
1
<?php
2
namespace Composer\Installers;
3
4
class MauticInstaller extends BaseInstaller
5
{
6
    protected $locations = array(
7
        'plugin' => 'plugins/{$name}/',
8
        'theme' => 'themes/{$name}/',
9
    );
10
11
    /**
12
     * Format package name of mautic-plugins to CamelCase
13
     */
14
    public function inflectPackageVars($vars)
15
    {
16
        if ($vars['type'] == 'mautic-plugin') {
17
            $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
18
                return strtoupper($matches[0][1]);
19
            }, ucfirst($vars['name']));
20
        }
21
22
        return $vars;
23
    }
24
25
}
26