make() 공개 메소드

Create a new object instance
public make ( array $config = [] ) : Dispatcher
$config array The config parameters which override the fof.xml information
리턴 FOF30\Dispatcher\Dispatcher A new Dispatcher object
예제 #1
0
 /**
  * @covers          FOF30\Factory\Magic\TransparentAuthenticationFactory::make
  * @dataProvider    getTestMake
  */
 public function testMake($test, $check)
 {
     $msg = 'TransparentAuthenticationFactory::make %s - Case: ' . $check['case'];
     $config['componentName'] = $test['component'];
     if ($test['backend_path']) {
         $config['backEndPath'] = $test['backend_path'];
     }
     $container = new TestContainer($config);
     // Required so we force FOF to read the fof.xml file
     $dummy = $container->appConfig;
     $factory = new TransparentAuthenticationFactory($container);
     $result = $factory->make(array());
     $this->assertEquals($check['result'], get_class($result), sprintf($msg, 'Returned the wrong result'));
 }
예제 #2
0
 /**
  * Creates a new TransparentAuthentication
  *
  * @param   array  $config  The configuration values for the TransparentAuthentication object
  *
  * @return  TransparentAuthentication
  */
 public function transparentAuthentication(array $config = array())
 {
     $toolbarClass = $this->container->getNamespacePrefix($this->getSection()) . 'TransparentAuthentication\\TransparentAuthentication';
     try {
         return $this->createTransparentAuthentication($toolbarClass, $config);
     } catch (TransparentAuthenticationNotFound $e) {
         // Not found. Let's go on.
     }
     $toolbarClass = $this->container->getNamespacePrefix('inverse') . 'TransparentAuthentication\\TransparentAuthentication';
     try {
         return $this->createTransparentAuthentication($toolbarClass, $config);
     } catch (TransparentAuthenticationNotFound $e) {
         // Not found. Return the magically created TransparentAuthentication
         $magic = new TransparentAuthenticationFactory($this->container);
         // Let's pass the section override (if any)
         $magic->setSection($this->getSection());
         return $magic->make($config);
     }
 }
예제 #3
0
파일: MagicFactory.php 프로젝트: akeeba/fof
 /**
  * Creates a new TransparentAuthentication handler
  *
  * @param   array $config The configuration values for the TransparentAuthentication object
  *
  * @return  TransparentAuthentication
  */
 public function transparentAuthentication(array $config = array())
 {
     $authClass = $this->container->getNamespacePrefix() . 'TransparentAuthentication\\TransparentAuthentication';
     try {
         return $this->createTransparentAuthentication($authClass, $config);
     } catch (TransparentAuthenticationNotFound $e) {
         // Not found. Return the magically created TA
         $magic = new TransparentAuthenticationFactory($this->container);
         return $magic->make($config);
     }
 }