/** * @test */ public function shouldParseWrapperClass() { //given $parser = new WrapperParser('\\Mocks\\MockUserWrapper'); //when $parser->parse(); //then $complex = $parser->getComplexTypes(); $this->assertCount(3, $complex); }
public function wrapper(&$type, $docComment) { if (!$this->isComplex($type)) { throw new WrapperParserException("This attribute is not complex type."); } preg_match('#@className=(.*?)(?:\\s|$)#', $docComment, $matches); $className = $matches[1]; $type = str_replace('\\', '', $className); $wrapperParser = new WrapperParser($className); $wrapperParser->parse(); return $wrapperParser; }
public function wrapper() { if (!$this->isComplex()) { throw new ParameterParserException("This parameter is not complex type."); } preg_match('#@className=(.*?)(?:\\s|$)#', $this->_parameter, $matches); $className = $matches[1]; $this->_type = str_replace('\\', '', $className); $wrapperParser = new WrapperParser($className); $wrapperParser->parse(); return $wrapperParser; }