@@ -94,8 +94,7 @@ |
||
| 94 | 94 | |
| 95 | 95 | if ($fieldDefinition instanceof BaseFieldDefinition || !$entityType->hasKey('bundle')) { |
| 96 | 96 | $parents = [StringHelper::camelCase($entityTypeId)]; |
| 97 | - } |
|
| 98 | - else { |
|
| 97 | + } else { |
|
| 99 | 98 | $parents = []; |
| 100 | 99 | foreach ($fieldMap[$entityTypeId][$fieldName]['bundles'] as $bundle) { |
| 101 | 100 | $parents[] = StringHelper::camelCase($entityTypeId . '_' . $bundle); |
@@ -43,8 +43,7 @@ |
||
| 43 | 43 | $propertyDefinition = reset($propertyDefinitions); |
| 44 | 44 | $derivative['type'] = $propertyDefinition->getDataType(); |
| 45 | 45 | $derivative['property'] = key($propertyDefinitions); |
| 46 | - } |
|
| 47 | - else { |
|
| 46 | + } else { |
|
| 48 | 47 | $derivative['type'] = StringHelper::camelCase('field', $entityTypeId, $supportsBundles ? $fieldBundle : '', $fieldName); |
| 49 | 48 | } |
| 50 | 49 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | protected function getDisplayModes() { |
| 64 | 64 | $storage = $this->entityTypeManager->getStorage('entity_view_mode'); |
| 65 | - return array_reduce($storage->loadMultiple(), function ($carry, EntityViewModeInterface $current) { |
|
| 65 | + return array_reduce($storage->loadMultiple(), function($carry, EntityViewModeInterface $current) { |
|
| 66 | 66 | $target = $current->getTargetType(); |
| 67 | 67 | list(, $id) = explode('.', $current->id()); |
| 68 | 68 | |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | // EarlyRenderingControllerWrapperSubscriber throws the leaked cache |
| 77 | 77 | // metadata exception. To avoid this, wrap the execution in its own render |
| 78 | 78 | // context. |
| 79 | - return $this->renderer->executeInRenderContext(new RenderContext(), function () use ($value, $args, $context, $info) { |
|
| 79 | + return $this->renderer->executeInRenderContext(new RenderContext(), function() use ($value, $args, $context, $info) { |
|
| 80 | 80 | $entityTypeId = $this->pluginDefinition['entity_type']; |
| 81 | 81 | |
| 82 | 82 | // The raw input needs to be converted to use the proper field and property |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | // EarlyRenderingControllerWrapperSubscriber throws the leaked cache |
| 76 | 76 | // metadata exception. To avoid this, wrap the execution in its own render |
| 77 | 77 | // context. |
| 78 | - return $this->renderer->executeInRenderContext(new RenderContext(), function () use ($value, $args, $context, $info) { |
|
| 78 | + return $this->renderer->executeInRenderContext(new RenderContext(), function() use ($value, $args, $context, $info) { |
|
| 79 | 79 | $entityTypeId = $this->pluginDefinition['entity_type']; |
| 80 | 80 | $storage = $this->entityTypeManager->getStorage($entityTypeId); |
| 81 | 81 | |
@@ -94,8 +94,7 @@ |
||
| 94 | 94 | |
| 95 | 95 | try { |
| 96 | 96 | $entity->delete(); |
| 97 | - } |
|
| 98 | - catch (EntityStorageException $exception) { |
|
| 97 | + } catch (EntityStorageException $exception) { |
|
| 99 | 98 | return new EntityCrudOutputWrapper(NULL, NULL, [ |
| 100 | 99 | $this->t('Entity deletion failed with exception: @exception.', [ |
| 101 | 100 | '@exception' => $exception->getMessage(), |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | // EarlyRenderingControllerWrapperSubscriber throws the leaked cache |
| 75 | 75 | // metadata exception. To avoid this, wrap the execution in its own render |
| 76 | 76 | // context. |
| 77 | - return $this->renderer->executeInRenderContext(new RenderContext(), function () use ($value, $args, $context, $info) { |
|
| 77 | + return $this->renderer->executeInRenderContext(new RenderContext(), function() use ($value, $args, $context, $info) { |
|
| 78 | 78 | $entityTypeId = $this->pluginDefinition['entity_type']; |
| 79 | 79 | $bundleName = $this->pluginDefinition['entity_bundle']; |
| 80 | 80 | $storage = $this->entityTypeManager->getStorage($entityTypeId); |
@@ -107,8 +107,7 @@ |
||
| 107 | 107 | foreach ($input as $key => $value) { |
| 108 | 108 | $entity->get($key)->setValue($value); |
| 109 | 109 | } |
| 110 | - } |
|
| 111 | - catch (\InvalidArgumentException $exception) { |
|
| 110 | + } catch (\InvalidArgumentException $exception) { |
|
| 112 | 111 | return new EntityCrudOutputWrapper(NULL, NULL, [ |
| 113 | 112 | $this->t('The entity update failed with exception: @exception.', ['@exception' => $exception->getMessage()]), |
| 114 | 113 | ]); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * {@inheritdoc} |
| 25 | 25 | */ |
| 26 | 26 | public function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { |
| 27 | - if ($value instanceof ConstraintViolationInterface){ |
|
| 27 | + if ($value instanceof ConstraintViolationInterface) { |
|
| 28 | 28 | yield $value->getMessage(); |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | // Add the target field condition to the query. |
| 65 | 65 | $definition = $this->getPluginDefinition(); |
| 66 | 66 | $field = $definition['field']; |
| 67 | - $ids = array_map(function ($item) { |
|
| 67 | + $ids = array_map(function($item) { |
|
| 68 | 68 | return $item['target_id']; |
| 69 | 69 | }, $value->get($field)->getValue()); |
| 70 | 70 | |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], |
| 73 | 73 | ]; |
| 74 | 74 | |
| 75 | - foreach (array_filter($this->menuLinkTree->transform($tree, $manipulators), function (MenuLinkTreeElement $item) { |
|
| 75 | + foreach (array_filter($this->menuLinkTree->transform($tree, $manipulators), function(MenuLinkTreeElement $item) { |
|
| 76 | 76 | return $item->link instanceof MenuLinkInterface && $item->link->isEnabled() && (empty($item->access) || $item->access->isAllowed()); |
| 77 | 77 | }) as $branch) { |
| 78 | 78 | yield $branch; |