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:
@@ -59,7 +59,7 @@ class TranslationDebugCommand extends Command
|
||||
private array $codePaths;
|
||||
private array $enabledLocales;
|
||||
|
||||
public function __construct(TranslatorInterface $translator, TranslationReaderInterface $reader, ExtractorInterface $extractor, string $defaultTransPath = null, string $defaultViewsPath = null, array $transPaths = [], array $codePaths = [], array $enabledLocales = [])
|
||||
public function __construct(TranslatorInterface $translator, TranslationReaderInterface $reader, ExtractorInterface $extractor, ?string $defaultTransPath = null, ?string $defaultViewsPath = null, array $transPaths = [], array $codePaths = [], array $enabledLocales = [])
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -79,7 +79,7 @@ class TranslationDebugCommand extends Command
|
||||
->setDefinition([
|
||||
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
|
||||
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'),
|
||||
new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'The messages domain'),
|
||||
new InputOption('domain', null, InputOption::VALUE_REQUIRED, 'The messages domain'),
|
||||
new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Display only missing messages'),
|
||||
new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Display only unused messages'),
|
||||
new InputOption('all', null, InputOption::VALUE_NONE, 'Load messages from all registered bundles'),
|
||||
@@ -155,7 +155,7 @@ EOF
|
||||
$codePaths = [$path.'/templates'];
|
||||
|
||||
if (!is_dir($transPaths[0])) {
|
||||
throw new InvalidArgumentException(sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0]));
|
||||
throw new InvalidArgumentException(\sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0]));
|
||||
}
|
||||
}
|
||||
} elseif ($input->getOption('all')) {
|
||||
@@ -181,10 +181,10 @@ EOF
|
||||
|
||||
// No defined or extracted messages
|
||||
if (!$allMessages || null !== $domain && empty($allMessages[$domain])) {
|
||||
$outputMessage = sprintf('No defined or extracted messages for locale "%s"', $locale);
|
||||
$outputMessage = \sprintf('No defined or extracted messages for locale "%s"', $locale);
|
||||
|
||||
if (null !== $domain) {
|
||||
$outputMessage .= sprintf(' and domain "%s"', $domain);
|
||||
$outputMessage .= \sprintf(' and domain "%s"', $domain);
|
||||
}
|
||||
|
||||
$io->getErrorStyle()->warning($outputMessage);
|
||||
@@ -196,9 +196,9 @@ EOF
|
||||
$fallbackCatalogues = $this->loadFallbackCatalogues($locale, $transPaths);
|
||||
|
||||
// Display header line
|
||||
$headers = ['State', 'Domain', 'Id', sprintf('Message Preview (%s)', $locale)];
|
||||
$headers = ['State', 'Domain', 'Id', \sprintf('Message Preview (%s)', $locale)];
|
||||
foreach ($fallbackCatalogues as $fallbackCatalogue) {
|
||||
$headers[] = sprintf('Fallback Message Preview (%s)', $fallbackCatalogue->getLocale());
|
||||
$headers[] = \sprintf('Fallback Message Preview (%s)', $fallbackCatalogue->getLocale());
|
||||
}
|
||||
$rows = [];
|
||||
// Iterate all message ids and determine their state
|
||||
@@ -320,7 +320,7 @@ EOF
|
||||
|
||||
private function formatId(string $id): string
|
||||
{
|
||||
return sprintf('<fg=cyan;options=bold>%s</>', $id);
|
||||
return \sprintf('<fg=cyan;options=bold>%s</>', $id);
|
||||
}
|
||||
|
||||
private function sanitizeString(string $string, int $length = 40): string
|
||||
|
||||
Reference in New Issue
Block a user