Completed
Pull Request — master (#328)
by
unknown
01:09
created

AbstractProvider::extend()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 2
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of Crawler Detect - the web crawler detection library.
5
 *
6
 * (c) Mark Beech <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Jaybizzle\CrawlerDetect\Fixtures;
13
14
abstract class AbstractProvider
15
{
16
    /**
17
     * The data set.
18
     *
19
     * @var array
20
     */
21
    protected $data;
22
23
    /**
24
     * Return the data set.
25
     *
26
     * @return array
27
     */
28
    public function getAll()
29
    {
30
        return $this->data;
31
    }
32
33
    /**
34
     * Extend the data set.
35
     *
36
     * @param array $data
37
     */
38
    public function extend($data)
39
    {
40
        if (is_array($data) && count($data)) {
41
            $this->data = array_merge($this->data, $data);
42
        }
43
    }
44
}
45