Not sure which way round this should go, whether azjezz/psl
should add support, or the other way round. If i use maglnet/ComposerRequireChecker
on a project that also depends on azjezz/psl
, because of the custom autoloader, there are several symbols which cannot be guessed by maglnet/ComposerRequireChecker
.
$ php composer-require-checker.phar check composer.json
ComposerRequireChecker 3.8.0@537138b833ab0f9ad72b667a72bece2a765e88ab
The following 43 unknown symbols were found:
+-----------------------------+--------------------+
| Unknown Symbol | Guessed Dependency |
+-----------------------------+--------------------+
| Psl\Dict\associate | |
| Psl\Dict\diff | |
| Psl\Dict\diff_by_key | |
| Psl\Dict\filter | |
| Psl\Dict\intersect_by_key | |
| Psl\Dict\map | |
| Psl\Dict\map_keys | |
| Psl\Env\current_dir | |
| Psl\Env\set_current_dir | |
| Psl\Env\temp_dir | |
| Psl\Filesystem\canonicalize | |
| Psl\Filesystem\exists | |
| Psl\Filesystem\is_directory | |
| Psl\Filesystem\is_file | |
| Psl\Filesystem\read_file | |
| Psl\invariant | |
| Psl\Iter\all | |
| Psl\Iter\any | |
| Psl\Iter\contains | |
| Psl\Iter\count | |
| Psl\Json\encode | |
| Psl\Regex\matches | |
| Psl\Shell\execute | |
| Psl\Str\format | |
| Psl\Str\join | |
| Psl\Str\lowercase | |
| Psl\Str\replace_every | |
| Psl\Str\split | |
| Psl\Str\trim | |
| Psl\Str\trim_right | |
| Psl\Str\uppercase | |
| Psl\Type\bool | |
| Psl\Type\dict | |
| Psl\Type\non_empty_string | |
| Psl\Type\object | |
| Psl\Type\string | |
| Psl\Type\vec | |
| Psl\Vec\concat | |
| Psl\Vec\filter | |
| Psl\Vec\filter_nulls | |
| Psl\Vec\keys | |
| Psl\Vec\map | |
| Psl\Vec\values | |
+-----------------------------+--------------------+
A reasonable workaround (and maybe indeed, the final "recommendation", given the custom autoloader) may be to explicitly ignore these symbols as long as azjezz/psl
is explicitly in composer.json
(although, the point of maglnet/ComposerRequireChecker
is to check that really!), for example:
{
"symbol-whitelist" : [
"null", "true", "false",
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never",
"Psl\\Dict\\associate",
"Psl\\Dict\\diff",
"Psl\\Dict\\diff_by_key",
"Psl\\Dict\\filter",
"Psl\\Dict\\intersect_by_key",
"Psl\\Dict\\map",
"Psl\\Dict\\map_keys",
"Psl\\Env\\current_dir",
"Psl\\Env\\set_current_dir",
"Psl\\Env\\temp_dir",
"Psl\\Filesystem\\canonicalize",
"Psl\\Filesystem\\exists",
"Psl\\Filesystem\\is_directory",
"Psl\\Filesystem\\is_file",
"Psl\\Filesystem\\read_file",
"Psl\\invariant",
"Psl\\Iter\\all",
"Psl\\Iter\\any",
"Psl\\Iter\\contains",
"Psl\\Iter\\count",
"Psl\\Json\\encode",
"Psl\\Regex\\matches",
"Psl\\Shell\\execute",
"Psl\\Str\\format",
"Psl\\Str\\join",
"Psl\\Str\\lowercase",
"Psl\\Str\\replace_every",
"Psl\\Str\\split",
"Psl\\Str\\trim",
"Psl\\Str\\trim_right",
"Psl\\Str\\uppercase",
"Psl\\Type\\bool",
"Psl\\Type\\dict",
"Psl\\Type\\non_empty_string",
"Psl\\Type\\object",
"Psl\\Type\\string",
"Psl\\Type\\vec",
"Psl\\Vec\\concat",
"Psl\\Vec\\filter",
"Psl\\Vec\\filter_nulls",
"Psl\\Vec\\keys",
"Psl\\Vec\\map",
"Psl\\Vec\\values"
],
"php-core-extensions" : [
"Core",
"date",
"pcre",
"Phar",
"Reflection",
"SPL",
"standard"
],
"scan-files" : []
}
When used, will work properly:
$ php composer-require-checker.phar check --config-file `pwd`/composer-require-checker-config.json composer.json
ComposerRequireChecker 3.8.0@537138b833ab0f9ad72b667a72bece2a765e88ab
There were no unknown symbols found.
Type: Enhancement