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

	namespace Edde\Ext\Upgrade;

	use Edde\Api\Container\ILazyInject;
	use Edde\Api\Crate\ICrateFactory;
	use Edde\Api\Schema\ISchemaManager;
	use Edde\Api\Storage\IStorage;
	use Edde\Common\AbstractObject;
	use Edde\Common\Query\Schema\CreateSchemaQuery;
	use Edde\Common\Query\Select\SelectQuery;
	use Edde\Common\Storage\UnknownSourceException;
	use Edde\Common\Upgrade\Event\OnUpgradeEvent;
	use Edde\Common\Upgrade\Event\UpgradeStartEvent;
	use Edde\Ext\Upgrade\UpgradeStorable;

	/**
	 * Upgrade Event Handler.
	 */
	class UpgradeHandler extends AbstractObject implements ILazyInject {
		/**
		 * @var IStorage
		 */
		protected $storage;
		/**
		 * @var ISchemaManager
		 */
		protected $schemaManager;
		/**
		 * @var ICrateFactory
		 */
		protected $crateFactory;

		public function lazyStorage(IStorage $storage) {
			$this->storage = $storage;
		}

		public function lazySchemaManager(ISchemaManager $schemaManager) {
			$this->schemaManager = $schemaManager;
		}

		public function lazyCrateFactory(ICrateFactory $crateFactory) {
			$this->crateFactory = $crateFactory;
		}

		public function eventUpgradeStart(UpgradeStartEvent $upgradeStartEvent) {
			$selectQuery = new SelectQuery();
			$this->storage->start();
			$selectQuery->select()
				->all()
				->from()
				->source(UpgradeStorable::class)
				->order()
				->desc()
				->property('stamp');<commit_msg>- ok a little docs<commit_after><?php
	declare(strict_types = 1);

	namespace Edde\Ext\Upgrade;

	use Edde\Api\Container\ILazyInject;
	use Edde\Api\Crate\ICrateFactory;
	use Edde\Api\Schema\ISchemaManager;
	use Edde\Api\Storage\IStorage;
	use Edde\Common\AbstractObject;
	use Edde\Common\Query\Schema\CreateSchemaQuery;
	use Edde\Common\Query\Select\SelectQuery;
	use Edde\Common\Storage\UnknownSourceException;
	use Edde\Common\Upgrade\Event\OnUpgradeEvent;
	use Edde\Common\Upgrade\Event\UpgradeStartEvent;
	use Edde\Ext\Upgrade\UpgradeStorable;

	/**
	 * Upgrade Event Handler.
	 */
	class UpgradeHandler extends AbstractObject implements ILazyInject {
		/**
		 * @var IStorage
		 */
		protected $storage;
		/**
		 * @var ISchemaManager
		 */
		protected $schemaManager;
		/**
		 * @var ICrateFactory
		 */
		protected $crateFactory;

		/**
		 * @param IStorage $storage
		 */
		public function lazyStorage(IStorage $storage) {
			$this->storage = $storage;
		}

		/**
		 * @param ISchemaManager $schemaManager
		 */
		public function lazySchemaManager(ISchemaManager $schemaManager) {
			$this->schemaManager = $schemaManager;
		}

		/**
		 * @param ICrateFactory $crateFactory
		 */
		public function lazyCrateFactory(ICrateFactory $crateFactory) {
			$this->crateFactory = $crateFactory;
		}

		public function eventUpgradeStart(UpgradeStartEvent $upgradeStartEvent) {
			$selectQuery = new SelectQuery();
			$this->storage->start();
			$selectQuery->select()
				->all()
				->from()
				->source(UpgradeStorable::class)
				->order()
				->desc()
				->property('stamp');
{'fraction_non_alphanumeric': 0.12678868552412645, 'fraction_numerical': 0.0006655574043261231, 'mean_word_length': 3.9603960396039604, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4655491', 'n_tokens_mistral': 1100, 'n_tokens_neox': 968, 'n_words': 174}