diff --git a/framework/db/ActiveQuery.php b/framework/db/ActiveQuery.php index 008f5f11e8..b928f31880 100644 --- a/framework/db/ActiveQuery.php +++ b/framework/db/ActiveQuery.php @@ -699,7 +699,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface * @return static * @see via() */ - public function viaTable($tableName, $link, $callable = null) + public function viaTable($tableName, $link, callable $callable = null) { $relation = new ActiveQuery(get_class($this->primaryModel), [ 'from' => [$tableName], diff --git a/framework/db/ActiveRelationTrait.php b/framework/db/ActiveRelationTrait.php index 8e4d87c8b9..a7c0eb33c2 100644 --- a/framework/db/ActiveRelationTrait.php +++ b/framework/db/ActiveRelationTrait.php @@ -99,7 +99,7 @@ trait ActiveRelationTrait * Its signature should be `function($query)`, where `$query` is the query to be customized. * @return static the relation object itself. */ - public function via($relationName, $callable = null) + public function via($relationName, callable $callable = null) { $relation = $this->primaryModel->getRelation($relationName); $this->via = [$relationName, $relation];