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

YawikInstaller::inflectPackageVars()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 8
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: cbleek
5
 * Date: 25.03.16
6
 * Time: 20:55
7
 */
8
9
namespace Composer\Installers;
10
11
12 View Code Duplication
class YawikInstaller extends BaseInstaller
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    protected $locations = array(
15
        'module'  => 'module/{$name}/',
16
    );
17
18
    /**
19
     * Format package name to CamelCase
20
     * @param array $vars
21
     *
22
     * @return array
23
     */
24
    public function inflectPackageVars($vars)
25
    {
26
        $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
        $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
        $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
30
        return $vars;
31
    }
32
}