InlineBaseObject   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 13 2
1
<?php
2
namespace Telegram\Bot\Objects\InlineQuery;
3
4
use BadMethodCallException;
5
use Illuminate\Support\Collection;
6
use Illuminate\Support\Str;
7
8
abstract class InlineBaseObject extends Collection
9
{
10
11
    /**
12
     * Magic method to set properties dynamically.
13
     *
14
     * @param $name
15
     * @param $arguments
16
     *
17
     * @return $this|mixed
18
     */
19
    public function __call($name, $arguments)
20
    {
21
        $action = substr($name, 0, 3);
22
23
        if ($action === 'set') {
24
            $property = Str::snake(substr($name, 3));
25
            $this->put($property, $arguments[0]);
26
27
            return $this;
28
        }
29
30
        throw new BadMethodCallException("Method {$name} does not exist.");
31
    }
32
}
33