1 | <?php |
||
24 | class Monitor |
||
25 | { |
||
26 | /** |
||
27 | * @var APIGuzzleAdapter |
||
28 | */ |
||
29 | private $adapter; |
||
30 | |||
31 | private static $mappings = array( |
||
32 | 'getScheduler' => array( |
||
33 | 'path' => 'v1/monitor/scheduler/', |
||
34 | 'entity' => 'PhraseanetSDK\Monitor\Scheduler', |
||
35 | 'query-keys' => array(), |
||
36 | 'result-property' => 'scheduler', |
||
37 | 'method' => 'GET', |
||
38 | ), |
||
39 | 'getTask' => array( |
||
40 | 'path' => 'v1/monitor/task/{task_id}/', |
||
41 | 'entity' => 'PhraseanetSDK\Monitor\Task', |
||
42 | 'query-keys' => array('task_id'), |
||
43 | 'result-property' => 'task', |
||
44 | 'method' => 'GET', |
||
45 | ), |
||
46 | 'startTask' => array( |
||
47 | 'path' => 'v1/monitor/task/{task_id}/start/', |
||
48 | 'entity' => 'PhraseanetSDK\Monitor\Task', |
||
49 | 'query-keys' => array('task_id'), |
||
50 | 'result-property' => 'task', |
||
51 | 'method' => 'POST', |
||
52 | ), |
||
53 | 'stopTask' => array( |
||
54 | 'path' => 'v1/monitor/task/{task_id}/stop/', |
||
55 | 'entity' => 'PhraseanetSDK\Monitor\Task', |
||
56 | 'query-keys' => array('task_id'), |
||
57 | 'result-property' => 'task', |
||
58 | 'method' => 'POST', |
||
59 | ), |
||
60 | 'getTasks' => array( |
||
61 | 'path' => 'v1/monitor/tasks/', |
||
62 | 'entity' => 'PhraseanetSDK\Monitor\Task', |
||
63 | 'query-keys' => array(), |
||
64 | 'result-property' => 'tasks', |
||
65 | 'method' => 'GET', |
||
66 | ), |
||
67 | ); |
||
68 | |||
69 | 6 | public function __construct(APIGuzzleAdapter $adapter) |
|
73 | |||
74 | 5 | public function __call($name, $arguments) |
|
82 | |||
83 | 5 | private function doCall($name, $arguments) |
|
110 | |||
111 | private function getEntity($name, $data) |
||
132 | } |
||
133 |
Let’s assume you have a class which uses late-static binding:
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: