metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
210 stars 153 forks source link

Annotation in eppDomain class #314

Closed Slisarenko closed 3 years ago

Slisarenko commented 3 years ago
/**
 *
 * @param eppContact $registrant
 * @param string $authorisationCode
 */
public function __construct($domainname, $registrant = null, $contacts = null, $hosts = null, $period = 0, $authorisationCode = null) {

    if (strlen($domainname)) {
        $this->setDomainname($domainname);
    } else {
        throw new eppException('Domain name not set');
    }
    $this->setPeriod($period);
    if ($registrant instanceof eppContact) {
        throw new eppException('Registrant must be Metaregistrar\EPP\eppContactHandle or string on eppDomain creation');
    }

As you can see the type of variable $registrant is eppContact, but If it is as stated in the annotation we throw an eppException, I think that you need to update an annotation. Personal for me, it's a problem because I'm getting an error from the psalm: expects Metaregistrar\EPP\eppContact|null, Metaregistrar\EPP\eppContactHandle provided

metaregistrar commented 3 years ago

Fixed in the latest commit