File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,18 @@ class PresenterFactory implements IPresenterFactory
2727 private array $ aliases = [];
2828 private array $ cache = [];
2929
30- /** @var callable */
31- private $ factory ;
30+ /** @var \Closure(string): IPresenter */
31+ private \ Closure $ factory ;
3232
3333
3434 /**
3535 * @param ?callable(string): IPresenter $factory
3636 */
3737 public function __construct (?callable $ factory = null )
3838 {
39- $ this ->factory = $ factory ?? fn (string $ class ): IPresenter => new $ class ;
39+ $ this ->factory = $ factory
40+ ? $ factory (...)
41+ : fn (string $ class ): IPresenter => new $ class ;
4042 }
4143
4244
Original file line number Diff line number Diff line change 1717 */
1818final class CallbackResponse implements Nette \Application \Response
1919{
20- /** @var callable */
21- private $ callback ;
20+ /** @var \Closure(Nette\Http\IRequest, Nette\Http\IResponse): void */
21+ private \ Closure $ callback ;
2222
2323
2424 /**
2525 * @param callable(Nette\Http\IRequest, Nette\Http\IResponse): void $callback
2626 */
2727 public function __construct (callable $ callback )
2828 {
29- $ this ->callback = $ callback ;
29+ $ this ->callback = $ callback(...) ;
3030 }
3131
3232
Original file line number Diff line number Diff line change 1717 */
1818final class Multiplier extends Component
1919{
20- /** @var callable */
21- private $ factory ;
20+ /** @var \Closure(string, self): Nette\ComponentModel\IComponent */
21+ private \ Closure $ factory ;
2222
2323
24+ /**
25+ * @param callable(string, self): Nette\ComponentModel\IComponent $factory
26+ */
2427 public function __construct (callable $ factory )
2528 {
26- $ this ->factory = $ factory ;
29+ $ this ->factory = $ factory(...) ;
2730 }
2831
2932
You can’t perform that action at this time.
0 commit comments