ShakeAround::__get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyWeChat\OfficialAccount\ShakeAround;
13
14
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
15
16
/**
17
 * Class Card.
18
 *
19
 * @author overtrue <[email protected]>
20
 *
21
 * @property \EasyWeChat\OfficialAccount\ShakeAround\DeviceClient   $device
22
 * @property \EasyWeChat\OfficialAccount\ShakeAround\GroupClient    $group
23
 * @property \EasyWeChat\OfficialAccount\ShakeAround\MaterialClient $material
24
 * @property \EasyWeChat\OfficialAccount\ShakeAround\RelationClient $relation
25
 * @property \EasyWeChat\OfficialAccount\ShakeAround\StatsClient    $stats
26
 * @property \EasyWeChat\OfficialAccount\ShakeAround\PageClient     $page
27
 */
28
class ShakeAround extends Client
29
{
30
    /**
31
     * @param string $property
32
     *
33
     * @return mixed
34
     *
35
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
36
     */
37 1
    public function __get($property)
38
    {
39 1
        if (isset($this->app["shake_around.{$property}"])) {
40 1
            return $this->app["shake_around.{$property}"];
41
        }
42
43 1
        throw new InvalidArgumentException(sprintf('No shake_around service named "%s".', $property));
44
    }
45
}
46