ArrayList::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/*
4
 * Copyright (C) 2016 Sebastian Böttger <[email protected]>
5
 * You may use, distribute and modify this code under the
6
 * terms of the MIT license.
7
 *
8
 * You should have received a copy of the MIT license with
9
 * this file. If not, please visit: https://opensource.org/licenses/mit-license.php
10
 */
11
12
namespace Seboettg\Collection;
13
14
use Seboettg\Collection\Lists\ListInterface;
15
use Seboettg\Collection\Lists\ArrayListTrait;
16
17
/**
18
 * ArrayList is a useful wrapper class for an array, similar to Java's ArrayList
19
 * @package Seboettg\Collection
20
 *
21
 * @author Sebastian Böttger <[email protected]>
22
 */
23
class ArrayList implements ListInterface
24
{
25
    use ArrayListTrait;
26
27
    /**
28
     * @var array
29
     */
30
    protected $array;
0 ignored issues
show
Coding Style introduced by
Protected member variable "array" must contain a leading underscore
Loading history...
31
32
    /**
33
     * ArrayList constructor.
34
     * @param array $data
35
     */
36 3
    public function __construct(...$data)
37
    {
38 3
        $this->array = $data;
39 3
    }
40
}
41