@@ 31-37 (lines=7) @@ | ||
28 | * @throws PropertyNotFoundException |
|
29 | * @throws PropertyReadOnlyException |
|
30 | */ |
|
31 | public function __set($property, $value) |
|
32 | { |
|
33 | if (property_exists($this, $property)) { |
|
34 | throw new PropertyReadOnlyException($property, get_class($this)); |
|
35 | } |
|
36 | throw new PropertyNotFoundException($property, get_class($this)); |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * Magic get |
|
@@ 48-55 (lines=8) @@ | ||
45 | * |
|
46 | * @throws PropertyNotFoundException |
|
47 | */ |
|
48 | public function __get($property) |
|
49 | { |
|
50 | if (property_exists($this, $property)) { |
|
51 | return $this->$property; |
|
52 | } |
|
53 | ||
54 | throw new PropertyNotFoundException($property, get_class($this)); |
|
55 | } |
|
56 | } |
|
57 |