diff --git a/lib/mobile/mobile.class.php b/lib/mobile/mobile.class.php index b73dc5ffc0..14fa3a8b22 100644 --- a/lib/mobile/mobile.class.php +++ b/lib/mobile/mobile.class.php @@ -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); diff --git a/lib/zin/core/props.class.php b/lib/zin/core/props.class.php index d7e00a983b..65d09537dc 100644 --- a/lib/zin/core/props.class.php +++ b/lib/zin/core/props.class.php @@ -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)) { diff --git a/lib/zin/core/set.class.php b/lib/zin/core/set.class.php index 5b6559c4d1..0658d386a1 100644 --- a/lib/zin/core/set.class.php +++ b/lib/zin/core/set.class.php @@ -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); diff --git a/lib/zin/core/setting.class.php b/lib/zin/core/setting.class.php index f17c212b55..30adefb471 100644 --- a/lib/zin/core/setting.class.php +++ b/lib/zin/core/setting.class.php @@ -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); } diff --git a/lib/zin/zentao/field.class.php b/lib/zin/zentao/field.class.php index d107125886..39f57b4e61 100644 --- a/lib/zin/zentao/field.class.php +++ b/lib/zin/zentao/field.class.php @@ -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); diff --git a/lib/zin/zentao/fieldlist.class.php b/lib/zin/zentao/fieldlist.class.php index e907e54a87..c37c20c575 100644 --- a/lib/zin/zentao/fieldlist.class.php +++ b/lib/zin/zentao/fieldlist.class.php @@ -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; diff --git a/lib/zin/zentao/zentao.func.php b/lib/zin/zentao/zentao.func.php index ab21950cb5..583664ec61 100644 --- a/lib/zin/zentao/zentao.func.php +++ b/lib/zin/zentao/zentao.func.php @@ -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)) { diff --git a/module/testcase/model.php b/module/testcase/model.php index 4ae31e69f8..068422da0a 100755 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -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') diff --git a/module/testtask/tao.php b/module/testtask/tao.php index 332a0affb2..92fdb26ec1 100644 --- a/module/testtask/tao.php +++ b/module/testtask/tao.php @@ -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')