ShakeAround   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __get() 0 7 2
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