o2system /
kernel
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * This file is part of the O2System Framework package. |
||
| 4 | * |
||
| 5 | * For the full copyright and license information, please view the LICENSE |
||
| 6 | * file that was distributed with this source code. |
||
| 7 | * |
||
| 8 | * @author Steeve Andrian Salim |
||
| 9 | * @copyright Copyright (c) Steeve Andrian Salim |
||
| 10 | */ |
||
| 11 | |||
| 12 | // ------------------------------------------------------------------------ |
||
| 13 | |||
| 14 | namespace O2System\Kernel\Http; |
||
| 15 | |||
| 16 | // ------------------------------------------------------------------------ |
||
| 17 | |||
| 18 | use O2System\Spl\Info\SplClassInfo; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Class Controller |
||
| 22 | * |
||
| 23 | * @package O2System\Framework\Http |
||
| 24 | */ |
||
| 25 | class Controller |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * Controller::getClassInfo |
||
| 29 | * |
||
| 30 | * @return \O2System\Spl\Info\SplClassInfo |
||
| 31 | */ |
||
| 32 | public function getClassInfo() |
||
| 33 | { |
||
| 34 | $classInfo = new SplClassInfo($this); |
||
| 35 | |||
| 36 | return $classInfo; |
||
| 37 | } |
||
| 38 | |||
| 39 | // ------------------------------------------------------------------------ |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Controller::__get |
||
| 43 | * |
||
| 44 | * @param string $property |
||
| 45 | * |
||
| 46 | * @return mixed |
||
| 47 | */ |
||
| 48 | public function &__get($property) |
||
| 49 | { |
||
| 50 | $get[ $property ] = false; |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
| 51 | |||
| 52 | if (services()->has($property)) { |
||
| 53 | $get[ $property ] = services()->get($property); |
||
| 54 | } |
||
| 55 | |||
| 56 | return $get[ $property ]; |
||
| 57 | } |
||
| 58 | |||
| 59 | // ------------------------------------------------------------------------ |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Controller::__call |
||
| 63 | * |
||
| 64 | * @param string $method |
||
| 65 | * @param array $args |
||
| 66 | * |
||
| 67 | * @return mixed |
||
| 68 | */ |
||
| 69 | public function __call($method, array $args = []) |
||
| 70 | { |
||
| 71 | if (method_exists($this, $method)) { |
||
| 72 | return call_user_func_array([$this, $method], $args); |
||
| 73 | } |
||
| 74 | } |
||
| 75 | } |