Open hkirsman opened 5 years ago
1 more comment on the issue that it in case you have for example PHP 7.3 installed but not the iconv module enabled, then it will fail silently as it will install 1.0.3 version of Code Quality tool. You'll then don't have the phpstan package installed and the line from documentation to copy it's config will fail:
cp vendor/wunderio/code-quality/config/phpstan.neon ./phpstan.neon
I was not able to solve it from composer.json.
Tried:
"require": {
"symfony/polyfill-iconv": "^1",
"require": {
"symfony/polyfill-iconv": "^1",
"wunderio/fake-iconv": "^1",
"provide": {
"ext-iconv": "*"
},
"config": {
"platform": {
"ext-iconv": "0"
}
},
All in all, it's advised to use the PHP iconv library as it's faster. Some more options to propose here
Something else?
@guncha25 @mgalang
Ok, here's my last thought on this. Here's the situation that I would like to avoid. I've installed the latest code-quality in lando using:
lando composer require wunderio/code-quality --dev
Everything goes fine but now when trying to commit it yells about the iconv library:
Wouldn't hurt to add this safe fallback for projects like Drupal 7 (it's in core drupal 8 composer.json)?
I added code-quality to my Drupal 7 project but it fails when commiting:
My system doesn't seem to have php module iconv enabled and configured. But then again it works fine for Drupal 8. When checking deeper, then I found that Drupal 8 has symfony/polyfill-iconv package installed. This solved my issue:
It's missing --dev intentionally because Drupal 8 web/core/composer.json file has the dependency also in require section as: