Card   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\Card;
13
14
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
15
16
/**
17
 * Class Card.
18
 *
19
 * @author overtrue <[email protected]>
20
 *
21
 * @property \EasyWeChat\OfficialAccount\Card\CodeClient          $code
22
 * @property \EasyWeChat\OfficialAccount\Card\MeetingTicketClient $meeting_ticket
23
 * @property \EasyWeChat\OfficialAccount\Card\MemberCardClient    $member_card
24
 * @property \EasyWeChat\OfficialAccount\Card\GeneralCardClient   $general_card
25
 * @property \EasyWeChat\OfficialAccount\Card\MovieTicketClient   $movie_ticket
26
 * @property \EasyWeChat\OfficialAccount\Card\CoinClient          $coin
27
 * @property \EasyWeChat\OfficialAccount\Card\SubMerchantClient   $sub_merchant
28
 * @property \EasyWeChat\OfficialAccount\Card\BoardingPassClient  $boarding_pass
29
 * @property \EasyWeChat\OfficialAccount\Card\JssdkClient         $jssdk
30
 * @property \EasyWeChat\OfficialAccount\Card\GiftCardClient      $gift_card
31
 * @property \EasyWeChat\OfficialAccount\Card\GiftCardOrderClient $gift_card_order
32
 * @property \EasyWeChat\OfficialAccount\Card\GiftCardPageClient  $gift_card_page
33
 * @property \EasyWeChat\OfficialAccount\Card\InvoiceClient       $invoice
34
 */
35
class Card extends Client
36
{
37
    /**
38
     * @param string $property
39
     *
40
     * @return mixed
41
     *
42
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
43
     */
44 1
    public function __get($property)
45
    {
46 1
        if (isset($this->app["card.{$property}"])) {
47 1
            return $this->app["card.{$property}"];
48
        }
49
50 1
        throw new InvalidArgumentException(sprintf('No card service named "%s".', $property));
51
    }
52
}
53