You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, it detects shadowed depencencies similar to [maglnet/composer-require-checker](https://github.com/maglnet/ComposerRequireChecker), but **much faster**:
*Note that this package itself has zero composer dependencies.*
19
+
17
20
## Preconditions:
18
21
- To achieve such performance, your project needs follow some `use statements` limitations
19
22
- Disallowed approaches:
@@ -61,18 +64,21 @@ Found shadow dependencies!
61
64
62
65
You can add `--verbose` flag to see first usage of each class.
63
66
64
-
## How it works:
65
-
This tool extracts dependencies and autoloader paths from your composer.json and detects:
67
+
## What it does:
68
+
This tool reads your `composer.json`and scans all paths listed in both `autoload` sections while analysing:
66
69
67
70
- Shadowed dependencies
68
-
- This stop working if such package gets removed in one of your dependencies
71
+
- Those are dependencies of your dependencies, which are not listed in `composer.json`
72
+
- Your code can break when your direct dependency gets updated to newer version which does not require that shadowed dependency anymore
73
+
- You should list all those classes within your dependencies
69
74
- Dev dependencies used in production code
70
-
- Those stop working if you ever run your application with `composer install --no-dev`
75
+
- Your code can break once you run your application with `composer install --no-dev`
76
+
- You should move those to `require` from `require-dev`
71
77
72
-
## Shadow dependency risks
73
-
You are not in control of dependencies of your dependencies, so your code can break if you rely on such transitive dependency and your direct dependency will be updated to newer version which does not require that transitive dependency anymore.
78
+
It is expected to run this tool in root of your project, where the `composer.json` is located.
79
+
If you want to run it elsewhere, you can use `--composer_json=path/to/composer.json` option.
74
80
75
-
Every used class should be listed in your `require` (or `require-dev`) section of `composer.json`.
81
+
Currently, it only supports those autoload sections: `psr-4`, `psr-0`, `files`.
0 commit comments