for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Anax\DI;
/**
* Extended factory for Anax database content management.
*
*/
class CDIFactoryContent extends CDIFactoryDefault
{
* Construct.
public function __construct()
parent::__construct();
$this->setShared('db', function() {
$db = new \Mos\Database\CDatabaseBasic();
$db->setOptions(require ANAX_APP_PATH . 'config/config_mysql.php');
$db->connect();
return $db;
});
$this->setShared('form', function() {
$form = new \Mos\HTMLForm\CForm();
return $form;
$this->setShared('PageController', function() {
$pageController = new \Anax\Page\PageController();
$pageController->setDI($this);
$this
this<Anax\DI\CDIFactoryContent>
object<Anax\DI\class>
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:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
return $pageController;
$this->setShared('BlogController', function() {
$blogController = new \Anax\Blog\BlogController();
$blogController->setDI($this);
return $blogController;
}
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: