Completed
Push — 2.0-dev ( 0f31c9...13891e )
by Takehiro
03:05
created

Column::delete()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
namespace Kwkm\MkLiveStatusClient;
3
4
/**
5
 * Class Column
6
 *
7
 * @package Kwkm\MkLiveStatusClient
8
 * @author Takehiro Kawakami <[email protected]>
9
 * @license MIT
10
 */
11
class Column
12
{
13
    private $columns;
14
15
    public function __construct($columns = array())
16
    {
17
        $this->columns = $columns;
18
    }
19
20
    public function add($column)
21
    {
22
        $this->columns[] = $column;
23
    }
24
25
    public function delete($column)
26
    {
27
        $index = array_search($column, $this->columns);
28
        if ($index !== null) {
29
            unset($this->columns[$index]);
30
        }
31
    }
32
33
    public function get()
34
    {
35
        return $this->columns;
36
    }
37
}