Skip to content

Commit a2ea0a4

Browse files
committed
strict type
1 parent 2edefe0 commit a2ea0a4

11 files changed

Lines changed: 25 additions & 25 deletions

class/Files/Blocks/BlocksFiles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ private function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $tab
116116
$contIf .= $this->xc->getXcCriteriaAdd($critName, $crit, "\t");
117117
$crit = $this->xc->getXcCriteria('', "'{$fieldId}'", "{$moduleDirname}_block_addCatSelect(\$options)", "'IN'", true);
118118
$contIf2 = $this->xc->getXcCriteriaAdd($critName, $crit, "\t\t");
119-
$contIf .= $this->pc->getPhpCodeConditions('1 != (\count(\$options) && 0 == \$options[0])', null, null, $contIf2, false, "\t");
119+
$contIf .= $this->pc->getPhpCodeConditions('1 != (\count(\$options) && 0 == \$options[0])', '', '', $contIf2, false, "\t");
120120
$crit = $this->xc->getXcCriteria('', "'{$fieldId}'", '0', "'!='", true);
121121
$contIf2 = $this->xc->getXcCriteriaAdd($critName, $crit, "\t\t");
122122
$contIf2 .= $this->xc->getXcCriteriaSetSort($critName, "'{$fieldId}'", "\t\t");
123123
$contIf2 .= $this->xc->getXcCriteriaSetOrder($critName, "'ASC'", "\t\t");
124-
$contIf .= $this->pc->getPhpCodeConditions('$typeBlock', null, null, $contIf2, false, "\t");
124+
$contIf .= $this->pc->getPhpCodeConditions('$typeBlock', '', '', $contIf2, false, "\t");
125125

126126
//content else: parent
127127
//search for SelectStatus field

class/Files/Blocks/BlocksFilesSpotlight.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function getBlocksShow($moduleDirname, $tableName, $tablePermissions, $f
132132
$crit = $this->xc->getXcCriteria('', "'{$fieldId}'", "'(' . \implode(',', \$options) . ')'", "'IN'", true);
133133
$contIf = $this->xc->getXcCriteriaAdd($critName, $crit, "\t\t");
134134
$contIf .= $this->xc->getXcEqualsOperator('$limit', '0', '',"\t\t");
135-
$func .= $this->pc->getPhpCodeConditions('\count($options) > 0 && (int)$options[0] > 0', null, '', $contIf, false, "\t");
135+
$func .= $this->pc->getPhpCodeConditions('\count($options) > 0 && (int)$options[0] > 0', '', '', $contIf, false, "\t");
136136
$func .= $this->pc->getPhpCodeBlankLine();
137137

138138
$func .= $this->xc->getXcCriteriaSetSort($critName, "'{$fieldId}'","\t");

class/Files/Classes/ClassFiles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ private function getPermissionsInForm($moduleDirname, $fieldId, $tableName)
365365
$contIf .= $this->cxc->getClassXoopsFormCheckBox('groupsCanSubmitCheckbox', $permissionSubmit, "groups_submit_{$tableName}[]", '$fullList', false, "\t\t\t");
366366
$contIf .= $this->cxc->getClassXoopsFormCheckBox('groupsCanViewCheckbox', $permissionView, "groups_view_{$tableName}[]", '$fullList', false, "\t\t\t");
367367

368-
$ret .= $this->pc->getPhpCodeConditions('$this->isNew()', null, null, $contIf, $contElse, "\t\t");
368+
$ret .= $this->pc->getPhpCodeConditions('$this->isNew()', '', '', $contIf, $contElse, "\t\t");
369369
$ret .= $this->pc->getPhpCodeCommentLine('To Approve', '', "\t\t");
370370
$ret .= $this->cxc->getClassAddOptionArray('groupsCanApproveCheckbox', '$groupList');
371371
$ret .= $this->cxc->getClassAddElement('form', '$groupsCanApproveCheckbox');

class/Files/Classes/ClassFormElements.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ private function getXoopsFormSelectFile($language, $moduleDirname, $tableName, $
334334
$contIf .= $this->cxc->getClassAddElement('fileTray', $labelInfo1, $t . "\t");
335335
$formHidden = $this->cxc->getClassXoopsFormHidden('', $fieldName, $ccFieldName, true, true, $t, true);
336336
$contElse = $this->cxc->getClassAddElement('fileTray', $formHidden, $t . "\t");
337-
$ret .= $this->pc->getPhpCodeConditions('$permissionUpload', null, null, $contIf, $contElse, "\t\t");
337+
$ret .= $this->pc->getPhpCodeConditions('$permissionUpload', '', '', $contIf, $contElse, "\t\t");
338338
$ret .= $this->cxc->getClassAddElement('form', "\$fileTray{$required}", $t);
339339

340340
return $ret;
@@ -420,7 +420,7 @@ private function getXoopsFormUploadImage($language, $moduleDirname, $tableName,
420420
$contIf .= $this->cxc->getClassAddElement('imageTray', $labelInfo3, $t . "\t");
421421
$formHidden = $this->cxc->getClassXoopsFormHidden('', $fieldName, $ccFieldName, true, true, $t, true);
422422
$contElse = $this->cxc->getClassAddElement('imageTray', $formHidden, $t . "\t");
423-
$ret .= $this->pc->getPhpCodeConditions('$permissionUpload', null, null, $contIf, $contElse, "\t\t");
423+
$ret .= $this->pc->getPhpCodeConditions('$permissionUpload', '', '', $contIf, $contElse, "\t\t");
424424
$ret .= $this->cxc->getClassAddElement('form', "\$imageTray{$required}", $t);
425425

426426
return $ret;
@@ -450,7 +450,7 @@ private function getXoopsFormUploadFile($language, $moduleDirname, $tableName, $
450450
$sprintf = $this->pc->getPhpCodeSprintf($language . '_UPLOADS', '".{$fileDirectory}/"');
451451
$xoopsFormLabel = $this->cxc->getClassXoopsFormLabel('', $sprintf, $ccFieldName, true, "\t\t", true);
452452
$condIf = $this->cxc->getClassAddElement('fileUploadTray', $xoopsFormLabel, $t . "\t");
453-
$uForm .= $this->pc->getPhpCodeConditions('!$this->isNew()', null, null, $condIf, false, "\t\t\t");
453+
$uForm .= $this->pc->getPhpCodeConditions('!$this->isNew()', '', '', $condIf, false, "\t\t\t");
454454
$getConfig = $this->xc->getXcGetConfig('maxsize_file');
455455
$uForm .= $this->xc->getXcEqualsOperator('$maxsize', $getConfig,'', "\t\t\t");
456456
$xoopsFormFile = $this->cxc->getClassXoopsFormFile('', "''", $fieldName, '$maxsize', true, '');
@@ -462,7 +462,7 @@ private function getXoopsFormUploadFile($language, $moduleDirname, $tableName, $
462462
$formHidden = $this->cxc->getClassXoopsFormHidden('', $fieldName, $ccFieldName, true, true, "\t\t", true);
463463
$contElse = $this->cxc->getClassAddElement('form', $formHidden, $t);
464464

465-
$ret .= $this->pc->getPhpCodeConditions('$permissionUpload', null, null, $uForm, $contElse, "\t\t");
465+
$ret .= $this->pc->getPhpCodeConditions('$permissionUpload', '', '', $uForm, $contElse, "\t\t");
466466

467467
return $ret;
468468
}
@@ -808,7 +808,7 @@ private function getXoopsFormTopic($language, $topicTableName, $fieldId, $fieldP
808808
$contIf .= $this->cxc->getClassXoopsMakeSelBox($ccFieldPid, $stlTopicTableName . 'Tree', $fieldPid, $fieldMain, '--', $fieldPid, $t . "\t");
809809
$formLabel = $this->cxc->getClassXoopsFormLabel('', $language, "\${$ccFieldPid}", true, '');
810810
$contIf .= $this->cxc->getClassAddElement('form', $formLabel, $t . "\t");
811-
$ret .= $this->pc->getPhpCodeConditions("\${$stlTopicTableName}Count", null, null, $contIf, false, $t);
811+
$ret .= $this->pc->getPhpCodeConditions("\${$stlTopicTableName}Count", '', '', $contIf, false, $t);
812812
$ret .= $this->pc->getPhpCodeUnset('cr' . $ucfTopicTableName, $t);
813813

814814
return $ret;

class/Files/CreateFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public function getLanguage($moduleDirname, $prefix = '', $suffix = '', $addFq =
329329
*/
330330
public function getLeftString($string)
331331
{
332-
return \mb_substr($string, 0, mb_strpos($string, '_'));
332+
return \mb_substr($string, 0, (int)\mb_strpos($string, '_'));
333333
}
334334

335335
/**

class/Files/CreatePhpCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public function getPhpCodeFunction($name = null, $params = null, $content = null
352352
* @param string $conditionElse
353353
* @return string
354354
*/
355-
public function getPhpCodeConditions($condition = null, $operator = null, $type = null, $contentIf = null, $contentElse = false, $t = '', $conditionElse = '')
355+
public function getPhpCodeConditions($condition = '', $operator = '', $type = '', $contentIf = '', $contentElse = false, $t = '', $conditionElse = '')
356356
{
357357
if ('==' === \trim($operator) || '===' === \trim($operator) || '!=' === \trim($operator) || '!==' === \trim($operator)) {
358358
//yoda conditions

class/Files/User/UserPages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ private function getPermissionsSave($moduleDirname, $ucfFieldId, $perm = 'view')
385385
$ret .= $this->xc->getXcDeleteRight('grouppermHandler', "{$moduleDirname}_{$perm}", '$mid', "\$new{$ucfFieldId}", false, "\t\t\t");
386386
$content = $this->xc->getXcAddRight('grouppermHandler', "{$moduleDirname}_{$perm}", "\$new{$ucfFieldId}", '$onegroupId', '$mid', false, "\t\t\t\t\t");
387387
$foreach = $this->pc->getPhpCodeForeach("_POST['groups_{$perm}']", false, false, 'onegroupId', $content, "\t\t\t\t");
388-
$ret .= $this->pc->getPhpCodeConditions("isset(\$_POST['groups_{$perm}'])", null, null, $foreach, false, "\t\t\t");
388+
$ret .= $this->pc->getPhpCodeConditions("isset(\$_POST['groups_{$perm}'])", '', '', $foreach, false, "\t\t\t");
389389

390390
return $ret;
391391
}

class/Files/User/UserXoopsCode.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ public function getUserBreadcrumbsFooterFile()
175175
/**
176176
* @public function getUserModVersionArray
177177
*
178-
* @param int $eleArray
179-
* @param $descriptions
180-
* @param null $name
181-
* @param null $index
182-
* @param bool $num
183-
* @param string $t
178+
* @param int $eleArray
179+
* @param string|array $descriptions
180+
* @param null $name
181+
* @param null $index
182+
* @param bool $num
183+
* @param string $t
184184
*
185185
* @return string
186186
*/
@@ -212,11 +212,11 @@ public function getUserModVersionArray($eleArray, $descriptions, $name = null, $
212212
//search for longest key
213213
$len = 0;
214214
foreach ($descs as $key => $desc) {
215-
$len = \mb_strlen($key) > $len ? \mb_strlen($key) : $len;
215+
$len = \mb_strlen((string)$key) > $len ? \mb_strlen((string)$key) : $len;
216216
}
217217

218218
foreach ($descs as $key => $desc) {
219-
$space = str_repeat(' ', $len - \mb_strlen($key));
219+
$space = str_repeat(' ', $len - \mb_strlen((string)$key));
220220
if ($eleArray < 4) {
221221
$ret .= $t . "\t'{$key}'{$space} => {$desc},{$n}";
222222
} elseif (11 === $eleArray) {

class/Files/User/UserXoopsVersion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ private function getXoopsVersionHeader($module, $language)
132132
$ret .= $this->xc->getXcEqualsOperator('$moduleDirName ', '\basename(__DIR__)');
133133
$ret .= $this->xc->getXcEqualsOperator('$moduleDirNameUpper', '\mb_strtoupper($moduleDirName)');
134134
$ret .= $this->getDashComment('Informations');
135-
$ha = (1 == $module->getVar('mod_admin')) ? 1 : 0;
136-
$hm = (1 == $module->getVar('mod_user')) ? 1 : 0;
135+
$ha = (1 == $module->getVar('mod_admin')) ? '1' : '0';
136+
$hm = (1 == $module->getVar('mod_user')) ? '1' : '0';
137137

138138
$descriptions = [
139139
'name' => "{$language}NAME",

class/Files/admin/AdminPages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private function getPermissionsSave($moduleDirname, $perm = 'view')
258258
$ret .= $this->xc->getXcDeleteRight('grouppermHandler', "{$moduleDirname}_{$perm}", '$mid', '$permId', false, "\t\t\t");
259259
$content = $this->xc->getXcAddRight('grouppermHandler', "{$moduleDirname}_{$perm}", '$permId', '$onegroupId', '$mid', false, "\t\t\t\t\t");
260260
$foreach = $this->pc->getPhpCodeForeach("_POST['groups_{$perm}']", false, false, 'onegroupId', $content, "\t\t\t\t");
261-
$ret .= $this->pc->getPhpCodeConditions("isset(\$_POST['groups_{$perm}'])", null, null, $foreach, false, "\t\t\t");
261+
$ret .= $this->pc->getPhpCodeConditions("isset(\$_POST['groups_{$perm}'])", '', '', $foreach, false, "\t\t\t");
262262

263263
return $ret;
264264
}

0 commit comments

Comments
 (0)