<commit_before><?php
	declare(strict_types = 1);

	namespace Edde\Common\Html\Macro;

	use Edde\Api\Control\IControl;
	use Edde\Api\Node\INode;
	use Edde\Api\Template\ICompiler;

	class ControlMacro extends AbstractHtmlMacro {
		/**
		 * @var string
		 */
		protected $control;

		/**
		 * @param array $macroList
		 * @param $control
		 */
		public function __construct($macroList, string $control) {
			parent::__construct((array)$macroList);
			$this->control = $control;
		}

		public function macro(INode $macro, INode $element, ICompiler $compiler) {
			$destination = $compiler->getDestination();

			$destination->write(sprintf("\t\t\t/** %s */\n", $element->getPath()));
			$destination->write(sprintf("\t\t\t\$controlList[%s] = function(%s \$root) use(&\$controlList, &\$stash) {\n", $compiler->delimite($element->getMeta('control')), IControl::class));
			$destination->write(sprintf("\t\t\t\t\$root->addControl(\$control = \$this->container->create(%s));\n", $compiler->delimite($this->control)));
			$this->writeTextValue($element, $destination, $compiler);
			$this->onControl($macro, $element, $compiler);
			$this->writeAttributeList($this->getAttributeList($element, $compiler), $destination);
			foreach ($element->getNodeList() as $node) {
				$destination->write(sprintf("\t\t\t\t\$controlList[%s](\$root);\n", $compiler->delimite($node->getMeta('control'))));
			}
			$destination->write("\t\t\t\treturn \$control;\n");
			$destination->write("\t\t\t};\n");
			$this->element($element, $compiler);
		}

		protected function onControl(INode $macro, INode $element, ICompiler $compiler) {
		}
	}<commit_msg>- fixed previously created bug<commit_after><?php
	declare(strict_types = 1);

	namespace Edde\Common\Html\Macro;

	use Edde\Api\Control\IControl;
	use Edde\Api\Node\INode;
	use Edde\Api\Template\ICompiler;

	class ControlMacro extends AbstractHtmlMacro {
		/**
		 * @var string
		 */
		protected $control;

		/**
		 * @param array $macroList
		 * @param $control
		 */
		public function __construct($macroList, string $control) {
			parent::__construct((array)$macroList);
			$this->control = $control;
		}

		public function macro(INode $macro, INode $element, ICompiler $compiler) {
			$destination = $compiler->getDestination();

			$destination->write(sprintf("\t\t\t/** %s */\n", $element->getPath()));
			$destination->write(sprintf("\t\t\t\$controlList[%s] = function(%s \$root) use(&\$controlList, &\$stash) {\n", $compiler->delimite($element->getMeta('control')), IControl::class));
			$destination->write(sprintf("\t\t\t\t\$root->addControl(\$control = \$this->container->create(%s));\n", $compiler->delimite($this->control)));
			$this->writeTextValue($element, $destination, $compiler);
			$this->onControl($macro, $element, $compiler);
			$this->writeAttributeList($this->getAttributeList($element, $compiler), $destination);
			foreach ($element->getNodeList() as $node) {
				$destination->write(sprintf("\t\t\t\t\$controlList[%s](\$control);\n", $compiler->delimite($node->getMeta('control'))));
			}
			$destination->write("\t\t\t\treturn \$control;\n");
			$destination->write("\t\t\t};\n");
			$this->element($element, $compiler);
		}

		protected function onControl(INode $macro, INode $element, ICompiler $compiler) {
		}
	}
{'fraction_non_alphanumeric': 0.20751833740831296, 'fraction_numerical': 0.0006112469437652812, 'mean_word_length': 4.8238434163701065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4616227', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1060, 'n_words': 174}