Completed
Push — master ( 390b51...0e9cfd )
by Mario
11:43
created

APIResponse::__construct()   A

Complexity

Conditions 2
Paths 2

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 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Marek\OpenWeatherMap\API\Value\Response;
6
7
use Marek\OpenWeatherMap\API\Exception\PropertyNotFoundException;
8
9
abstract class APIResponse
10
{
11
    /**
12
     * Construct object optionally with a set of properties.
13
     *
14
     * @param array $properties
15
     */
16
//    public function __construct(array $properties = [])
17
//    {
18
//        foreach ($properties as $property => $value) {
19
//            $this->{$property} = $value;
20
//        }
21
//    }
22
23
    /**
24
     * Magic set function handling writes to non public properties.
25
     *
26
     *
27
     * @param string $property Name of the property
28
     * @param string $value
29
     *
30
     * @throws PropertyNotFoundException
31
     */
32
//    public function __set($property, $value)
33
//    {
34
//        if (!property_exists($this, $property)) {
35
//            throw new PropertyNotFoundException($property, get_class($this));
36
//        }
37
//
38
//        $this->{$property} = $value;
39
//    }
40
41
    /**
42
     * Magic get function handling read to non public properties.
43
     *
44
     * Returns value for all readonly (protected) properties.
45
     *
46
     *
47
     * @param string $property Name of the property
48
     *
49
     * @throws PropertyNotFoundException
50
     *
51
     * @return mixed
52
     */
53
//    public function __get($property)
54
//    {
55
//        if (property_exists($this, $property)) {
56
//            return $this->{$property};
57
//        }
58
//
59
//        throw new PropertyNotFoundException($property, get_class($this));
60
//    }
61
}
62