Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
28 / 28 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
| GeneratorParsers | |
100.00% |
28 / 28 |
|
100.00% |
4 / 4 |
6 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| doParse | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| getParsers | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| initParsers | |
100.00% |
22 / 22 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace WsdlToPhp\PackageGenerator\Generator; |
| 6 | |
| 7 | use WsdlToPhp\PackageGenerator\Container\Parser as ParserContainer; |
| 8 | use WsdlToPhp\PackageGenerator\Parser\SoapClient\Functions as FunctionsParser; |
| 9 | use WsdlToPhp\PackageGenerator\Parser\SoapClient\Structs as StructsParser; |
| 10 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagAttribute as TagAttributeParser; |
| 11 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagChoice as TagChoiceParser; |
| 12 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagComplexType as TagComplexTypeParser; |
| 13 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagDocumentation as TagDocumentationParser; |
| 14 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagElement as TagElementParser; |
| 15 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagEnumeration as TagEnumerationParser; |
| 16 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagExtension as TagExtensionParser; |
| 17 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagHeader as TagHeaderParser; |
| 18 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagImport as TagImportParser; |
| 19 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagInclude as TagIncludeParser; |
| 20 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagInput as TagInputParser; |
| 21 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagList as TagListParser; |
| 22 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagOutput as TagOutputParser; |
| 23 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagRestriction as TagRestrictionParser; |
| 24 | use WsdlToPhp\PackageGenerator\Parser\Wsdl\TagUnion as TagUnionParser; |
| 25 | |
| 26 | class GeneratorParsers extends AbstractGeneratorAware |
| 27 | { |
| 28 | protected ParserContainer $parsers; |
| 29 | |
| 30 | public function __construct(Generator $generator) |
| 31 | { |
| 32 | parent::__construct($generator); |
| 33 | $this->initParsers(); |
| 34 | } |
| 35 | |
| 36 | public function doParse(): self |
| 37 | { |
| 38 | foreach ($this->parsers as $parser) { |
| 39 | $parser->parse(); |
| 40 | } |
| 41 | |
| 42 | return $this; |
| 43 | } |
| 44 | |
| 45 | public function getParsers(): ParserContainer |
| 46 | { |
| 47 | return $this->parsers; |
| 48 | } |
| 49 | |
| 50 | protected function initParsers(): self |
| 51 | { |
| 52 | if (!isset($this->parsers)) { |
| 53 | $this->parsers = new ParserContainer($this->generator); |
| 54 | $this->parsers |
| 55 | ->add(new FunctionsParser($this->generator)) |
| 56 | ->add(new StructsParser($this->generator)) |
| 57 | ->add(new TagIncludeParser($this->generator)) |
| 58 | ->add(new TagImportParser($this->generator)) |
| 59 | ->add(new TagEnumerationParser($this->generator)) |
| 60 | ->add(new TagAttributeParser($this->generator)) |
| 61 | ->add(new TagComplexTypeParser($this->generator)) |
| 62 | ->add(new TagElementParser($this->generator)) |
| 63 | ->add(new TagExtensionParser($this->generator)) |
| 64 | ->add(new TagHeaderParser($this->generator)) |
| 65 | ->add(new TagInputParser($this->generator)) |
| 66 | ->add(new TagOutputParser($this->generator)) |
| 67 | ->add(new TagRestrictionParser($this->generator)) |
| 68 | ->add(new TagUnionParser($this->generator)) |
| 69 | ->add(new TagListParser($this->generator)) |
| 70 | ->add(new TagChoiceParser($this->generator)) |
| 71 | ->add(new TagDocumentationParser($this->generator)) |
| 72 | ; |
| 73 | } |
| 74 | |
| 75 | return $this; |
| 76 | } |
| 77 | } |