Closed
Description
e.g.:
if ($type & self::OUTPUT_RAW) {
$messages = \array_map(['Symfony\Component\Console\Formatter\OutputFormatter', 'escape'], $messages);
}
return \call_user_func_array(array('Symfony\\Component\\Debug\\Exception\\FlattenException', $method), $args);
This peculiar case could be part of #286, but more generally I believe such strings should be scoped properly. without much risks
Activity
[-]Prefix classes in arrays[/-][+][Scoper] Prefix classes in arrays[/+]::class
instead of string for class name algolia/algoliasearch-client-php#667fix: Correctly scope call_user_func_array()
fix: Correctly scope call_user_func_array() (#889)
theofidry commentedon Nov 3, 2023
There is quite a few more cases that could be handled, in general I think to better handle it it would be worth leveraging the JetBrains' stubs to apply it to
callable
types in general.Unfortunately treating user code is likely a lot more tricky as this would require reflection which would significantly slow down the process.
[-][Scoper] Prefix classes in arrays[/-][+][Scoper] Handle callables[/+]theofidry commentedon May 5, 2024
Closing this. It's a nice to have that I'm unlikely to ever implement myself and no one came forward to propose something in 5 years.
Moreover, it is not possible to use callables with the spread operator in PHP completely removing this problem.