ServerVariableTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getServerVar() 0 4 2
1
<?php
2
3
namespace yiicod\fileupload\components\traits;
4
5
/**
6
 * Trait ServerVariableTrait
7
 *
8
 * @package yiicod\fileupload\common
9
 */
10
trait ServerVariableTrait
11
{
12
    /**
13
     * Get server variable
14
     *
15
     * @param string $name
16
     */
17
    protected function getServerVar(string $name)
18
    {
19
        return isset($_SERVER[$name]) ? $_SERVER[$name] : null;
20
    }
21
}
22