| Conditions | 6 |
| Paths | 9 |
| Total Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function setup($sConfigFile) |
||
| 30 | { |
||
| 31 | if(!file_exists($sConfigFile)) |
||
| 32 | { |
||
| 33 | throw new Exception("Unable to find config file at $sConfigFile"); |
||
| 34 | } |
||
| 35 | |||
| 36 | // Read the config options. |
||
| 37 | $aOptions = jaxon()->config()->read($sConfigFile); |
||
| 38 | $aLibOptions = key_exists('lib', $aOptions) ? $aOptions['lib'] : []; |
||
| 39 | $aAppOptions = key_exists('app', $aOptions) ? $aOptions['app'] : []; |
||
| 40 | |||
| 41 | if(!is_array($aLibOptions) || !is_array($aAppOptions)) |
||
| 42 | { |
||
| 43 | throw new Exception("Unexpected content in config file at $sConfigFile"); |
||
| 44 | } |
||
| 45 | |||
| 46 | // Set the session manager |
||
| 47 | jaxon()->di()->setSessionManager(function () { |
||
|
|
|||
| 48 | return new SessionManager(); |
||
| 49 | }); |
||
| 50 | |||
| 51 | $this->bootstrap() |
||
| 52 | ->lib($aLibOptions) |
||
| 53 | ->app($aAppOptions) |
||
| 54 | // ->uri($sUri) |
||
| 55 | // ->js(!$isDebug, $sJsUrl, $sJsDir, !$isDebug) |
||
| 56 | ->run(true); |
||
| 57 | } |
||
| 58 | |||
| 69 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: