diff --git a/ToolkitApi/CW/I5Error.php b/ToolkitApi/CW/I5Error.php index f71c957..d73e814 100644 --- a/ToolkitApi/CW/I5Error.php +++ b/ToolkitApi/CW/I5Error.php @@ -8,13 +8,13 @@ */ class I5Error { - static $instance = null; - static protected $_i5Error = array(); + public static $instance = null; + protected static $_i5Error = array(); /** * @return null */ - static function getInstance() + public static function getInstance() { if(self::$instance == NULL){ $className = __CLASS__; diff --git a/ToolkitApi/CW/ToolkitServiceCw.php b/ToolkitApi/CW/ToolkitServiceCw.php index 3b106c6..c6330dd 100644 --- a/ToolkitApi/CW/ToolkitServiceCw.php +++ b/ToolkitApi/CW/ToolkitServiceCw.php @@ -10,7 +10,7 @@ */ class ToolkitServiceCw extends Toolkit { - static $instance = null; + public static $instance = null; public function __construct($database, $userOrI5NamingFlag, $password, $extensionPrefix, $isPersistent = false) { @@ -28,7 +28,7 @@ public function __construct($database, $userOrI5NamingFlag, $password, $extensio * @param bool $forceNew * @return bool|null */ - static function getInstance($databaseNameOrResource = '*LOCAL', $userOrI5NamingFlag = '', $password = '', $extensionPrefix = '', $isPersistent = false, $forceNew = false) + public static function getInstance($databaseNameOrResource = '*LOCAL', $userOrI5NamingFlag = '', $password = '', $extensionPrefix = '', $isPersistent = false, $forceNew = false) { // if we're forcing a new instance, close db conn first if exists. if ($forceNew && self::hasInstance() && isset(self::$instance->conn)) @@ -64,7 +64,7 @@ static function getInstance($databaseNameOrResource = '*LOCAL', $userOrI5NamingF * * @return boolean */ - static function hasInstance() + public static function hasInstance() { if (isset(self::$instance) && is_object(self::$instance)) { return true; diff --git a/ToolkitApi/CW/cw.php b/ToolkitApi/CW/cw.php index 38cf73f..afd85fb 100644 --- a/ToolkitApi/CW/cw.php +++ b/ToolkitApi/CW/cw.php @@ -615,7 +615,7 @@ function i5_pclose(ToolkitServiceCw &$connection) * @param ToolkitServiceCw $connection [optional] the result of i5_connect(), or omit * @return boolean True on success, False on failure */ -function i5_adopt_authority($user, $password, ToolkitServiceCw $connection=null) +function i5_adopt_authority($user, $password, ?ToolkitServiceCw $connection=null) { // if conn not passed in, get instance of toolkit. If can't be obtained, return false. if (!$connection = verifyConnection($connection)) { @@ -801,7 +801,7 @@ function i5_errormsg() * @param ToolkitServiceCw $connection Optional connection object * @return boolean for success/failure */ -function i5_command($cmdString, $input = array(), $output = array(), ToolkitServiceCw $connection = null) +function i5_command($cmdString, $input = array(), $output = array(), ?ToolkitServiceCw $connection = null) { // if conn not passed in, get instance of toolkit. If can't be obtained, return false. if (!$connection = verifyConnection($connection)) { @@ -1464,7 +1464,7 @@ function i5_jobLog_list_close(&$list = null) * @param ToolkitServiceCw $connection * @return bool|null */ -function verifyConnection(ToolkitServiceCw $connection = null) +function verifyConnection(?ToolkitServiceCw $connection = null) { // if conn passed and non-null but it's bad if ($connection && !is_a($connection, 'ToolkitApi\CW\ToolkitServiceCw')) { @@ -2082,7 +2082,7 @@ function i5_data_area_read($name, $offsetOrConnection = null, $length = null, $c * @param ToolkitServiceCw $connection * @return boolean True on success, false on failure */ -function i5_data_area_write($name, $value, $offsetOrConnection = null, $length = null, ToolkitServiceCw $connection=null) +function i5_data_area_write($name, $value, $offsetOrConnection = null, $length = null, ?ToolkitServiceCw $connection=null) { if (isset($length)) { // assume offset and length are both provided, since they come as a pair. @@ -2851,7 +2851,7 @@ function i5_objects_list_close(&$list) * @param ToolkitServiceCw $connection * @return \ToolkitApi\CW\DataDescription */ -function i5_dtaq_prepare($name, $description, $keySizeOrConnection = 0, ToolkitServiceCw $connection = null) +function i5_dtaq_prepare($name, $description, $keySizeOrConnection = 0, ?ToolkitServiceCw $connection = null) { $keySize = 0; // init // user is allowed to omit $keySize, so there may be a variable number of parameters diff --git a/ToolkitApi/DataArea.php b/ToolkitApi/DataArea.php index fe63b5b..529dc3a 100644 --- a/ToolkitApi/DataArea.php +++ b/ToolkitApi/DataArea.php @@ -16,7 +16,7 @@ class DataArea /** * @param ToolkitInterface $ToolkitSrvObj */ - public function __construct(ToolkitInterface $ToolkitSrvObj = null) + public function __construct(?ToolkitInterface $ToolkitSrvObj = null) { if ($ToolkitSrvObj instanceof Toolkit) { $this->ToolkitSrvObj = $ToolkitSrvObj; diff --git a/ToolkitApi/DataQueue.php b/ToolkitApi/DataQueue.php index e218877..cd7c273 100644 --- a/ToolkitApi/DataQueue.php +++ b/ToolkitApi/DataQueue.php @@ -17,7 +17,7 @@ class DataQueue /** * @param ToolkitInterface $ToolkitSrvObj */ - public function __construct(ToolkitInterface $ToolkitSrvObj = null) + public function __construct(?ToolkitInterface $ToolkitSrvObj = null) { if ($ToolkitSrvObj instanceof Toolkit) { $this->Toolkit = $ToolkitSrvObj ; diff --git a/ToolkitApi/DateTimeApi.php b/ToolkitApi/DateTimeApi.php index 7f0c02d..7fcda74 100644 --- a/ToolkitApi/DateTimeApi.php +++ b/ToolkitApi/DateTimeApi.php @@ -13,7 +13,7 @@ class DateTimeApi /** * @param ToolkitInterface $ToolkitSrvObj */ - public function __construct(ToolkitInterface $ToolkitSrvObj = null) + public function __construct(?ToolkitInterface $ToolkitSrvObj = null) { if ($ToolkitSrvObj instanceof Toolkit) { $this->ToolkitSrvObj = $ToolkitSrvObj ; diff --git a/ToolkitApi/JobLogs.php b/ToolkitApi/JobLogs.php index 46bc1c1..1c50e67 100644 --- a/ToolkitApi/JobLogs.php +++ b/ToolkitApi/JobLogs.php @@ -19,7 +19,7 @@ class JobLogs * @param ToolkitInterface $ToolkitSrvObj * @param string $tmpUSLib */ - public function __construct(ToolkitInterface $ToolkitSrvObj = null, $tmpUSLib = DFTLIB) + public function __construct(?ToolkitInterface $ToolkitSrvObj = null, $tmpUSLib = DFTLIB) { if ($ToolkitSrvObj instanceof Toolkit ) { $this->ToolkitSrvObj = $ToolkitSrvObj; diff --git a/ToolkitApi/ListFromApi.php b/ToolkitApi/ListFromApi.php index cf687de..2a83860 100644 --- a/ToolkitApi/ListFromApi.php +++ b/ToolkitApi/ListFromApi.php @@ -20,7 +20,7 @@ class ListFromApi * @param $lengthOfReceiverVariable * @param ToolkitInterface $ToolkitSrvObj */ - public function __construct($requestHandle, $totalRecords, $receiverDs, $lengthOfReceiverVariable, ToolkitInterface $ToolkitSrvObj = null) + public function __construct($requestHandle, $totalRecords, $receiverDs, $lengthOfReceiverVariable, ?ToolkitInterface $ToolkitSrvObj = null) { if ($ToolkitSrvObj instanceof Toolkit) { $this->ToolkitSrvObj = $ToolkitSrvObj; diff --git a/ToolkitApi/ObjectLists.php b/ToolkitApi/ObjectLists.php index 41085d4..6034c67 100644 --- a/ToolkitApi/ObjectLists.php +++ b/ToolkitApi/ObjectLists.php @@ -16,7 +16,7 @@ class ObjectLists /** * @param ToolkitInterface $ToolkitSrvObj */ - public function __construct(ToolkitInterface $ToolkitSrvObj = null) + public function __construct(?ToolkitInterface $ToolkitSrvObj = null) { if ($ToolkitSrvObj instanceof Toolkit) { $this->ToolkitSrvObj = $ToolkitSrvObj; diff --git a/ToolkitApi/SpooledFiles.php b/ToolkitApi/SpooledFiles.php index 458f015..7f92368 100644 --- a/ToolkitApi/SpooledFiles.php +++ b/ToolkitApi/SpooledFiles.php @@ -19,7 +19,7 @@ class SpooledFiles * @param ToolkitInterface $ToolkitSrvObj * @param null $UserLib */ - public function __construct(ToolkitInterface $ToolkitSrvObj = NULL, $UserLib = NULL) + public function __construct(?ToolkitInterface $ToolkitSrvObj = NULL, $UserLib = NULL) { if ($ToolkitSrvObj instanceof Toolkit) { $this->ToolkitSrvObj = $ToolkitSrvObj; diff --git a/ToolkitApi/SystemValues.php b/ToolkitApi/SystemValues.php index 7f76807..c0ce9ea 100644 --- a/ToolkitApi/SystemValues.php +++ b/ToolkitApi/SystemValues.php @@ -14,7 +14,7 @@ class SystemValues /** * @param ToolkitInterface $ToolkitSrvObj */ - public function __construct(ToolkitInterface $ToolkitSrvObj = null){ + public function __construct(?ToolkitInterface $ToolkitSrvObj = null){ if ($ToolkitSrvObj instanceof Toolkit) { $this->ToolkitSrvObj = $ToolkitSrvObj; return $this; @@ -105,7 +105,7 @@ public function getError() { /** * @param $errCode */ - private function setError($errCode) + private function setError($errCode) { if ($errCode == '') /*clear error message*/ { $this->ErrMessage = ''; diff --git a/ToolkitApi/TmpUserSpace.php b/ToolkitApi/TmpUserSpace.php index 477e085..b458f99 100644 --- a/ToolkitApi/TmpUserSpace.php +++ b/ToolkitApi/TmpUserSpace.php @@ -11,7 +11,7 @@ class TmpUserSpace extends UserSpace * @param int $DftUsSize * @throws \Exception */ - function __construct($Toolkit, $UsLib = DFTLIB, $DftUsSize = 32700) + public function __construct($Toolkit, $UsLib = DFTLIB, $DftUsSize = 32700) { parent::__construct($Toolkit); @@ -27,7 +27,7 @@ function __construct($Toolkit, $UsLib = DFTLIB, $DftUsSize = 32700) /** * @todo do not delete */ - function __destruct() + public function __destruct() { // $this->DeleteUserSpace(); } diff --git a/ToolkitApi/Toolkit.php b/ToolkitApi/Toolkit.php index 180bbb9..db7cfe6 100644 --- a/ToolkitApi/Toolkit.php +++ b/ToolkitApi/Toolkit.php @@ -18,7 +18,7 @@ */ class Toolkit implements ToolkitInterface { - const VERSION = "1.9.6"; // version number for front-end PHP toolkit + public const VERSION = "1.9.6"; // version number for front-end PHP toolkit /* @todo use inputXml and outputXml to make this class more flexibly OO-like. Fewer strings copied around. * Better would be to use a Request object that has a connection. @@ -53,8 +53,8 @@ class Toolkit implements ToolkitInterface protected $_isCw = false; // whether the CW is used for this instance. - static protected $_config; // config options from INI file. Accessed by static method getConfigValue(); - static protected $_os; // operating system + protected static $_config; // config options from INI file. Accessed by static method getConfigValue(); + protected static $_os; // operating system // brought over from CW protected $joblog = ''; @@ -1139,7 +1139,7 @@ public function getDiagnostics($info = 'joblog', $jobName = '', $jobUser = '', $ * * @return string Version number (e.g. '1.4.0') */ - static function getFrontEndVersion() + public static function getFrontEndVersion() { return self::VERSION; } @@ -1170,7 +1170,7 @@ public function getBackEndVersion() * @param $library * @return string Version number (e.g. '1.8.0') */ - static function getLocalBackEndVersion($library) + public static function getLocalBackEndVersion($library) { $cmd = "qsh -c /qsys.lib/$library.lib/xmlver.pgm"; @@ -1395,7 +1395,7 @@ public function ClCommandWithCpf($command) * @param int $dimension * @return array */ - static function AddParameter($type, $io, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0) + public static function AddParameter($type, $io, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0) { return array ('type' => $type, // storage 'io' => $io, // in/out/both @@ -1421,7 +1421,7 @@ static function AddParameter($type, $io, $comment, $varName = '', $value = '', $ * @param bool $useHex * @return CharParam */ - static function AddParameterChar($io, $size , $comment, $varName = '', $value= '', $varying = 'off',$dimension = 0, + public static function AddParameterChar($io, $size , $comment, $varName = '', $value= '', $varying = 'off',$dimension = 0, $by='', $isArray = false, $ccsidBefore = '', $ccsidAfter = '', $useHex = false) { return new CharParam($io, $size , $comment, $varName, $value , $varying , $dimension, $by, @@ -1436,7 +1436,7 @@ static function AddParameterChar($io, $size , $comment, $varName = '', $value= ' * @param int $dimension * @return Int32Param */ - static function AddParameterInt32($io, $comment, $varName = '', $value = '', $dimension = 0) + public static function AddParameterInt32($io, $comment, $varName = '', $value = '', $dimension = 0) { return new Int32Param($io, $comment, $varName, $value, $dimension); } @@ -1447,7 +1447,7 @@ static function AddParameterInt32($io, $comment, $varName = '', $value = '', $di * @param $labelFindLen * @return SizeParam */ - static function AddParameterSize($comment, $varName = '', $labelFindLen = 0) + public static function AddParameterSize($comment, $varName = '', $labelFindLen = 0) { return new SizeParam($comment, $varName, $labelFindLen); } @@ -1458,7 +1458,7 @@ static function AddParameterSize($comment, $varName = '', $labelFindLen = 0) * @param $labelFindLen * @return SizePackParam */ - static function AddParameterSizePack($comment, $varName = '', $labelFindLen = 0) + public static function AddParameterSizePack($comment, $varName = '', $labelFindLen = 0) { return new SizePackParam($comment, $varName, $labelFindLen); } @@ -1497,7 +1497,7 @@ public static function AddParameterInt16($io, $comment, $varName='', $value='', * @param int $dimension * @return Int64Param */ - static function AddParameterInt64($io, $comment, $varName = '', $value = '', $dimension = 0) + public static function AddParameterInt64($io, $comment, $varName = '', $value = '', $dimension = 0) { return new Int64Param($io, $comment, $varName, $value, $dimension); } @@ -1536,7 +1536,7 @@ public static function AddParameterUInt16($io, $comment, $varName='', $value='', * @param int $dimension * @return UInt32Param */ - static function AddParameterUInt32($io, $comment, $varName = '', $value = '', $dimension =0) + public static function AddParameterUInt32($io, $comment, $varName = '', $value = '', $dimension =0) { return new UInt32Param($io, $comment, $varName, $value, $dimension) ; // removed erroneous "off" } @@ -1549,7 +1549,7 @@ static function AddParameterUInt32($io, $comment, $varName = '', $value = '', $d * @param int $dimension * @return UInt64Param */ - static function AddParameterUInt64($io, $comment, $varName = '', $value='', $dimension=0) + public static function AddParameterUInt64($io, $comment, $varName = '', $value='', $dimension=0) { return new UInt64Param($io, $comment, $varName, $value, $dimension); } @@ -1562,7 +1562,7 @@ static function AddParameterUInt64($io, $comment, $varName = '', $value='', $dim * @param int $dimension * @return FloatParam */ - static function AddParameterFloat($io, $comment, $varName = '', $value='', $dimension=0) + public static function AddParameterFloat($io, $comment, $varName = '', $value='', $dimension=0) { return(new FloatParam($io, $comment, $varName, $value, $dimension)); } @@ -1575,7 +1575,7 @@ static function AddParameterFloat($io, $comment, $varName = '', $value='', $dime * @param int $dimension * @return RealParam */ - static function AddParameterReal($io, $comment, $varName = '', $value='', $dimension=0) + public static function AddParameterReal($io, $comment, $varName = '', $value='', $dimension=0) { return new RealParam($io, $comment, $varName, $value, $dimension); } @@ -1590,7 +1590,7 @@ static function AddParameterReal($io, $comment, $varName = '', $value='', $dimen * @param int $dimension * @return PackedDecParam */ - static function AddParameterPackDec($io, $length ,$scale , $comment, $varName = '', $value='', $dimension=0) + public static function AddParameterPackDec($io, $length ,$scale , $comment, $varName = '', $value='', $dimension=0) { return new PackedDecParam($io, $length ,$scale , $comment, $varName, $value, $dimension); } @@ -1605,7 +1605,7 @@ static function AddParameterPackDec($io, $length ,$scale , $comment, $varName = * @param int $dimension * @return ZonedParam */ - static function AddParameterZoned($io, $length ,$scale , $comment, $varName = '', $value='', $dimension=0) + public static function AddParameterZoned($io, $length ,$scale , $comment, $varName = '', $value='', $dimension=0) { return new ZonedParam($io, $length ,$scale , $comment, $varName , $value, $dimension); } @@ -1617,7 +1617,7 @@ static function AddParameterZoned($io, $length ,$scale , $comment, $varName = '' * @param string $comment * @return HoleParam */ - static function AddParameterHole($size , $comment='hole') + public static function AddParameterHole($size , $comment='hole') { return new HoleParam($size, $comment); } @@ -1631,7 +1631,7 @@ static function AddParameterHole($size , $comment='hole') * @param int $dimension * @return BinParam */ - static function AddParameterBin($io, $size , $comment, $varName = '', $value='',$dimension =0) + public static function AddParameterBin($io, $size , $comment, $varName = '', $value='',$dimension =0) { return new BinParam($io, $size , $comment, $varName, $value,$dimension); } @@ -1640,7 +1640,7 @@ static function AddParameterBin($io, $size , $comment, $varName = '', $value='', * @param $array * @return array */ - static function AddParameterArray($array) + public static function AddParameterArray($array) { $params = array(); @@ -1668,7 +1668,7 @@ static function AddParameterArray($array) * @param string $io * @return DataStructure */ - static function AddDataStruct(array $parameters, $name='struct_name', $dim=0, $by='', $isArray=false, $labelLen = null, $comment = '', $io = 'both') + public static function AddDataStruct(array $parameters, $name='struct_name', $dim=0, $by='', $isArray=false, $labelLen = null, $comment = '', $io = 'both') { return new DataStructure($parameters, $name, $dim, $comment, $by, $isArray, $labelLen, $io); } @@ -1676,7 +1676,7 @@ static function AddDataStruct(array $parameters, $name='struct_name', $dim=0, $b /** * @return DataStructure */ - static function AddErrorDataStruct() + public static function AddErrorDataStruct() { return new DataStructure(self::GenerateErrorParameter(), 'errorDs', 0); } @@ -1688,7 +1688,7 @@ static function AddErrorDataStruct() * * @return DataStructure */ - static function AddErrorDataStructZeroBytes() + public static function AddErrorDataStructZeroBytes() { return new DataStructure(self::GenerateErrorParameterZeroBytes(), 'errorDs', 0); } @@ -1715,7 +1715,7 @@ static function AddErrorDataStructZeroBytes() * @param int $paramNum * @return string */ - static function getErrorDataStructXml($paramNum = 0) + public static function getErrorDataStructXml($paramNum = 0) { $paramNumStr = ($paramNum) ? ($paramNum . '.') : ''; @@ -1734,7 +1734,7 @@ static function getErrorDataStructXml($paramNum = 0) * @param int $paramNum * @return string */ - static function getErrorDataStructXmlWithCode($paramNum = 0) + public static function getErrorDataStructXmlWithCode($paramNum = 0) { $paramNumStr = ($paramNum) ? ($paramNum . '.') : ''; @@ -1754,7 +1754,7 @@ static function getErrorDataStructXmlWithCode($paramNum = 0) * @param int $paramNum * @return string */ - static function getListInfoApiXml($paramNum = 0) + public static function getListInfoApiXml($paramNum = 0) { $paramNumStr = ($paramNum) ? ($paramNum . '.') : ''; @@ -1781,7 +1781,7 @@ static function getListInfoApiXml($paramNum = 0) * @param int $paramNum * @return string */ - static function getNumberOfRecordsDesiredApiXml($paramNum = 0) + public static function getNumberOfRecordsDesiredApiXml($paramNum = 0) { $paramNumStr = ($paramNum) ? ($paramNum . '.') : ''; @@ -1796,7 +1796,7 @@ static function getNumberOfRecordsDesiredApiXml($paramNum = 0) * @param int $paramNum * @return string */ - static function getSortInformationApiXml($paramNum = 0) + public static function getSortInformationApiXml($paramNum = 0) { $paramNumStr = ($paramNum) ? ($paramNum . '.') : ''; @@ -1815,7 +1815,7 @@ static function getSortInformationApiXml($paramNum = 0) * @param $lengthOfReceiverVariable * @return string */ - static function getDummyReceiverAndLengthApiXml($paramNum, $lengthOfReceiverVariable) + public static function getDummyReceiverAndLengthApiXml($paramNum, $lengthOfReceiverVariable) { $paramNumStr = $paramNum . '.'; $paramNumStrNext = ($paramNum + 1) . '.'; @@ -2060,7 +2060,7 @@ public function generate_name() * * @return array */ - static function GenerateErrorParameter() + public static function GenerateErrorParameter() { $ErrBytes = 144; $ErrBytesAv = 144; @@ -2083,7 +2083,7 @@ static function GenerateErrorParameter() * * @return array */ - static function GenerateErrorParameterZeroBytes() + public static function GenerateErrorParameterZeroBytes() { $ErrBytes = 0; // changed $this to self so can work in static context @@ -2244,7 +2244,7 @@ public function getJobAttributes() * * @return string */ - static function classPath() + public static function classPath() { return __FILE__; } @@ -2384,7 +2384,7 @@ protected function extractErrorFromJoblog(array $programsToLookFor) * @param string $password * @return boolean True on success, False on failure */ - function changeCurrentUser($user, $password) + public function changeCurrentUser($user, $password) { // Force user/pw to uppercase. (should they?) // Ask Support team for opinion on uppercase or not. @@ -2487,7 +2487,7 @@ function changeCurrentUser($user, $password) * @param mixed|null $default * @return bool|null */ - static function getConfigValue($heading, $key, $default = null) + public static function getConfigValue($heading, $key, $default = null) { // if we haven't read config file yet, do so. if (!isset(self::$_config)) { @@ -2510,7 +2510,7 @@ static function getConfigValue($heading, $key, $default = null) * * @return string */ - static function getPhpOperatingSystem() { + public static function getPhpOperatingSystem() { if (!isset(self::$_os)) { self::$_os = php_uname('s'); @@ -2524,7 +2524,7 @@ static function getPhpOperatingSystem() { * * @return bool */ - static function isPhpRunningOnIbmI() + public static function isPhpRunningOnIbmI() { return (self::getPhpOperatingSystem() == 'OS400'); } @@ -2539,7 +2539,7 @@ static function isPhpRunningOnIbmI() * * @return bool */ - static function getPhpCcsid() + public static function getPhpCcsid() { if (isset($_SERVER['CCSID'])) { // web/fastcgi diff --git a/ToolkitApi/ToolkitInterface.php b/ToolkitApi/ToolkitInterface.php index 757e63e..32fd988 100644 --- a/ToolkitApi/ToolkitInterface.php +++ b/ToolkitApi/ToolkitInterface.php @@ -155,7 +155,7 @@ public function getDiagnostics($info = 'joblog', $jobName = '', $jobUser = '', $ /** * @return string Version number (e.g. '1.4.0') */ - static function getFrontEndVersion(); + public static function getFrontEndVersion(); /** * @return string Version @@ -166,7 +166,7 @@ public function getBackEndVersion(); * @param $library * @return string Version number (e.g. '1.8.0') */ - static function getLocalBackEndVersion($library); + public static function getLocalBackEndVersion($library); /** * @param array $command string will be turned into an array @@ -215,7 +215,7 @@ public function ClCommandWithCpf($command); * @param int $dimension * @return array */ - static function AddParameter($type, $io, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0); + public static function AddParameter($type, $io, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0); /** * @param $io @@ -232,7 +232,7 @@ static function AddParameter($type, $io, $comment, $varName = '', $value = '', $ * @param bool $useHex * @return CharParam */ - static function AddParameterChar($io, $size, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0, $by = '', $isArray = false, $ccsidBefore = '', $ccsidAfter = '', $useHex = false); + public static function AddParameterChar($io, $size, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0, $by = '', $isArray = false, $ccsidBefore = '', $ccsidAfter = '', $useHex = false); /** * @param $io @@ -242,7 +242,7 @@ static function AddParameterChar($io, $size, $comment, $varName = '', $value = ' * @param int $dimension * @return Int32Param */ - static function AddParameterInt32($io, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterInt32($io, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $comment @@ -250,7 +250,7 @@ static function AddParameterInt32($io, $comment, $varName = '', $value = '', $di * @param $labelFindLen * @return SizeParam */ - static function AddParameterSize($comment, $varName = '', $labelFindLen = 0); + public static function AddParameterSize($comment, $varName = '', $labelFindLen = 0); /** * @param $comment @@ -258,7 +258,7 @@ static function AddParameterSize($comment, $varName = '', $labelFindLen = 0); * @param $labelFindLen * @return SizePackParam */ - static function AddParameterSizePack($comment, $varName = '', $labelFindLen = 0); + public static function AddParameterSizePack($comment, $varName = '', $labelFindLen = 0); /** * @param $io @@ -288,7 +288,7 @@ public static function AddParameterInt16($io, $comment, $varName = '', $value = * @param int $dimension * @return Int64Param */ - static function AddParameterInt64($io, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterInt64($io, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $io @@ -318,7 +318,7 @@ public static function AddParameterUInt16($io, $comment, $varName = '', $value = * @param int $dimension * @return UInt32Param */ - static function AddParameterUInt32($io, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterUInt32($io, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $io @@ -328,7 +328,7 @@ static function AddParameterUInt32($io, $comment, $varName = '', $value = '', $d * @param int $dimension * @return UInt64Param */ - static function AddParameterUInt64($io, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterUInt64($io, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $io @@ -338,7 +338,7 @@ static function AddParameterUInt64($io, $comment, $varName = '', $value = '', $d * @param int $dimension * @return FloatParam */ - static function AddParameterFloat($io, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterFloat($io, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $io @@ -348,7 +348,7 @@ static function AddParameterFloat($io, $comment, $varName = '', $value = '', $di * @param int $dimension * @return RealParam */ - static function AddParameterReal($io, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterReal($io, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $io @@ -360,7 +360,7 @@ static function AddParameterReal($io, $comment, $varName = '', $value = '', $dim * @param int $dimension * @return PackedDecParam */ - static function AddParameterPackDec($io, $length, $scale, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterPackDec($io, $length, $scale, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $io @@ -372,14 +372,14 @@ static function AddParameterPackDec($io, $length, $scale, $comment, $varName = ' * @param int $dimension * @return ZonedParam */ - static function AddParameterZoned($io, $length, $scale, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterZoned($io, $length, $scale, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $size * @param string $comment * @return HoleParam */ - static function AddParameterHole($size, $comment = 'hole'); + public static function AddParameterHole($size, $comment = 'hole'); /** * @param $io @@ -390,13 +390,13 @@ static function AddParameterHole($size, $comment = 'hole'); * @param int $dimension * @return BinParam */ - static function AddParameterBin($io, $size, $comment, $varName = '', $value = '', $dimension = 0); + public static function AddParameterBin($io, $size, $comment, $varName = '', $value = '', $dimension = 0); /** * @param $array * @return array */ - static function AddParameterArray($array); + public static function AddParameterArray($array); /** * @param array $parameters @@ -409,54 +409,54 @@ static function AddParameterArray($array); * @param string $io * @return DataStructure */ - static function AddDataStruct(array $parameters, $name = 'struct_name', $dim = 0, $by = '', $isArray = false, $labelLen = null, $comment = '', $io = 'both'); + public static function AddDataStruct(array $parameters, $name = 'struct_name', $dim = 0, $by = '', $isArray = false, $labelLen = null, $comment = '', $io = 'both'); /** * @return DataStructure */ - static function AddErrorDataStruct(); + public static function AddErrorDataStruct(); /** * @return DataStructure */ - static function AddErrorDataStructZeroBytes(); + public static function AddErrorDataStructZeroBytes(); /** * @param int $paramNum * @return string */ - static function getErrorDataStructXml($paramNum = 0); + public static function getErrorDataStructXml($paramNum = 0); /** * @param int $paramNum * @return string */ - static function getErrorDataStructXmlWithCode($paramNum = 0); + public static function getErrorDataStructXmlWithCode($paramNum = 0); /** * @param int $paramNum * @return string */ - static function getListInfoApiXml($paramNum = 0); + public static function getListInfoApiXml($paramNum = 0); /** * @param int $paramNum * @return string */ - static function getNumberOfRecordsDesiredApiXml($paramNum = 0); + public static function getNumberOfRecordsDesiredApiXml($paramNum = 0); /** * @param int $paramNum * @return string */ - static function getSortInformationApiXml($paramNum = 0); + public static function getSortInformationApiXml($paramNum = 0); /** * @param int $paramNum * @param $lengthOfReceiverVariable * @return string */ - static function getDummyReceiverAndLengthApiXml($paramNum, $lengthOfReceiverVariable); + public static function getDummyReceiverAndLengthApiXml($paramNum, $lengthOfReceiverVariable); /** * @return string @@ -501,12 +501,12 @@ public function generate_name(); /** * @return array */ - static function GenerateErrorParameter(); + public static function GenerateErrorParameter(); /** * @return array */ - static function GenerateErrorParameterZeroBytes(); + public static function GenerateErrorParameterZeroBytes(); /** * @param $retPgmArr @@ -552,14 +552,14 @@ public function getJobAttributes(); /** * @return string */ - static function classPath(); + public static function classPath(); /** * @param string $user Generally should be uppercase * @param string $password * @return boolean True on success, False on failure */ - function changeCurrentUser($user, $password); + public function changeCurrentUser($user, $password); /** * @param $heading @@ -567,20 +567,20 @@ function changeCurrentUser($user, $password); * @param null $default * @return bool|null */ - static function getConfigValue($heading, $key, $default = null); + public static function getConfigValue($heading, $key, $default = null); /** * @return string */ - static function getPhpOperatingSystem(); + public static function getPhpOperatingSystem(); /** * @return bool */ - static function isPhpRunningOnIbmI(); + public static function isPhpRunningOnIbmI(); /** * @return bool */ - static function getPhpCcsid(); + public static function getPhpCcsid(); } diff --git a/ToolkitApi/ToolkitService.php b/ToolkitApi/ToolkitService.php index cc89c1a..8451d5e 100644 --- a/ToolkitApi/ToolkitService.php +++ b/ToolkitApi/ToolkitService.php @@ -20,7 +20,7 @@ class ToolkitService * @param bool|array $isPersistent * @return Toolkit */ - static function getInstance($databaseNameOrResource = '*LOCAL', $userOrI5NamingFlag = '', $password = '', $transportType = '', $isPersistent = false) + public static function getInstance($databaseNameOrResource = '*LOCAL', $userOrI5NamingFlag = '', $password = '', $transportType = '', $isPersistent = false) { return new Toolkit($databaseNameOrResource, $userOrI5NamingFlag, $password, $transportType, $isPersistent); } diff --git a/ToolkitApi/ToolkitServiceParameter.php b/ToolkitApi/ToolkitServiceParameter.php index 6a6055d..2b99990 100644 --- a/ToolkitApi/ToolkitServiceParameter.php +++ b/ToolkitApi/ToolkitServiceParameter.php @@ -8,20 +8,20 @@ */ class ProgramParameter { - protected $type; /*storage */ - protected $io; /*in/out/both*/ - protected $comment; /*comment*/ - protected $varName; /*variable name*/ - protected $data; /*value */ - protected $varying; /*varying on/varying off */ - protected $dimension; - protected $by; /* val or ref */ - protected $isArray; /* treat as an array of similarly defined data. true or false */ - protected $labelSetLen; /* use on an integer field to set length there based on labelLen (see below) */ - protected $labelLen; /* use this on a data structure to get the size/length */ - protected $labelDoUntil = ''; /* use on a data structure array along with 'dim' to to set # of records to return based on labelEndDo (see below) */ - protected $labelEndDo = ''; /* use this on an integer "count" field to control the number of records to return in n array data structure (see labelDoUntil above) */ - protected $returnParameter; + protected $type; /*storage */ + protected $io; /*in/out/both*/ + protected $comment; /*comment*/ + protected $varName; /*variable name*/ + protected $data; /*value */ + protected $varying; /*varying on/varying off */ + protected $dimension; + protected $by; /* val or ref */ + protected $isArray; /* treat as an array of similarly defined data. true or false */ + protected $labelSetLen; /* use on an integer field to set length there based on labelLen (see below) */ + protected $labelLen; /* use this on a data structure to get the size/length */ + protected $labelDoUntil = ''; /* use on a data structure array along with 'dim' to to set # of records to return based on labelEndDo (see below) */ + protected $labelEndDo = ''; /* use this on an integer "count" field to control the number of records to return in n array data structure (see labelDoUntil above) */ + protected $returnParameter; // CCSID/hex support protected $_ccsidBefore; @@ -29,7 +29,7 @@ class ProgramParameter protected $_useHex; // if data field is not named, the toolkit creates a name of the pattern var0, var1, var2... - static protected $_fallbackNameSequence = 0; // start with zero to give unnamed elements a unique name + protected static $_fallbackNameSequence = 0; // start with zero to give unnamed elements a unique name // @todo do setlen for other program param types, too @@ -50,7 +50,7 @@ class ProgramParameter * @param bool $useHex * @throws \Exception */ - function __construct( $type, $io, $comment='', $varName = '', $value = '', $varying = 'off', $dimension = 0, $by = 'ref', $isArray = false, $labelSetLen = null, $labelLen = null, + public function __construct( $type, $io, $comment='', $varName = '', $value = '', $varying = 'off', $dimension = 0, $by = 'ref', $isArray = false, $labelSetLen = null, $labelLen = null, $ccsidBefore = '', $ccsidAfter = '', $useHex = false) { // some properties are different if value is an array (implement via a data structure). @@ -154,7 +154,7 @@ public function setParamProperties($properties = array()) /** * for unnamed data elements, to provide a unique name initialized by PgmCall method, so make public. */ - static function initializeFallbackVarName() + public static function initializeFallbackVarName() { self::$_fallbackNameSequence = 0; //static variable } @@ -396,7 +396,7 @@ public function isReturn() * @param $arrParams * @param array $arrValues */ - static function UpdateParameterValues(&$arrParams, array $arrValues) + public static function UpdateParameterValues(&$arrParams, array $arrValues) { if (!is_array($arrValues) || !is_array($arrParams)) { return false; @@ -433,7 +433,7 @@ static function UpdateParameterValues(&$arrParams, array $arrValues) * @param $hex_data * @return string */ - static function bin2str( $hex_data ) + public static function bin2str( $hex_data ) { $str=''; $upto = strlen($hex_data); @@ -476,7 +476,7 @@ class DataStructure extends ProgramParameter * @param int|null $labelLen * @param string $io */ - function __construct($paramsArray, $struct_name ="DataStruct", $dim=0, $comment = '', $by='', $isArray=false, $labelLen = null, $io = 'both') + public function __construct($paramsArray, $struct_name ="DataStruct", $dim=0, $comment = '', $by='', $isArray=false, $labelLen = null, $io = 'both') { parent::__construct("ds", $io, $comment, $struct_name, $paramsArray, 'off', $dim, $by, $isArray, null, $labelLen); } @@ -507,7 +507,7 @@ class CharParam extends ProgramParameter * @param string $ccsidAfter * @param bool $useHex */ - function __construct($io, $size, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0, $by='', $isArray = false, + public function __construct($io, $size, $comment, $varName = '', $value = '', $varying = 'off', $dimension = 0, $by='', $isArray = false, $ccsidBefore = '', $ccsidAfter = '', $useHex = false) { $type = sprintf("%dA", $size); @@ -536,7 +536,7 @@ class ZonedParam extends ProgramParameter * @param string $by * @param bool $isArray */ - function __construct($io, $length, $scale, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) + public function __construct($io, $length, $scale, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) { $type = sprintf("%ds%d", $length, $scale); parent::__construct($type, $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray, null, null, '', '', false); @@ -564,7 +564,7 @@ class PackedDecParam extends ProgramParameter * @param bool $isArray * @param int|null $labelSetLen */ - function __construct($io, $length, $scale, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false, $labelSetLen = null) + public function __construct($io, $length, $scale, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false, $labelSetLen = null) { $type = sprintf("%dp%d", $length, $scale); parent::__construct( $type, $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray, $labelSetLen, null, '', '', false); @@ -589,7 +589,7 @@ class Int32Param extends ProgramParameter * @param bool $isArray * @param int|null $labelSetLen */ - function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false, $labelSetLen = null) + public function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false, $labelSetLen = null) { parent::__construct('10i0', $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray, $labelSetLen, null); return $this; @@ -609,7 +609,7 @@ class SizeParam extends Int32Param * @param string $varName * @param string $labelSetLen */ - function __construct($comment, $varName = '', $labelSetLen = null) + public function __construct($comment, $varName = '', $labelSetLen = null) { parent::__construct('in', $comment, $varName, 0, 0, '', false, $labelSetLen); return $this; @@ -629,7 +629,7 @@ class SizePackParam extends PackedDecParam * @param string $varName * @param string $labelSetLen */ - function __construct($comment, $varName = '', $labelSetLen = null) + public function __construct($comment, $varName = '', $labelSetLen = null) { parent::__construct('in', 5, 0, $comment, $varName, 0, 0, '', false, $labelSetLen); return $this; @@ -652,7 +652,7 @@ class Int64Param extends ProgramParameter * @param string $by * @param bool $isArray */ - function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) + public function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) { parent::__construct('20i0', $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray); return $this; @@ -675,7 +675,7 @@ class UInt32Param extends ProgramParameter * @param string $by * @param bool $isArray */ - function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) + public function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) { parent::__construct('10u0', $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray); return $this; @@ -698,7 +698,7 @@ class UInt64Param extends ProgramParameter * @param string $by * @param bool $isArray */ - function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) + public function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) { parent::__construct('20u0', $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray); return $this; @@ -721,7 +721,7 @@ class FloatParam extends ProgramParameter * @param string $by * @param bool $isArray */ - function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) + public function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) { parent::__construct('4f', $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray); return $this; @@ -744,7 +744,7 @@ class RealParam extends ProgramParameter * @param string $by * @param bool $isArray */ - function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) + public function __construct($io, $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) { parent::__construct('8f', $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray); return $this; @@ -763,7 +763,7 @@ class HoleParam extends ProgramParameter * @param $length * @param string $comment */ - function __construct($length, $comment = 'hole') + public function __construct($length, $comment = 'hole') { $type = sprintf("%dh", $length); // note, no varname or value needed because data will be ignored. @@ -790,7 +790,7 @@ class BinParam extends ProgramParameter * @param string $by * @param bool $isArray */ - function __construct($io, $size , $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) + public function __construct($io, $size , $comment, $varName = '', $value = '', $dimension=0, $by='', $isArray = false) { $type = sprintf("%dB", $size); parent::__construct($type, $io, $comment, $varName, $value, 'off', $dimension, $by, $isArray); @@ -801,7 +801,7 @@ function __construct($io, $size , $comment, $varName = '', $value = '', $dimensi * @param $hex_data * @return string */ - static function bin2str($hex_data) + public static function bin2str($hex_data) { return parent::bin2str($hex_data); } diff --git a/ToolkitApi/ToolkitServiceXML.php b/ToolkitApi/ToolkitServiceXML.php index f817acf..ca70a00 100644 --- a/ToolkitApi/ToolkitServiceXML.php +++ b/ToolkitApi/ToolkitServiceXML.php @@ -369,7 +369,7 @@ public function parseDiagnosticsXml($xml) * @param null $function * @return string */ - public function buildXmlIn($inputOutputParams = NULL, array $returnParams = NULL, + public function buildXmlIn($inputOutputParams = NULL, ?array $returnParams = NULL, $pgm = "", $lib = "", $function = NULL) diff --git a/ToolkitApi/UserSpace.php b/ToolkitApi/UserSpace.php index e0649c7..ae8e4f6 100644 --- a/ToolkitApi/UserSpace.php +++ b/ToolkitApi/UserSpace.php @@ -13,7 +13,7 @@ class UserSpace /** * @param ToolkitInterface $ToolkitSrvObj */ - public function __construct(ToolkitInterface $ToolkitSrvObj = null) + public function __construct(?ToolkitInterface $ToolkitSrvObj = null) { if ($ToolkitSrvObj instanceof Toolkit) { $this->ToolkitSrvObj = $ToolkitSrvObj ; diff --git a/tests/functional/ToolkitTest.php b/tests/functional/ToolkitTest.php index d8e9152..9149943 100644 --- a/tests/functional/ToolkitTest.php +++ b/tests/functional/ToolkitTest.php @@ -9,7 +9,7 @@ final class ToolkitTest extends TestCase { - const TEMPORARY_LIBRARY = 'MYLIB1'; + public const TEMPORARY_LIBRARY = 'MYLIB1'; /** * @var array