Failed Conditions
Pull Request — master (#320)
by Rafael
02:42
created

Sources::isApple()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Models;
6
7
use Phalcon\Di;
8
use Canvas\Exception\ModelException;
9
10
11
/**
12
 * Class Resources
13
 *
14
 * @package Canvas\Models
15
 *
16
 * @property \Phalcon\Di $di
17
 */
18
class Sources extends AbstractModel
19
{
20
    /**
21
     *
22
     * @var integer
23
     */
24
    public $id;
25
26
    /**
27
     *
28
     * @var string
29
     */
30
    public $title;
31
32
    /**
33
     *
34
     * @var string
35
     */
36
    public $url;
37
38
    /**
39
     *
40
     * @var integer
41
     */
42
    public $language_id;
0 ignored issues
show
Coding Style introduced by
$language_id 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
     *
46
     * @var string
47
     */
48
    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...
49
50
    /**
51
     *
52
     * @var string
53
     */
54
    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...
55
56
    /**
57
     *
58
     * @var integer
59
     */
60
    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...
61
62
    /**
63
     * Initialize method for model.
64
     */
65
    public function initialize()
66
    {
67
        $this->setSource('sources');
68
    }
69
70
    /**
71
     * Returns table name mapped in the model.
72
     *
73
     * @return string
74
     */
75
    public function getSource(): string
76
    {
77
        return 'sources';
78
    }
79
80
    /**
81
     * Validate is source is from apple
82
     *
83
     * @return bool
84
     */
85
    public function isApple(): bool
86
    {
87
        return $this->title == 'apple';
88
    }
89
}
90