Skip to content

Commit

Permalink
[TASK] Type hint arguments in ViewInterface (#933)
Browse files Browse the repository at this point in the history
Add proper type hints to the two arguments
in ViewInterface->assign(). This is not
breaking since existing implementations can
still accept "more" by not setting these
arguments - method arguments of subtypes
are contravariant. This will be backported
to 2.14.
  • Loading branch information
lolli42 authored Jul 23, 2024
1 parent a3799ae commit 9aeb4b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/ViewInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 23,7 @@ interface ViewInterface
* @return ViewInterface an instance of $this, to enable chaining
* @api
*/
public function assign($key, $value);
public function assign(string $key, mixed $value);

/**
* Add multiple variables to the view data collection
Expand Down

0 comments on commit 9aeb4b1

Please sign in to comment.