Passed
Push — main ( 23165f...4af278 )
by Miaad
01:25
created

telegram::__callStatic()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 2
1
<?php
2
3
namespace BPT\api;
4
5
class telegram {
6
    public function __call (string $name, array $arguments) {
7
        if (!isset($arguments[1]) && is_array($arguments[0])) {
8
            request::$name(...$arguments[0]);
9
        }
10
        else {
11
            request::$name($arguments);
12
        }
13
    }
14
15
    public static function __callStatic (string $name, array $arguments) {
16
        if (!isset($arguments[1]) && is_array($arguments[0])) {
17
            request::$name(...$arguments[0]);
18
        }
19
        else {
20
            request::$name(...$arguments);
21
        }
22
    }
23
}