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

BaseEntry   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 29
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A set() 0 6 1
A get() 0 4 1
A toArray() 0 4 1
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
}