1 | <?php |
||
39 | class App extends SlimApp implements |
||
40 | ConfigurableInterface |
||
41 | { |
||
42 | use ConfigurableTrait; |
||
43 | |||
44 | /** |
||
45 | * Store the unique instance |
||
46 | * |
||
47 | * @var App $instance |
||
48 | */ |
||
49 | protected static $instance; |
||
50 | |||
51 | /** |
||
52 | * @var ModuleManager |
||
53 | */ |
||
54 | private $moduleManager; |
||
55 | |||
56 | /** |
||
57 | * @var RouteManager |
||
58 | */ |
||
59 | private $routeManager; |
||
60 | |||
61 | /** |
||
62 | * Getter for creating/returning the unique instance of this class. |
||
63 | * |
||
64 | * @param Container|array $container The application's settings. |
||
65 | * @return self |
||
66 | */ |
||
67 | public static function instance($container = []) |
||
77 | |||
78 | /** |
||
79 | * Create new Charcoal application (and SlimApp). |
||
80 | * |
||
81 | * ### Dependencies |
||
82 | * |
||
83 | * **Required** |
||
84 | * |
||
85 | * - `config` — AppConfig |
||
86 | * |
||
87 | * **Optional** |
||
88 | * |
||
89 | * - `logger` — PSR-3 Logger |
||
90 | * |
||
91 | * @uses SlimApp::__construct() |
||
92 | * @param ContainerInterface|array $container The application's settings. |
||
93 | * @throws LogicException If trying to create a new instance of a singleton. |
||
94 | */ |
||
95 | public function __construct($container = []) |
||
118 | |||
119 | /** |
||
120 | * Run application. |
||
121 | * |
||
122 | * Initialize the Charcoal application before running (with SlimApp). |
||
123 | * |
||
124 | * @uses self::setup() |
||
125 | * @param boolean $silent If true, will run in silent mode (no response). |
||
126 | * @return ResponseInterface The PSR7 HTTP response. |
||
127 | */ |
||
128 | public function run($silent = false) |
||
134 | |||
135 | /** |
||
136 | * @throws LogicException If trying to clone an instance of a singleton. |
||
137 | * @return void |
||
138 | */ |
||
139 | final private function __clone() |
||
148 | |||
149 | /** |
||
150 | * @throws LogicException If trying to unserialize an instance of a singleton. |
||
151 | * @return void |
||
152 | */ |
||
153 | final private function __wakeup() |
||
162 | |||
163 | /** |
||
164 | * Retrieve the application's module manager. |
||
165 | * |
||
166 | * @return ModuleManager |
||
167 | */ |
||
168 | protected function moduleManager() |
||
185 | |||
186 | /** |
||
187 | * Retrieve the application's route manager. |
||
188 | * |
||
189 | * @return RouteManager |
||
190 | */ |
||
191 | protected function routeManager() |
||
205 | |||
206 | /** |
||
207 | * Registers the default services and features that Charcoal needs to work. |
||
208 | * |
||
209 | * @return void |
||
210 | */ |
||
211 | private function setup() |
||
228 | |||
229 | |||
230 | /** |
||
231 | * Setup the application's "global" routables. |
||
232 | * |
||
233 | * Routables can only be defined globally (app-level) for now. |
||
234 | * |
||
235 | * @return void |
||
236 | */ |
||
237 | protected function setupRoutables() |
||
272 | |||
273 | /** |
||
274 | * @throws ContainerValueNotFoundException No container entry was found for the middleware. |
||
275 | * @return void |
||
276 | */ |
||
277 | protected function setupMiddleware() |
||
295 | } |
||
296 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.