1 | <?php |
||
42 | class Navigator |
||
43 | { |
||
44 | /** @var ModuleStack */ |
||
45 | public $modules = array(); |
||
46 | |||
47 | /** @var Registry */ |
||
48 | public $registry = array(); |
||
49 | |||
50 | /** |
||
51 | * Initiate the navigator by setting up a ModuleStack and a Registry |
||
52 | * |
||
53 | * @return void |
||
|
|||
54 | */ |
||
55 | public function __construct() |
||
61 | |||
62 | /** |
||
63 | * Magic property to get a provider without a preset caller |
||
64 | * |
||
65 | * @param string $type |
||
66 | * |
||
67 | * @return Provider |
||
68 | */ |
||
69 | public function __get($type) |
||
73 | |||
74 | /** |
||
75 | * Magic function to get a provider with a preset caller |
||
76 | * |
||
77 | * @param string $type |
||
78 | * @param mixed $args |
||
79 | * |
||
80 | * @return Provider |
||
81 | */ |
||
82 | public function __call($type, $args) |
||
88 | |||
89 | /** |
||
90 | * Store the navigator within a cache file |
||
91 | * |
||
92 | * @param string $path |
||
93 | */ |
||
94 | public function storeCache($path) |
||
104 | |||
105 | /** |
||
106 | * Recreate the navigator from a cache file |
||
107 | * |
||
108 | * @param string $path |
||
109 | * |
||
110 | * @return bool |
||
111 | */ |
||
112 | public function loadCache($path) |
||
122 | |||
123 | /** |
||
124 | * Get the Module that provides a context |
||
125 | * |
||
126 | * @param string $name plain name of the context |
||
127 | * |
||
128 | * @return Module|null |
||
129 | */ |
||
130 | public function getContextModule($name) |
||
138 | |||
139 | /** |
||
140 | * Generic call for a type of provider |
||
141 | * |
||
142 | * @param string $type |
||
143 | * @param string $caller Caller module name |
||
144 | * |
||
145 | * @return Provider |
||
146 | */ |
||
147 | public function provider($type, $caller = null) |
||
162 | } |
||
163 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.