Skip to content

Commit

Permalink
[TASK] Avoid deprecated deprecationLog() usage if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrodala committed Sep 11, 2020
1 parent 95c0a53 commit 8263f49
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Classes/Command/Legacy/AbstractLegacyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ public function getDefinition()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
GeneralUtility::deprecationLog(sprintf(
$deprecationMessage = sprintf(
'The CLI command "%s" is deprecated and will be removed with Searchable v4, use "%s" instead',
$this->getName(),
$this->replacementCommand
));
);

if (!method_exists(GeneralUtility::class, 'deprecationLog')) { // TYPO3v10
trigger_error($deprecationMessage, E_USER_DEPRECATED);
} else {
// @extensionScannerIgnoreLine
GeneralUtility::deprecationLog($deprecationMessage);
}

return $this->getApplication()->find($this->replacementCommand)->run($input, $output);
}
Expand Down

0 comments on commit 8263f49

Please sign in to comment.