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
All paths are expected to exist. If you need some glob functionality, you can do it in your config file and pass the expanded list to e.g. `ignoreErrorsOnPaths`.
168
138
169
139
### Detecting classes from non-php files:
170
140
171
-
Simplest fuzzy search for classnames within your yaml/neon/xml/json files might look like this:
141
+
Some classes might be used only in your DIC config files. Here is a simple way to extract those:
$config->addForceUsedSymbols($matches[1]); // possibly filter by class_exists || interface_exists
184
154
```
185
155
186
-
Similar approach should help you to avoid false positives in unused dependencies due to the usages being present in e.g. DIC config files only.
156
+
Similar approach should help you to avoid false positives in unused dependencies.
187
157
Another approach for DIC-only usages is to scan the generated php file, but that gave us worse results.
188
158
159
+
### Scanning codebase located elsewhere:
160
+
- This can be done by pointing `--composer-json` to `composer.json` of the other codebase
161
+
189
162
## Limitations:
190
163
- Extension dependencies are not analysed (e.g. `ext-json`)
191
164
- Files without namespace has limited support
192
165
- Only symbols with use statements and FQNs are detected
193
166
194
-
-----
195
-
196
-
Despite those limitations, our experience is that this composer-dependency-analyser works much better than composer-unused and composer-require-checker.
197
-
198
167
## Contributing:
199
168
- Check your code by `composer check`
200
169
- Autofix coding-style by `composer fix:cs`
@@ -203,4 +172,3 @@ Despite those limitations, our experience is that this composer-dependency-analy
203
172
## Supported PHP versions
204
173
- Runtime requires PHP 7.2 - 8.3
205
174
- Scanned codebase should use PHP >= 5.3
206
-
- This can be done by pointing `--composer-json` to codebase located elsewhere
0 commit comments