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

	namespace Edde\Common\Link;

	use Edde\Api\Link\IHostUrl;
	use Edde\Api\Link\ILinkFactory;
	use Edde\Api\Link\ILinkGenerator;
	use Edde\Api\Link\LinkException;
	use Edde\Common\Usable\AbstractUsable;

	class LinkFactory extends AbstractUsable implements ILinkFactory {
		/**
		 * @var IHostUrl
		 */
		protected $hostUrl;
		/**
		 * @var ILinkGenerator[]
		 */
		protected $linkGeneratorList = [];

		/**
		 * @param IHostUrl $hostUrl
		 */
		public function __construct(IHostUrl $hostUrl) {
			$this->hostUrl = $hostUrl;
		}

		public function registerLinkGenerator(ILinkGenerator $lingGenerator): ILinkFactory {
			$this->linkGeneratorList[] = $lingGenerator;
			return $this;
		}

		public function generate($generate, ...$parameterList) {
			$this->use();
			foreach ($this->linkGeneratorList as $lingGenerator) {
				if (($url = $lingGenerator->generate($generate, ...$parameterList)) !== null) {
					return $url;
				}
			}
			throw new LinkException(sprintf('Cannot generate link from the given input.'));
		}

		protected function prepare() {
		}
	}<commit_msg>- renamed variable $ling to $link :|<commit_after><?php
	declare(strict_types = 1);

	namespace Edde\Common\Link;

	use Edde\Api\Link\IHostUrl;
	use Edde\Api\Link\ILinkFactory;
	use Edde\Api\Link\ILinkGenerator;
	use Edde\Api\Link\LinkException;
	use Edde\Common\Usable\AbstractUsable;

	class LinkFactory extends AbstractUsable implements ILinkFactory {
		/**
		 * @var IHostUrl
		 */
		protected $hostUrl;
		/**
		 * @var ILinkGenerator[]
		 */
		protected $linkGeneratorList = [];

		/**
		 * @param IHostUrl $hostUrl
		 */
		public function __construct(IHostUrl $hostUrl) {
			$this->hostUrl = $hostUrl;
		}

		public function registerLinkGenerator(ILinkGenerator $lingGenerator): ILinkFactory {
			$this->linkGeneratorList[] = $lingGenerator;
			return $this;
		}

		public function generate($generate, ...$parameterList) {
			$this->use();
			foreach ($this->linkGeneratorList as $linkGenerator) {
				if (($url = $linkGenerator->generate($generate, ...$parameterList)) !== null) {
					return $url;
				}
			}
			throw new LinkException(sprintf('Cannot generate link from the given input.'));
		}

		protected function prepare() {
		}
	}
{'fraction_non_alphanumeric': 0.13642384105960265, 'fraction_numerical': 0.0008830022075055188, 'mean_word_length': 3.780590717299578, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '957708', 'n_tokens_mistral': 820, 'n_tokens_neox': 704, 'n_words': 156}