ComposerRequireChecker: False positives on some bundle and classes

Command result (extract):

+--------------------------------------------------------------------------+--------------------+
| unknown symbol                                                           | guessed dependency |
+--------------------------------------------------------------------------+--------------------+
| Nelmio\ApiDocBundle\NelmioApiDocBundle                                   |                    |
| Gregwar\ImageBundle\GregwarImageBundle                                   |                    |
| Ornicar\GravatarBundle\OrnicarGravatarBundle                             |                    |
| A2lix\TranslationFormBundle\A2lixTranslationFormBundle                   |                    |
| Browscap\BrowscapBundle\BrowscapBundle                                   |                    |
| EightPoints\Bundle\GuzzleBundle\GuzzleBundle                             |                    |
| SLLH\IsoCodesValidator\Bridge\Symfony\Bundle\SLLHIsoCodesValidatorBundle |                    |
| Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle                      |                    |
| Sonata\EasyExtendsBundle\SonataEasyExtendsBundle                         |                    |
| Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle                    |                    |
| JMS\TranslationBundle\JMSTranslationBundle                               |                    |
| Joli\GifExceptionBundle\GifExceptionBundle                               |                    |
| DAMA\DoctrineTestBundle\DAMADoctrineTestBundle                           |                    |
| Liip\FunctionalTestBundle\LiipFunctionalTestBundle                       |                    |
| A2lix\TranslationFormBundle\Form\Type\TranslationsType                   |                    |
| KERNEL_ROOT_DIR                                                          |                    |
| Ornicar\GravatarBundle\GravatarApi                                       |                    |
| Swift_Mailer                                                             |                    |
| Swift_Attachment                                                         |                    |
| Swift_Message                                                            |                    |
| SLLH\IsoCodesValidator\Constraints\CreditCard                            |                    |
| Composer\Script\Event                                                    |                    |
+--------------------------------------------------------------------------+--------------------+

But the corresponding bundles are required on the root composer.json file:

{
        "php": "^7.1",
        "ext-PDO": "^7.1",
        "ext-dom": "20031129",
        "ext-filter": "^7.1",
        "ext-hash": "^1.0",
        "ext-intl": "^1.0.2",
        "ext-json": "^1.5",
        "ext-openssl": "^7.1",
        "a2lix/translation-form-bundle": "^2.1",
        "algatux/influxdb-bundle": "^2.1",
        "behat/transliterator": "^1.2",
        "browscap/browscap-bundle": "^1.0",
        "browscap/browscap-php": "^2.1",
        "cebe/markdown": "^1.1",
        "digitick/sepa-xml": "^1.0",
        "doctrine/annotations": "^1.6",
        "doctrine/cache": "^1.7",
        "doctrine/collections": "^1.5",
        "doctrine/common": "^2.8",
        "doctrine/dbal": "^2.6",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.3",
        "doctrine/doctrine-migrations-bundle": "^1.0",
        "doctrine/inflector": "^1.3",
        "doctrine/orm": "^2.6",
        "dompdf/dompdf": "^0.8",
        "egulias/email-validator": "^2.1",
        "eightpoints/guzzle-bundle": "^6.1",
        "emojione/emojione": "^3.1.2",
        "fabpot/goutte": "^3.0",
        "friendsofsymfony/jsrouting-bundle": "^1.5",
        "friendsofsymfony/oauth-server-bundle": "^1.4",
        "friendsofsymfony/oauth2-php": "^1.2",
        "friendsofsymfony/rest-bundle": "^2.0",
        "friendsofsymfony/user-bundle": "^2.0",
        "fzaninotto/faker": "^1.7",
        "giggsey/libphonenumber-for-php": "^8.9",
        "greg0ire/enum": "^3.1",
        "gregwar/image-bundle": "^2.1",
        "guzzlehttp/guzzle": "^6.0",
        "hackzilla/password-generator": "^1.4",
        "hackzilla/password-generator-bundle": "^2.0",
        "hautelook/alice-bundle": "^1.0",
        "incenteev/composer-parameter-handler": "^2.0",
        "influxdb/influxdb-php": "^1.14",
        "inlinestyle/inlinestyle": "^1.2",
        "internations/solr-utils": "^0.8",
        "jms/serializer": "^1.11",
        "jms/serializer-bundle": "^2.1",
        "jms/translation-bundle": "^1.4",
        "knplabs/doctrine-behaviors": "^1.4",
        "knplabs/knp-markdown-bundle": "^1.3",
        "knplabs/knp-menu": "^2.3",
        "knplabs/knp-menu-bundle": "^2.0",
        "knplabs/knp-paginator-bundle": "^2.4.3",
        "kriswallsmith/spork": "^0.3",
        "lexik/jwt-authentication-bundle": "^2.4",
        "lstrojny/fxmlrpc": "^0.14.0",
        "misd/phone-number-bundle": "^1.2",
        "monolog/monolog": "^1.23",
        "mtdowling/cron-expression": "^1.1",
        "nelmio/alice": "^2.0",
        "nelmio/api-doc-bundle": "dev-nexy as 2.10",
        "nexylan/cloudflare": "dev-master",
        "nexylan/cloudflare-host-gw": "^0.1",
        "nexylan/gandi-sdk": "^0.3",
        "nexylan/graylog-sdk": "^0.1",
        "nexylan/nexycrypt": "^0.2",
        "nexylan/paybox-direct": "^0.3.4",
        "nexylan/slack": "^1.7",
        "nexylan/slack-bundle": "^1.1",
        "ornicar/gravatar-bundle": "^1.2",
        "ovh/ovh": "^2.0",
        "patchwork/utf8": "^1.3",
        "php-http/guzzle6-adapter": "^1.1",
        "php-http/httplug-bundle": "^1.7",
        "predis/predis": "^1.0",
        "psr/http-message": "^1.0",
        "psr/log": "^1.0",
        "rollerworks/password-strength-bundle": "^2.0",
        "rollerworks/password-strength-validator": "^1.0",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^5.0.1",
        "simplethings/entity-audit-bundle": "^1.0.1",
        "sllh/iso-codes-validator": "^3.1",
        "snc/redis-bundle": "^2.0,>2.0.2",
        "sonata-project/admin-bundle": "^3.3",
        "sonata-project/block-bundle": "^3.12",
        "sonata-project/core-bundle": "^3.9",
        "sonata-project/doctrine-extensions": "^1.0",
        "sonata-project/doctrine-orm-admin-bundle": "^3.0.3",
        "sonata-project/intl-bundle": "^2.2",
        "stof/doctrine-extensions-bundle": "^1.1",
        "swiftmailer/swiftmailer": "^6.0",
        "symfony/dotenv": "^4.0",
        "symfony/monolog-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.1",
        "symfony/swiftmailer-bundle": "^3.0",
        "symfony/symfony": "^3.4",
        "tilleuls/ovh-bundle": "^1.0",
        "twig/extensions": "^1.0",
        "twig/twig": "^2.4",
        "webmozart/assert": "^1.2"
    },
    "require-dev": {
        "behat/mink-browserkit-driver": "^1.3",
        "behat/mink-extension": "^2.0",
        "behat/mink-selenium2-driver": "^1.2",
        "behat/symfony2-extension": "^2.0",
        "dama/doctrine-test-bundle": "^4.0",
        "doctrine/doctrine-fixtures-bundle": "^2.4",
        "jolicode/gif-exception-bundle": "^1.4",
        "knplabs/friendly-contexts": "^0.8",
        "liip/functional-test-bundle": "^1.9",
        "lookyman/phpstan-symfony": "^0.4.1",
        "phpdocumentor/reflection-docblock": "^3.2.3",
        "phpstan/phpstan-doctrine": "^0.9.1",
        "phpstan/phpstan-phpunit": "^0.9.3",
        "phpstan/phpstan-shim": "^0.9.1",
        "phpstan/phpstan-strict-rules": "^0.9.0",
        "phpunit/phpunit": "^6.4",
        "sensio/generator-bundle": "^3.1",
        "sonata-project/easy-extends-bundle": "^2.5",
        "symfony/web-server-bundle": "^3.3"
    }

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 44 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Hi,

I’m not sure if it’s a false positive. If you’re running the check with PHP versions < 8.1 the class is not available (seems like it was introduced with 8.1) and so it’s a unknown symbol for the lower versions.

Ignoring symbols is already possible. Please have a look at the symbol-whitelist within the example configuration: https://github.com/maglnet/ComposerRequireChecker/blob/3.7.x/data/config.dist.json

I don’t care what symfony does

Yeah, your choice, I’m not trying to convince you. But yes, an option to permit both would solve everything! 👍

I’m on the issue.

Most likely to be reported upstream then

What do you mean?

config/bundles.php is a special file to activate or not the bundle according to environment. There is no reason to require debug-bundle on production.

Maybe not really a false positive according to the current behavior, but it would be great to have an option to specify files where both can be accepted (dev and not). 👍

@maglnet do we have something to collect all defined symbols and the defining files? Would be interesting to have some debug output that dumps all files associated with the originating file.