diff --git a/.cspell-project-words.txt b/.cspell-project-words.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6d8b38b1fcc6ebe8cf290c3adfde688733b995c --- /dev/null +++ b/.cspell-project-words.txt @@ -0,0 +1,6 @@ +acquia +Acquia +perz +ptid +webform +Webform diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..af218c15e24389bd3300e4e400a3b01c58731ce1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +################ +# GitLabCI template for Drupal projects. +# +# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. +# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained. +# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your +# pipelines automatically. However, you can modify this template if you have additional needs for your project. +# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/ +################ + +# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/ +# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml +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' +# +################ +# Pipeline configuration variables are defined with default values and descriptions in the file +# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml +# Uncomment the lines below if you want to override any of the variables. The following is just an example. +################ +variables: + OPT_IN_TEST_CURRENT: '1' + OPT_IN_TEST_PREVIOUS_MAJOR: '1' + SKIP_ESLINT: '1' diff --git a/composer.json b/composer.json index d4e3af8081655ef25f7c4e8bccf34933f0d8132e..4ec0eef6d4174da312a4fd81d518dd6d0cdf3f2f 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "source": "https://git.drupalcode.org/project/webform_javascript_setting" }, "require": { - "drupal/core": "^9.4 || ^10", - "drupal/webform": "^6.2" + "drupal/webform": "^6.2", + "drupal/core": "^9.4 || ^10 || ^11" } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000000000000000000000000000000000000..a6b23f21cdc6dc7612b6677e3d34603ba3411044 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,11 @@ +includes: + - phar://phpstan.phar/conf/bleedingEdge.neon + +parameters: + level: 5 + paths: + - . + reportUnmatchedIgnoredErrors: false + ignoreErrors: + # Required static call in /src/Plugin/WebformElement/WebformJavaScriptSetting.php + - "#Drupal calls should be avoided in classes, use dependency injection instead#" diff --git a/src/Element/WebformJavaScriptSetting.php b/src/Element/WebformJavaScriptSetting.php index b450e9abba12ed2b95b385ad6cdf37e3ad4603dc..6ea4aadb66d1bc63b752b748532f436e2cba79b3 100644 --- a/src/Element/WebformJavaScriptSetting.php +++ b/src/Element/WebformJavaScriptSetting.php @@ -5,7 +5,7 @@ namespace Drupal\webform_javascript_setting\Element; use Drupal\Core\Render\Element\Hidden; /** - * Provides a webform element that stores a JavaScript setting in a hidden input. + * Adds a Webform element to store a JavaScript setting in a hidden input. * * @FormElement("webform_javascript_setting") */ diff --git a/tests/modules/webform_javascript_setting_test/webform_javascript_setting_test.info.yml b/tests/modules/webform_javascript_setting_test/webform_javascript_setting_test.info.yml index fd2415c8d45cbb26daaedd8079b982fc2babb54b..3f5dd213fd74f4c705fffea7f326ed87999ec1ea 100644 --- a/tests/modules/webform_javascript_setting_test/webform_javascript_setting_test.info.yml +++ b/tests/modules/webform_javascript_setting_test/webform_javascript_setting_test.info.yml @@ -2,6 +2,6 @@ name: 'Webform JavaScript Settings Element test' type: module description: 'Support module for Webform JavaScript Settings Element testing.' package: 'Webform Testing' -core_version_requirement: ^9.4 +core_version_requirement: ^9.4 || ^10.1 || ^11 dependencies: - 'webform_javascript_setting:webform_javascript_setting' diff --git a/tests/src/FunctionalJavascript/WebformJavaScriptSettingJavaScriptTest.php b/tests/src/FunctionalJavascript/WebformJavaScriptSettingJavaScriptTest.php index 2593b6ecd70261ab09d544d9b6360235de0cdd6e..073a6ac708a9cd2e286b6df58b8ca7b565ae21ac 100644 --- a/tests/src/FunctionalJavascript/WebformJavaScriptSettingJavaScriptTest.php +++ b/tests/src/FunctionalJavascript/WebformJavaScriptSettingJavaScriptTest.php @@ -1,6 +1,6 @@ <?php -declare(strict_types = 1); +declare(strict_types=1); namespace Drupal\Tests\webform_setting_javascript\FunctionalJavascript; @@ -23,7 +23,7 @@ class WebformJavaScriptSettingJavaScriptTest extends WebDriverTestBase { /** * Modules to enable. * - * @var array + * @var array<string> */ protected static $modules = ['webform_javascript_setting_test']; diff --git a/webform_javascript_setting.info.yml b/webform_javascript_setting.info.yml index 4976b5b0b2596098c99bf8c134addc3e3795a3fe..f5c03419a03898e2db6fb3210b7359b0738b5ce7 100644 --- a/webform_javascript_setting.info.yml +++ b/webform_javascript_setting.info.yml @@ -2,6 +2,6 @@ name: 'Webform JavaScript Setting Element' description: 'Provides a webform element that pulls a JavaScript object''s setting/property into a hidden field.' package: Webform type: module -core_version_requirement: ^9.4 || ^10 +core_version_requirement: ^9.4 || ^10 || ^11 dependencies: - webform:webform diff --git a/webform_javascript_setting.module b/webform_javascript_setting.module index 1d2b77101f39e7bc568c9e507b83c43fcb7224f3..cfe5dbe6a5c202f2d8cab04b3a0a5a11e579e50a 100644 --- a/webform_javascript_setting.module +++ b/webform_javascript_setting.module @@ -2,10 +2,10 @@ /** * @file - * Provides an element that pulls a JavaScript object''s setting into a hidden field. + * Adds a Webform element to store a JavaScript setting in a hidden input. */ -declare(strict_types = 1); +declare(strict_types=1); use Drupal\Core\Form\FormStateInterface;