Exemple #1
0
 function testCreate()
 {
     $this->assertInstanceOf('Slince\\Routing\\Matcher', Factory::createMatcher());
     $this->assertInstanceOf('Slince\\Routing\\Generator', Factory::createGenerator(RequestContext::create()));
     $this->assertInstanceOf('Slince\\Routing\\RouteCollection', Factory::createRoutes());
 }
Exemple #2
0
 /**
  * 获取generator
  * @return Generator|GeneratorInterface
  */
 function getGenerator()
 {
     if (is_null($this->generator)) {
         if (is_null($this->context)) {
             throw new InvalidArgumentException('Miss Argument "Context" for generator');
         }
         $this->generator = Factory::createGenerator($this->context);
     }
     return $this->generator;
 }