Completed
Push — master ( 2236d8...f66191 )
by Taosikai
10:51
created

Model::fromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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
use Slince\Shopify\Hydrator\Hydrator;
15
use Slince\Shopify\Hydrator\Type\DateTimeType;
16
17
abstract class Model implements ModelInterface
18
{
19
    /**
20
     * The id of the model.
21
     *
22
     * @var string
23
     */
24
    protected $id;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getId()
30
    {
31
        return $this->id;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function setId($id)
38
    {
39
        $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...
40
41
        return $this;
42
    }
43
}