@@ -118,7 +118,7 @@ |
||
| 118 | 118 | ->getQuery() |
| 119 | 119 | ->getResult(); |
| 120 | 120 | $templates = []; |
| 121 | - $recursiveGetTemplates = function ($template) use (&$recursiveGetTemplates, &$templates) { |
|
| 121 | + $recursiveGetTemplates = function($template) use (&$recursiveGetTemplates, &$templates) { |
|
| 122 | 122 | array_push($templates, $template); |
| 123 | 123 | foreach ($template->getInheritors() as $_template) { |
| 124 | 124 | if ($_template instanceof Template) { |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $businessEntity = $options['businessEntity']; |
| 28 | 28 | $getMethod = $businessEntity->getGetMethod(); |
| 29 | 29 | preg_match_all('/{{([a-zA-Z]+)}}/', $getMethod, $matches); |
| 30 | - $identifiers = array_map(function ($property) { |
|
| 30 | + $identifiers = array_map(function($property) { |
|
| 31 | 31 | return $property->getName(); |
| 32 | 32 | }, |
| 33 | 33 | $businessEntity->getBusinessIdentifiers()->toArray() |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | //we use the PRE_SUBMIT event to set the mode option |
| 74 | 74 | $builder->addEventListener( |
| 75 | 75 | FormEvents::PRE_SUBMIT, |
| 76 | - function (FormEvent $event) use ($options) { |
|
| 76 | + function(FormEvent $event) use ($options) { |
|
| 77 | 77 | //we get the raw data for the widget form |
| 78 | 78 | $rawData = $event->getData(); |
| 79 | 79 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | ]); |
| 118 | 118 | $builder->addEventListener( |
| 119 | 119 | FormEvents::PRE_SET_DATA, |
| 120 | - function (FormEvent $event) use ($options) { |
|
| 120 | + function(FormEvent $event) use ($options) { |
|
| 121 | 121 | $dataSources = $options['dataSources']->getDataSources(); |
| 122 | 122 | $widget = $event->getData(); |
| 123 | 123 | foreach ($dataSources as $alias => $dataSource) { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ); |
| 132 | 132 | $builder->addEventListener( |
| 133 | 133 | FormEvents::POST_SUBMIT, |
| 134 | - function (FormEvent $event) { |
|
| 134 | + function(FormEvent $event) { |
|
| 135 | 135 | $widget = $event->getData(); |
| 136 | 136 | /** @var Criteria $criteria */ |
| 137 | 137 | foreach ($widget->getCriterias() as $criteria) { |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $getMethod = $businessEntity->getGetMethod(); |
| 51 | 51 | preg_match_all('/{{([a-zA-Z]+)}}/', $getMethod, $matches); |
| 52 | 52 | // build an array with businessIdentifiers properties names |
| 53 | - $identifiers = array_map(function ($property) { |
|
| 53 | + $identifiers = array_map(function($property) { |
|
| 54 | 54 | return $property->getName(); |
| 55 | 55 | }, |
| 56 | 56 | $businessEntity->getBusinessIdentifiers()->toArray() |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | while ($file = readdir($openFolder)) { |
| 153 | 153 | if ($file != '.' && $file != '..') { |
| 154 | 154 | // Remove file |
| 155 | - $recursiveDelete = function ($str) use (&$recursiveDelete) { |
|
| 155 | + $recursiveDelete = function($str) use (&$recursiveDelete) { |
|
| 156 | 156 | if (is_file($str)) { |
| 157 | 157 | return @unlink($str); |
| 158 | 158 | } elseif (is_dir($str)) { |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | ob_start(); |
| 21 | 21 | $loader = $this; |
| 22 | - $includeWrapper = function () use ($file, $loader) { |
|
| 22 | + $includeWrapper = function() use ($file, $loader) { |
|
| 23 | 23 | return include $file; |
| 24 | 24 | }; |
| 25 | 25 | $data = $includeWrapper(); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | 'attr' => [ |
| 75 | 75 | 'class' => 'add_'.$options['business_entity_id'].'_link picker_entity_select', |
| 76 | 76 | ], |
| 77 | - 'query_builder' => function (EntityRepository $er) use ($businessEntity, $locale) { |
|
| 77 | + 'query_builder' => function(EntityRepository $er) use ($businessEntity, $locale) { |
|
| 78 | 78 | // Don't display entities that don't have translations in the current locale. |
| 79 | 79 | if (in_array(Translatable::class, class_uses($businessEntity->getClass()))) { |
| 80 | 80 | return $er->createQueryBuilder('entity') |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $builder->get('ressourceId')->addModelTransformer( |
| 92 | 92 | new CallbackTransformer( |
| 93 | - function ($idToEntity) use ($entityManager, $businessEntity) { |
|
| 93 | + function($idToEntity) use ($entityManager, $businessEntity) { |
|
| 94 | 94 | // transform the array to a string |
| 95 | 95 | return $entityManager->getRepository($businessEntity->getClass())->findOneById($idToEntity); |
| 96 | 96 | }, |
| 97 | - function ($entityToId) { |
|
| 97 | + function($entityToId) { |
|
| 98 | 98 | // transform the string back to an array |
| 99 | 99 | return $entityToId->getId(); |
| 100 | 100 | } |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | |
| 31 | 31 | $builder->addModelTransformer( |
| 32 | 32 | new CallbackTransformer( |
| 33 | - function ($businessEntity) { |
|
| 33 | + function($businessEntity) { |
|
| 34 | 34 | return $businessEntity; |
| 35 | 35 | }, |
| 36 | - function ($nameToBusinessEntity) use ($entityManager) { |
|
| 36 | + function($nameToBusinessEntity) use ($entityManager) { |
|
| 37 | 37 | return $entityManager->getRepository( |
| 38 | 38 | 'VictoireBusinessEntityBundle:BusinessEntity' |
| 39 | 39 | )->findOneByName( |