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()); }
/** * 获取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; }