• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/engine/autowire/parameter.php
  • Класс: BitrixMainEngineAutoWireParameter
  • Вызов: Parameter::__construct
public function __construct(string $className, Closure $constructor, Closure $externalNameConstructor = null)
{
	$this
		->setClassName($className)
		->setConstructor($constructor)
	;

	$reflectionFunction = new ReflectionFunction($constructor);
	if ($reflectionFunction->getNumberOfParameters() > 1)
	{
		if ($externalNameConstructor === null)
		{
			$externalNameConstructor = static function(ReflectionParameter $parameter){
				return $parameter->getName() . 'Id';
			};
		}

		$this->setExternalNameConstructor($externalNameConstructor);
	}

}