ExampleFile   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setDirectory() 0 6 2
A __construct() 0 3 1
1
<?php
2
/**
3
 * @author: jiangyi
4
 * @date: 下午9:53 2018/11/28
5
 */
6
7
namespace Hello;
8
9
class ExampleFile
10
{
11
    protected $id;
12
    protected $directory;
13
14
    public function __construct($id)
15
    {
16
        $this->id = $id;
17
    }
18
19
    public function setDirectory($directory)
20
    {
21
        $this->directory = $directory . DIRECTORY_SEPARATOR . $this->id;
22
23
        if (!file_exists($this->directory)) {
24
            mkdir($this->directory, 0700, true);
25
        }
26
    }
27
}
28