Fixed some issues
Closes #3481609
Merge request reports
Activity
added 3 commits
-
3092fb63...4fddacab - 2 commits from branch
project:2.x
- 59e7ad5f - Merge branch commerce_giftcard:2.x into 3481609-fix-cspell-eslint-phpcs-phpstan
-
3092fb63...4fddacab - 2 commits from branch
added 1 commit
- b57d3c07 - #Issue-3481609:Fixed cspell and phpstan errors.
122 122 if (!$this->get('balance')->isEmpty()) { 123 123 return $this->get('balance')->first()->toPrice(); 124 124 } 125 return NULL; 125 126 } Absolutely,I agree that returning 0 could be a safer choice in this context, as it provides a clear indication of no balance rather than an ambiguous NULL. I'll create an issue asap.Thanks
Edited by Lavanya TalwarHey @Anybody , Created this issue, have a look https://www.drupal.org/project/commerce_giftcard/issues/3482077.
106 106 public function getComment() { 107 107 $text = $this->get('comment')->value; 108 108 if ($text) { 109 if ($this->get('variables')->first() && $this->get('variables')->first()->toArray()) { 110 return new TranslatableMarkup($text, $this->get('variables')->first()->toArray()); 109 $variables = $this->get('variables')->first(); 110 if ($variables && $variables->toArray()) { 111 return \Drupal::translation()->formatString($text, $variables->toArray()); 106 106 public function getComment() { 107 107 $text = $this->get('comment')->value; 108 108 if ($text) { 109 if ($this->get('variables')->first() && $this->get('variables')->first()->toArray()) { 110 return new TranslatableMarkup($text, $this->get('variables')->first()->toArray()); 109 $variables = $this->get('variables')->first(); 110 if ($variables && $variables->toArray()) { 111 return \Drupal::translation()->formatString($text, $variables->toArray()); 111 112 } 112 113 else { 113 return new TranslatableMarkup($text); 114 return $text; Same here (https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StringTranslation!StringTranslationTrait.php/trait/StringTranslationTrait/11.x) but please also add a @todo comment above that variables should not be translated. That should be fixed in a follow-up issue.
- .cspell.json 0 → 100644
9 "Gift cards", 10 "autofills", 11 "completition", 12 "messasge", 13 "fewfsfs", 14 "Hegal" 15 ], 16 "dictionaries": ["en-US"], 17 "files": [ 18 "**/*.php", 19 "**/*.twig", 20 "**/*.yml", 21 "**/*.json" 22 ] 23 } 24 - Comment on lines +1 to +24
You could instead simply use a
.cspell-project-words.txt
file with just the words. See https://julian.pustkuchen.com/en/drupal-ci-ignore-cspell-words-.cspell-project-words.txt changed this line in version 5 of the diff
I think such a file would be better and clearer than writing it into the gitlab.ci?
See https://julian.pustkuchen.com/en/drupal-ci-ignore-cspell-words-.cspell-project-words.txt how to do it
- .cspell.json 0 → 100644
1 { 2 "version": "0.1", 3 "ignoreWords": [ 4 "giftcards", 5 "Giftcards", 6 "giftcard", 7 "Giftcard", 8 "Gift card", 9 "Gift cards", 10 "autofills", 11 "completition", 12 "messasge", 13 "fewfsfs", 14 "Hegal" changed this line in version 5 of the diff
@Anybody this is fixed in commit# !22 (8f261149)
- .cspell.json 0 → 100644
1 { 2 "version": "0.1", 3 "ignoreWords": [ 4 "giftcards", 5 "Giftcards", 6 "giftcard", 7 "Giftcard", 8 "Gift card", 9 "Gift cards", 10 "autofills", 11 "completition", changed this line in version 5 of the diff
Heyy @Anybody , I have created an issue for this task. Here you go: https://www.drupal.org/project/commerce_giftcard/issues/3484545
- .cspell.json 0 → 100644
1 { 2 "version": "0.1", 3 "ignoreWords": [ 4 "giftcards", 5 "Giftcards", 6 "giftcard", 7 "Giftcard", 8 "Gift card", 9 "Gift cards", 10 "autofills", 11 "completition", 12 "messasge", changed this line in version 5 of the diff
@Anybody CSPELL feedback should be marked as resolved now to avoid the noise.
added 1 commit
- 8f261149 - Using _cspell_words variable and fixing other typos.
added 1 commit
- 2ef3472e - Remove extraneous words from the project dictionary and correct spelling errors.
added 1 commit
- 9d6cc5cd - Refactor checkout pane constructor to make it more durable