Model::setId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the slince/shopify-api-php
5
 *
6
 * (c) Slince <[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 Slince\Shopify\Common\Model;
13
14
abstract class Model implements ModelInterface
15
{
16
    /**
17
     * The id of the model.
18
     *
19
     * @var string
20
     */
21
    protected $id;
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function getId()
27
    {
28
        return $this->id;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function setId($id)
35
    {
36
        $this->id = $id;
0 ignored issues
show
Documentation Bug introduced by
The property $id was declared of type string, but $id is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
37
38
        return $this;
39
    }
40
}