<commit_before><?php
namespace Application\Service;

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Ora\EventStore\DoctrineEventStore;

class EventStoreFactory implements FactoryInterface {
	
	private static $instance;
	
    public function createService(ServiceLocatorInterface $serviceLocator) {
    	$entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default');
    	if(is_null(self::$instance)) {
			self::$instance = new DoctrineEventStore($entityManager);
		}
		return self::$instance;
	}

}<commit_msg>All service initialization sequence is performed only if the service isn't already available<commit_after><?php
namespace Application\Service;

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Ora\EventStore\DoctrineEventStore;

class EventStoreFactory implements FactoryInterface {
	
	private static $instance;
	
    public function createService(ServiceLocatorInterface $serviceLocator) {
    	if(is_null(self::$instance)) {
	    	$entityManager = $serviceLocator->get('doctrine.entitymanager.orm_default');
			self::$instance = new DoctrineEventStore($entityManager);
		}
		return self::$instance;
	}

}
{'fraction_non_alphanumeric': 0.09558823529411764, 'fraction_numerical': 0.0, 'mean_word_length': 6.469512195121951, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5396797', 'n_tokens_mistral': 344, 'n_tokens_neox': 328, 'n_words': 68}