/** * @param OutputInterface $output */ public function __construct(OutputInterface $output) { $filenames = [CLI_ROOT . '/resources/bot/bot1', CLI_ROOT . '/resources/bot/bot2', CLI_ROOT . '/resources/bot/bot3', CLI_ROOT . '/resources/bot/bot4']; // The frames are the contents of each file, with each line indented. $frames = array_map(function ($filename) { return preg_replace('/^/m', ' ', file_get_contents($filename)) . "\n <info>Platform.sh</info>"; }, $filenames); parent::__construct($output, $frames); }
/** * @param OutputInterface $output * @param string $signature */ public function __construct(OutputInterface $output, $signature = '') { $filenames = [CLI_ROOT . '/resources/bot/bot1', CLI_ROOT . '/resources/bot/bot2', CLI_ROOT . '/resources/bot/bot3', CLI_ROOT . '/resources/bot/bot4']; $indent = ' '; if (strlen($signature) > 0) { $signatureIndent = str_repeat(' ', strlen($indent) + 5 - floor(strlen($signature) / 2)); $signature = "\n" . $signatureIndent . '<info>' . $signature . '</info>'; } // The frames are the contents of each file, with each line indented. $frames = array_map(function ($filename) use($indent, $signature) { return preg_replace('/^/m', $indent, file_get_contents($filename)) . $signature; }, $filenames); parent::__construct($output, $frames); }