Loading src/TwigExtension/TypeStyleExtension.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,11 +4,12 @@ namespace Drupal\type_style\TwigExtension; use Twig\TwigFunction; use Drupal\Core\Entity\EntityInterface; use Twig\Extension\AbstractExtension; /** * A Twig extension to render type styles. */ class TypeStyleExtension extends \Twig_Extension { class TypeStyleExtension extends AbstractExtension { /** * Generates a list of all Twig functions that this extension defines. Loading tests/src/Functional/TypeStyleTest.php +3 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ class TypeStyleTest extends BrowserTestBase { /** * {@inheritdoc} */ public static $modules = ['type_style', 'node']; protected static $modules = ['type_style', 'node']; /** * {@inheritdoc} Loading @@ -42,7 +42,8 @@ class TypeStyleTest extends BrowserTestBase { 'type_style[color]' => '#ffffff', 'type_style[icon]' => 'my-icon', ]; $this->drupalPostForm('/admin/structure/types/manage/article', $edit, t('Save content type')); $this->drupalGet('/admin/structure/types/manage/article'); $this->submitForm($edit, t('Save content type')); // Ensure that the configuration form contains the correct settings. $this->drupalGet('/admin/structure/types/manage/article'); $this->assertSession()->pageTextContains('Style settings'); Loading type_style.api.php +2 −1 Original line number Diff line number Diff line <?php use Drupal\Core\Config\Entity\ConfigEntityBundleBase; /** * @file * Hooks related to Type Style module. Loading @@ -21,7 +22,7 @@ * @param \Drupal\Core\Config\Entity\ConfigEntityBundleBase $type * The type being edited. */ function hook_type_style_form_alter(array &$form, \Drupal\Core\Config\Entity\ConfigEntityBundleBase $type) { function hook_type_style_form_alter(array &$form, ConfigEntityBundleBase $type) { $label = $type->getEntityType()->getLabel(); $settings = $type->getThirdPartySettings('type_style'); Loading Loading
src/TwigExtension/TypeStyleExtension.php +2 −1 Original line number Diff line number Diff line Loading @@ -4,11 +4,12 @@ namespace Drupal\type_style\TwigExtension; use Twig\TwigFunction; use Drupal\Core\Entity\EntityInterface; use Twig\Extension\AbstractExtension; /** * A Twig extension to render type styles. */ class TypeStyleExtension extends \Twig_Extension { class TypeStyleExtension extends AbstractExtension { /** * Generates a list of all Twig functions that this extension defines. Loading
tests/src/Functional/TypeStyleTest.php +3 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ class TypeStyleTest extends BrowserTestBase { /** * {@inheritdoc} */ public static $modules = ['type_style', 'node']; protected static $modules = ['type_style', 'node']; /** * {@inheritdoc} Loading @@ -42,7 +42,8 @@ class TypeStyleTest extends BrowserTestBase { 'type_style[color]' => '#ffffff', 'type_style[icon]' => 'my-icon', ]; $this->drupalPostForm('/admin/structure/types/manage/article', $edit, t('Save content type')); $this->drupalGet('/admin/structure/types/manage/article'); $this->submitForm($edit, t('Save content type')); // Ensure that the configuration form contains the correct settings. $this->drupalGet('/admin/structure/types/manage/article'); $this->assertSession()->pageTextContains('Style settings'); Loading
type_style.api.php +2 −1 Original line number Diff line number Diff line <?php use Drupal\Core\Config\Entity\ConfigEntityBundleBase; /** * @file * Hooks related to Type Style module. Loading @@ -21,7 +22,7 @@ * @param \Drupal\Core\Config\Entity\ConfigEntityBundleBase $type * The type being edited. */ function hook_type_style_form_alter(array &$form, \Drupal\Core\Config\Entity\ConfigEntityBundleBase $type) { function hook_type_style_form_alter(array &$form, ConfigEntityBundleBase $type) { $label = $type->getEntityType()->getLabel(); $settings = $type->getThirdPartySettings('type_style'); Loading