Skip to content

Commit

Permalink
PHP 7.0 changes
Browse files Browse the repository at this point in the history
Signed-off-by: Davis Peixoto <[email protected]>
  • Loading branch information
davispeixoto committed Feb 26, 2018
1 parent 28e149b commit cc2c18b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/Davispeixoto/ForceDotComToolkitForPhp/SObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct($response = null)
$this->fields = $this->convertFields($fieldsToConvert);
}

if (sizeof($anArray) > 0) {
if (count($anArray) > 0) {
foreach ($anArray as $key => $children_sobject) {
$this->fields->$key = $children_sobject;
}
Expand Down Expand Up @@ -289,5 +289,3 @@ public function isSObject($param)
return isset($param->type);
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function getNamespace()
public function printDebugInfo()
{
echo 'PHP Toolkit Version: ' . $this->version . PHP_EOL;
echo 'Current PHP version: ' . phpversion();
echo 'Current PHP version: ' . PHP_VERSION;
echo PHP_EOL;
echo 'SOAP enabled: ';
if (extension_loaded('soap')) {
Expand Down Expand Up @@ -114,7 +114,7 @@ public function printDebugInfo()
public function createConnection($wsdl, $proxy = null, $soap_options = array())
{
// use correct version comparison
if (version_compare(phpversion(), '5.3', '<')) {
if (version_compare(PHP_VERSION, '5.3', '<')) {
throw new Exception ('PHP versions older than 5.3 are no longer supported. Please upgrade!');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,3 @@ public function merge($mergeRequest, $type)
return parent::_merge($arg);
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct($wsdl, $loginResult, $sforceConn)
{
$soapClientArray = null;

$phpversion = substr(phpversion(), 0, strpos(phpversion(), '-'));
$phpversion = substr(PHP_VERSION, 0, strpos(PHP_VERSION, '-'));
if ($phpversion > '5.1.2') {
$soapClientArray = array(
'user_agent' => 'salesforce-toolkit-php/' . $this->version,
Expand Down Expand Up @@ -185,5 +185,3 @@ public function getLastResponseHeaders()
return $this->sforce->__getLastResponseHeaders();
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SforcePartnerClient extends SforceBaseClient
{
const PARTNER_NAMESPACE = 'urn:partner.soap.sforce.com';

function SforcePartnerClient()
public function __construct()
{
$this->namespace = self::PARTNER_NAMESPACE;
}
Expand Down

0 comments on commit cc2c18b

Please sign in to comment.