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

AbstractProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAll() 0 4 1
A extend() 0 6 3
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