| Conditions | 1 |
| Paths | 1 |
| Total Lines | 28 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | public function __construct() |
||
| 16 | {
|
||
| 17 | parent::__construct(); |
||
| 18 | |||
| 19 | $this->setShared('db', function() {
|
||
| 20 | $db = new \Mos\Database\CDatabaseBasic(); |
||
| 21 | $db->setOptions(require ANAX_APP_PATH . 'config/config_mysql.php'); |
||
| 22 | $db->connect(); |
||
| 23 | return $db; |
||
| 24 | }); |
||
| 25 | |||
| 26 | $this->setShared('form', function() {
|
||
| 27 | $form = new \Mos\HTMLForm\CForm(); |
||
| 28 | return $form; |
||
| 29 | }); |
||
| 30 | |||
| 31 | $this->setShared('PageController', function() {
|
||
| 32 | $pageController = new \Anax\Page\PageController(); |
||
| 33 | $pageController->setDI($this); |
||
|
|
|||
| 34 | return $pageController; |
||
| 35 | }); |
||
| 36 | |||
| 37 | $this->setShared('BlogController', function() {
|
||
| 38 | $blogController = new \Anax\Blog\BlogController(); |
||
| 39 | $blogController->setDI($this); |
||
| 40 | return $blogController; |
||
| 41 | }); |
||
| 42 | } |
||
| 43 | } |
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: