Returns the title of the command process.
public getProcessTitle ( ) : string | null | ||
Результат | string | null | The process title or `null` if no title should be set. |
/** * Executes the command for the given parsed arguments. * * @param Args $args The parsed console arguments. * @param IO $io The I/O. * * @return int Returns 0 on success and any other integer on error. * * @throws Exception */ public function handle(Args $args, IO $io) { $processTitle = $this->config->getProcessTitle(); $this->warnIfProcessTitleNotSupported($processTitle, $io); if ($processTitle && ProcessTitle::isSupported()) { ProcessTitle::setProcessTitle($processTitle); try { $statusCode = $this->doHandle($args, $io); } catch (Exception $e) { ProcessTitle::resetProcessTitle(); throw $e; } ProcessTitle::resetProcessTitle(); } else { $statusCode = $this->doHandle($args, $io); } // Any empty value is considered a success if (!$statusCode) { return 0; } // Anything else is normalized to a valid error status code // (i.e. one of [1, 255]) return min(max((int) $statusCode, 1), 255); }
public function testSetProcessTitleNull() { $this->config->setProcessTitle(null); $this->assertNull($this->config->getProcessTitle()); }