Skip to content

False positive "unused dependency ext-mbstring " when run on PHP 8.3 and symfony/polyfill-php84 is usedΒ #254

@LastDragon-ru

Description

@LastDragon-ru

Configs

{
  "require": {
    "ext-mbstring": "*",
    "symfony/polyfill-php84": "^1.31"
  },
  "require-dev": {
    "shipmonk/composer-dependency-analyser": "^1.8.4"
  },
  "autoload": {
    "classmap": [
      "src/MyClass.php"
    ]
  }
}
<?php declare(strict_types = 1);

class MyClass {
    public function trim(string $string): string {
        return mb_trim($string);
    }
}

Actual

PHP 8.4

Found 1 unused dependency!
(those are listed in composer.json, but no usage was found in scanned paths)

  β€’ symfony/polyfill-php84

PHP 8.3

Found 1 unused dependency!
(those are listed in composer.json, but no usage was found in scanned paths)

  β€’ ext-mbstring

Expected

On PHP 8.3 it should not report that ext-mbstring is unused because mb_trim is related to ext-mbstring.

Proposal

Maybe some way to tell composer-dependency-analyser about extensions and their functions, but it should be "soft" (= should not lead to report about unused symfony/polyfill-php84 on PHP 8.3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions