Sns::__get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 0
cts 4
cp 0
crap 6
rs 10
1
<?php
2
3
namespace EasyIM\TencentIM\Sns;
4
5
use EasyIM\Kernel\Exceptions\InvalidArgumentException;
6
7
/**
8
 * Class Sns
9
 *
10
 * @package EasyIM\TencentIM\Sns
11
 * @author  longing <[email protected]>
12
 */
13
class Sns extends Client
14
{
15
    /**
16
     *
17
     * @param string $property
18
     *
19
     * @return mixed
20
     * @throws InvalidArgumentException
21
     */
22
    public function __get(string $property)
23
    {
24
        if (isset($this->app["sns.{$property}"])) {
25
            return $this->app["sns.{$property}"];
26
        }
27
28
        throw new InvalidArgumentException(sprintf('No Sns service named "%s".', $property));
29
    }
30
}
31