<commit_before><?php
return array (
		'invokables' => array (
				'Mcwork\Controller\Index' => 'Mcwork\Controller\IndexController',
				'Mcwork\Controller\Content' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Pages' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\PageContent' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Contribution' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Navigation' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Menue' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Conf' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Apps' => 'Mcwork\Controller\McworkappController' 
		),
		'factories' => array (
				'Mcwork\Controller\App' => function ($sl) {
					$app = new Contentinum\Service\ContentinumApp();
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$app->setOptions($params->toArray());
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							if (false != ($ctrlName = $app->getOptions('controller'))){
								$ctrl = new $ctrlName();
							} else {
								$ctrl = new Mcwork\Controller\McworkappController ();
							}
							if (false != ($methodName = $app->getOptions('ctrlmethod'))){
								$ctrl->setMethod($methodName);
							}
							$workerName = $app->getOptions('worker');
							$entityName = $app->getOptions('entity');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							}
							
							if (false != ($storage = $app->getOptions('storage')) ){
								$worker = new $workerName();
								$worker->setStorage ( new $storage () );								
							}
							$ctrl->setEntity(new $entityName());
							$ctrl->setWorker($worker);
							return $ctrl;
						}
					} else {
						return new Mcwork\Controller\McworkappController ();
					}
				},
				'Mcwork\Controller\AddItems' => function ($sl) {
					$uripath = str_replace ( '/', '_',$_SERVER['REQUEST_URI']);
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$page = substr($uripath,1,strlen($uripath));
					$app = new Contentinum\Service\ContentinumApp();
					$app->setOptions($params->toArray());
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							$workerName = $app->getOptions('worker');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							} else {
								$worker = new $workerName($sl->getServiceLocator ()->get ( 'doctrine.entitymanager.orm_default' ));
							}	
							$entityName = $app->getOptions('entity');							
							$worker->setEntity(new $entityName());
							$targetEntities = $app->getOptions('targetentities');
							if ( is_array($targetEntities) && ! empty($targetEntities)){
								foreach ($targetEntities as $key => $tEntity){
									$worker->addTargetEntities ( $key, $tEntity );
								}
							}
							$formName = $app->getOptions('form');	
							$formFactory = new $formName($worker);
							$decorators = $sl->getServiceLocator ()->get ( 'Mcwork\FormDecorators' );
							$formFactory->setDecorators ( $decorators->default->toArray () );
							$ctrl = new Mcwork\Controller\AddFormController ( $formFactory );
							$ctrl->setWorker ( $worker );
							$ctrl->setFormAction ($app->getOptions('formaction') );
							$ctrl->setToRoute ($app->getOptions('settoroute') );
							$populate = $app->getOptions('populate');
							if ( is_array($populate) && ! empty($populate) ){
								$ctrl->setAddPopulate($populate);
							}
							return $ctrl;							
						}
					}
				},				
				'Mcwork\Controller\EditItem' => function ($sl) {
					$uripath = str_replace ( '/', '_',$_SERVER['REQUEST_URI']);
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$page = substr($uripath,1,strlen($uripath));				
					$app = new Contentinum\Service\ContentinumApp();
					$app->setOptions($params->toArray());	 
					$app->cutUri();   
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							$workerName = $app->getOptions('worker');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							} else {
								$worker = new $workerName($sl->getServiceLocator ()->get ( 'doctrine.entitymanager.orm_default' ));
							}
							$entityName = $app->getOptions('entity');
							$worker->setEntity(new $entityName());
							$targetEntities = $app->getOptions('targetentities');
							if ( is_array($targetEntities) && ! empty($targetEntities)){
								foreach ($targetEntities as $key => $tEntity){
									$worker->addTargetEntities ( $key, $tEntity );
								}
							}
							$formName = $app->getOptions('form');
							$formFactory = new $formName($worker);
							$decorators = $sl->getServiceLocator ()->get ( 'Mcwork\FormDecorators' );
							$formFactory->setDecorators ( $decorators->default->toArray () );
							$ctrl = new Mcwork\Controller\EditFormController ( $formFactory );
							$ctrl->setWorker ( $worker );
							$ctrl->setFormAction ($app->getOptions('formaction') );
							$ctrl->setToRoute ($app->getOptions('settoroute') );
							
							if (false != ($setexclude = $app->getOptions('setexclude'))){
								$ctrl->setExclude($setexclude);
							}
							return $ctrl;							
						}
					}
				},
				
				'Mcwork\Controller\DeleteItem' => function($sl) {
					$uripath = str_replace ( '/', '_',$_SERVER['REQUEST_URI']);
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$page = substr($uripath,1,strlen($uripath));
					$app = new Contentinum\Service\ContentinumApp();
					$app->setOptions($params->toArray());
					$app->cutUri();
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							$workerName = $app->getOptions('worker');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							} elseif (false != ($storage = $app->getOptions('storage')) ){
								$worker = new $workerName();
								$worker->setStorage ( new $storage () );<commit_msg>handover service locator in add item and edit item<commit_after><?php
return array (
		'invokables' => array (
				'Mcwork\Controller\Index' => 'Mcwork\Controller\IndexController',
				'Mcwork\Controller\Content' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Pages' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\PageContent' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Contribution' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Navigation' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Content\Menue' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Conf' => 'Mcwork\Controller\McworkappController',
				'Mcwork\Controller\Apps' => 'Mcwork\Controller\McworkappController' 
		),
		'factories' => array (
				'Mcwork\Controller\App' => function ($sl) {
					$app = new Contentinum\Service\ContentinumApp();
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$app->setOptions($params->toArray());
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							if (false != ($ctrlName = $app->getOptions('controller'))){
								$ctrl = new $ctrlName();
							} else {
								$ctrl = new Mcwork\Controller\McworkappController ();
							}
							if (false != ($methodName = $app->getOptions('ctrlmethod'))){
								$ctrl->setMethod($methodName);
							}
							$workerName = $app->getOptions('worker');
							$entityName = $app->getOptions('entity');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							}
							
							if (false != ($storage = $app->getOptions('storage')) ){
								$worker = new $workerName();
								$worker->setStorage ( new $storage () );								
							}
							$ctrl->setEntity(new $entityName());
							$ctrl->setWorker($worker);
							return $ctrl;
						}
					} else {
						return new Mcwork\Controller\McworkappController ();
					}
				},
				'Mcwork\Controller\AddItems' => function ($sl) {
					$uripath = str_replace ( '/', '_',$_SERVER['REQUEST_URI']);
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$page = substr($uripath,1,strlen($uripath));
					$app = new Contentinum\Service\ContentinumApp();
					$app->setOptions($params->toArray());
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							$workerName = $app->getOptions('worker');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							} else {
								$worker = new $workerName($sl->getServiceLocator ()->get ( 'doctrine.entitymanager.orm_default' ));
							}	
							$entityName = $app->getOptions('entity');							
							$worker->setEntity(new $entityName());
							$targetEntities = $app->getOptions('targetentities');
							if ( is_array($targetEntities) && ! empty($targetEntities)){
								foreach ($targetEntities as $key => $tEntity){
									$worker->addTargetEntities ( $key, $tEntity );
								}
							}
							$formName = $app->getOptions('form');	
							$formFactory = new $formName($worker);
							$decorators = $sl->getServiceLocator ()->get ( 'Mcwork\FormDecorators' );
							$formFactory->setDecorators ( $decorators->default->toArray () );
							$formFactory->setServiceLocator($sl->getServiceLocator ());
							$ctrl = new Mcwork\Controller\AddFormController ( $formFactory );
							$ctrl->setWorker ( $worker );
							$ctrl->setFormAction ($app->getOptions('formaction') );
							$ctrl->setToRoute ($app->getOptions('settoroute') );
							$populate = $app->getOptions('populate');
							if ( is_array($populate) && ! empty($populate) ){
								$ctrl->setAddPopulate($populate);
							}
							return $ctrl;							
						}
					}
				},				
				'Mcwork\Controller\EditItem' => function ($sl) {
					$uripath = str_replace ( '/', '_',$_SERVER['REQUEST_URI']);
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$page = substr($uripath,1,strlen($uripath));				
					$app = new Contentinum\Service\ContentinumApp();
					$app->setOptions($params->toArray());	 
					$app->cutUri();   
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							$workerName = $app->getOptions('worker');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							} else {
								$worker = new $workerName($sl->getServiceLocator ()->get ( 'doctrine.entitymanager.orm_default' ));
							}
							$entityName = $app->getOptions('entity');
							$worker->setEntity(new $entityName());
							$targetEntities = $app->getOptions('targetentities');
							if ( is_array($targetEntities) && ! empty($targetEntities)){
								foreach ($targetEntities as $key => $tEntity){
									$worker->addTargetEntities ( $key, $tEntity );
								}
							}
							$formName = $app->getOptions('form');
							$formFactory = new $formName($worker);
							$decorators = $sl->getServiceLocator ()->get ( 'Mcwork\FormDecorators' );
							$formFactory->setDecorators ( $decorators->default->toArray () );
							$formFactory->setServiceLocator($sl->getServiceLocator ());
							$ctrl = new Mcwork\Controller\EditFormController ( $formFactory );
							$ctrl->setWorker ( $worker );
							$ctrl->setFormAction ($app->getOptions('formaction') );
							$ctrl->setToRoute ($app->getOptions('settoroute') );
							
							if (false != ($setexclude = $app->getOptions('setexclude'))){
								$ctrl->setExclude($setexclude);
							}
							return $ctrl;							
						}
					}
				},
				
				'Mcwork\Controller\DeleteItem' => function($sl) {
					$uripath = str_replace ( '/', '_',$_SERVER['REQUEST_URI']);
					$params = $sl->getServiceLocator ()->get ( 'Mcwork\Pages' );
					$page = substr($uripath,1,strlen($uripath));
					$app = new Contentinum\Service\ContentinumApp();
					$app->setOptions($params->toArray());
					$app->cutUri();
					if (true === $app->isPageAvailable()){
						if (true === $app->setAppData()){
							$worker = null;
							$workerName = $app->getOptions('worker');
							if (false != ($entityManager = $app->getOptions('entitymanager'))){
								$worker = new $workerName( $sl->getServiceLocator ()->get ($entityManager) );
							} elseif (false != ($storage = $app->getOptions('storage')) ){
								$worker = new $workerName();
								$worker->setStorage ( new $storage () );
{'fraction_non_alphanumeric': 0.18492069458016988, 'fraction_numerical': 0.00045102608434187776, 'mean_word_length': 3.1049058932428264, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 221, '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': '3220392', 'n_tokens_mistral': 5563, 'n_tokens_neox': 4034, 'n_words': 640}