Completed
Push — 1.x ( 257780...f31d1d )
by Mikaël
42:33 queued 33:38
created

GeneratorParsers   C

Complexity

Total Complexity 6

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 19

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 1
cbo 19
dl 0
loc 59
ccs 33
cts 33
cp 1
rs 6.875

4 Methods

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