mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -35,7 +35,7 @@ class DebugAutowiringCommand extends ContainerDebugCommand
|
||||
{
|
||||
private ?FileLinkFormatter $fileLinkFormatter;
|
||||
|
||||
public function __construct(string $name = null, FileLinkFormatter $fileLinkFormatter = null)
|
||||
public function __construct(?string $name = null, ?FileLinkFormatter $fileLinkFormatter = null)
|
||||
{
|
||||
$this->fileLinkFormatter = $fileLinkFormatter;
|
||||
parent::__construct($name);
|
||||
@@ -78,7 +78,7 @@ EOF
|
||||
$serviceIds = array_filter($serviceIds, fn ($serviceId) => false !== stripos(str_replace('\\', '', $serviceId), $searchNormalized) && !str_starts_with($serviceId, '.'));
|
||||
|
||||
if (!$serviceIds) {
|
||||
$errorIo->error(sprintf('No autowirable classes or interfaces found matching "%s"', $search));
|
||||
$errorIo->error(\sprintf('No autowirable classes or interfaces found matching "%s"', $search));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ EOF
|
||||
$io->title('Autowirable Types');
|
||||
$io->text('The following classes & interfaces can be used as type-hints when autowiring:');
|
||||
if ($search) {
|
||||
$io->text(sprintf('(only showing classes/interfaces matching <comment>%s</comment>)', $search));
|
||||
$io->text(\sprintf('(only showing classes/interfaces matching <comment>%s</comment>)', $search));
|
||||
}
|
||||
$hasAlias = [];
|
||||
$all = $input->getOption('all');
|
||||
@@ -120,10 +120,10 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
$serviceLine = sprintf('<fg=yellow>%s</>', $serviceId);
|
||||
$serviceLine = \sprintf('<fg=yellow>%s</>', $serviceId);
|
||||
if ('' !== $fileLink = $this->getFileLink($previousId)) {
|
||||
$serviceLine = substr($serviceId, \strlen($previousId));
|
||||
$serviceLine = sprintf('<fg=yellow;href=%s>%s</>', $fileLink, $previousId).('' !== $serviceLine ? sprintf('<fg=yellow>%s</>', $serviceLine) : '');
|
||||
$serviceLine = \sprintf('<fg=yellow;href=%s>%s</>', $fileLink, $previousId).('' !== $serviceLine ? \sprintf('<fg=yellow>%s</>', $serviceLine) : '');
|
||||
}
|
||||
|
||||
if ($container->hasAlias($serviceId)) {
|
||||
@@ -168,7 +168,7 @@ EOF
|
||||
$io->newLine();
|
||||
|
||||
if (0 < $serviceIdsNb) {
|
||||
$io->text(sprintf('%s more concrete service%s would be displayed when adding the "--all" option.', $serviceIdsNb, $serviceIdsNb > 1 ? 's' : ''));
|
||||
$io->text(\sprintf('%s more concrete service%s would be displayed when adding the "--all" option.', $serviceIdsNb, $serviceIdsNb > 1 ? 's' : ''));
|
||||
}
|
||||
if ($all) {
|
||||
$io->text('Pro-tip: use interfaces in your type-hints instead of classes to benefit from the dependency inversion principle.');
|
||||
|
||||
Reference in New Issue
Block a user