Failed Conditions
Push — master ( dc6c53...ed3b11 )
by Maximo
01:10 queued 11s
created

PaymentMethods   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 76
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 4 1
A getSource() 0 4 1
A getDefault() 0 4 1
A getId() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Canvas\Models;
5
6
class PaymentMethods extends AbstractModel
7
{
8
    /**
9
     *
10
     * @var integer
11
     */
12
    public $id;
13
14
    /**
15
     *
16
     * @var string
17
     */
18
    public $name;
19
20
    /**
21
     *
22
     * @var integer
23
     */
24
    public $is_default;
0 ignored issues
show
Coding Style introduced by
$is_default does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
25
26
    /**
27
     *
28
     * @var string
29
     */
30
    public $created_at;
0 ignored issues
show
Coding Style introduced by
$created_at does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
31
32
    /**
33
     *
34
     * @var string
35
     */
36
    public $updated_at;
0 ignored issues
show
Coding Style introduced by
$updated_at does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
37
38
    /**
39
     *
40
     * @var integer
41
     */
42
    public $is_deleted;
0 ignored issues
show
Coding Style introduced by
$is_deleted does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
43
44
    /**
45
     * Initialize method for model.
46
     */
47
    public function initialize()
48
    {
49
        $this->setSource('payment_methods');
50
    }
51
52
    /**
53
     * Returns table name mapped in the model.
54
     *
55
     * @return string
56
     */
57
    public function getSource(): string
58
    {
59
        return 'payment_methods';
60
    }
61
62
    /**
63
     * Returns table name mapped in the model.
64
     *
65
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
66
     */
67
    public static function getDefault(): self
68
    {
69
        return self::findFirst(['conditions' => "is_default = 1 and is_deleted = 0"]);
70
    }
71
72
    /**
73
     * Returns table name mapped in the model.
74
     *
75
     * @return int
76
     */
77
    public function getId(): int
78
    {
79
        return (int)$this->id;
80
    }
81
}
82