diff --git a/module/action/model.php b/module/action/model.php index 8dd32ef08b..eaa93cc9b8 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -285,7 +285,7 @@ class actionModel extends model * @access public * @return object */ - public function processHistory(object $history = null): object + public function processHistory(?object $history = null): object { if(empty($history)) return $history; $users = $this->loadModel('user')->getPairs('noletter'); @@ -433,7 +433,7 @@ class actionModel extends model * @access public * @return array */ - public function getTrashes(string $objectType, string $type, string $orderBy, object $pager = null): array + public function getTrashes(string $objectType, string $type, string $orderBy, ?object $pager = null): array { $noMultipleExecutions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('multiple')->eq('0')->andWhere('type')->in('sprint,kanban')->fetchPairs(); @@ -534,7 +534,7 @@ class actionModel extends model * @access public * @return array */ - public function getTrashesBySearch(string $objectType, string $type, string|int $queryID, string $orderBy, object $pager = null): array + public function getTrashesBySearch(string $objectType, string $type, string|int $queryID, string $orderBy, ?object $pager = null): array { if($objectType == 'all') return array(); if($queryID && $queryID != 'myQueryID') @@ -955,7 +955,7 @@ class actionModel extends model * @access public * @return array */ - public function buildActionList(array $actions, array|null $users = null, bool $commentEditable = true): array + public function buildActionList(array $actions, ?array $users = null, bool $commentEditable = true): array { if(empty($users)) $users = $this->loadModel('user')->getPairs('noletter'); diff --git a/module/api/model.php b/module/api/model.php index 3ae375a477..d52b6e0bd1 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -390,7 +390,7 @@ class apiModel extends model * @param object $pager * @return array */ - public function getListByModuleID(int $libID = 0, int $moduleID = 0, int $releaseID = 0, object $pager = null): array + public function getListByModuleID(int $libID = 0, int $moduleID = 0, int $releaseID = 0, ?object $pager = null): array { /* Get release info. */ if($releaseID > 0) @@ -472,7 +472,7 @@ class apiModel extends model * @access public * @return array */ - public function getStructByQuery(int $libID, object $pager = null, string $orderBy = ''): array + public function getStructByQuery(int $libID, ?object $pager = null, string $orderBy = ''): array { return $this->dao->select('t1.*,t2.realname as addedName')->from(TABLE_APISTRUCT)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t2.account = t1.addedBy') @@ -494,7 +494,7 @@ class apiModel extends model * @access public * @return array */ - public function getStructListByRelease(object $release, string $where = '1 = 1 ', object $pager = null, string $orderBy = 'id'): array + public function getStructListByRelease(object $release, string $where = '1 = 1 ', ?object $pager = null, string $orderBy = 'id'): array { $strJoin = array(); if(isset($release->snap['structs'])) @@ -527,7 +527,7 @@ class apiModel extends model * @access public * @return array */ - public function getReleaseByQuery(array $libID, object $pager = null, string $orderBy = ''): array + public function getReleaseByQuery(array $libID, ?object $pager = null, string $orderBy = ''): array { return $this->dao->select('*')->from(TABLE_API_LIB_RELEASE) ->where('lib')->in($libID) diff --git a/module/branch/model.php b/module/branch/model.php index e59615cea0..35965d036a 100644 --- a/module/branch/model.php +++ b/module/branch/model.php @@ -53,7 +53,7 @@ class branchModel extends model * @access public * @return array */ - public function getList(int $productID, int $executionID = 0, string $browseType = 'active', string $orderBy = 'order', object|null $pager = null, bool $withMainBranch = true): array + public function getList(int $productID, int $executionID = 0, string $browseType = 'active', string $orderBy = 'order', ?object $pager = null, bool $withMainBranch = true): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getBranches(); diff --git a/module/bug/model.php b/module/bug/model.php index e2056240f9..d559b4ca29 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -97,7 +97,7 @@ class bugModel extends model * @access public * @return array */ - public function getList(string $browseType, array $productIdList, int $projectID, array $executionIdList, int|string $branch = 'all', int $moduleID = 0, int $queryID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getList(string $browseType, array $productIdList, int $projectID, array $executionIdList, int|string $branch = 'all', int $moduleID = 0, int $queryID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { if($browseType == 'bymodule' && $this->session->bugBrowseType && $this->session->bugBrowseType != 'bysearch') $browseType = $this->session->bugBrowseType; @@ -125,7 +125,7 @@ class bugModel extends model * @access public * @return array */ - public function getPlanBugs(int $planID, string $status = 'all', string $orderBy = 'id_desc', object $pager = null): array + public function getPlanBugs(int $planID, string $status = 'all', string $orderBy = 'id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return array(); @@ -216,7 +216,7 @@ class bugModel extends model * @access public * @return array */ - public function getActiveBugs(array|int $products, int|string $branch, string $executions, array $excludeBugs, object $pager = null, string $orderBy = 'id desc'): array + public function getActiveBugs(array|int $products, int|string $branch, string $executions, array $excludeBugs, ?object $pager = null, string $orderBy = 'id desc'): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getBugs(); @@ -244,7 +244,7 @@ class bugModel extends model * @access public * @return array */ - public function getActiveAndPostponedBugs(array $products, int $executionID, object $pager = null): array + public function getActiveAndPostponedBugs(array $products, int $executionID, ?object $pager = null): array { return $this->dao->select('t1.*')->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.product = t2.product') @@ -670,7 +670,7 @@ class bugModel extends model * @access public * @return array */ - public function getBugs2Link(int $bugID, bool $bySearch = false, string $excludeBugs = '', int $queryID = 0, object $pager = null): array + public function getBugs2Link(int $bugID, bool $bySearch = false, string $excludeBugs = '', int $queryID = 0, ?object $pager = null): array { $bug = $this->getByID($bugID); @@ -861,7 +861,7 @@ class bugModel extends model * @access public * @return array */ - public function getUserBugs(string $account, string $type = 'assignedTo', string $orderBy = 'id_desc', int $limit = 0, object $pager = null, int $executionID = 0, int $queryID = 0): array + public function getUserBugs(string $account, string $type = 'assignedTo', string $orderBy = 'id_desc', int $limit = 0, ?object $pager = null, int $executionID = 0, int $queryID = 0): array { if($type != 'bySearch' and !$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array(); @@ -974,7 +974,7 @@ class bugModel extends model * @access public * @return array */ - public function getProjectBugs(int $projectID, int $productID = 0, int|string $branchID = 0, int $build = 0, string $type = '', int $param = 0, string $orderBy = 'id_desc', string $excludeBugs = '', object $pager = null): array + public function getProjectBugs(int $projectID, int $productID = 0, int|string $branchID = 0, int $build = 0, string $type = '', int $param = 0, string $orderBy = 'id_desc', string $excludeBugs = '', ?object $pager = null): array { if(strpos($orderBy, 'pri_') !== false) $orderBy = str_replace('pri_', 'priOrder_', $orderBy); if(strpos($orderBy, 'severity_') !== false) $orderBy = str_replace('severity_', 'severityOrder_', $orderBy); @@ -1026,7 +1026,7 @@ class bugModel extends model * @access public * @return array */ - public function getExecutionBugs(int $executionID, int $productID = 0, string|int $branchID = 'all', string|array $builds = '0', string $type = '', int $param = 0, string $orderBy = 'id_desc', string $excludeBugs = '', object $pager = null): array + public function getExecutionBugs(int $executionID, int $productID = 0, string|int $branchID = 'all', string|array $builds = '0', string $type = '', int $param = 0, string $orderBy = 'id_desc', string $excludeBugs = '', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getBugs(); @@ -1088,7 +1088,7 @@ class bugModel extends model * @access public * @return array|null */ - public function getProductLeftBugs(array $buildIdList, int $productID, int|string $branch = '', string $linkedBugs = '', object $pager = null): array|null + public function getProductLeftBugs(array $buildIdList, int $productID, int|string $branch = '', string $linkedBugs = '', ?object $pager = null): array|null { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getBugs(); @@ -1202,7 +1202,7 @@ class bugModel extends model * @access public * @return array */ - public function getReleaseBugs(array $buildIdList, int $productID, int|string $branch = 0, string $linkedBugs = '', object $pager = null): array + public function getReleaseBugs(array $buildIdList, int $productID, int|string $branch = 0, string $linkedBugs = '', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getBugs(); @@ -2143,7 +2143,7 @@ class bugModel extends model * @access public * @return array */ - public function getBySearch(string $object = 'bug', array|int $productIdList = array(), int|string $branch = 0, int $projectID = 0, int $executionID = 0, int $queryID = 0, string $excludeBugs = '', string $orderBy = '', object $pager = null): array + public function getBySearch(string $object = 'bug', array|int $productIdList = array(), int|string $branch = 0, int $projectID = 0, int $executionID = 0, int $queryID = 0, string $excludeBugs = '', string $orderBy = '', ?object $pager = null): array { $bugQuery = $this->processSearchQuery($object, $queryID, $productIdList, (string)$branch); diff --git a/module/bug/tao.php b/module/bug/tao.php index 2e8da927cc..e1f2dbef43 100644 --- a/module/bug/tao.php +++ b/module/bug/tao.php @@ -38,7 +38,7 @@ class bugTao extends bugModel * @access protected * @return array */ - protected function getListByBrowseType(string $browseType, array $productIdList, int $projectID, array $executionIdList, int|string $branch, array $moduleIdList, int $queryID, string $orderBy, object $pager = null): array + protected function getListByBrowseType(string $browseType, array $productIdList, int $projectID, array $executionIdList, int|string $branch, array $moduleIdList, int $queryID, string $orderBy, ?object $pager = null): array { $browseType = strtolower($browseType); @@ -112,7 +112,7 @@ class bugTao extends bugModel * @access protected * @return array */ - protected function getNeedConfirmList(array $productIdList, int $projectID, array $executionIdList, int|string $branch, array $moduleIdList, string $orderBy, object $pager = null): array + protected function getNeedConfirmList(array $productIdList, int $projectID, array $executionIdList, int|string $branch, array $moduleIdList, string $orderBy, ?object $pager = null): array { return $this->dao->select("t1.*, t2.title AS storyTitle, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) AS priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) AS severityOrder")->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') diff --git a/module/build/model.php b/module/build/model.php index 0db88c17a4..bdfce7dbf1 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -74,7 +74,7 @@ class buildModel extends model * @access public * @return array */ - public function getProjectBuilds(int $projectID = 0, string $type = 'all', string $param = '', string $orderBy = 't1.date_desc,t1.id_desc', object $pager = null): array + public function getProjectBuilds(int $projectID = 0, string $type = 'all', string $param = '', string $orderBy = 't1.date_desc,t1.id_desc', ?object $pager = null): array { $shadows = $this->dao->select('shadow')->from(TABLE_RELEASE)->where("FIND_IN_SET({$projectID}, project)")->fetchPairs('shadow', 'shadow'); $builds = $this->dao->select('t1.*, t2.name as productName') @@ -129,7 +129,7 @@ class buildModel extends model * @access public * @return array */ - public function getProjectBuildsBySearch(int $projectID, int $queryID, string $orderBy = 't1.date_desc,t1.id_desc', object $pager = null): array + public function getProjectBuildsBySearch(int $projectID, int $queryID, string $orderBy = 't1.date_desc,t1.id_desc', ?object $pager = null): array { /* If there are saved query conditions, reset the session. */ if((int)$queryID) @@ -170,7 +170,7 @@ class buildModel extends model * @access public * @return array */ - public function getExecutionBuilds(int $executionID, string $type = '', string $param = '', string $orderBy = 't1.date_desc,t1.id_desc', object $pager = null): array + public function getExecutionBuilds(int $executionID, string $type = '', string $param = '', string $orderBy = 't1.date_desc,t1.id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getBuilds(); @@ -198,7 +198,7 @@ class buildModel extends model * @access public * @return object[] */ - public function getExecutionBuildsBySearch(int $executionID, int $queryID, object $pager = null): array + public function getExecutionBuildsBySearch(int $executionID, int $queryID, ?object $pager = null): array { /* If there are saved query conditions, reset the session. */ if($queryID) @@ -896,7 +896,7 @@ class buildModel extends model * @access public * @return array */ - public function getBugList(string $bugIdList, string $orderBy = '', object $pager = null): array + public function getBugList(string $bugIdList, string $orderBy = '', ?object $pager = null): array { return $this->dao->select('*')->from(TABLE_BUG) ->where('id')->in($bugIdList) @@ -916,7 +916,7 @@ class buildModel extends model * @access public * @return array */ - public function getStoryList(string $storyIdList, int $branch = 0, string $orderBy = '', object $pager = null): array + public function getStoryList(string $storyIdList, int $branch = 0, string $orderBy = '', ?object $pager = null): array { $stories = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY) ->where('id')->in($storyIdList) diff --git a/module/caselib/model.php b/module/caselib/model.php index 52cfa33db2..d1c0d0e8fd 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -152,7 +152,7 @@ class caselibModel extends model * @access public * @return array */ - public function getList(string $type = 'all', string $orderBy = 'id_desc', object $pager = null): array + public function getList(string $type = 'all', string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('*')->from(TABLE_TESTSUITE) ->where('product')->eq(0) @@ -174,7 +174,7 @@ class caselibModel extends model * @access public * @return array */ - public function getPairs(string $type = 'all', string $orderBy = 'id_desc', object $pager = null): array + public function getPairs(string $type = 'all', string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('id,name')->from(TABLE_TESTSUITE) ->where('product')->eq(0) @@ -227,7 +227,7 @@ class caselibModel extends model * @access public * @return array */ - public function getLibCases(int $libID, string $browseType, int $queryID = 0, int $moduleID = 0, string $sort = 'id_desc', object $pager = null, string $from = 'qa'): array + public function getLibCases(int $libID, string $browseType, int $queryID = 0, int $moduleID = 0, string $sort = 'id_desc', ?object $pager = null, string $from = 'qa'): array { $browseType = $browseType == 'bymodule' && $this->session->libBrowseType && $this->session->libBrowseType != 'bysearch' ? $this->session->libBrowseType : $browseType; diff --git a/module/cne/model.php b/module/cne/model.php index b35e55b932..ae4857bd15 100644 --- a/module/cne/model.php +++ b/module/cne/model.php @@ -47,7 +47,7 @@ class cneModel extends model * @access public * @return bool */ - public function updateConfig(object $instance, object $settings = null): bool + public function updateConfig(object $instance, ?object $settings = null): bool { $apiParams = array(); $apiParams['cluster'] = ''; diff --git a/module/common/model.php b/module/common/model.php index 8134c12232..19051aa3ad 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1980,7 +1980,7 @@ eof; * @access public * @return string|array|bool */ - public static function http(string $url, $data = null, array $options = array(), array $headers = array(), string $dataType = 'data', string $method = 'POST', int $timeout = 30, bool $httpCode = false, bool $log = true): string|array|bool + public static function http(string $url, mixed $data = null, array $options = array(), array $headers = array(), string $dataType = 'data', string $method = 'POST', int $timeout = 30, bool $httpCode = false, bool $log = true): string|array|bool { global $lang, $app; diff --git a/module/company/model.php b/module/company/model.php index 9121d1ec0e..0362d53510 100644 --- a/module/company/model.php +++ b/module/company/model.php @@ -51,7 +51,7 @@ class companyModel extends model * @access public * @return array */ - public function getUsers(string $browseType = 'inside', string $type = '', string|int $queryID = 0, int $deptID = 0, string $sort = '', object $pager = null): array + public function getUsers(string $browseType = 'inside', string $type = '', string|int $queryID = 0, int $deptID = 0, string $sort = '', ?object $pager = null): array { if($type == 'bydept') { diff --git a/module/compile/model.php b/module/compile/model.php index 80c1c72a6f..8d9f078ab2 100644 --- a/module/compile/model.php +++ b/module/compile/model.php @@ -54,7 +54,7 @@ class compileModel extends model * @access public * @return array */ - public function getList(int $repoID, int $jobID, string $browseType = '', int $queryID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getList(int $repoID, int $jobID, string $browseType = '', int $queryID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { $compileQuery = ''; if($browseType == 'bySearch') diff --git a/module/design/model.php b/module/design/model.php index 049227a0f0..6a9dd0c33d 100755 --- a/module/design/model.php +++ b/module/design/model.php @@ -91,7 +91,7 @@ class designModel extends model * @access public * @return bool|array */ - public function update(int $designID = 0, object $design = null): bool|array + public function update(int $designID = 0, ?object $design = null): bool|array { $oldDesign = $this->getByID($designID); if(!$oldDesign) return false; @@ -135,7 +135,7 @@ class designModel extends model * @access public * @return array|bool */ - public function assign(int $designID = 0, object $design = null): array|bool + public function assign(int $designID = 0, ?object $design = null): array|bool { $oldDesign = $this->getByID($designID); if(!$oldDesign) return false; @@ -302,7 +302,7 @@ class designModel extends model * @access public * @return object */ - public function getAffectedScope(object $design = null): object + public function getAffectedScope(?object $design = null): object { if(!isset($design->id)) return $design; @@ -329,7 +329,7 @@ class designModel extends model * @access public * @return object[] */ - public function getList(int|array $projectID = 0, int|array $productID = 0, string $type = 'all', int $param = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getList(int|array $projectID = 0, int|array $productID = 0, string $type = 'all', int $param = 0, string $orderBy = 'id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getDesigns(); @@ -370,7 +370,7 @@ class designModel extends model * @access public * @return object|bool */ - public function getCommit(int $designID = 0, object $pager = null): object|bool + public function getCommit(int $designID = 0, ?object $pager = null): object|bool { $design = $this->dao->select('*')->from(TABLE_DESIGN)->where('id')->eq($designID)->fetch(); if(!$design) return false; @@ -401,7 +401,7 @@ class designModel extends model * @access public * @return object[] */ - public function getBySearch(int $projectID = 0, int $productID = 0, int $queryID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getBySearch(int $projectID = 0, int $productID = 0, int $queryID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { if($queryID) { diff --git a/module/doc/model.php b/module/doc/model.php index f098864fac..797d7d9453 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -373,7 +373,7 @@ class docModel extends model * @access public * @return bool|int */ - public function createApiLib(object $formData = null): bool|int + public function createApiLib(?object $formData = null): bool|int { $this->app->loadLang('api'); @@ -411,7 +411,7 @@ class docModel extends model * @access public * @return array|false */ - public function updateApiLib(int $id, object $formData = null): array|bool + public function updateApiLib(int $id, ?object $formData = null): array|bool { $oldLib = $this->getLibByID($id); @@ -495,7 +495,7 @@ class docModel extends model * @access public * @return array */ - public function getDocsByBrowseType(string $browseType, int $queryID, int $moduleID, string $sort, object $pager = null) + public function getDocsByBrowseType(string $browseType, int $queryID, int $moduleID, string $sort, ?object $pager = null) { if($browseType == 'all') return $this->getDocs(0, 0, $browseType, $sort, $pager); @@ -558,7 +558,7 @@ class docModel extends model * @access public * @return array */ - public function getMyDocListBySearch(int $queryID, array $hasPrivDocIdList, array $allLibIDList, string $sort, object $pager = null): array + public function getMyDocListBySearch(int $queryID, array $hasPrivDocIdList, array $allLibIDList, string $sort, ?object $pager = null): array { if($queryID) { @@ -664,7 +664,7 @@ class docModel extends model * @access public * @return array */ - public function getDocTemplateList(int $libID = 0, string $type = 'all', string $orderBy = 'id_desc', object $pager = null, string $searchName = ''): array + public function getDocTemplateList(int $libID = 0, string $type = 'all', string $orderBy = 'id_desc', ?object $pager = null, string $searchName = ''): array { return $this->dao->select('*')->from(TABLE_DOC) ->where('templateType')->ne('') @@ -725,7 +725,7 @@ class docModel extends model * @access public * @return array */ - public function getDocs(int $libID, int $moduleID, string $browseType, string $orderBy, object $pager = null): array + public function getDocs(int $libID, int $moduleID, string $browseType, string $orderBy, ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getDocs(); @@ -915,7 +915,7 @@ class docModel extends model * @access public * @return array */ - public function getMineList(string $type, string $browseType, int $queryID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getMineList(string $type, string $browseType, int $queryID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { $query = ''; if($browseType == 'bysearch') @@ -978,7 +978,7 @@ class docModel extends model * @access public * @return array */ - public function getMySpaceDocs(string $type, string $browseType, string $query = '', string $orderBy = 'id_desc', object $pager = null, string $appendDocs = '', string $filterDocs = ''): array + public function getMySpaceDocs(string $type, string $browseType, string $query = '', string $orderBy = 'id_desc', ?object $pager = null, string $appendDocs = '', string $filterDocs = ''): array { if(!in_array($type, array('all', 'view', 'collect', 'createdby', 'editedby'))) return array(); @@ -2421,7 +2421,7 @@ class docModel extends model * @access public * @return array */ - public function getLibFiles(string $type, int $objectID, string $browseType = '', int $param = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getLibFiles(string $type, int $objectID, string $browseType = '', int $param = 0, string $orderBy = 'id_desc', ?object $pager = null): array { if(!in_array($type, array('execution', 'project', 'product'))) return array(); @@ -3064,7 +3064,7 @@ class docModel extends model * @access public * @return array */ - public function getDocsBySearch(string $type, int $objectID, int $libID, int $queryID, string $orderBy = 'id_desc', object $pager = null): array + public function getDocsBySearch(string $type, int $objectID, int $libID, int $queryID, string $orderBy = 'id_desc', ?object $pager = null): array { $query = $this->buildQuery($type, $queryID); $libs = $this->getLibsByObject($type, $objectID, $libID); @@ -3311,7 +3311,7 @@ class docModel extends model * @access public * @return object */ - public function buildLibItem(int $libID, object $lib, string $type, int $moduleID = 0, int $objectID = 0, string $browseType = '', int $docID = 0, object|null|bool $release = null): object + public function buildLibItem(int $libID, object $lib, string $type, int $moduleID = 0, int $objectID = 0, string $browseType = '', int $docID = 0, mixed $release = null): object { $releaseModule = array(); if($release && $release->lib == $lib->id) @@ -3597,7 +3597,7 @@ class docModel extends model * @access public * @return array */ - public function getDynamic(object $pager = null): array + public function getDynamic(?object $pager = null): array { $allLibs = $this->getLibs('hasApi'); $hasPrivDocIdList = $this->getPrivDocs(array(), 0, 'all'); diff --git a/module/entry/model.php b/module/entry/model.php index 5f761351f8..3de72e7e43 100644 --- a/module/entry/model.php +++ b/module/entry/model.php @@ -60,7 +60,7 @@ class entryModel extends model * @access public * @return array */ - public function getList(string $orderBy = 'id_desc', object $pager = null): array + public function getList(string $orderBy = 'id_desc', ?object $pager = null): array { if(strpos($orderBy, 'desc_') !== false) $orderBy = str_replace('desc_', '`desc`_', $orderBy); return $this->dao->select('*')->from(TABLE_ENTRY)->where('deleted')->eq('0')->orderBy($orderBy)->page($pager)->fetchAll('id'); @@ -76,7 +76,7 @@ class entryModel extends model * @access public * @return array */ - public function getLogs(int $id, string $orderBy = 'date_desc', object $pager = null): array + public function getLogs(int $id, string $orderBy = 'date_desc', ?object $pager = null): array { return $this->dao->select('*')->from(TABLE_LOG) ->where('objectType')->eq('entry') diff --git a/module/execution/tao.php b/module/execution/tao.php index 071f91c29d..d8b5cf6c9a 100644 --- a/module/execution/tao.php +++ b/module/execution/tao.php @@ -421,7 +421,7 @@ class executionTao extends executionModel * @access public * @return object[] */ - public function getSearchBugs(array $productIdList, int $executionID, string $sql = '1=1', string $orderBy = 'id_desc', object|null $pager = null): array + public function getSearchBugs(array $productIdList, int $executionID, string $sql = '1=1', string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('*')->from(TABLE_BUG) ->where($sql) diff --git a/module/execution/zen.php b/module/execution/zen.php index cbd9d1e9fa..883895f044 100644 --- a/module/execution/zen.php +++ b/module/execution/zen.php @@ -1725,7 +1725,7 @@ class executionZen extends execution * @param object[]|object $execution * @return array */ - protected function setUserMoreLink(array|object $execution = null): array + protected function setUserMoreLink(mixed $execution = null): array { $appendPo = $appendPm = $appendQd = $appendRd = array(); if(is_array($execution)) diff --git a/module/file/control.php b/module/file/control.php index e3359d633d..c05dbf34cc 100755 --- a/module/file/control.php +++ b/module/file/control.php @@ -341,7 +341,7 @@ class file extends control * @access public * @return void */ - public function printFiles(array $files, string $fieldset, object|null $object = null, string $method = 'view', bool $showDelete = true, bool $showEdit = true) + public function printFiles(array $files, string $fieldset, ?object $object = null, string $method = 'view', bool $showDelete = true, bool $showEdit = true) { $this->view->files = $files; $this->view->fieldset = $fieldset; diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 540fcf7ef1..dca03f4b66 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -45,7 +45,7 @@ class gitlabModel extends model * @access public * @return array */ - public function getList(string $orderBy = 'id_desc', object $pager = null): array + public function getList(string $orderBy = 'id_desc', ?object $pager = null): array { $gitlabList = $this->loadModel('pipeline')->getList('gitlab', $orderBy, $pager); @@ -271,7 +271,7 @@ class gitlabModel extends model * @access public * @return array */ - public function getCommits(object $repo, string $entry, object $pager = null, string $begin = '', string $end = '', object|null $query = null): array + public function getCommits(object $repo, string $entry, ?object $pager = null, string $begin = '', string $end = '', ?object $query = null): array { $scm = $this->app->loadClass('scm'); $scm->setEngine($repo); @@ -619,7 +619,7 @@ class gitlabModel extends model * @access public * @return array */ - public function apiGetProjectsPager(int $gitlabID, string $keyword = '', string $orderBy = 'id_desc', object $pager = null): array + public function apiGetProjectsPager(int $gitlabID, string $keyword = '', string $orderBy = 'id_desc', ?object $pager = null): array { $apiRoot = $this->getApiRoot($gitlabID); if(!$apiRoot) return array('pager' => null, 'projects' => array()); @@ -1434,7 +1434,7 @@ class gitlabModel extends model * @access public * @return object|array|null */ - public function apiGetTags(int $gitlabID, int $projectID, string $orderBy = '', string $keyword = '', object $pager = null): object|array|null + public function apiGetTags(int $gitlabID, int $projectID, string $orderBy = '', string $keyword = '', ?object $pager = null): object|array|null { $apiRoot = $this->getApiRoot($gitlabID); @@ -2294,7 +2294,7 @@ class gitlabModel extends model * @access public * @return bool */ - public function checkUserAccess(int $gitlabID, int $projectID = 0, object $project = null, array $groupIDList = array(), string $maxRole = 'maintainer'): bool + public function checkUserAccess(int $gitlabID, int $projectID = 0, ?object $project = null, array $groupIDList = array(), string $maxRole = 'maintainer'): bool { if($this->app->user->admin) return true; diff --git a/module/gitlab/zen.php b/module/gitlab/zen.php index 23ff7aa479..d1f728d602 100644 --- a/module/gitlab/zen.php +++ b/module/gitlab/zen.php @@ -336,7 +336,7 @@ class gitlabZen extends gitlab * @access protected * @return object */ - protected function issueToZentaoObject(object $issue, int $gitlabID, object $changes = null): object + protected function issueToZentaoObject(object $issue, int $gitlabID, ?object $changes = null): object { if(!isset($this->config->gitlab->maps->{$issue->objectType})) return null; diff --git a/module/host/model.php b/module/host/model.php index 74f12bf7ce..4fbc075163 100644 --- a/module/host/model.php +++ b/module/host/model.php @@ -23,7 +23,7 @@ class hostModel extends model * @access public * @return array */ - public function getList(string $browseType = 'all', int $param = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getList(string $browseType = 'all', int $param = 0, string $orderBy = 'id_desc', ?object $pager = null): array { $browseType = strtolower($browseType); diff --git a/module/instance/model.php b/module/instance/model.php index 19f3034501..6d9b2166a3 100644 --- a/module/instance/model.php +++ b/module/instance/model.php @@ -112,7 +112,7 @@ class instanceModel extends model * @access public * @return array */ - public function getList(object $pager = null, string $pinned = '', string $searchParam = '', string $status = 'all', bool $alertMark = true) + public function getList(?object $pager = null, string $pinned = '', string $searchParam = '', string $status = 'all', bool $alertMark = true) { $instances = $this->dao->select('instance.*')->from(TABLE_INSTANCE)->alias('instance') ->leftJoin(TABLE_SPACE)->alias('space')->on('space.id=instance.space') @@ -583,7 +583,7 @@ class instanceModel extends model * @access public * @return false|object Failure: return false, Success: return instance */ - public function install(object $app, object $dbInfo, object $customData, int $spaceID = null, array $settings = array()) + public function install(object $app, object $dbInfo, object $customData, ?int $spaceID = null, array $settings = array()) { $this->loadModel('space'); if(!isset($this->app->user->account)) diff --git a/module/mail/model.php b/module/mail/model.php index 70fa02e558..b6cc4c772f 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -482,7 +482,7 @@ class mailModel extends model * @access public * @return array */ - public function getQueue(string $status = 'all', string $orderBy = 'id_desc', object|null $pager = null, bool $mergeByUser = true): array + public function getQueue(string $status = 'all', string $orderBy = 'id_desc', ?object $pager = null, bool $mergeByUser = true): array { $mails = $this->dao->select('*')->from(TABLE_NOTIFY) ->where('objectType')->eq('mail') diff --git a/module/mr/model.php b/module/mr/model.php index 2691a57696..87f60da667 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -35,7 +35,7 @@ class mrModel extends model * @access public * @return array */ - public function getList(string $mode = 'all', string $param = 'all', string $orderBy = 'id_desc', array $filterProjects = array(), int $repoID = 0, int $objectID = 0, object $pager = null): array + public function getList(string $mode = 'all', string $param = 'all', string $orderBy = 'id_desc', array $filterProjects = array(), int $repoID = 0, int $objectID = 0, ?object $pager = null): array { $filterProjectSql = ''; if(!$this->app->user->admin && !empty($filterProjects)) @@ -964,7 +964,7 @@ class mrModel extends model * @access public * @return array */ - public function getLinkList(int $MRID, string $type, string $orderBy = 'id_desc', object $pager = null): array + public function getLinkList(int $MRID, string $type, string $orderBy = 'id_desc', ?object $pager = null): array { if(!isset($this->config->objectTables[$type])) return array(); diff --git a/module/personnel/model.php b/module/personnel/model.php index f82c7c7790..d3057d32bb 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -529,7 +529,7 @@ class personnelModel extends model * @access public * @return array */ - public function getWhitelist(int $objectID = 0, string $objectType = '', string $orderBy = 'id_desc', object $pager = null): array + public function getWhitelist(int $objectID = 0, string $objectType = '', string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('t1.id,t1.account,t2.realname,t2.dept,t2.role,t2.phone,t2.qq,t2.weixin,t2.email')->from(TABLE_ACL)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account') @@ -823,7 +823,7 @@ class personnelModel extends model * @access public * @return string */ - public function createMemberLink(object $dept = null, int $programID = 0): string + public function createMemberLink(?object $dept = null, int $programID = 0): string { return helper::createLink('personnel', 'accessible', "program={$programID}&deptID={$dept->id}"); } diff --git a/module/pivot/tao.php b/module/pivot/tao.php index 50dbd58720..5173385469 100644 --- a/module/pivot/tao.php +++ b/module/pivot/tao.php @@ -11,7 +11,7 @@ class pivotTao extends pivotModel * @access public * @return object|bool */ - protected function fetchPivot(int $id, string|null $version = null): object|bool + protected function fetchPivot(int $id, ?string $version = null): object|bool { $pivot = $this->dao->select('*')->from(TABLE_PIVOT)->where('id')->eq($id)->andWhere('deleted')->eq('0')->fetch(); if(!$pivot) return false; diff --git a/module/pivot/zen.php b/module/pivot/zen.php index a57be88353..56c027a39c 100644 --- a/module/pivot/zen.php +++ b/module/pivot/zen.php @@ -192,7 +192,7 @@ class pivotZen extends pivot * @access public * @return void */ - public function show(int $groupID, int $pivotID, string $mark = '', string|null $version = null): void + public function show(int $groupID, int $pivotID, string $mark = '', ?string $version = null): void { $this->pivot->checkAccess($pivotID, 'preview'); diff --git a/module/product/tao.php b/module/product/tao.php index 24560bb5a3..850778fc90 100644 --- a/module/product/tao.php +++ b/module/product/tao.php @@ -82,7 +82,7 @@ class productTao extends productModel * @access protected * @return array */ - protected function fetchAllProductProjects(int $productID, string $browseType = 'all', string $branch = 'all', string $orderBy = 'order_desc', object|null $pager = null): array + protected function fetchAllProductProjects(int $productID, string $browseType = 'all', string $branch = 'all', string $orderBy = 'order_desc', ?object $pager = null): array { return $this->dao->select('DISTINCT t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') @@ -110,7 +110,7 @@ class productTao extends productModel * @access protected * @return array */ - protected function fetchInvolvedProductProjects(int $productID, string $browseType = 'all', string $branch = 'all', string $orderBy = 'order_desc', object|null $pager = null): array + protected function fetchInvolvedProductProjects(int $productID, string $browseType = 'all', string $branch = 'all', string $orderBy = 'order_desc', ?object $pager = null): array { return $this->dao->select('DISTINCT t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') diff --git a/module/product/zen.php b/module/product/zen.php index 34c58c5cb8..e031008d86 100644 --- a/module/product/zen.php +++ b/module/product/zen.php @@ -412,7 +412,7 @@ class productZen extends product * @access protected * @return array */ - protected function getExportData(int $programID, string $browseType, string $orderBy, int $param = 0, object|null $pager = null): array + protected function getExportData(int $programID, string $browseType, string $orderBy, int $param = 0, ?object $pager = null): array { $users = $this->user->getPairs('noletter'); $products = strtolower($browseType) == 'bysearch' ? $this->product->getListBySearch((int)$param) : $this->product->getList($programID, $browseType); @@ -916,7 +916,7 @@ class productZen extends product * @access protected * @return array */ - public function getStories(int $projectID, int $productID, string $branchID = '', int $moduleID = 0, int $param = 0, string $storyType = 'all', string $browseType = 'allstory', string $orderBy = 'id_desc', object $pager = null): array + public function getStories(int $projectID, int $productID, string $branchID = '', int $moduleID = 0, int $param = 0, string $storyType = 'all', string $browseType = 'allstory', string $orderBy = 'id_desc', ?object $pager = null): array { /* Append id for second sort. */ $sort = common::appendOrder($orderBy); @@ -956,7 +956,7 @@ class productZen extends product * @access public * @return array */ - public function getStoriesByStoryType(int $productID, string $branch = '', string $storyType = 'all', string $orderBy = 'id_desc', object $pager = null): array + public function getStoriesByStoryType(int $productID, string $branch = '', string $storyType = 'all', string $orderBy = 'id_desc', ?object $pager = null): array { /* Append id for second sort. */ $sort = common::appendOrder($orderBy); diff --git a/module/productplan/model.php b/module/productplan/model.php index 9b4f0f84bc..cd98b7b891 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -102,7 +102,7 @@ class productplanModel extends model * @access public * @return array */ - public function getList(int $productID = 0, string $branch = '', string $browseType = 'undone', object|null $pager = null, string $orderBy = 'begin_desc', string $param = '', int $queryID = 0): array + public function getList(int $productID = 0, string $branch = '', string $browseType = 'undone', ?object $pager = null, string $orderBy = 'begin_desc', string $param = '', int $queryID = 0): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getPlans(); @@ -623,7 +623,7 @@ class productplanModel extends model * @access public * @return object */ - public function buildPlanByStatus(string $status, string $closedReason = '', object $plan = null): object + public function buildPlanByStatus(string $status, string $closedReason = '', ?object $plan = null): object { $now = helper::now(); diff --git a/module/productplan/tao.php b/module/productplan/tao.php index d48f785fc1..919412b93b 100644 --- a/module/productplan/tao.php +++ b/module/productplan/tao.php @@ -24,7 +24,7 @@ class productplanTao extends productplanModel * @access protected * @return array */ - protected function getPlanList(array $productIdList, string $branch = '', string $browseType = '', string $param = '', string $orderBy = '', object $pager = null): array + protected function getPlanList(array $productIdList, string $branch = '', string $browseType = '', string $param = '', string $orderBy = '', ?object $pager = null): array { return $this->dao->select('*')->from(TABLE_PRODUCTPLAN) ->where('deleted')->eq(0) @@ -48,7 +48,7 @@ class productplanTao extends productplanModel * @access protected * @return array */ - protected function getPlanProjects(array $planIdList, int|null $productID = null): array + protected function getPlanProjects(array $planIdList, ?int $productID = null): array { if(empty($planIdList)) return []; diff --git a/module/program/model.php b/module/program/model.php index edd464042a..5dff361da0 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -189,7 +189,7 @@ class programModel extends model * @access public * @return array */ - public function getList(string $status = 'all', string $orderBy = 'id_asc', string $type = '', array $topIdList = array(), object $pager = null): array + public function getList(string $status = 'all', string $orderBy = 'id_asc', string $type = '', array $topIdList = array(), ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getPrograms(); @@ -245,7 +245,7 @@ class programModel extends model * @access public * @return array */ - public function getListBySearch(string $orderBy = 'id_asc', int $queryID = 0, bool $hasProject = false, object|null $pager = null): array + public function getListBySearch(string $orderBy = 'id_asc', int $queryID = 0, bool $hasProject = false, ?object $pager = null): array { if($this->session->programQuery == false) $this->session->set('programQuery', ' 1 = 1'); if($queryID) @@ -500,7 +500,7 @@ class programModel extends model * @access public * @return object[] */ - public function getProjectList(int $programID = 0, string $browseType = 'all', int $queryID = 0, string $orderBy = 'id_desc', string $programTitle = '', bool $queryAll = false, object $pager = null): array + public function getProjectList(int $programID = 0, string $browseType = 'all', int $queryID = 0, string $orderBy = 'id_desc', string $programTitle = '', bool $queryAll = false, ?object $pager = null): array { $path = ''; if($programID) $path = $this->getByID($programID)->path; @@ -574,7 +574,7 @@ class programModel extends model * @access public * @return array */ - public function getStakeholders(int $programID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getStakeholders(int $programID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('t2.account,t2.realname,t2.role,t2.qq,t2.mobile,t2.phone,t2.weixin,t2.email,t1.id,t1.type,t1.from,t1.key')->from(TABLE_STAKEHOLDER)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.user=t2.account') @@ -1127,7 +1127,7 @@ class programModel extends model * @access public * @return array */ - public function getProjectStats(int $programID = 0, string $browseType = 'undone', int $queryID = 0, string $orderBy = 'id_desc', string $programTitle = '', bool $queryAll = false, object|null $pager = null): array + public function getProjectStats(int $programID = 0, string $browseType = 'undone', int $queryID = 0, string $orderBy = 'id_desc', string $programTitle = '', bool $queryAll = false, ?object $pager = null): array { if(commonModel::isTutorialMode()) return $this->loadModel('tutorial')->getProjectStats($browseType); diff --git a/module/program/zen.php b/module/program/zen.php index bbd484805f..9d75b17226 100644 --- a/module/program/zen.php +++ b/module/program/zen.php @@ -115,7 +115,7 @@ class programZen extends program * @access protected * @return array */ - protected function getProgramsByType(string $status, string $orderBy, int $param = 0, object|null $pager = null): array + protected function getProgramsByType(string $status, string $orderBy, int $param = 0, ?object $pager = null): array { $status = strtolower($status); $this->view->summary = ''; diff --git a/module/programplan/model.php b/module/programplan/model.php index 8c1d22bfb6..0cd56a5430 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -507,7 +507,7 @@ class programplanModel extends model * @access public * @return bool */ - public function update(int $planID = 0, int $projectID = 0, object|null $plan = null): bool + public function update(int $planID = 0, int $projectID = 0, ?object $plan = null): bool { if(empty($plan)) return false; @@ -882,7 +882,7 @@ class programplanModel extends model * @access public * @return array */ - public function getGanttTasks(int $projectID, array $planIdList, string $browseType, int $queryID, object $pager = null) + public function getGanttTasks(int $projectID, array $planIdList, string $browseType, int $queryID, ?object $pager = null) { $tasks = array(); if($browseType == 'bysearch') diff --git a/module/programplan/tao.php b/module/programplan/tao.php index 2fa7189ebc..37a69f87f7 100644 --- a/module/programplan/tao.php +++ b/module/programplan/tao.php @@ -875,7 +875,7 @@ class programplanTao extends programplanModel * @access protected * @return array */ - protected function getTaskDateLimit(object $task, object|null $execution = null, object|null $parent = null): array + protected function getTaskDateLimit(object $task, ?object $execution = null, ?object $parent = null): array { $estStart = helper::isZeroDate($task->estStarted) ? '' : $task->estStarted; $estEnd = helper::isZeroDate($task->deadline) ? '' : $task->deadline; diff --git a/module/programplan/zen.php b/module/programplan/zen.php index d4572c0bb6..169c9ede7e 100644 --- a/module/programplan/zen.php +++ b/module/programplan/zen.php @@ -208,7 +208,7 @@ class programplanZen extends programplan * @access protected * @return object|false */ - protected function prepareEditPlan(int $planID, int $projectID, object $plan, object|null $parentStage = null): object|false + protected function prepareEditPlan(int $planID, int $projectID, object $plan, ?object $parentStage = null): object|false { if($plan->end < $plan->begin) dao::$errors['end'] = $this->lang->programplan->error->planFinishSmall; diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 1aee4c5a3e..d58de00f57 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -25,7 +25,7 @@ class projectreleaseModel extends model * @access public * @return array */ - public function getList(int $projectID, string $type = 'all', string $orderBy = 't1.date_desc', object $pager = null): array + public function getList(int $projectID, string $type = 'all', string $orderBy = 't1.date_desc', ?object $pager = null): array { $releases = $this->dao->select('t1.*, t2.name AS productName, t2.type AS productType')->from(TABLE_RELEASE)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') diff --git a/module/release/model.php b/module/release/model.php index fc260734ec..7b640a808c 100755 --- a/module/release/model.php +++ b/module/release/model.php @@ -145,7 +145,7 @@ class releaseModel extends model * @access public * @return object[] */ - public function getList(int $productID, string|int $branch = 'all', string $type = 'all', string $orderBy = 't1.date_desc', string $releaseQuery = '', object $pager = null): array + public function getList(int $productID, string|int $branch = 'all', string $type = 'all', string $orderBy = 't1.date_desc', string $releaseQuery = '', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getReleases(); @@ -1194,7 +1194,7 @@ class releaseModel extends model * @access public * @return array */ - public function getStoryList(string $storyIdList, string|int $branch, string $orderBy = '', object $pager = null): array + public function getStoryList(string $storyIdList, string|int $branch, string $orderBy = '', ?object $pager = null): array { $stories = $this->dao->select("t1.*,t2.id as buildID, t2.name as buildName, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")->from(TABLE_STORY)->alias('t1') ->leftJoin(TABLE_BUILD)->alias('t2')->on("FIND_IN_SET(t1.id, t2.stories)") @@ -1232,7 +1232,7 @@ class releaseModel extends model * @access public * @return array */ - public function getBugList(string $bugIdList, string $orderBy = '', object $pager = null, string $type = 'linked'): array + public function getBugList(string $bugIdList, string $orderBy = '', ?object $pager = null, string $type = 'linked'): array { $bugs = array(); diff --git a/module/repo/model.php b/module/repo/model.php index b2e43356fb..e37d17658b 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -96,7 +96,7 @@ class repoModel extends model * @access public * @return array */ - public function getList(int $projectID = 0, string $SCM = '', string $orderBy = 'id_desc', object $pager = null, bool $getCodePath = false, bool $lastSubmitTime = false, string $type = '', int $param = 0): array + public function getList(int $projectID = 0, string $SCM = '', string $orderBy = 'id_desc', ?object $pager = null, bool $getCodePath = false, bool $lastSubmitTime = false, string $type = '', int $param = 0): array { $repoQuery = $type == 'bySearch' ? $this->repoTao->processSearchQuery($param) : ''; $repos = $this->getListByCondition($repoQuery, $SCM, $orderBy, $pager); @@ -844,7 +844,7 @@ class repoModel extends model * @access public * @return array */ - public function getCommits(object $repo, string $entry, string $revision = 'HEAD', string $type = 'dir', object|null $pager = null, string $begin = '', string $end = '', object|string|null $query = null): array + public function getCommits(object $repo, string $entry, string $revision = 'HEAD', string $type = 'dir', ?object $pager = null, string $begin = '', string $end = '', mixed $query = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getCommits(); @@ -2105,7 +2105,7 @@ class repoModel extends model * @access public * @return array */ - public function getFileTree(object $repo, string $branch = '', array $diffs = null): array + public function getFileTree(object $repo, string $branch = '', ?array $diffs = null): array { set_time_limit(0); $allFiles = array(); @@ -2964,7 +2964,7 @@ class repoModel extends model * @access public * @return array */ - public function getListByCondition(string $repoQuery, string $SCM, string $orderBy = 'id_desc', object $pager = null): array + public function getListByCondition(string $repoQuery, string $SCM, string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('*')->from(TABLE_REPO) ->where('deleted')->eq('0') diff --git a/module/search/model.php b/module/search/model.php index 556abc7ba2..796032ccb0 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -598,7 +598,7 @@ class searchModel extends model * @access public * @return array */ - public function getList(string $keywords, array|string $type, object $pager = null): array + public function getList(string $keywords, array|string $type, ?object $pager = null): array { list($words, $againstCond, $likeCondition) = $this->searchTao->getSqlParams($keywords); $allowedObjects = $this->searchTao->getAllowedObjects($type); diff --git a/module/serverroom/model.php b/module/serverroom/model.php index 4518bd3676..2779f09d35 100644 --- a/module/serverroom/model.php +++ b/module/serverroom/model.php @@ -22,7 +22,7 @@ class serverroomModel extends model * @access public * @return array */ - public function getList(string $browseType = 'all', int $param = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getList(string $browseType = 'all', int $param = 0, string $orderBy = 'id_desc', ?object $pager = null): array { $query = ''; if($browseType == 'bysearch') diff --git a/module/space/model.php b/module/space/model.php index 8655d7d818..a60eff7597 100644 --- a/module/space/model.php +++ b/module/space/model.php @@ -111,7 +111,7 @@ class spaceModel extends model * @access public * @return array */ - public function getSpaceInstances(int $spaceID, string $status = 'all', string $searchName = '', object $pager = null): array + public function getSpaceInstances(int $spaceID, string $status = 'all', string $searchName = '', ?object $pager = null): array { $instances = $this->dao->select('*')->from(TABLE_INSTANCE) ->where('deleted')->eq(0) diff --git a/module/stakeholder/model.php b/module/stakeholder/model.php index 0a315f2537..163c920dfd 100644 --- a/module/stakeholder/model.php +++ b/module/stakeholder/model.php @@ -242,7 +242,7 @@ class stakeholderModel extends model * @access public * @return array */ - public function getStakeholders(int $projectID, string $browseType = 'all', string $orderBy = 'id_desc', object $pager = null): array + public function getStakeholders(int $projectID, string $browseType = 'all', string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('t1.*, t2.role, t2.phone, t2.realname as name, t2.email, t2.qq, t2.weixin, t2.nature, t2.analysis, t2.strategy, t3.name as companyName, t4.model as projectModel')->from(TABLE_STAKEHOLDER)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.user=t2.account') @@ -473,7 +473,7 @@ class stakeholderModel extends model * @access public * @return array */ - public function getExpectList(string $browseType = 'all', int $queryID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getExpectList(string $browseType = 'all', int $queryID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { $stakeholderQuery = ''; if($browseType == 'bysearch') diff --git a/module/story/model.php b/module/story/model.php index bb0cc397a6..afabdfbd96 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -262,7 +262,7 @@ class storyModel extends model * @access public * @return array */ - public function getExecutionStories(int|array $executionID = 0, int $productID = 0, string $orderBy = 't1.`order`_desc', string $browseType = 'byModule', string $param = '0', string $storyType = 'story', array|string $excludeStories = '', object|null $pager = null): array + public function getExecutionStories(int|array $executionID = 0, int $productID = 0, string $orderBy = 't1.`order`_desc', string $browseType = 'byModule', string $param = '0', string $storyType = 'story', array|string $excludeStories = '', ?object $pager = null): array { if(commonModel::isTutorialMode()) return $this->loadModel('tutorial')->getExecutionStories(); @@ -352,7 +352,7 @@ class storyModel extends model * @access public * @return void */ - public function batchGetExecutionStories(string $executionIdList = '', int $productID = 0, string $orderBy = 't1.`order`_desc', string $type = 'byModule', string $param = '0', string $storyType = 'story', array|string $excludeStories = '', object|null $pager = null): array + public function batchGetExecutionStories(string $executionIdList = '', int $productID = 0, string $orderBy = 't1.`order`_desc', string $type = 'byModule', string $param = '0', string $storyType = 'story', array|string $excludeStories = '', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getStories(); @@ -445,7 +445,7 @@ class storyModel extends model * @access public * @return array */ - public function getPlanStories(int $planID, string $status = 'all', string $orderBy = 'id_desc', object|null $pager = null): array + public function getPlanStories(int $planID, string $status = 'all', string $orderBy = 'id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return array(); @@ -2310,7 +2310,7 @@ class storyModel extends model * @access public * @return array */ - public function getStories2Link(int $storyID, string $browseType = 'bySearch', int $queryID = 0, object $pager = null): array + public function getStories2Link(int $storyID, string $browseType = 'bySearch', int $queryID = 0, ?object $pager = null): array { $story = $this->getById($storyID); $excludes = $this->storyTao->getRelation($storyID, $story->type); @@ -2343,7 +2343,7 @@ class storyModel extends model * @access public * @return array */ - public function getProductStories(string|int|array $productID = 0, array|string|int $branch = 0, array|string $moduleIdList = '', array|string $status = 'all', string $type = 'story', string $orderBy = 'id_desc', bool $hasParent = true, array|string $excludeStories = '', object|null $pager = null): array + public function getProductStories(string|int|array $productID = 0, array|string|int $branch = 0, array|string $moduleIdList = '', array|string $status = 'all', string $type = 'story', string $orderBy = 'id_desc', bool $hasParent = true, array|string $excludeStories = '', ?object $pager = null): array { if(commonModel::isTutorialMode()) return $this->loadModel('tutorial')->getStories(); $showGrades = isset($this->config->{$type}->showGrades) ? $this->config->{$type}->showGrades : null; @@ -2630,7 +2630,7 @@ class storyModel extends model * @access public * @return array */ - public function getByField(int|array $productID, int|string $branch, string|array $modules, string $fieldName, string $fieldValue, string $type = 'story', string $orderBy = '', object|null $pager = null, string $operator = 'equal'): array + public function getByField(int|array $productID, int|string $branch, string|array $modules, string $fieldName, string $fieldValue, string $type = 'story', string $orderBy = '', ?object $pager = null, string $operator = 'equal'): array { if(!$this->loadModel('common')->checkField(TABLE_STORY, $fieldName) and $fieldName != 'reviewBy' and $fieldName != 'assignedBy') return array(); @@ -2687,7 +2687,7 @@ class storyModel extends model * @access public * @return array */ - public function get2BeClosed(int|array $productID, int|string $branch, string|array $modules, string $type = 'story', string $orderBy = '', object|null $pager = null): array + public function get2BeClosed(int|array $productID, int|string $branch, string|array $modules, string $type = 'story', string $orderBy = '', ?object $pager = null): array { $showGrades = isset($this->config->{$type}->showGrades) ? $this->config->{$type}->showGrades : null; if($showGrades) @@ -2729,7 +2729,7 @@ class storyModel extends model * @access public * @return array */ - public function getBySearch(int|string $productID, int|string $branch = '', int $queryID = 0, string $orderBy = '', int|array $executionID = 0, string $type = 'story', array|string $excludeStories = '', string $excludeStatus = '', object|null $pager = null): array + public function getBySearch(int|string $productID, int|string $branch = '', int $queryID = 0, string $orderBy = '', int|array $executionID = 0, string $type = 'story', array|string $excludeStories = '', string $excludeStatus = '', ?object $pager = null): array { $this->loadModel('product'); $executionID = empty($executionID) ? 0 : $executionID; @@ -2844,7 +2844,7 @@ class storyModel extends model * @access public * @return array */ - public function getBySQL(int|string $productID, string $sql, string $orderBy, object|null $pager = null, string $type = 'story'): array + public function getBySQL(int|string $productID, string $sql, string $orderBy, ?object $pager = null, string $type = 'story'): array { /* Get plans. */ $plans = $this->dao->select('id,title')->from(TABLE_PRODUCTPLAN)->where('deleted')->eq('0') @@ -3102,7 +3102,7 @@ class storyModel extends model * @access public * @return array */ - public function getUserStories(string $account, string $type = 'assignedTo', string $orderBy = 'id_desc', object|null $pager = null, string $storyType = 'story', bool $includeLibStories = true, string|int $shadow = 0, int $productID = 0): array + public function getUserStories(string $account, string $type = 'assignedTo', string $orderBy = 'id_desc', ?object $pager = null, string $storyType = 'story', bool $includeLibStories = true, string|int $shadow = 0, int $productID = 0): array { $sql = $this->dao->select("t1.*, t1.`path`, t1.`plan`, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, t2.name as productTitle, t2.shadow as shadow")->from(TABLE_STORY)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id'); @@ -3256,7 +3256,7 @@ class storyModel extends model * @access public * @return array */ - public function getZeroCase(int $productID, int $projectID = 0, int $executionID = 0, int $branchID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getZeroCase(int $productID, int $projectID = 0, int $executionID = 0, int $branchID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { $casedStories = $this->dao->select('DISTINCT t1.story') ->from(TABLE_CASE)->alias('t1') @@ -4804,7 +4804,7 @@ class storyModel extends model * @access public * @return array */ - public function getExportStories(string $orderBy = 'id_desc', string $storyType = 'story', object|null $postData = null): array + public function getExportStories(string $orderBy = 'id_desc', string $storyType = 'story', ?object $postData = null): array { $orderBy = $orderBy !== 'id_desc' ? 'id_desc' : $orderBy; /* The order of the stories for exporting is disabled. */ @@ -5114,7 +5114,7 @@ class storyModel extends model * @access public * @return array */ - public function buildActionButtonList(object $story, $type = 'browse', object|null $execution = null, $storyType = 'story', array $maxGradeGroup = array()): array + public function buildActionButtonList(object $story, $type = 'browse', ?object $execution = null, $storyType = 'story', array $maxGradeGroup = array()): array { $params = "storyID=$story->id"; @@ -5366,7 +5366,7 @@ class storyModel extends model * @access public * @return array */ - public function getGradeMenu(string $storyType, object $project = null): array + public function getGradeMenu(string $storyType, ?object $project = null): array { $storyTypes = isset($project->storyType) ? explode(',', $project->storyType) : array(); $showEpic = $this->config->enableER && ($storyType == 'epic' || in_array('epic', $storyTypes) || $storyType == 'all'); diff --git a/module/story/tao.php b/module/story/tao.php index e6cba39677..18dbb157e6 100644 --- a/module/story/tao.php +++ b/module/story/tao.php @@ -34,7 +34,7 @@ class storyTao extends storyModel * @access protected * @return array */ - protected function getProjectRequirements(int $productID, int $projectID, object|null $pager = null): array + protected function getProjectRequirements(int $productID, int $projectID, ?object $pager = null): array { return $this->dao->select('t2.*')->from(TABLE_PROJECTSTORY)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on("t1.story = t2.id && t2.type ='requirement'") @@ -382,7 +382,7 @@ class storyTao extends storyModel * @access protected * @return array */ - protected function getExecutionStoriesBySearch(int $executionID, int $queryID, int $productID, string $orderBy, string $storyType = 'story', string $sqlCondition = '', array $excludeStories = array(), object|null $pager = null): array + protected function getExecutionStoriesBySearch(int $executionID, int $queryID, int $productID, string $orderBy, string $storyType = 'story', string $sqlCondition = '', array $excludeStories = array(), ?object $pager = null): array { /* 获取查询条件。 */ $rawModule = $this->app->rawModule; @@ -509,7 +509,7 @@ class storyTao extends storyModel * @access protected * @return int[] */ - protected function fetchExecutionStories(dao $storyDAO, int $productID, string $type, string $branch, string $orderBy, object|null $pager = null): array + protected function fetchExecutionStories(dao $storyDAO, int $productID, string $type, string $branch, string $orderBy, ?object $pager = null): array { if(strpos($orderBy, 'version_') !== false) $orderBy = str_replace('version_', 't2.version_', $orderBy); @@ -539,7 +539,7 @@ class storyTao extends storyModel * @access protected * @return int[] */ - protected function fetchProjectStories(dao $storyDAO, int $productID, string $type, string $branch, array $executionStoryIdList, string $orderBy, object|null $pager = null, object|null $project = null): array + protected function fetchProjectStories(dao $storyDAO, int $productID, string $type, string $branch, array $executionStoryIdList, string $orderBy, ?object $pager = null, ?object $project = null): array { if(strpos($orderBy, 'version_') !== false) $orderBy = str_replace('version_', 't2.version_', $orderBy); @@ -1958,7 +1958,7 @@ class storyTao extends storyModel * @access protected * @return array */ - protected function buildBrowseActionBtnList(object $story, string $params = '', string $storyType = 'story', object $execution = null, array $maxGradeGroup = array()): array + protected function buildBrowseActionBtnList(object $story, string $params = '', string $storyType = 'story', ?object $execution = null, array $maxGradeGroup = array()): array { global $lang; $actions = array(); diff --git a/module/task/model.php b/module/task/model.php index c91b14e219..3f41360c57 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -123,7 +123,7 @@ class taskModel extends model * @access public * @return bool */ - public function afterBatchCreate(array $taskIdList, object $parent = null): bool + public function afterBatchCreate(array $taskIdList, ?object $parent = null): bool { /* Process other data after split task. */ if($parent && !empty($taskIdList)) @@ -723,7 +723,7 @@ class taskModel extends model * @access public * @return bool */ - public function canOperateEffort(object $task, object $effort = null): bool + public function canOperateEffort(object $task, ?object $effort = null): bool { if(empty($task->team)) { @@ -761,7 +761,7 @@ class taskModel extends model * @access public * @return false|void */ - public function checkEstStartedAndDeadline(int $executionID, string $estStarted, string $deadline, int|null $rowID = null) + public function checkEstStartedAndDeadline(int $executionID, string $estStarted, string $deadline, ?int $rowID = null) { $beginIndex = $rowID === null ? 'estStarted' : "estStarted[$rowID]"; $endIndex = $rowID === null ? 'deadline' : "deadline[$rowID]"; @@ -870,7 +870,7 @@ class taskModel extends model * @access public * @return object|bool */ - public function computeMultipleHours(object $oldTask, object $task = null, array $team = array(), bool $autoStatus = true): object|bool + public function computeMultipleHours(object $oldTask, ?object $task = null, array $team = array(), bool $autoStatus = true): object|bool { if(!$oldTask) return false; @@ -1750,7 +1750,7 @@ class taskModel extends model * @access public * @return array */ - public function getExecutionTasks(int|array $executionID, int $productID = 0, string|array $type = 'all', array $modules = array(), string $orderBy = 'status_asc, id_desc', object $pager = null): array + public function getExecutionTasks(int|array $executionID, int $productID = 0, string|array $type = 'all', array $modules = array(), string $orderBy = 'status_asc, id_desc', ?object $pager = null): array { $tasks = $this->taskTao->fetchExecutionTasks($executionID, $productID, $type, $modules, $orderBy, $pager); if(empty($tasks)) return array(); @@ -1902,7 +1902,7 @@ class taskModel extends model * @access public * @return object[] */ - public function getListByCondition(object $condition, string $orderBy = 'id_desc', object|null $pager = null): array + public function getListByCondition(object $condition, string $orderBy = 'id_desc', ?object $pager = null): array { $defaultValueList = array('priList' => array(), 'assignedToList' => array(), 'statusList' => array(), 'idList' => array(), 'taskName' => ''); foreach($defaultValueList as $key => $defaultValue) @@ -2349,7 +2349,7 @@ class taskModel extends model * @access public * @return object[] */ - public function getUserTasks(string $account, string $type = 'assignedTo', int $limit = 0, object $pager = null, string $orderBy = 'id_desc', int $projectID = 0): array + public function getUserTasks(string $account, string $type = 'assignedTo', int $limit = 0, ?object $pager = null, string $orderBy = 'id_desc', int $projectID = 0): array { if($type != 'myInvolved' && !$this->loadModel('common')->checkField(TABLE_TASK, $type)) return array(); @@ -3136,7 +3136,7 @@ class taskModel extends model * @access public * @return array|string|false */ - public function update(object $task, object $teamData = null): array|string|false + public function update(object $task, ?object $teamData = null): array|string|false { $taskID = $task->id; $oldTask = $this->getByID($taskID); diff --git a/module/task/zen.php b/module/task/zen.php index 68f120f3a7..1ffe8c0b36 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -1048,7 +1048,7 @@ class taskZen extends task * @access public * @return void */ - public function checkLegallyDate(object $task, bool $isDateLimit, object|null $parent, int|null $rowID = null): void + public function checkLegallyDate(object $task, bool $isDateLimit, ?object $parent, ?int $rowID = null): void { $beginIndex = $rowID === null ? 'estStarted' : "estStarted[$rowID]"; $endIndex = $rowID === null ? 'deadline' : "deadline[$rowID]"; diff --git a/module/testcase/model.php b/module/testcase/model.php index 609d7e3f66..4ae31e69f8 100755 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -91,7 +91,7 @@ class testcaseModel extends model * @access public * @return array */ - public function getModuleCases(int|array $productID, int|string $branch = 0, int|array $moduleIdList = 0, string $browseType = '', string $auto = 'no', string $caseType = '', string $orderBy = 'id_desc', object $pager = null, string $from = 'testcase'): array + public function getModuleCases(int|array $productID, int|string $branch = 0, int|array $moduleIdList = 0, string $browseType = '', string $auto = 'no', string $caseType = '', string $orderBy = 'id_desc', ?object $pager = null, string $from = 'testcase'): array { $isProjectTab = $this->app->tab == 'project' && $from != 'doc'; $isExecutionTab = $this->app->tab == 'execution' && $from != 'doc'; @@ -133,7 +133,7 @@ class testcaseModel extends model * @access public * @return array */ - public function getExecutionCases(string $browseType = 'all', int $executionID = 0, int $productID = 0, int|string $branchID = 0, int $moduleID = 0, int $paramID = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getExecutionCases(string $browseType = 'all', int $executionID = 0, int $productID = 0, int|string $branchID = 0, int $moduleID = 0, int $paramID = 0, string $orderBy = 'id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getCases(); diff --git a/module/testcase/tao.php b/module/testcase/tao.php index 61a3af0bff..9de1e2a23c 100644 --- a/module/testcase/tao.php +++ b/module/testcase/tao.php @@ -61,7 +61,7 @@ class testcaseTao extends testcaseModel * @access protected * @return array */ - protected function getModuleProjectCases(int|array $productID, int|string $branch = 0, int|array $moduleIdList = 0, string $browseType = '', string $auto = 'no', string $caseType = '', string $orderBy = 'id_desc', object $pager = null): array + protected function getModuleProjectCases(int|array $productID, int|string $branch = 0, int|array $moduleIdList = 0, string $browseType = '', string $auto = 'no', string $caseType = '', string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('distinct t1.*, t2.*, t4.title AS storyTitle')->from(TABLE_PROJECTCASE)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') @@ -96,7 +96,7 @@ class testcaseTao extends testcaseModel * @access protected * @return array */ - protected function getNeedConfirmList(int|array $productID, string|int $branch, array $modules, string $auto, string $caseType, string $sort, object $pager = null): array + protected function getNeedConfirmList(int|array $productID, string|int $branch, array $modules, string $auto, string $caseType, string $sort, ?object $pager = null): array { return $this->dao->select('distinct t1.*, t2.title AS storyTitle')->from(TABLE_CASE)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') @@ -130,7 +130,7 @@ class testcaseTao extends testcaseModel * @access public * @return array */ - public function getBySuite(int $productID, int|string $branch = 0, int $suiteID = 0, array|int $moduleIdList = 0, string $auto = 'no', string $orderBy = 'id_desc', object $pager = null): array + public function getBySuite(int $productID, int|string $branch = 0, int $suiteID = 0, array|int $moduleIdList = 0, string $auto = 'no', string $orderBy = 'id_desc', ?object $pager = null): array { return $this->dao->select('t1.*, t2.title AS storyTitle, t3.version AS version')->from(TABLE_CASE)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') diff --git a/module/testreport/model.php b/module/testreport/model.php index 2c6eb5be5b..103d1504d3 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -92,7 +92,7 @@ class testreportModel extends model * @access public * @return array */ - public function getList(int $objectID, string $objectType, int $extra = 0, string $orderBy = 'id_desc', object $pager = null): array + public function getList(int $objectID, string $objectType, int $extra = 0, string $orderBy = 'id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getTestReports(); @@ -119,7 +119,7 @@ class testreportModel extends model * @access public * @return array */ - public function getTaskCases(array $tasks, string $begin, string $end, string $idList = '', object $pager = null): array + public function getTaskCases(array $tasks, string $begin, string $end, string $idList = '', ?object $pager = null): array { $cases = $this->dao->select('t2.*, t1.task, t1.assignedTo, t1.status, t1.lastRunDate AS maxRunDate')->from(TABLE_TESTRUN)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') diff --git a/module/testreport/zen.php b/module/testreport/zen.php index 88580af531..575e49c049 100644 --- a/module/testreport/zen.php +++ b/module/testreport/zen.php @@ -142,7 +142,7 @@ class testreportZen extends testreport * @access protected * @return array */ - protected function assignTesttaskReportData(int $objectID, string $begin = '', string $end = '', int $productID = 0, object $task = null, string $method = 'create'): array + protected function assignTesttaskReportData(int $objectID, string $begin = '', string $end = '', int $productID = 0, ?object $task = null, string $method = 'create'): array { $begin = !empty($begin) ? date("Y-m-d", strtotime($begin)) : $task->begin; $end = !empty($end) ? date("Y-m-d", strtotime($end)) : $task->end; @@ -279,7 +279,7 @@ class testreportZen extends testreport * @access protected * @return void */ - protected function assignReportData(array $reportData, string $method, object $pager = null): void + protected function assignReportData(array $reportData, string $method, ?object $pager = null): void { foreach($reportData as $key => $value) { diff --git a/module/testsuite/model.php b/module/testsuite/model.php index 7a7dd83046..5bd089cdb4 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -46,7 +46,7 @@ class testsuiteModel extends model * @access public * @return array */ - public function getSuites(int $productID, string $orderBy = 'id_desc', object $pager = null, string $param = ''): array + public function getSuites(int $productID, string $orderBy = 'id_desc', ?object $pager = null, string $param = ''): array { return $this->dao->select('*')->from(TABLE_TESTSUITE) ->where('product')->eq($productID) @@ -182,7 +182,7 @@ class testsuiteModel extends model * @access public * @return array */ - public function getLinkedCases(int $suiteID, string $orderBy = 'id_desc', object $pager = null, bool $append = true): array + public function getLinkedCases(int $suiteID, string $orderBy = 'id_desc', ?object $pager = null, bool $append = true): array { $suite = $this->getById($suiteID); if(!$suite) return array(); @@ -238,7 +238,7 @@ class testsuiteModel extends model * @access public * @return array */ - public function getUnlinkedCases(object $suite, string $browseType = 'all', int $param = 0, object $pager = null): array + public function getUnlinkedCases(object $suite, string $browseType = 'all', int $param = 0, ?object $pager = null): array { if($this->session->testsuiteQuery == false) $this->session->set('testsuiteQuery', ' 1 = 1'); if($param) diff --git a/module/testtask/model.php b/module/testtask/model.php index 131576d921..847932d668 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -55,7 +55,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getProductTasks(int $productID, string $branch = 'all', string $type = '', string $begin = '', string $end = '', string $orderBy = 'id_desc', object $pager = null): array + public function getProductTasks(int $productID, string $branch = 'all', string $type = '', string $begin = '', string $end = '', string $orderBy = 'id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getTesttasks(); @@ -103,7 +103,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getProductUnitTasks(int $productID, string $browseType = 'newest', string $orderBy = 'id_desc', object $pager = null): array + public function getProductUnitTasks(int $productID, string $browseType = 'newest', string $orderBy = 'id_desc', ?object $pager = null): array { $begin = ''; $end = ''; @@ -152,7 +152,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getProjectTasks(int $projectID, string $orderBy = 'id_desc', object $pager = null): array + public function getProjectTasks(int $projectID, string $orderBy = 'id_desc', ?object $pager = null): array { $tasks = $this->dao->select('t1.*, t1.id AS idName, t5.multiple, IF(t4.shadow = 1, t5.name, t4.name) AS productName, t3.name AS executionName, t2.name AS buildName, t2.branch AS branch, t5.name AS projectName, t4.`order` AS productOrder') ->from(TABLE_TESTTASK)->alias('t1') @@ -181,7 +181,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getExecutionTasks(int $executionID, string $objectType = 'execution', string $orderBy = 'id_desc', object $pager = null): array + public function getExecutionTasks(int $executionID, string $objectType = 'execution', string $orderBy = 'id_desc', ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getTesttasks(); @@ -308,7 +308,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getByUser(string $account, object $pager = null, string $orderBy = 'id_desc', string $type = ''): array + public function getByUser(string $account, ?object $pager = null, string $orderBy = 'id_desc', string $type = ''): array { return $this->dao->select("t1.*, t2.name AS executionName, t2.multiple AS executionMultiple, t5.name AS projectName, t3.name AS buildName, t4.name AS productName, CONCAT(t2.name, '/', t3.name) as executionBuild") ->from(TABLE_TESTTASK)->alias('t1') @@ -356,7 +356,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getLinkableCases(int $productID, object $task, string $type = 'all', int $param = 0, object $pager = null): array + public function getLinkableCases(int $productID, object $task, string $type = 'all', int $param = 0, ?object $pager = null): array { if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1'); $query = $this->session->testcaseQuery; @@ -386,7 +386,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getAllLinkableCases(object $task, string $query = '', array $linkedCases = array(), object $pager = null): array + public function getAllLinkableCases(object $task, string $query = '', array $linkedCases = array(), ?object $pager = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getCases(); @@ -414,7 +414,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getLinkableCasesByStory(int $productID, object $task, string $query = '', array $linkedCases = array(), object $pager = null): array + public function getLinkableCasesByStory(int $productID, object $task, string $query = '', array $linkedCases = array(), ?object $pager = null): array { $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories'); if(!$stories) return array(); @@ -447,7 +447,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getLinkableCasesByBug(int $productID, object $task, string $query = '', array $linkedCases = array(), object $pager = null): array + public function getLinkableCasesByBug(int $productID, object $task, string $query = '', array $linkedCases = array(), ?object $pager = null): array { $bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs'); if(!$bugs) return array(); @@ -479,7 +479,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getLinkableCasesBySuite(int $productID, object $task, int $suite, string $query = '', array$linkedCases = array(), object $pager = null): array + public function getLinkableCasesBySuite(int $productID, object $task, int $suite, string $query = '', array$linkedCases = array(), ?object $pager = null): array { if(strpos($query, '`product`') !== false) $query = str_replace('`product`', 't1.`product`', $query); @@ -509,7 +509,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getLinkableCasesByTestTask(int $testTask, string $query = '', array $linkedCases = array(), object $pager = null): array + public function getLinkableCasesByTestTask(int $testTask, string $query = '', array $linkedCases = array(), ?object $pager = null): array { /* Format the query condition. */ $query = preg_replace('/`(\w+)`/', 't1.`$1`', $query); @@ -980,7 +980,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getRuns(int $taskID, array $modules, string $orderBy, object $pager = null): array + public function getRuns(int $taskID, array $modules, string $orderBy, ?object $pager = null): array { $orderBy = $this->addPrefixToOrderBy($orderBy); @@ -1006,7 +1006,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getRunsBySuite(int $taskID, int $suiteID, string $orderBy, object $pager = null): array + public function getRunsBySuite(int $taskID, int $suiteID, string $orderBy, ?object $pager = null): array { $orderBy = $this->addPrefixToOrderBy($orderBy); $cases = $this->loadModel('testsuite')->getLinkedCasePairs($suiteID); @@ -1056,7 +1056,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getUserRuns(int $taskID, string $user, array $modules = array(), string $orderBy = 'id_desc', object $pager = null): array + public function getUserRuns(int $taskID, string $user, array $modules = array(), string $orderBy = 'id_desc', ?object $pager = null): array { $orderBy = $this->addPrefixToOrderBy($orderBy); @@ -1134,7 +1134,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getTaskCases(int $productID, string $browseType, int $queryID, int $moduleID, string $sort, object $pager = null, object $task = null): array + public function getTaskCases(int $productID, string $browseType, int $queryID, int $moduleID, string $sort, ?object $pager = null, ?object $task = null): array { if(common::isTutorialMode()) return $this->loadModel('tutorial')->getCases(); diff --git a/module/todo/model.php b/module/todo/model.php index 17bffc7f54..2edceb2303 100755 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -226,7 +226,7 @@ class todoModel extends model * @access public * @return array */ - public function getList(string $type = 'today', string $account = '', string|array $status = 'all', int $limit = 0, object $pager = null, string $orderBy="date,status,begin"): array + public function getList(string $type = 'today', string $account = '', string|array $status = 'all', int $limit = 0, ?object $pager = null, string $orderBy="date,status,begin"): array { $this->app->loadClass('date', true); diff --git a/module/todo/tao.php b/module/todo/tao.php index 9686123ad7..82ba991b27 100644 --- a/module/todo/tao.php +++ b/module/todo/tao.php @@ -445,7 +445,7 @@ class todoTao extends todoModel * @access protected * @return array */ - protected function getListBy(string $type, string $account, array|string $status, string $begin, string $end, int $limit, string $orderBy, object $pager = null): array + protected function getListBy(string $type, string $account, array|string $status, string $begin, string $end, int $limit, string $orderBy, ?object $pager = null): array { return $this->dao->select('*')->from(TABLE_TODO) ->where('deleted')->eq('0') diff --git a/module/transfer/zen.php b/module/transfer/zen.php index a37942b840..d1d760206b 100644 --- a/module/transfer/zen.php +++ b/module/transfer/zen.php @@ -268,7 +268,7 @@ class transferZen extends transfer * @access private * @return string */ - private function processEstimate(int $row = 0, object $object = null): string + private function processEstimate(int $row = 0, ?object $object = null): string { $members = $this->loadModel('user')->getTeamMemberPairs($this->session->taskTransferParams['executionID'], 'execution'); $html = '