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

Symfony1Installer::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
namespace Composer\Installers;
3
4
/**
5
 * Plugin installer for symfony 1.x
6
 *
7
 * @author Jérôme Tamarelle <[email protected]>
8
 */
9 View Code Duplication
class Symfony1Installer 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...
10
{
11
    protected $locations = array(
12
        'plugin'    => 'plugins/{$name}/',
13
    );
14
15
    /**
16
     * Format package name to CamelCase
17
     */
18
    public function inflectPackageVars($vars)
19
    {
20
        $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
21
            return strtoupper($matches[0][1]);
22
        }, $vars['name']);
23
24
        return $vars;
25
    }
26
}
27