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

WhiteList::adjustWhiteList()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 16
rs 9.4286
cc 2
eloc 8
nc 2
nop 1
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