Completed
Push — master ( a84454...13fcd8 )
by Camilo
06:24
created

ResultArray   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace unreal4u\TelegramAPI\Telegram\Types\Custom;
5
6
use unreal4u\TelegramAPI\Abstracts\CustomType;
7
use Psr\Log\LoggerInterface;
8
9
/**
10
 * Mainly used if we have no clue what type of (new?) object the API is returning us
11
 */
12
class ResultArray extends CustomType
13
{
14
    /**
15
     * @var string
16
     */
17
    public $data = '';
18
19 1
    public function __construct(array $result, LoggerInterface $logger = null)
20
    {
21 1
        $this->logger = $logger;
22 1
        $this->data = json_encode($result);
23 1
    }
24
25
    /**
26
     * Return the data
27
     * @return string
28
     */
29
    public function __toString()
30
    {
31
        return $this->data;
32
    }
33
}
34