Skip to content

Commit dd2d104

Browse files
committed
ToolkitServiceParameter: Cleaned up docblocks and some comments.
1 parent b1172bd commit dd2d104

File tree

1 file changed

+5
-58
lines changed

1 file changed

+5
-58
lines changed

ToolkitApi/ToolkitServiceParameter.php

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,20 @@ static function initializeFallbackVarName()
159159
}
160160

161161
/**
162+
* for unnamed data elements, provide a unique name: var0, var1, var2...
163+
*
162164
* @return string
163165
*/
164166
protected function getFallbackVarName()
165167
{
166-
// for unnamed data elements, provide a unique name: var0, var1, var2...
167-
// Then increment sequence for next time.
168-
// This works better than in the original new toolkit, where the var(n) only was applied if 'var was not set as a variable at all.
169-
// whereas often there's a 'var' attribute but it's empty.
170168
$varName = 'var' . self::$_fallbackNameSequence++;
171169

172170
return $varName;
173171
}
174172

175173
/**
174+
* if $value is an array, but not yet a data structure, make a data structure of the array elements.
175+
*
176176
* @param $type
177177
* @param $io
178178
* @param $comment
@@ -193,10 +193,6 @@ protected function getFallbackVarName()
193193
protected function handleParamValue($type, $io, $comment, $varName, $value, $varying, $dimension, $by, $isArray,
194194
$labelSetLen, $labelLen, $ccsidBefore, $ccsidAfter, $useHex)
195195
{
196-
197-
// added....
198-
// if $value is an array, but not yet a data structure, make a data structure of the array elements.
199-
/// same for $dim
200196
if (is_array($value) && ($type != 'ds')) {
201197
$count = count($value);
202198

@@ -394,14 +390,13 @@ public function isReturn()
394390
* updates $arrParams, so pass it by reference.
395391
* $arrParms is an array of parameter arrays or objects.
396392
*
397-
* Note: no return value. The first parameter, $arrayParams, gets updated.
393+
* @deprecated Can't find where this function is used.
398394
*
399395
* @param $arrParams
400396
* @param array $arrValues
401397
*/
402398
static function UpdateParameterValues(&$arrParams, array $arrValues)
403399
{
404-
// if either argument is not an array, leave.
405400
if (!is_array($arrValues) || !is_array($arrParams)) {
406401
return false;
407402
}
@@ -457,54 +452,6 @@ static function bin2str( $hex_data )
457452

458453
return $str;
459454
}
460-
461-
/**
462-
* ParametersToArray is deprecated. No longer needed
463-
*
464-
* @param null $arrParams
465-
* @return array|null
466-
*/
467-
static function ParametersToArray($arrParams = null)
468-
{
469-
if (!is_array($arrParams ) && !( $arrParams instanceof ProgramParameter)) {
470-
return null;
471-
}
472-
473-
$params = null;
474-
475-
if ($arrParams instanceof ProgramParameter) {
476-
// single ProgramParameter object
477-
if ($arrParams->isDS()) {
478-
$arr = $arrParams->getParamValue();
479-
if ($arrParams->isReturn()) {
480-
// a "return" DS (didn't work properly)
481-
$params = array('ds' =>
482-
array('fields' => self::ParametersToArray( $arr ),
483-
'ds_descr' => $arrParams->getParamProperties()));
484-
485-
} else { // non-return DS. Reduce DS to simple structure('ds'=>valuearray), eliminating any attributes the DS had, such as its name.
486-
$params[] = array('ds' => self::ParametersToArray($arr));
487-
}
488-
} else { // single non-DS param
489-
$params[]=$arrParams->getParamProperties();
490-
}
491-
}
492-
else
493-
{ // array of ProgramParameter objects
494-
foreach ($arrParams as $single) {
495-
if ($single->isDS()) {
496-
// element in array is DS
497-
$arr = $single->getParamValue(); // array of values
498-
// Reduce DS to simple structure ('ds'=>valuearray), eliminating any attributes the DS had, such as its name.
499-
$params[] = array('ds'=> self::ParametersToArray( $arr ));
500-
} else { // regular non-DS parm
501-
$params[]=$single->getParamProperties();
502-
}
503-
}
504-
}
505-
506-
return $params;
507-
}
508455
}
509456

510457
/**

0 commit comments

Comments
 (0)