コード例 #1
0
ファイル: FactoryTrait.php プロジェクト: gridguyz/zork
 /**
  * Register a factory-adapter
  *
  * @param string $adapter Adapter's name
  * @param string $class Adapter's class
  * @return self
  */
 public function registerAdapter($adapter, $class)
 {
     $this->builder->registerAdapter(get_called_class(), $adapter, $class);
     return $this;
 }
コード例 #2
0
ファイル: BuilderTest.php プロジェクト: gridguyz/zork
 /**
  * Test register to non-existing factory
  *
  * @expectedException   Zork\Factory\Exception\ExceptionInterface
  */
 public function testRegisterToNonExistingFactory()
 {
     $this->builder->registerAdapter('NonExsitentFactory', 'adapter0', 'stdClass');
 }