diff --git a/shortcode_basic_tags/templates/shortcode-button.html.twig b/shortcode_basic_tags/templates/shortcode-button.html.twig index 907d9e6dd342a68054828b45df0f1471c2186434..1aaf8a54cd707c5bb15c905e36a1f6312e6ae9ba 100644 --- a/shortcode_basic_tags/templates/shortcode-button.html.twig +++ b/shortcode_basic_tags/templates/shortcode-button.html.twig @@ -9,4 +9,4 @@ * - text: The button label. */ #} -<a{{ attributes }}><span>{{ text }}</span></a> \ No newline at end of file +<a{{ attributes }}><span>{{ text }}</span></a> diff --git a/shortcode_basic_tags/templates/shortcode-clear.html.twig b/shortcode_basic_tags/templates/shortcode-clear.html.twig index 9639b8fc21eaa65582c800c76d7dd9958debc6bd..9eaca1429c5c233a7824967578b495993ccb631c 100644 --- a/shortcode_basic_tags/templates/shortcode-clear.html.twig +++ b/shortcode_basic_tags/templates/shortcode-clear.html.twig @@ -9,4 +9,4 @@ * - text: The content. */ #} -<{{ type }}{{ attributes }}>{{ text | raw }}</{{ type }}> \ No newline at end of file +<{{ type }}{{ attributes }}>{{ text | raw }}</{{ type }}> diff --git a/shortcode_basic_tags/templates/shortcode-dropcap.html.twig b/shortcode_basic_tags/templates/shortcode-dropcap.html.twig index 672d0f7800adbea95b3f8c57d7cf82083c04cb93..0dd582a65b22d642ec144ddab9d759c371798b4d 100644 --- a/shortcode_basic_tags/templates/shortcode-dropcap.html.twig +++ b/shortcode_basic_tags/templates/shortcode-dropcap.html.twig @@ -8,4 +8,4 @@ * - text: The quoted text. */ #} -<span class="{{ class }}">{{ text }}</span> \ No newline at end of file +<span class="{{ class }}">{{ text }}</span> diff --git a/shortcode_basic_tags/templates/shortcode-img.html.twig b/shortcode_basic_tags/templates/shortcode-img.html.twig index a3cb4593b1589260d8aa3ca865b5195566dd28b4..c07ee06632c008137931965b3ae4ede2e9e04cad 100644 --- a/shortcode_basic_tags/templates/shortcode-img.html.twig +++ b/shortcode_basic_tags/templates/shortcode-img.html.twig @@ -9,4 +9,4 @@ * - alt: The alt text. */ #} -<img src="{{ src }}" class="{{ class }}" alt="{{ alt }}"> \ No newline at end of file +<img src="{{ src }}" class="{{ class }}" alt="{{ alt }}"> diff --git a/shortcode_basic_tags/templates/shortcode-item.html.twig b/shortcode_basic_tags/templates/shortcode-item.html.twig index 5d9c98b79a4b3be53d74e98dd754b86ae59fdbd2..2076dbb455713f076ff732b41ccdce8ed1bec264 100644 --- a/shortcode_basic_tags/templates/shortcode-item.html.twig +++ b/shortcode_basic_tags/templates/shortcode-item.html.twig @@ -9,4 +9,4 @@ * - text: The content. */ #} -<{{ type }}{{ attributes }}>{{ text | raw }}</{{ type }}> \ No newline at end of file +<{{ type }}{{ attributes }}>{{ text | raw }}</{{ type }}> diff --git a/shortcode_basic_tags/templates/shortcode-link.html.twig b/shortcode_basic_tags/templates/shortcode-link.html.twig index f7447997d6a18cb9becc5c0469183182b8d459b3..07ae180866c7b380d3fb2fb7eace30833138a849 100644 --- a/shortcode_basic_tags/templates/shortcode-link.html.twig +++ b/shortcode_basic_tags/templates/shortcode-link.html.twig @@ -9,4 +9,4 @@ * - text: The link label. */ #} -<a{{ attributes }}>{{ text }}</a> \ No newline at end of file +<a{{ attributes }}>{{ text }}</a> diff --git a/shortcode_basic_tags/templates/shortcode-quote.html.twig b/shortcode_basic_tags/templates/shortcode-quote.html.twig index 62f321e4ce6de33e0b50fddacc1f5a2c8993118b..167d85de71d49efb194122b6ea58f0c19c866ceb 100644 --- a/shortcode_basic_tags/templates/shortcode-quote.html.twig +++ b/shortcode_basic_tags/templates/shortcode-quote.html.twig @@ -15,4 +15,4 @@ <span class="quote-author">{{ author | trans }} wrote: </span> {% endif %} {{ text | raw }} -</span> \ No newline at end of file +</span> diff --git a/src/ShortcodeService.php b/src/ShortcodeService.php index bdeda4cff9b4980b4be218df797424d820e215d7..786601c85ab691126a6736e56b0d84bc87c7cb26 100644 --- a/src/ShortcodeService.php +++ b/src/ShortcodeService.php @@ -86,7 +86,7 @@ class ShortcodeService { * @return array * Array of shortcode plugin definitions, keyed by token, not id. */ - public function getShortcodePlugins(FilterInterface $filter = NULL, bool $reset = FALSE): array { + public function getShortcodePlugins(?FilterInterface $filter = NULL, bool $reset = FALSE): array { $shortcodes = &drupal_static(__FUNCTION__); // Prime plugin cache. @@ -212,7 +212,7 @@ class ShortcodeService { * @return string * The processed string. */ - public function process($text, string $langcode = Language::LANGCODE_NOT_SPECIFIED, FilterInterface $filter = NULL): string { + public function process($text, string $langcode = Language::LANGCODE_NOT_SPECIFIED, ?FilterInterface $filter = NULL): string { $shortcodes = $this->getShortcodePlugins($filter); // Processing recursively, now embedding tags within other tags is @@ -357,7 +357,7 @@ class ShortcodeService { * @return string * The processed string. */ - public function postprocessText($text, string $langcode, FilterInterface $filter = NULL): string { + public function postprocessText($text, string $langcode, ?FilterInterface $filter = NULL): string { // preg_match_all('/<p>s.*<!--.*-->.*<div/isU', $text, $r); // dpm($r, '$r');