- Issue created by @adamfranco
- 🇺🇸United States adamfranco
Attached is a patch to fix the argument type for $format parameter to match that used by
libphonenumber\PhoneNumberFormat
(string --> int).After this patch PHPStan reports only more minor errors:
vendor/bin/phpstan analyze --level 5 ../drupal-other/telephone_formatter/ 5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% ------ ----------------------------------------------------------------------------------------- Line drupal-other/telephone_formatter/src/Plugin/Field/FieldFormatter/TelephoneFormatter.php ------ ----------------------------------------------------------------------------------------- 77 Unsafe usage of new static(). 💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static 184 Access to an undefined property Drupal\Core\Field\FieldItemInterface::$value. 💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property 222 Access to an undefined property Drupal\Core\Field\FieldItemInterface::$value. 💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property 250 Access to an undefined property Drupal\Core\Field\FieldItemInterface::$value. 💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property ------ ----------------------------------------------------------------------------------------- ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Line drupal-other/telephone_formatter/tests/src/Functional/FieldFormatterTest.php ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 15 Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use. 22 PHPDoc type array of property Drupal\Tests\telephone_formatter\Functional\FieldFormatterTest::$modules is not covariant with PHPDoc type array<string> of overridden property Drupal\Tests\BrowserTestBase::$modules. 💡 You can fix 3rd party PHPDoc types with stub files: 💡 https://phpstan.org/user-guide/stub-files ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [ERROR] Found 6 errors
- First commit to issue fork.
- Status changed to Needs review
about 1 year ago 5:40am 19 December 2023 - Open on Drupal.org →Core: 10.1.x + Environment: PHP 8.2 & MySQL 8last update
about 1 year ago Waiting for branch to pass - 🇮🇳India viren18febS
Hi @adamfranco
I have fixed the remaining issues and added a patch . please review
Thanks