WsdlToPhp /
PackageGenerator
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace WsdlToPhp\PackageGenerator\Model; |
||
| 6 | |||
| 7 | use WsdlToPhp\PackageGenerator\Container\Model\Schema as SchemaContainer; |
||
| 8 | use WsdlToPhp\PackageGenerator\Generator\Generator; |
||
| 9 | use WsdlToPhp\WsdlHandler\Wsdl as WsdlDocument; |
||
| 10 | |||
| 11 | final class Wsdl extends AbstractDocument |
||
| 12 | { |
||
| 13 | private SchemaContainer $schemas; |
||
| 14 | |||
| 15 | 462 | public function __construct(Generator $generator, string $name, string $content) |
|
| 16 | { |
||
| 17 | 462 | parent::__construct($generator, $name, $content); |
|
| 18 | 460 | $this->schemas = new SchemaContainer($generator); |
|
| 19 | } |
||
| 20 | |||
| 21 | 114 | public function getContent(): WsdlDocument |
|
| 22 | { |
||
| 23 | 114 | return parent::getContent(); |
|
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 24 | } |
||
| 25 | |||
| 26 | 66 | public function addSchema(Schema $schema): self |
|
| 27 | { |
||
| 28 | 66 | $this->getContent()->addExternalSchema($schema->getContent()); |
|
| 29 | |||
| 30 | 66 | $this->schemas->add($schema); |
|
| 31 | |||
| 32 | 66 | return $this; |
|
| 33 | } |
||
| 34 | |||
| 35 | 66 | public function hasSchema(string $schemaLocation): bool |
|
| 36 | { |
||
| 37 | 66 | return $this->schemas->getSchemaByName($schemaLocation) instanceof Schema; |
|
| 38 | } |
||
| 39 | |||
| 40 | 114 | public function getSchemas(): SchemaContainer |
|
| 41 | { |
||
| 42 | 114 | return $this->schemas; |
|
| 43 | } |
||
| 44 | |||
| 45 | 462 | protected function contentClass(): string |
|
| 46 | { |
||
| 47 | 462 | return WsdlDocument::class; |
|
| 48 | } |
||
| 49 | } |
||
| 50 |