Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package global functions seems conflicts with classes with the same names? #216

Open
LastDragon-ru opened this issue Jan 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@LastDragon-ru
Copy link
Contributor

LastDragon-ru commented Jan 11, 2025

I'm migrating to the 1.8.2 and found new strange false-positive

image

The first file have only the class definition, all other lines - usage of this class.

class Value extends Block {
   // ...
}

The illuminate/collections (required by lara-asp-testing package from dev dependencies) defines the value function on https://github.com/laravel/framework/blob/61492a8846a1ab4bd6ab01e3edf90007ba818753/src/Illuminate/Collections/helpers.php#L223-L238

PS: https://github.com/LastDragon-ru/lara-asp/actions/runs/12721635835/job/35464780891

@LastDragon-ru LastDragon-ru changed the title User global functions seems conflicts with classes with the same names? Package global functions seems conflicts with classes with the same names? Jan 11, 2025
@LastDragon-ru
Copy link
Contributor Author

I made some research - the type of class Value is incorrect, UsedSymbolExtractor thinks that it is a function...

How to reproduce

{
  "require": {
    "php": "^8.3"
  },
  "require-dev": {
    "shipmonk/composer-dependency-analyser": "^1.8.2",
    "illuminate/collections": "^11.0.8"
  },
  "autoload": {
    "classmap": [
      "src/Value.php"
    ]
  }
}
<?php

class Value {}
./vendor/bin/composer-dependency-analyser --verbose --show-all-usages

Will output

Found 1 dev dependency in production code!
(those should probably be moved to "require" section in composer.json)

  • illuminate/collections
      Value
        src/Value.php:3

@janedbal janedbal added the bug Something isn't working label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants