Card   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 8
c 1
b 0
f 1
dl 0
loc 58
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A delete() 0 3 1
A __get() 0 3 1
A asStripeCard() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Phalcon\Cashier;
4
5
use Stripe\Card as StripeCard;
6
7
class Card
8
{
9
    /**
10
     * The Stripe model instance.
11
     *
12
     * @var Users
0 ignored issues
show
Bug introduced by
The type Phalcon\Cashier\Users was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
     */
14
    protected $user;
15
16
    /**
17
     * The Stripe card instance.
18
     *
19
     * @var \Stripe\Card
20
     */
21
    protected $card;
22
23
    /**
24
     * Create a new card instance.
25
     *
26
     * @param  Users  $user
27
     * @param  \Stripe\Card  $card
28
     * @return void
29
     */
30
    public function __construct($user, StripeCard $card)
31
    {
32
        $this->card = $card;
33
        $this->user = $user;
34
    }
35
36
    /**
37
     * Delete the card.
38
     *
39
     * @return \Stripe\Card
40
     */
41
    public function delete()
42
    {
43
        return $this->card->delete();
44
    }
45
46
    /**
47
     * Get the Stripe card instance.
48
     *
49
     * @return \Stripe\Card
50
     */
51
    public function asStripeCard()
52
    {
53
        return $this->card;
54
    }
55
56
    /**
57
     * Dynamically get values from the Stripe card.
58
     *
59
     * @param  string  $key
60
     * @return mixed
61
     */
62
    public function __get($key)
63
    {
64
        return $this->card->{$key};
65
    }
66
}
67