@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $xor = array(); |
| 51 | 51 | $properties = is_array($properties) ? $properties : array($properties); |
| 52 | 52 | |
| 53 | - foreach($properties as $field) { |
|
| 53 | + foreach ($properties as $field) { |
|
| 54 | 54 | if ($assoc = $this->addAssociation($queryBuilder, $field, false)) { |
| 55 | 55 | $fieldPath = sprintf('%s.%s', $assoc[0], $holder = $assoc[1]); |
| 56 | 56 | } else { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | ; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - return array($alias, $field , $hidden); |
|
| 159 | + return array($alias, $field, $hidden); |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
@@ -22,9 +22,9 @@ |
||
| 22 | 22 | |
| 23 | 23 | $em->createQueryBuilder() |
| 24 | 24 | ->update(get_class($object), 'o') |
| 25 | - ->set('o.' . $object->getUniqueStateField(), ':update') |
|
| 26 | - ->where('o.' . $object->getUniqueStateField() . ' = :where') |
|
| 27 | - ->andWhere('o.' . $id . ' <> :self') |
|
| 25 | + ->set('o.'.$object->getUniqueStateField(), ':update') |
|
| 26 | + ->where('o.'.$object->getUniqueStateField().' = :where') |
|
| 27 | + ->andWhere('o.'.$id.' <> :self') |
|
| 28 | 28 | ->setParameter('update', false) |
| 29 | 29 | ->setParameter('where', true) |
| 30 | 30 | ->setParameter('self', $object) |
@@ -15,20 +15,20 @@ |
||
| 15 | 15 | |
| 16 | 16 | $this->register( |
| 17 | 17 | 'getCurrentUser', |
| 18 | - function ($arg) { |
|
| 18 | + function($arg) { |
|
| 19 | 19 | return sprintf('$this->get("security.token_storage")->getToken()->getUser()', $arg); |
| 20 | 20 | }, |
| 21 | - function (array $variables) { |
|
| 21 | + function(array $variables) { |
|
| 22 | 22 | return $variables['container']->get('security.token_storage')->getToken()->getUser(); |
| 23 | 23 | } |
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | 26 | $this->register( |
| 27 | 27 | 'getQueryParam', |
| 28 | - function ($limitKey, $default) { |
|
| 28 | + function($limitKey, $default) { |
|
| 29 | 29 | return sprintf('$this->get("request")->get(%s, %s)', $limitKey, $default); |
| 30 | 30 | }, |
| 31 | - function (array $variables, $limitKey, $default) { |
|
| 31 | + function(array $variables, $limitKey, $default) { |
|
| 32 | 32 | return $variables['container']->get('request')->get($limitKey, $default); |
| 33 | 33 | } |
| 34 | 34 | ); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event) use ($configs) { |
| 40 | 40 | $form = $event->getForm(); |
| 41 | 41 | |
| 42 | - foreach($configs as $property => $config) { |
|
| 42 | + foreach ($configs as $property => $config) { |
|
| 43 | 43 | if (true === $depended = $this->prepare($config, 'self')) { |
| 44 | 44 | $this->resizeBySelf($event, $property, $config); |
| 45 | 45 | continue; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | if ($data = $form->get($property)->getData()) { |
| 53 | 53 | $form->get($partnerName) |
| 54 | - ->setData(call_user_func_array(array($data, 'get' . $partnerName), array())) |
|
| 54 | + ->setData(call_user_func_array(array($data, 'get'.$partnerName), array())) |
|
| 55 | 55 | ; |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | private function build(FormEvent $event, array $configs) |
| 88 | 88 | { |
| 89 | - foreach($configs as $property => $config) { |
|
| 89 | + foreach ($configs as $property => $config) { |
|
| 90 | 90 | $this->resize($event, $property, $config); |
| 91 | 91 | $this->resizeBySelf($event, $property, $config); |
| 92 | 92 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | } else { |
| 122 | 122 | if (!$partnerData = $partner->getData()) { |
| 123 | 123 | $accessor = PropertyAccess::createPropertyAccessor(); |
| 124 | - if($fieldData = $accessor->getValue($data, $property)) { |
|
| 124 | + if ($fieldData = $accessor->getValue($data, $property)) { |
|
| 125 | 125 | $partnerData = $accessor->getValue($fieldData, $partnerName); |
| 126 | 126 | } |
| 127 | 127 | } |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | */ |
| 171 | 171 | public static function getUserAwareChoiceBuilder(FormBuilderInterface $builder, UserInterface $user = null) |
| 172 | 172 | { |
| 173 | - return function (EntityRepository $objectRepository) use ($builder, $user) { |
|
| 173 | + return function(EntityRepository $objectRepository) use ($builder, $user) { |
|
| 174 | 174 | return $objectRepository->createQueryBuilder('o') |
| 175 | 175 | ->andWhere('o.user = :user') |
| 176 | 176 | ->setParameter('user', $user ?: $builder->getAttribute('user_aware')) |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $pattern = $this->router->getRouteCollection()->get($routeName)->getPath(); |
| 54 | 54 | |
| 55 | 55 | if (preg_match_all('/\{([a-z]+)\}/', $pattern, $matches)) { |
| 56 | - foreach($matches[1] as $holder) { |
|
| 56 | + foreach ($matches[1] as $holder) { |
|
| 57 | 57 | $value = $accessor->getValue($object, $holder); |
| 58 | 58 | |
| 59 | 59 | if (!is_numeric($value)) { |
@@ -288,7 +288,7 @@ |
||
| 288 | 288 | * |
| 289 | 289 | * @throws \SM\SMException |
| 290 | 290 | */ |
| 291 | - public function getPosibleTransitions(StatableInterface $object = null, $objectIdentifier = 'id') |
|
| 291 | + public function getPosibleTransitions(StatableInterface $object = null, $objectIdentifier = 'id') |
|
| 292 | 292 | { |
| 293 | 293 | if (empty($object)) { |
| 294 | 294 | return; |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $interfaces = array(); |
| 64 | 64 | |
| 65 | - foreach($config['resources'] as $model => $resource) { |
|
| 66 | - foreach($resource['classes'] as $key => $class) { |
|
| 65 | + foreach ($config['resources'] as $model => $resource) { |
|
| 66 | + foreach ($resource['classes'] as $key => $class) { |
|
| 67 | 67 | if ($key === 'interface') { |
| 68 | 68 | $name = sprintf('%s.%s.%s.class', $this->applicationName, $key, $model); |
| 69 | 69 | $container->setParameter($name, $class); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - $container->setParameter($this->getAlias() . '_interfaces', $interfaces); |
|
| 76 | + $container->setParameter($this->getAlias().'_interfaces', $interfaces); |
|
| 77 | 77 | |
| 78 | 78 | foreach ($this->configFiles as $configFile) { |
| 79 | 79 | if (file_exists(sprintf('%s/%s', $this->getConfigDir(), $configFile))) { |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | return $this->viewHandler->handle($configuration, View::create($resource, 204)); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $this->flashHelper->addSuccessFlash($configuration, $state ? $path . '_enabled' : $path . '_disabled', $resource); |
|
| 91 | + $this->flashHelper->addSuccessFlash($configuration, $state ? $path.'_enabled' : $path.'_disabled', $resource); |
|
| 92 | 92 | |
| 93 | 93 | return $this->redirectHandler->redirectToIndex($configuration, $resource); |
| 94 | 94 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | if (is_string($ids)) { |
| 107 | - $ids = explode( ',', $ids); |
|
| 107 | + $ids = explode(',', $ids); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $resources = $this->repository->findBy(array( |