Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
6 / 6
CRAP
100.00% covered (success)
100.00%
1 / 1
Wsdl
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
6 / 6
6
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getContent
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 addSchema
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 hasSchema
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getSchemas
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 contentClass
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace WsdlToPhp\PackageGenerator\Model;
6
7use WsdlToPhp\PackageGenerator\Container\Model\Schema as SchemaContainer;
8use WsdlToPhp\PackageGenerator\Generator\Generator;
9use WsdlToPhp\WsdlHandler\Wsdl as WsdlDocument;
10
11final class Wsdl extends AbstractDocument
12{
13    private SchemaContainer $schemas;
14
15    public function __construct(Generator $generator, string $name, string $content)
16    {
17        parent::__construct($generator, $name, $content);
18        $this->schemas = new SchemaContainer($generator);
19    }
20
21    public function getContent(): WsdlDocument
22    {
23        return parent::getContent();
24    }
25
26    public function addSchema(Schema $schema): self
27    {
28        $this->getContent()->addExternalSchema($schema->getContent());
29
30        $this->schemas->add($schema);
31
32        return $this;
33    }
34
35    public function hasSchema(string $schemaLocation): bool
36    {
37        return $this->schemas->getSchemaByName($schemaLocation) instanceof Schema;
38    }
39
40    public function getSchemas(): SchemaContainer
41    {
42        return $this->schemas;
43    }
44
45    protected function contentClass(): string
46    {
47        return WsdlDocument::class;
48    }
49}