Where is created $class varicle in presenterFactory.php?

Notice: This thread is very old.

4 years ago

Jakub Bouček
Member | 46
+
-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.

4 years ago

Jan Tvrdík
Nette guru | 2563
+
+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#…

4 years ago

Jakub Bouček
Member | 46
+
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)