Completed
Push — master ( 7eec5f...b860e6 )
by Lorenzo
14:21
created

WhiteList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A adjustWhiteList() 0 16 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Lore
5
 * Date: 11/01/2016
6
 * Time: 09:32
7
 */
8
9
namespace Padosoft\LaravelComposerSecurity;
10
11
12
class WhiteList
13
{
14
    /**
15
     * @param $white
16
     * @return array
17
     */
18
    public static function adjustWhiteList($white)
19
    {
20
        if ($white == '') {
21
            return array();
22
        }
23
24
        $w = explode(",", str_replace('\\', '/', $white));
25
26
        $whitelist = array_map(function ($item) {
27
            return str_finish($item, '/');
28
        },
29
            $w
30
        );
31
32
        return $whitelist;
33
    }
34
}
35