Skip to content

Commit 0a74b82

Browse files
committed
PHP 5.6 backward compatible changes
1 parent 26cd6b2 commit 0a74b82

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

lib/net/authorize/api/controller/base/ApiOperationBase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ public function execute($endPoint = \net\authorize\api\constants\ANetEnvironment
118118

119119
// $requestRoot = (new \net\authorize\api\contract\v1\Mapper)->getXmlName((new \ReflectionClass($this->apiRequest))->getName());
120120
// $requestRoot = (\net\authorize\api\contract\v1\Mapper::Instance())->getXmlName((new \ReflectionClass($this->apiRequest))->getName());
121-
$requestRoot = (\net\authorize\util\Mapper::Instance())->getXmlName((new \ReflectionClass($this->apiRequest))->getName());
121+
$mapper = \net\authorize\util\Mapper::Instance();
122+
$requestRoot = $mapper->getXmlName((new \ReflectionClass($this->apiRequest))->getName());
122123

123124
$requestArray = [$requestRoot => $this->apiRequest];
124125

lib/net/authorize/util/Mapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function Instance()
5353
// // return $this->classes[$classname]['properties'][$property]['type'];
5454
// }
5555

56-
public function getClass(string $class, string $property){
56+
public function getClass($class, $property){
5757

5858
//echo "getClass calling : class - " . $class . " property - " . $property . "\n";
5959
$obj = new MapperObj;
@@ -107,7 +107,7 @@ public function getClass(string $class, string $property){
107107
// return $this->classes[$classname]['properties'][$property]['type'];
108108
}
109109

110-
public function getXmlName(string $class){
110+
public function getXmlName($class){
111111
if(isset($this->classes[$class]['xml_root_name'])){
112112
return $this->classes[$class]['xml_root_name'];
113113
}

scripts/appendJsonSeralizeCode.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
foreach($values as $key => $value){
99
//$classDetails = (new \net\authorize\api\contract\v1\Mapper)->getClass(get_class() , $key);
1010
//$classDetails = (\net\authorize\api\contract\v1\Mapper::Instance())->getClass(get_class() , $key);
11-
$classDetails = (\net\authorize\util\Mapper::Instance())->getClass(get_class() , $key);
11+
$mapper = \net\authorize\util\Mapper::Instance();
12+
$classDetails = $mapper->getClass(get_class() , $key);
1213
if (isset($value)){
1314
//$classDetails = (new \net\authorize\api\contract\v1\Mapper)->getClass(get_class() , $key);
1415
if ($classDetails->className === 'Date'){

scripts/appendSetCode.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
//$classname = (new net\authorize\api\contract\v1\Mapper)->getClass(get_class() , $key);
77
//$classDetails = (new \net\authorize\api\contract\v1\Mapper)->getClass(get_class() , $key);
88
//$classDetails = (\net\authorize\api\contract\v1\Mapper::Instance())->getClass(get_class() , $key);
9-
$classDetails = (\net\authorize\util\Mapper::Instance())->getClass(get_class() , $key);
9+
$mapper = \net\authorize\util\Mapper::Instance();
10+
$classDetails = $mapper->getClass(get_class() , $key);
1011
//if (substr($classname, 0, 5) === "array") {
1112
// $classname = ltrim($classname, 'array<');
1213
// $classname = rtrim($classname, '>');

0 commit comments

Comments
 (0)