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\Framework\Cli; |
||
15 | |||
16 | // ------------------------------------------------------------------------ |
||
17 | |||
18 | /** |
||
19 | * Class Commander |
||
20 | * @package O2System\Framework\Cli |
||
21 | */ |
||
22 | abstract class Commander extends \O2System\Kernel\Cli\Commander |
||
23 | { |
||
24 | /** |
||
25 | * Commander::__get |
||
26 | * |
||
27 | * @param string $property |
||
28 | * |
||
29 | * @return mixed|\O2System\Framework\Containers\Models|\O2System\Framework\Models\NoSql\Model|\O2System\Framework\Models\Sql\Model |
||
30 | */ |
||
31 | public function &__get($property) |
||
32 | { |
||
33 | $get[ $property ] = false; |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
34 | |||
35 | // CodeIgniter property aliasing |
||
36 | if ($property === 'load') { |
||
37 | $property = 'loader'; |
||
38 | } |
||
39 | |||
40 | if (services()->has($property)) { |
||
41 | return services()->get($property); |
||
42 | } elseif (o2system()->__isset($property)) { |
||
43 | return o2system()->__get($property); |
||
44 | } elseif ($property === 'model') { |
||
45 | return models('controller'); |
||
46 | } |
||
47 | |||
48 | return $get[ $property ]; |
||
49 | } |
||
50 | } |