-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicObject.php
More file actions
42 lines (36 loc) · 945 Bytes
/
Copy pathBasicObject.php
File metadata and controls
42 lines (36 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
namespace Echron\DataTypes;
class BasicObject
{
/**
* @param string $name
* @throws \Exception
* @internal
* @deprecated
* @access private
*/
public function __get(string $name)
{
throw new \Exception('Cannot get new property "' . $name . '" to instance of "' . get_class($this) . '"');
}
/**
* @param string $name
* @param $value
* @throws \Exception
* @deprecated
* @access private
*/
public function __set(string $name, $value)
{
throw new \Exception('Cannot set new property "' . $name . '" to instance of "' . get_class($this) . '"');
}
public function __isset(string $name)
{
throw new \Exception('Cannot use method isset "' . $name . '" to instance of "' . get_class($this) . '"');
}
function jsonSerialize(): array
{
return get_object_vars($this);
}
}