Problem/Motivation

Running PHPCS shows the warnings/errors in attached file, which should be fixed

CommentFileSizeAuthor
shortcode.txt4.82 KBggh

Issue fork shortcode-3514294

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ggh created an issue. See original summary.

ggh’s picture

Status: Active » Needs review

MR Raised

paraderojether’s picture

Status: Needs review » Reviewed & tested by the community

Hi

I reviewed MR!8, applied against Shortcode 2.0.3, and confirmed fixes the issues reported by phpcs.

➜  shortcode git:(main) ✗ curl https://git.drupalcode.org/project/shortcode/-/merge_requests/8.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5248    0  5248    0     0  12752      0 --:--:-- --:--:-- --:--:-- 12958
patching file 'shortcode_basic_tags/templates/shortcode-button.html.twig'
patching file 'shortcode_basic_tags/templates/shortcode-clear.html.twig'
patching file 'shortcode_basic_tags/templates/shortcode-dropcap.html.twig'
patching file 'shortcode_basic_tags/templates/shortcode-img.html.twig'
patching file 'shortcode_basic_tags/templates/shortcode-item.html.twig'
patching file 'shortcode_basic_tags/templates/shortcode-link.html.twig'
patching file 'shortcode_basic_tags/templates/shortcode-quote.html.twig'
patching file 'src/ShortcodeService.php'
➜  shortcode git:(main) ✗ cd ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig shortcode
➜  contrib git:(main) ✗

It all passed PHPCS using Gitlab CI.

Moving this to RTBC.
Thank you.

andres alvarez’s picture

It would be a good opportunity to include the fixes suggested by cspell and PHPStan as well, to ensure a more complete code quality improvement and increase the visibility of this update.

andres alvarez’s picture

Priority: Minor » Normal
Status: Reviewed & tested by the community » Needs review
andres alvarez’s picture

I think we should already be doing MR with the branch.

gokul.jayan made their first commit to this issue’s fork.

gokul.jayan’s picture

Added missing ContainerFactoryPluginInterface to ShortcodeCorrector to fix the error.

ArgumentCountError: Too few arguments to function Drupal\shortcode\Plugin\Filter\ShortcodeCorrector::__construct(), 3 passed in /var/www/html/docroot/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php on line 25 and exactly 4 expected in Drupal\shortcode\Plugin\Filter\ShortcodeCorrector->__construct() (line 42 of modules/contrib/shortcode/src/Plugin/Filter/ShortcodeCorrector.php).

paraderojether’s picture

Status: Needs review » Reviewed & tested by the community

Hi

I reviewed CSpell and PHPStan, and they also passed on GitLab CI.

Thank you.

swirt’s picture

It would be good to get this in, because when using PHP 8.4 I am getting the following errors that this MR would resolve

<b>Deprecated</b>:  Drupal\shortcode\ShortcodeService::getShortcodePlugins(): Implicitly marking parameter $filter as nullable is deprecated,
the explicit nullable type must be used instead in <b>/var/www/html/docroot/modules/contrib/shortcode/src/ShortcodeService.php</b> on line <b>89</b><br />
<br />
<b>Deprecated</b>:  Drupal\shortcode\ShortcodeService::process(): Implicitly marking parameter $filter as nullable is deprecated,
the explicit nullable type must be used instead in <b>/var/www/html/docroot/modules/contrib/shortcode/src/ShortcodeService.php</b> on line <b>215</b><br />
<br />
<b>Deprecated</b>:  Drupal\shortcode\ShortcodeService::postprocessText(): Implicitly marking parameter $filter as nullable is deprecated,
the explicit nullable type must be used instead in <b>/var/www/html/docroot/modules/contrib/shortcode/src/ShortcodeService.php</b> on line <b>360</b><br />

denes.szabo made their first commit to this issue’s fork.

denes.szabo’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the hard work on this, everyone! Assigning credit and closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

denes.szabo’s picture

Status: Fixed » Closed (fixed)