diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..212ba769998d2ec8bbddb5f476d7916691dcea4c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +include: + - project: $_GITLAB_TEMPLATES_REPO + ref: $_GITLAB_TEMPLATES_REF + file: + - '/includes/include.drupalci.main.yml' + - '/includes/include.drupalci.variables.yml' + - '/includes/include.drupalci.workflows.yml' +variables: + OPT_IN_TEST_PREVIOUS_MAJOR: 1 + OPT_IN_TEST_NEXT_MINOR: 1 + OPT_IN_TEST_NEXT_MAJOR: 0 + RUN_JOB_UPGRADE_STATUS: 0 + _CSPELL_WORDS: "epam,epam’s,levitsky,quickedit" +cspell: + allow_failure: false +phpcs: + allow_failure: false +phpstan: + allow_failure: false +phpstan (next minor): + allow_failure: true +phpstan (next major): + allow_failure: false +phpunit (previous major): + allow_failure: false +phpunit (next minor): + allow_failure: false +phpunit (next major): + allow_failure: false +upgrade status: + allow_failure: false diff --git a/composer.json b/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..c3d2b04c3275219e510b6ed5b4def1a6033ebc5c --- /dev/null +++ b/composer.json @@ -0,0 +1,12 @@ +{ + "name": "drupal/text_field_formatter", + "description": "A simple empty page solution. Assists in creating empty menu callbacks mostly used for pages that only consist of blocks.", + "type": "drupal-module", + "license": "GPL-2.0-or-later", + "homepage": "https://www.drupal.org/project/text_field_formatter", + "support": { + "issues": "https://www.drupal.org/project/issues/text_field_formatter", + "source": "https://git.drupalcode.org/project/text_field_formatter" + } + } + \ No newline at end of file diff --git a/src/Plugin/Field/FieldFormatter/TextFieldFormatter.php b/src/Plugin/Field/FieldFormatter/TextFieldFormatter.php index 56137a320f16f6d615c8522a4c562b96a4a1668d..353f6e1bd4dcc16eb1822e1f3fb42621a0fa30a6 100644 --- a/src/Plugin/Field/FieldFormatter/TextFieldFormatter.php +++ b/src/Plugin/Field/FieldFormatter/TextFieldFormatter.php @@ -81,17 +81,19 @@ class TextFieldFormatter extends StringFormatter { * @param \Drupal\Core\Utility\Token $token * The token service. */ - public function __construct($plugin_id, - $plugin_definition, - FieldDefinitionInterface $field_definition, - array $settings, - $label, - $view_mode, - array $third_party_settings, - EntityTypeManagerInterface $entity_type_manager, - ModuleHandlerInterface $module_handler, - MessengerInterface $messenger, - Token $token) { + public function __construct( + $plugin_id, + $plugin_definition, + FieldDefinitionInterface $field_definition, + array $settings, + $label, + $view_mode, + array $third_party_settings, + EntityTypeManagerInterface $entity_type_manager, + ModuleHandlerInterface $module_handler, + MessengerInterface $messenger, + Token $token, + ) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $entity_type_manager); $this->moduleHandler = $module_handler; @@ -372,7 +374,7 @@ class TextFieldFormatter extends StringFormatter { $attributes = explode("\r\n", $attributes); foreach ($attributes as $attribute) { $attribute = explode("|", $attribute); - $prepared[$attribute[0]] = isset($attribute[1]) ? $attribute[1] : ''; + $prepared[$attribute[0]] = $attribute[1] ?? ''; } } diff --git a/text_field_formatter.info.yml b/text_field_formatter.info.yml index b81686a169aa3b1023651ef24c3ca5c16bd606b6..4ec8ea7ca1fe3cb9ebaab8c65f6359221ef983e8 100644 --- a/text_field_formatter.info.yml +++ b/text_field_formatter.info.yml @@ -1,5 +1,5 @@ name: 'Text Field Formatter' type: module description: 'This is the extension of the plain text field formatter with additional wrappers, classes and attributes.' -core_version_requirement: ">=8" +core_version_requirement: ^10.2 || ^11.0 package: 'Field formatters'