* [misc] compatibility zin with PHP8.4

This commit is contained in:
zhujinyong
2025-07-11 09:46:37 +08:00
committed by wangzemei
parent 3b56239a15
commit a2bf2be540
9 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -651,7 +651,7 @@ class mobile
* from the $headers array instead.
*/
public function __construct(
array $headers = null,
?array $headers = null,
$userAgent = null
) {
$this->setHttpHeaders($headers);
+1 -1
View File
@@ -109,7 +109,7 @@ class props extends \zin\utils\dataset
if($value) $this->setVal($name, $value);
}
public function bindEvent(string|array $name, string|array $handler = null)
public function bindEvent(string|array $name, ?string|array $handler = null)
{
if(is_array($name))
{
+1 -1
View File
@@ -25,7 +25,7 @@ class set extends setting implements iDirective
* @param array|object|string $data Properties list array.
* @param mixed $value Property value.
*/
public function __construct(array|string $data = null, mixed $value = null)
public function __construct(?array|object|string $data = null, mixed $value = null)
{
parent::__construct($data, $value);
+1 -1
View File
@@ -136,7 +136,7 @@ class setting extends \zin\utils\dataset
* @param mixed $value - Setting value.
* @return setting
*/
function setting(array|string $setting = null, mixed $value = null): setting
function setting(?array|string $setting = null, mixed $value = null): setting
{
return new setting($setting, $value);
}
+2 -2
View File
@@ -26,7 +26,7 @@ class field extends setting
public mixed $default;
public function __construct(string|object|array|null $nameOrProps = null, ?fieldList $fieldList = null, ?field $parent = null)
public function __construct(?string|object|array $nameOrProps = null, ?fieldList $fieldList = null, ?field $parent = null)
{
$this->fieldList = $fieldList;
$this->parent = $parent;
@@ -146,7 +146,7 @@ class field extends setting
return $this->setVal('labelWidth', $width);
}
public function labelHint(?string $hint, string|object|array $classOrProps = null): field
public function labelHint(?string $hint, mixed $classOrProps = null): field
{
$this->setVal('labelHint', $hint);
if (is_string($classOrProps)) $this->labelHintClass($classOrProps);
+1 -1
View File
@@ -334,7 +334,7 @@ class fieldList
return isset(static::$map[$listName]) ? static::$map[$listName] : null;
}
public static function getListFields(string $listName, string $fieldNames = null): array
public static function getListFields(string $listName, ?string $fieldNames = null): array
{
if(is_null($fieldNames)) list($listName, $fieldNames) = explode('/', $listName);
if(is_null($fieldNames)) return null;
+1 -1
View File
@@ -130,7 +130,7 @@ function isAjaxRequest(?string $type = null): bool
* @param array $options
* @return directive|set
*/
function bind(string $name, bool|string|array $callback, array|string $options = null): directive|set
function bind(string $name, bool|string|array $callback, mixed $options = null): directive|set
{
if(is_string($options) && is_string($callback))
{
+5 -5
View File
@@ -379,7 +379,7 @@ class testcaseModel extends model
* @access public
* @return array
*/
public function getByAssignedTo(string $account, string $auto = 'no', string $orderBy = 'id_desc', object $pager = null): array
public function getByAssignedTo(string $account, string $auto = 'no', string $orderBy = 'id_desc', ?object $pager = null): array
{
return $this->dao->select('t1.id AS run, t1.task, t1.case, t1.version, t1.assignedTo, t1.lastRunner, t1.lastRunDate, t1.lastRunResult, t1.status AS lastRunStatus, t2.id AS id, t2.project, t2.pri, t2.title, t2.type, t2.openedBy, t2.color, t2.product, t2.lib, t2.branch, t2.module, t2.status, t2.auto, t2.story, t2.storyVersion, t3.name AS taskName')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
@@ -406,7 +406,7 @@ class testcaseModel extends model
* @access public
* @return array
*/
public function getByOpenedBy(string $account, string $auto = 'no', string $orderBy = 'id_desc', object $pager = null): array
public function getByOpenedBy(string $account, string $auto = 'no', string $orderBy = 'id_desc', ?object $pager = null): array
{
return $this->dao->findByOpenedBy($account)->from(TABLE_CASE)
->andWhere('deleted')->eq('0')
@@ -433,7 +433,7 @@ class testcaseModel extends model
* @access public
* @return array
*/
public function getByStatus(int $productID = 0, int|string $branch = 0, string $type = 'all', string $status = 'all', int $moduleID = 0, string $auto = 'no', string $orderBy = 'id_desc', object $pager = null): array
public function getByStatus(int $productID = 0, int|string $branch = 0, string $type = 'all', string $status = 'all', int $moduleID = 0, string $auto = 'no', string $orderBy = 'id_desc', ?object $pager = null): array
{
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
@@ -1998,7 +1998,7 @@ class testcaseModel extends model
* @access public
* @return array
*/
public function getSceneGroups(int|array $productID, string $branch = '', string $browseType = '', int $moduleID = 0, string $caseType = '', string $orderBy = 'id_desc', object $pager = null): array
public function getSceneGroups(int|array $productID, string $branch = '', string $browseType = '', int $moduleID = 0, string $caseType = '', string $orderBy = 'id_desc', ?object $pager = null): array
{
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : array();
$scenes = $this->dao->select('*')->from(TABLE_SCENE)
@@ -2714,7 +2714,7 @@ class testcaseModel extends model
* @access public
* @return array
*/
public function getCanImportCases(int $productID, int $libID, string $orderBy = 'id_desc', object $pager = null, string $browseType = '', int $queryID = 0): array
public function getCanImportCases(int $productID, int $libID, string $orderBy = 'id_desc', ?object $pager = null, string $browseType = '', int $queryID = 0): array
{
$query = '';
if($browseType == 'bysearch')
+1 -1
View File
@@ -19,7 +19,7 @@ class testtaskTao extends testtaskModel
* @access protected
* @return array
*/
protected function fetchTesttaskList(int $productID, string $branch = '', int $projectID = 0, string $unit = 'no', string $scope = '', string $status = '', string $begin = '', string $end = '', string $orderBy = '', object $pager = null): array
protected function fetchTesttaskList(int $productID, string $branch = '', int $projectID = 0, string $unit = 'no', string $scope = '', string $status = '', string $begin = '', string $end = '', string $orderBy = '', ?object $pager = null): array
{
return $this->dao->select("t1.*, t5.multiple, IF(t2.shadow = 1, t5.name, t2.name) AS productName, t3.name AS executionName, t4.name AS buildName, t4.branch AS branch, t5.name AS projectName")
->from(TABLE_TESTTASK)->alias('t1')