File tree Expand file tree Collapse file tree 4 files changed +5
-11
lines changed Expand file tree Collapse file tree 4 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -111,10 +111,9 @@ public function run(Application\Request $request)
111
111
/**
112
112
* Template factory.
113
113
* @param string
114
- * @param callable
115
114
* @return Application\UI\ITemplate
116
115
*/
117
- public function createTemplate ($ class = NULL , $ latteFactory = NULL )
116
+ public function createTemplate ($ class = NULL , callable $ latteFactory = NULL )
118
117
{
119
118
$ latte = $ latteFactory ? $ latteFactory () : $ this ->getContext ()->getByType ('Nette\Bridges\ApplicationLatte\ILatteFactory ' )->create ();
120
119
$ template = $ class ? new $ class : new Nette \Bridges \ApplicationLatte \Template ($ latte );
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class PresenterFactory extends Nette\Object implements IPresenterFactory
31
31
/**
32
32
* @param callable function (string $class): IPresenter
33
33
*/
34
- public function __construct ($ factory = NULL )
34
+ public function __construct (callable $ factory = NULL )
35
35
{
36
36
$ this ->factory = $ factory ?: function ($ class ) { return new $ class ; };
37
37
}
Original file line number Diff line number Diff line change @@ -19,13 +19,10 @@ class Multiplier extends PresenterComponent
19
19
private $ factory ;
20
20
21
21
22
- /**
23
- * @param callable
24
- */
25
- public function __construct ($ factory )
22
+ public function __construct (callable $ factory )
26
23
{
27
24
parent ::__construct ();
28
- $ this ->factory = Nette \ Utils \Callback:: check ( $ factory) ;
25
+ $ this ->factory = $ factory ;
29
26
}
30
27
31
28
Original file line number Diff line number Diff line change @@ -74,10 +74,8 @@ public function loadConfiguration()
74
74
* @param callable
75
75
* @return void
76
76
*/
77
- public function addMacro ($ macro )
77
+ public function addMacro (callable $ macro )
78
78
{
79
- Nette \Utils \Validators::assert ($ macro , 'callable ' );
80
-
81
79
$ container = $ this ->getContainerBuilder ();
82
80
$ container ->getDefinition ($ this ->prefix ('latteFactory ' ))
83
81
->addSetup ('?->onCompile[] = function ($engine) { ' . $ macro . '($engine->getCompiler()); } ' , ['@self ' ]);
You can’t perform that action at this time.
0 commit comments