File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,10 +111,9 @@ public function run(Application\Request $request)
111111 /**
112112 * Template factory.
113113 * @param string
114- * @param callable
115114 * @return Application\UI\ITemplate
116115 */
117- public function createTemplate ($ class = NULL , $ latteFactory = NULL )
116+ public function createTemplate ($ class = NULL , callable $ latteFactory = NULL )
118117 {
119118 $ latte = $ latteFactory ? $ latteFactory () : $ this ->getContext ()->getByType ('Nette\Bridges\ApplicationLatte\ILatteFactory ' )->create ();
120119 $ 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
3131 /**
3232 * @param callable function (string $class): IPresenter
3333 */
34- public function __construct ($ factory = NULL )
34+ public function __construct (callable $ factory = NULL )
3535 {
3636 $ this ->factory = $ factory ?: function ($ class ) { return new $ class ; };
3737 }
Original file line number Diff line number Diff line change @@ -19,13 +19,10 @@ class Multiplier extends PresenterComponent
1919 private $ factory ;
2020
2121
22- /**
23- * @param callable
24- */
25- public function __construct ($ factory )
22+ public function __construct (callable $ factory )
2623 {
2724 parent ::__construct ();
28- $ this ->factory = Nette \ Utils \Callback:: check ( $ factory) ;
25+ $ this ->factory = $ factory ;
2926 }
3027
3128
Original file line number Diff line number Diff line change @@ -74,10 +74,8 @@ public function loadConfiguration()
7474 * @param callable
7575 * @return void
7676 */
77- public function addMacro ($ macro )
77+ public function addMacro (callable $ macro )
7878 {
79- Nette \Utils \Validators::assert ($ macro , 'callable ' );
80-
8179 $ container = $ this ->getContainerBuilder ();
8280 $ container ->getDefinition ($ this ->prefix ('latteFactory ' ))
8381 ->addSetup ('?->onCompile[] = function ($engine) { ' . $ macro . '($engine->getCompiler()); } ' , ['@self ' ]);
You can’t perform that action at this time.
0 commit comments