php-epp-client icon indicating copy to clipboard operation
php-epp-client copied to clipboard

$version must be ?string

Open sayoki opened this issue 3 years ago • 7 comments
trafficstars

I tried running the code on PHP 8.1 and received the following error: PHP Fatal error: Type of Metaregistrar\EPP\eppResponse::$version must be ?string (as in class DOMDocument) in /Protocols/EPP/eppResponses/eppResponse.php on line 9

I can't find the exact spot where to fix this.

sayoki avatar Feb 25 '22 09:02 sayoki

Difficult to say, as there is so little information. From your statement, it would seem to me that the login response of the registry is not formatted as expected. But since the version variable is hardly ever used in the php-epp-client code, i cannot imagine where this error is coming from.

Do you have a log of what is sent and received from the registry?

metaregistrar avatar Feb 28 '22 09:02 metaregistrar

I do not have any log available at this moment.

I decided to stay at version PHP 8.0, because this php client is clearly not ready for PHP 8.1.

sayoki avatar Feb 28 '22 09:02 sayoki

So this issue is related to the variable handling of PHP 8.1? I will start testing with 8.1 soon

metaregistrar avatar Feb 28 '22 10:02 metaregistrar

PHP 8.0 is working fine for me.

sayoki avatar Feb 28 '22 19:02 sayoki

any update?

sayoki avatar Jun 08 '22 14:06 sayoki

Just noticed this on PHP 8.1.7, downgrading my interpreter

tpimh avatar Jun 20 '22 06:06 tpimh

Same on plain Ubuntu 22.04 with PHP 8.1.2

bessone avatar Sep 09 '22 10:09 bessone

PHP Fatal error: Type of Metaregistrar\EPP\eppResponse::$version must be ?string (as in class DOMDocument) in /Protocols/EPP/eppResponses/eppResponse.php on line 9

@bessone @tpimh @sayoki Which version of metaregistrar/php-epp-client are you using?

eppResponse::$version was used prior to 1.0.11 but 2cdb917899fc3126e18b33d50ea8fffadf49b773 changed the property name to $versions.

The error message sounds like you are using a version < 1.0.11. Can you confirm this?

W0rma avatar Dec 08 '22 07:12 W0rma

I can't find the version of this code.

sayoki avatar Dec 08 '22 08:12 sayoki

I can't find the version of this code.

If you have used composer to install the package you can see the currently installed version in the output of composer show metaregistrar/php-epp-client.

If composer is not used please navigate to the source file of the class eppResponse (<root-dir-of-php-epp-client>/Protocols/EPP/eppReponses/eppResponse.php) in your local repository and check if there is still a property called $version. In this case you are using an old version of this package which does not contain the fix in 2cdb917899fc3126e18b33d50ea8fffadf49b773.

W0rma avatar Dec 08 '22 12:12 W0rma

Rule 79 - 82

/*
 * @var array of supported versions
 */
public $version;

sayoki avatar Dec 08 '22 19:12 sayoki

Alright, seems like my assumption was correct and you are currently using an older version of this package.

Have you already tried updating to the most recent version?

W0rma avatar Dec 09 '22 07:12 W0rma

No, because our programmers added and changed code wich was not pushed towards github.

sayoki avatar Dec 12 '22 12:12 sayoki

No, because our programmers added and changed code wich was not pushed towards github.

In this case I don't think that the maintainer of this package can help you. You/your programmers need to update the code on your side.

W0rma avatar Dec 12 '22 16:12 W0rma

What do we change?

sayoki avatar Jul 29 '23 18:07 sayoki

We give it up, too much errors:

Array ( [type] => 64 [message] => Type of Metaregistrar\EPP\eppResponse::$version must be ?string (as in class DOMDocument) [file] => /Protocols/EPP/eppResponses/eppResponse.php [line] => 9 )

[X] Array ( [type] => 8192 [message] => Creation of dynamic property Metaregistrar\EPP\eppLogoutResponse::$resultCode is deprecated [file] => /Protocols/EPP/eppConnection.php [line] => 316 )

Array ( [type] => 8192 [message] => Creation of dynamic property nusoap_client::$return is deprecated [file] =>

Array ( [type] => 8192 [message] => Return type of Metaregistrar\EPP\eppResponse::saveXML(?DOMNode $node = null, $options = null) should either be compatible with DOMDocument::saveXML(?DOMNode $node = null, int $options = 0): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [file] => /Protocols/EPP/eppResponses/eppResponse.php [line] => 114 )

sayoki avatar Jul 30 '23 11:07 sayoki

PHP 8.0 works fine, PHP 8.2 gives multiple errors.

sayoki avatar Jul 30 '23 11:07 sayoki