mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
[PHP 8.4] Fixes for implicit nullability deprecation (#20133)
Fixes all issues that emit deprecation notices on PHP 8.4 for implicit nullable parameter type declarations. Related to #20128. See: - [RFC](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types) - [PHP 8.4: Implicitly nullable parameter declarations deprecated](https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated) Co-authored-by: Wilmer Arambula <terabytesoftw@gmail.com> Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
This commit is contained in:
committed by
GitHub
parent
ac1a5af67b
commit
a292af13bf
@ -785,7 +785,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
||||
* @throws InvalidConfigException when query is not initialized properly
|
||||
* @see via()
|
||||
*/
|
||||
public function viaTable($tableName, $link, callable $callable = null)
|
||||
public function viaTable($tableName, $link, ?callable $callable = null)
|
||||
{
|
||||
$modelClass = $this->primaryModel ? get_class($this->primaryModel) : $this->modelClass;
|
||||
$relation = new self($modelClass, [
|
||||
|
||||
@ -97,7 +97,7 @@ interface ActiveQueryInterface extends QueryInterface
|
||||
* Its signature should be `function($query)`, where `$query` is the query to be customized.
|
||||
* @return $this the relation object itself.
|
||||
*/
|
||||
public function via($relationName, callable $callable = null);
|
||||
public function via($relationName, ?callable $callable = null);
|
||||
|
||||
/**
|
||||
* Finds the related records for the specified primary record.
|
||||
|
||||
@ -104,7 +104,7 @@ trait ActiveRelationTrait
|
||||
* Its signature should be `function($query)`, where `$query` is the query to be customized.
|
||||
* @return $this the relation object itself.
|
||||
*/
|
||||
public function via($relationName, callable $callable = null)
|
||||
public function via($relationName, ?callable $callable = null)
|
||||
{
|
||||
$relation = $this->primaryModel->getRelation($relationName);
|
||||
$callableUsed = $callable !== null;
|
||||
|
||||
Reference in New Issue
Block a user