Browse Source

Fix coding standarts

merge-requests/2/head
Chi 4 years ago
parent
commit
2149c32ed2
  1. 1
      src/TwigTweakExtension.php
  2. 2
      src/View/BlockViewBuilder.php
  3. 2
      src/View/EntityFormViewBuilder.php
  4. 2
      src/View/EntityViewBuilder.php
  5. 2
      src/View/FieldViewBuilder.php
  6. 2
      src/View/ImageViewBuilder.php
  7. 2
      src/View/MenuViewBuilder.php
  8. 4
      src/View/RegionViewBuilder.php
  9. 5
      tests/src/Kernel/EntityFormViewBuilderTest.php

1
src/TwigTweakExtension.php

@ -84,6 +84,7 @@ class TwigTweakExtension extends AbstractExtension {
}), }),
new TwigFunction('drupal_breadcrumb', [self::class, 'drupalBreadcrumb']), new TwigFunction('drupal_breadcrumb', [self::class, 'drupalBreadcrumb']),
new TwigFunction('drupal_breakpoint', [self::class, 'drupalBreakpoint'], $all_options), new TwigFunction('drupal_breakpoint', [self::class, 'drupalBreakpoint'], $all_options),
// @phpcs:ignore Drupal.Arrays.Array.LongLineDeclaration
new TwigFunction('drupal_contextual_links', [self::class, 'drupalContextualLinks']), new TwigFunction('drupal_contextual_links', [self::class, 'drupalContextualLinks']),
]; ];

2
src/View/BlockViewBuilder.php

@ -16,7 +16,7 @@ use Drupal\Core\Session\AccountInterface;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
/** /**
* BlockViewBuilder service. * Block view builder.
*/ */
class BlockViewBuilder { class BlockViewBuilder {

2
src/View/EntityFormViewBuilder.php

@ -8,7 +8,7 @@ use Drupal\Core\Entity\EntityFormBuilderInterface;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
/** /**
* EntityFormViewBuilder service. * Entity form view builder.
*/ */
class EntityFormViewBuilder { class EntityFormViewBuilder {

2
src/View/EntityViewBuilder.php

@ -8,7 +8,7 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
/** /**
* EntityViewBuilder service. * Entity view builder.
*/ */
class EntityViewBuilder { class EntityViewBuilder {

2
src/View/FieldViewBuilder.php

@ -8,7 +8,7 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\EntityRepositoryInterface;
/** /**
* FieldViewBuilder service. * Field view builder.
*/ */
class FieldViewBuilder { class FieldViewBuilder {

2
src/View/ImageViewBuilder.php

@ -7,7 +7,7 @@ use Drupal\Core\Cache\CacheableMetadata;
use Drupal\file\FileInterface; use Drupal\file\FileInterface;
/** /**
* ImageViewBuilder service. * Image view builder.
*/ */
class ImageViewBuilder { class ImageViewBuilder {

2
src/View/MenuViewBuilder.php

@ -5,7 +5,7 @@ namespace Drupal\twig_tweak\View;
use Drupal\Core\Menu\MenuLinkTreeInterface; use Drupal\Core\Menu\MenuLinkTreeInterface;
/** /**
* MenuViewBuilder service. * Menu view builder.
*/ */
class MenuViewBuilder { class MenuViewBuilder {

4
src/View/RegionViewBuilder.php

@ -11,7 +11,7 @@ use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
/** /**
* RegionViewBuilder service. * Region view builder.
*/ */
class RegionViewBuilder { class RegionViewBuilder {
@ -83,7 +83,7 @@ class RegionViewBuilder {
$cache_metadata = new CacheableMetadata(); $cache_metadata = new CacheableMetadata();
/* @var $blocks \Drupal\block\BlockInterface[] */ /** @var \Drupal\block\BlockInterface[] $blocks */
foreach ($blocks as $id => $block) { foreach ($blocks as $id => $block) {
$access = $block->access('view', NULL, TRUE); $access = $block->access('view', NULL, TRUE);
$cache_metadata = $cache_metadata->merge(CacheableMetadata::createFromObject($access)); $cache_metadata = $cache_metadata->merge(CacheableMetadata::createFromObject($access));

5
tests/src/Kernel/EntityFormViewBuilderTest.php

@ -38,7 +38,10 @@ final class EntityFormViewBuilderTest extends KernelTestBase {
$this->installConfig(['system']); $this->installConfig(['system']);
$this->installEntitySchema('node'); $this->installEntitySchema('node');
NodeType::create(['type' => 'article'])->save(); NodeType::create(['type' => 'article'])->save();
$this->setUpCurrentUser(['name' => 'User 1'], ['edit any article content', 'access content']); $this->setUpCurrentUser(
['name' => 'User 1'],
['edit any article content', 'access content'],
);
} }
/** /**

Loading…
Cancel
Save