goetas-webservices / xsd2php

Convert XSD into PHP classes and JMS serializer definitions
MIT License
238 stars 91 forks source link

Declaration of Xsd2PhpExtension::getAlias() must be compatible with Symfony\Component\DependencyInjection\Extension\Extension::getAlias() #146

Closed brausepulver closed 2 years ago

brausepulver commented 2 years ago

symfony/dependency-injection: v6.0.5

PHP Stack trace:
PHP   1. {main}() /var/www/html/vendor/bin/xsd2php:0
PHP   2. include() /var/www/html/vendor/bin/xsd2php:117
PHP   3. Composer\Autoload\ClassLoader->loadClass($class = 'GoetasWebservices\\Xsd\\XsdToPhp\\DependencyInjection\\Xsd2PhpExtension') /var/www/html/vendor/goetas-webservices/xsd2php/bin/xsd2php:18
PHP   4. Composer\Autoload\includeFile($file = '/var/www/html/vendor/composer/../goetas-webservices/xsd2php/src/DependencyInjection/Xsd2PhpExtension.php') /var/www/html/vendor/composer/ClassLoader.php:428
PHP   5. include() /var/www/html/vendor/composer/ClassLoader.php:571

This happens because the parent class requires https://github.com/goetas-webservices/xsd2php/blob/b76f9ae19fdb46f1293c4b7faedf0fa67720b34c/src/DependencyInjection/Xsd2PhpExtension.php#L67 to be type-hinted with string.

alexschwarz89 commented 2 years ago

+1

peternicholls commented 2 years ago

+1

peternicholls commented 2 years ago

error is gone by adding : string to function in /goetas-webservices/xsd2php/src/DependencyInjection/Xsd2PhpExtension.php on line 67

public function getAlias(): string

Can someone do a pull request or something please?

goetas commented 2 years ago

done in https://github.com/goetas-webservices/xsd2php/pull/150