Skip to content

Commit

Permalink
Better docblocks for typecasting of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
metaregistrar committed Nov 18, 2019
1 parent b04f03a commit d720594
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Examples/modifydomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function modifydomain($conn, $domainname, $registrant = null, $admincontact = nu
$del = new eppDomain($domainname);
}
foreach ($oldns as $ns) {
$del->addHost($ns);
$del->addHost(new eppHost($ns->getHostname()));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Protocols/EPP/eppResponses/eppCreateContactResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getContactCreateDate() {

/**
*
* @return eppContactHandle contacthandle
* @return null|eppContactHandle
*/
public function getContactHandle() {
if ($handle = $this->queryPath('/epp:epp/epp:response/epp:resData/contact:creData/contact:id')) {
Expand Down
3 changes: 1 addition & 2 deletions Protocols/EPP/eppResponses/eppCreateDomainResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public function getDomainName() {
}

public function getDomain() {
$return = new eppDomain($this->getDomainName());
return $return;
return new eppDomain($this->getDomainName());
}

}
13 changes: 6 additions & 7 deletions Protocols/EPP/eppResponses/eppInfoDomainResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getDomainId() {
/**
* Receive an array of statuses
*
* @return string status
* @return null|string[]
*/
public function getDomainStatuses() {
$statuses = null;
Expand Down Expand Up @@ -93,7 +93,7 @@ public function getDomainContact($contacttype) {
/**
* Get the contacts associated with the domain name as eppContactHandle objects
*
* @return array eppContactHandles
* @return null|eppContactHandle[]
*/
public function getDomainContacts() {
$xpath = $this->xPath();
Expand Down Expand Up @@ -191,7 +191,7 @@ public function getDomainUpdateClientId() {
* This function returns the associated nameservers from a domain object
* Please do not confuse this with getDomainHosts(), which is used for subordinate host objects
*
* @return array of strings
* @return null|eppHost[]
*/
public function getDomainNameservers() {
$xpath = $this->xPath();
Expand All @@ -214,9 +214,8 @@ public function getDomainNameservers() {
}
}
return $ns;
} else {
return null;
}
return null;
}

/**
Expand Down Expand Up @@ -251,14 +250,14 @@ public function getDomainAuthInfo() {
* OBSOLETE, DO NOT USE THIS FUNCTION
* If you need DNSSEC KeyData or DSData, see the extension SecDNS-1.1
* ALL DNSSEC FUNCTIONS ARE IN THERE
* @return array|null
* @return null|eppSecdns[]
*/
public function getKeydata() {
// Check if dnssec is enabled on this interface
if ($this->findNamespace('secDNS')) {
$xpath = $this->xPath();
$result = $xpath->query('/epp:epp/epp:response/epp:extension/secDNS:infData/*');
$keys = array();
$keys = [];
if ($result->length > 0) {
foreach ($result as $keydata) {
/* @var $keydata \DOMElement */
Expand Down
28 changes: 14 additions & 14 deletions Protocols/EPP/eppResponses/eppInfoHostResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ public function getHost() {
}

/**
*
* @return string hostname
* Get the hostname from the server response
* @return string
*/
public function getHostName() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/host:infData/host:name');
}

/**
*
* @return array of host addresses
* Get Host IP addresses from the server response
* @return array
*/
public function getHostAddresses() {
$ip = null;
Expand All @@ -39,8 +39,8 @@ public function getHostAddresses() {
}

/**
*
* @return string status
* Get an array of statuses from the server response
* @return null|string[]
*/
public function getHostStatuses() {
$stat = null;
Expand All @@ -53,56 +53,56 @@ public function getHostStatuses() {
}

/**
*
* @return string statuses
* Get statuses as comma-separated values from the server response
* @return string
*/
public function getHostStatusCSV() {
return parent::arrayToCSV($this->getHostStatuses());
}

/**
*
* @return string roid
* @return string
*/
public function getHostRoid() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/host:infData/host:roid');
}

/**
*
* @return string create_date
* @return string
*/
public function getHostCreateDate() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/host:infData/host:crDate');
}

/**
*
* @return string update_date
* @return string
*/
public function getHostUpdateDate() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/host:infData/host:upDate');
}

/**
*
* @return string client id
* @return string
*/
public function getHostClientId() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/host:infData/host:clID');
}

/**
*
* @return string client id
* @return string
*/
public function getHostCreateClientId() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/host:infData/host:crID');
}

/**
*
* @return string client id
* @return string
*/
public function getHostUpdateClientId() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/host:infData/host:upID');
Expand Down
3 changes: 2 additions & 1 deletion Protocols/EPP/eppResponses/eppPollResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public function getMessageCount() {
* TYPE_CREATE
* TYPE_UPDATE
* TYPE_DELETE
* @return string
*/
public function getMessageType() {
if ($this->messageType) {
Expand Down Expand Up @@ -139,7 +140,7 @@ public function getDomainName() {

/**
* If present, retrieve the current status of the domain name in question
* @return string|null
* @return null|string
*/
public function getDomainStatus() {
$this->messageType = $this->getMessageType();
Expand Down
6 changes: 6 additions & 0 deletions Protocols/EPP/eppResponses/eppRenewResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ function __destruct() {
# DOMAIN RENEW RESPONSES
#

/**
* @return null|string
*/
public function getDomainName() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:renData/domain:name');
}

/**
* @return null|string
*/
public function getDomainExpirationDate() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:renData/domain:exDate');
}
Expand Down
5 changes: 4 additions & 1 deletion Protocols/EPP/eppResponses/eppResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function getProblemtype() {

/**
*
* @return string|null
* @return null|string
*/
public function getResultCode() {
$result = $this->queryPath('/epp:epp/epp:response/epp:result/@code');
Expand Down Expand Up @@ -390,6 +390,9 @@ public function queryPath($path, $object = null) {
}
}

/**
* @param $exceptionhandler
*/
public function addException($exceptionhandler) {
$this->exceptions[] = $exceptionhandler;
}
Expand Down
28 changes: 25 additions & 3 deletions Protocols/EPP/eppResponses/eppTransferResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,58 @@ function __destruct() {
# DOMAIN TRANSFER RESPONSES
#

/**
* @return null|string
*/
public function getDomainName() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:trnData/domain:name');
}

/**
* @return eppDomain
*/
public function getDomain() {
$return = new eppDomain($this->getDomainName());
return $return;

return new eppDomain($this->getDomainName());
}

/**
* @return null|string
*/
public function getTransferStatus() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:trnData/domain:trStatus');
}

/**
* @return null|string
*/
public function getTransferRequestClientId() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:trnData/domain:reID');
}

/**
* @return null|string
*/
public function getTransferRequestDate() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:trnData/domain:reDate');
}

/**
* @return null|string
*/
public function getTransferExpirationDate() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:trnData/domain:exDate');
}

/**
* @return null|string
*/
public function getTransferActionDate() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:trnData/domain:acDate');
}

/**
* @return null|string
*/
public function getTransferActionClientId() {
return $this->queryPath('/epp:epp/epp:response/epp:resData/domain:trnData/domain:acID');
}
Expand Down

0 comments on commit d720594

Please sign in to comment.