$a= A::init(new A_Db);
class A { protected $adapter = null; protected function __construct(\X\Interfaces\A $adapter){$this->adapter = $adapter;} protected function __clone(){} { if(!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }// end function init()
Dostaję taki komunikat:
Cytat
Catchable fatal error: Argument 1 passed to X\lib\A::__construct() must implement interface X\Interfaces\A, none given, called in /var/www/A.php on line 27 and defined in /var/www/A.php on line 20
Jeśli odwołam się do klasy normalnie przez new A(); to zadziała, a jak zrobić aby było to przez jedną instancje?