Completed
Push — master ( 315749...e0be30 )
by Алексей
03:54
created

BaseEntry::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: akeinhell
5
 * Date: 06.11.2016
6
 * Time: 11:37
7
 */
8
9
namespace Telegram\Base;
10
11
12
class BaseEntry
13
{
14
    protected $attributes;
15
16
    /**
17
     * BaseEntry constructor.
18
     */
19
    public function __construct()
20
    {
21
        $this->attributes = collect();
22
    }
23
24
    protected function set($key, $value)
25
    {
26
        $this->attributes->put($key, $value);
27
28
        return $this;
29
    }
30
31
    protected function get($key, $default = null)
32
    {
33
        return $this->attributes->get($key, $default);
34
    }
35
36
    public function toArray()
37
    {
38
        return $this->attributes->toArray();
39
    }
40
}