<commit_before><?php

declare(strict_types = 1);

namespace NAttreid\WebManager\Services\Hooks;

use IPub\FlashMessages\FlashNotifier;
use NAttreid\Cms\Configurator\Configurator;
use NAttreid\Cms\Factories\FormFactory;
use NAttreid\Form\Form;
use Nette\Reflection\ClassType;
use Nette\SmartObject;

/**
 * Class HookFactory
 *
 * @property-read string $name
 * @property string $latte
 *
 * @author Attreid <<EMAIL>>
 */
abstract class HookFactory
{
	use SmartObject;

	/** @var FormFactory */
	protected $formFactory;

	/** @var Configurator */
	protected $configurator;

	/** @var FlashNotifier */
	protected $flashNotifier;

	/** @var string */
	private $name;

	/** @var string */
	private $latte;

	public function __construct(FormFactory $formFactory, Configurator $configurator, FlashNotifier $flashNotifier)
	{
		$this->formFactory = $formFactory;
		$this->configurator = $configurator;
		$this->flashNotifier = $flashNotifier;

		$this->name = $this->createName();

		$this->init();
	}

	public function init()
	{

	}

	/**
	 * Vrati nazev
	 * @return string
	 */
	private function createName(): string
	{
		$reflection = new ClassType(get_called_class());
		return str_replace('Hook', '', lcfirst($reflection->getShortName()));
	}

	/**
	 * @return string
	 */
	protected function getName(): string
	{
		return $this->name;
	}

	/**
	 * @return string
	 */
	protected function getLatte(): string
	{
		return $this->latte;
	}

	/**
	 * @param string $latte
	 */
	protected function setLatte(string $latte)
	{
		$this->latte = (string)$latte;
	}<commit_msg>oprava chyb pri prechodu na php7<commit_after><?php

declare(strict_types = 1);

namespace NAttreid\WebManager\Services\Hooks;

use IPub\FlashMessages\FlashNotifier;
use NAttreid\Cms\Configurator\Configurator;
use NAttreid\Cms\Factories\FormFactory;
use NAttreid\Form\Form;
use Nette\Reflection\ClassType;
use Nette\SmartObject;

/**
 * Class HookFactory
 *
 * @property-read string $name
 * @property string $latte
 *
 * @author Attreid <<EMAIL>>
 */
abstract class HookFactory
{
	use SmartObject;

	/** @var FormFactory */
	protected $formFactory;

	/** @var Configurator */
	protected $configurator;

	/** @var FlashNotifier */
	protected $flashNotifier;

	/** @var string */
	private $name;

	/** @var string */
	private $latte;

	public function __construct(FormFactory $formFactory, Configurator $configurator, FlashNotifier $flashNotifier)
	{
		$this->formFactory = $formFactory;
		$this->configurator = $configurator;
		$this->flashNotifier = $flashNotifier;

		$this->name = $this->createName();

		$this->init();
	}

	public function init()
	{

	}

	/**
	 * Vrati nazev
	 * @return string
	 */
	private function createName(): string
	{
		$reflection = new ClassType(get_called_class());
		return str_replace('Hook', '', lcfirst($reflection->getShortName()));
	}

	/**
	 * @return string
	 */
	protected function getName(): string
	{
		return $this->name;
	}

	/**
	 * @return string|null
	 */
	protected function getLatte()
	{
		return $this->latte;
	}

	/**
	 * @param string $latte
	 */
	protected function setLatte(string $latte)
	{
		$this->latte = (string)$latte;
	}
{'fraction_non_alphanumeric': 0.14685314685314685, 'fraction_numerical': 0.0009535918626827717, 'mean_word_length': 4.100486223662885, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, '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': '801491', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1075, 'n_words': 228}