Where is created $class varicle in presenterFactory.php?

3 years ago

Jakub Bouček
Member | 44
+
-1
-

Hi, here in PresenterFactory is on line 36 varible $class and i still can't understand, where is filled.

/**
 * @param  callable  function (string $class): IPresenter
 */
public function __construct(callable $factory = NULL)
{
    $this->factory = $factory ?: function ($class) { return new $class; };
}

It's bug or any class property? Thanks.

3 years ago

Jan Tvrdík
Nette guru | 2550
+
+1
-

The first $class is closure parametr declaration and the second $class is reading the argument.

Maybe you look for https://github.com/…xtension.php#…

3 years ago

Jakub Bouček
Member | 44
+
0
-

OMG i see. I am now feeling little stupid. Thanks :)

Please close topic.

Last edited by Jakub Bouček (2015-12-28 00:14)