From ad0b6eb32f65c3a63961c84521b032e947f8c54f Mon Sep 17 00:00:00 2001 From: Joe Huss Date: Wed, 4 Jan 2023 08:51:21 +0000 Subject: [PATCH] update merging in https://github.com/OpenSRS/osrs-toolkit-php/pull/50 --- opensrs/Base.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/opensrs/Base.php b/opensrs/Base.php index 4d3a2168..ae3020d7 100644 --- a/opensrs/Base.php +++ b/opensrs/Base.php @@ -35,7 +35,7 @@ class Base * openSRS_base object constructor. * * Closes an existing socket connection, if we have one - * + * * @since 3.1 */ public function __construct() @@ -80,7 +80,7 @@ private function _verifySystemProperties() * @param string $request Raw XML request * * @return string $data Raw XML response - * + * * @since 3.1 */ public function send_cmd($request) @@ -106,7 +106,7 @@ public function send_cmd($request) * Method to initialize a socket connection to the OpenSRS server. * * @return bool True if connected - * + * * @since 3.1 */ private function init_socket() @@ -126,7 +126,7 @@ private function init_socket() * Method to check if a socket connection exists. * * @return bool True if connected - * + * * @since 3.4 */ public function is_connected() @@ -136,7 +136,7 @@ public function is_connected() /** * Method to close the socket connection. - * + * * @since 3.4 */ private function close_socket() @@ -148,7 +148,7 @@ private function close_socket() /** * Method to read data from the buffer stream. - * + * * @return string XML response * * @since 3.1 @@ -171,7 +171,7 @@ private function read_data() /** * Method to send data. - * + * * @param string $message XML request * * @return string $message XML response @@ -264,11 +264,11 @@ private function readData(&$fh, $timeout = 5) /* PHP doesn't have timeout for fread ... we just set the timeout for the socket */ socket_set_timeout($fh, $timeout); $header = $this->readHeader($fh, $timeout); - if (!$header || !isset($header{'content-length'}) || (empty($header{'content-length'}))) { + if (!$header || !isset($header['content-length']) || (empty($header['content-length']))) { throw new Exception('oSRS Error - UNEXPECTED ERROR: No Content-Length header provided! Please make sure IP is whitelisted in RWI.'); } - $len = (int) $header{'content-length'}; + $len = (int) $header['content-length']; $line = ''; while (strlen($line) < $len) { $line .= fread($fh, $len); @@ -302,13 +302,13 @@ public function convertArray2Formatted($type = '', $data = '') } /** - * Get configured tlds for domain call - * Will use (in order of preference)... - * 1. selected tlds - * 2. supplied default tlds + * Get configured tlds for domain call + * Will use (in order of preference)... + * 1. selected tlds + * 2. supplied default tlds * 3. included default tlds. - * - * @return array tlds + * + * @return array tlds */ public function getConfiguredTlds() { @@ -345,7 +345,7 @@ public function setDataObject($format, $dataObject) /** * Does the dataObject have a domain set? - * + * * @return bool */ public function hasDomain()