Completed
Push — master ( 6d01ad...9b4680 )
by
unknown
10:02 queued 06:58
created

Collector::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Blast Project package.
5
 *
6
 * Copyright (C) 2015-2017 Libre Informatique
7
 *
8
 * This file is licenced under the GNU LGPL v3.
9
 * For the full copyright and license information, please view the LICENSE.md
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Blast\CoreBundle\Profiler;
14
15
class Collector
16
{
17
    /**
18
     * @var mixed
19
     */
20
    private $data;
21
22
    public function __construct()
23
    {
24
        $this->data = [];
25
    }
26
27
    /**
28
     * @param mixed $data
29
     *
30
     * @return Collector
31
     */
32
    public function collect($name, $data, $destination = DataCollection::DESTINATION_PROFILER, $type = null)
33
    {
34
        $dataCollection = new DataCollection($name, $data, $destination, $type);
35
        $this->data[] = $dataCollection;
36
37
        return $this;
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getData()
44
    {
45
        return $this->data;
46
    }
47
}
48