输出列表项目

@param  string $message
@param  string $status
@param  string $decorateStyle
@param  string $decorate
176330
public function status(string $message, string $status, string $decorateStyle = 'info', string $decorate = '*')
    {
        $this->output->writeln(
            sprintf(
                ' <%s>%s</> %s %s',
                $decorateStyle,
                $decorate,
                str_pad($message, 36),
                $status
            )
        );
    }
393920
private function setStatus($status, $message = '')
    {
        if ($status > $this->status) {
            $this->status = $status;
            // Save the message belonging to this worse state.
            if (!empty($message)) {
                $this->statusMessage = $message;
            }
        }
    }
730082
public function setStatus($status, $message = '')
    {
        $status = (int)$status;
        if ($status < 100 || $status > 505) {
            return;
        }
        $this->status = (int) $status;
    }
46649
protected function notifyPlural(
        $message,
        $number,
        array $params = [],
        $domain = null,
        $status = Notification::STATE_DONE
    ) {
        $this->notificationPool->addNotification(
            new TranslatableNotificationMessage([
                'message' => $message,
                'number' => $number,
                'translationParams' => $params,
                'domain' => $domain,
            ]),
            $status
        );
    }
396912
public function sendError($status = self::HTTP_NOT_FOUND, $message = '')
    {
        if (!is_int($status) || $status < 400 || $status > 505) {
            return;
        }
        
        $this->setBody($message, 'error');
        $this->setStatus($status);
        $this->send();
    }
1023060
protected function _format($statusCode=null, $message=null, $body=false)
    {
        $format = [];
        // Status Code field is necessary
        $format['code'] = ($statusCode) 
            ?: $this->response->getStatusCode();
        // Message field
        if ($message) {
            $format['message'] = $message;
        }
        // Body field
        if ($body !== false) {
            $format['data'] = $body;
        }
        
        return $format;
    }
815165
public function handle(StatusMessage $message)
    {
        $this->message = $message;
        $this->output = $message->getOutput();
        $output = $this->output;

        $repository = $message->getRepository();
        $storage = $message->getStorage();

        $availableMigrations = $repository->fetchAll();
        $migratedVersions = $storage->fetchAll();

        $migratedVersions->sortWith($message->getComparator());
        $headVersion = $migratedVersions->last();

        $currentMessage = $headVersion ?
            "Current version: <comment>{$headVersion->getId()}</comment>" :
            'Nothing has been migrated yet.';
        $output->writeln($currentMessage);

        $diff = array_diff($availableMigrations->toArray(), $migratedVersions->toArray());

        $pendingCount = count($diff);

        if ($pendingCount > 0) {
            $executable = defined('MIGRATIONS_EXECUTABLE') ? MIGRATIONS_EXECUTABLE . ' ' : '';
            $output->writeln([
                "Your database is out-of-date by $pendingCount versions, and can be migrated.",
                sprintf(
                    '  (use "<comment>%smigrate</comment>" to execute all migrations)',
                    $executable
                ),
                ''
            ]);
            if ($headVersion) {
                list($beforeHead, $afterHead) = $this->splitDiff($diff, $message->getComparator(), $headVersion);
            } else {
                $beforeHead = [];
                $afterHead = $diff;
            }
            $this->printDiff(
                $beforeHead,
                [
                    'Old migrations still pending:',
                    sprintf("  (use \"<comment>{$executable}migrate HEAD</comment>\" to migrate them)", $executable),
                ],
                self::STYLE_COMMENT
            );
            $this->printDiff($afterHead, ['New migrations:'], self::STYLE_INFO);
        } else {
            $output->writeln('Your database is up-to-date.');
        }
    }
144504
public static function addMessage($text, $status = 'info'): void
    {
        $message         = new stdClass();
        $message->text   = $text;
        $message->status = $status;

        $messages   = Session::get(self::FLASH_KEY, []);
        $messages[] = $message;
        Session::put(self::FLASH_KEY, $messages);
    }
495017
private function message(string $command, int $status, ?array $output): string
  {
    $message = sprintf('Command below exited with status %s:', $status);
    $message .= PHP_EOL;
    $message .= $command;

    if (!empty($output))
    {
      $message .= PHP_EOL;
      $message .= implode(PHP_EOL, $output);
    }

    return $message;
  }
120524
public function setStatusCode($statusCode, $message = null)
    {
        $this->statusCode = (int) $statusCode;

        // Add status message to meta array
        $this->addMeta(['status' => ['code' => (int) $statusCode]]);

        // Set optional status message if present
        if (!empty($message)) {
            $this->setStatusMessage($message);
        }

        return $this;
    }
1364041
private function error(string $message, $status = 1)
    {
        $this->printer->printError($message);
        exit($status);
    }
1337803
public static function success($message = '', $style = null) {
		if (is_array($message)) {
			$msg     = unget($message, 'message');
			$args    = $message;
			$message = $msg ? $msg : '';
		} else {
			$args = [];
		}

		return new JsonView([
			'code'    => self::SUCCESS,
			'message' => $message,
			'args'    => $args,
			'style'   => $style
		], ['ajax' => '1']);
	}
503752
private static function handleError(int $status, string $message = null)
    {
        if ($status === 400) {
            throw new BadRequestException($message, $status);
        }

        if ($status === 422) {
            throw new ValidationFailedException($message, $status);
        }

        if ($status === 429) {
            throw new ApiLimitExceededException($message, $status);
        }

        if ($status < 500) {
            throw new ClientErrorException($message, $status);
        }

        throw new ServerErrorException($message, $status);
    }
308366
public function errorResponse(string $errorCode = null, int $statusCode = null, $message = null):JsonResponse
    {
        return app(Responder::class)->error($errorCode, $statusCode, $message);
    }
351731
protected function writeFileResult($status, $message)
    {
        $output = null;

        if (0 === $this->outputLevel) {
           return null;
        }

        switch ($status) {
            case self::FILE_FAILURE:
                $output = $this->getFileResultTemplate('bg_red_fg_white', 'FAIL', 'file/test FAILURE', $message);
                break;

            case self::FILE_PASS:
                $output = $this->getFileResultTemplate('green', 'OK', 'file/test OK', $message);
                break;

            default: break;
        }

        $this->writeLine($output);
    }
1147322
def _set_status(self, status, message=''):
        

        message = message.strip()

        # fetch away message from provided id
        if message.startswith(':'):
            msg_id = message[1:]
            message = self.messages.get(msg_id, '')

        message = message.encode('utf-8', 'replace')

        # attempt to set status for each supported application
        for func in self.set_status_funcs:
            func(status, message)
1261440
public function stderr($msg, $status = self::STATUS_FAIL)
    {
        $msg = "<strong>".$msg."</strong>";
        $msg = $this->removeColors($msg);
        $msg = $this->replaceEOLs($msg);

        if (defined('STDERR')) {
            fwrite(STDERR, $msg);
        } else {
            echo $msg;
            if (count(\ob_get_status()) !== 0) {
                ob_flush();
            }
        }
        return $this;
    }