Get an instance of the preprocessor for the current status

@param int $status
The HTTP status to use
@return HttpStatusPreprocessorInterface
433622
public function get($status) {

        $preprocessor = $this->has($status) ?
            $this->preprocessors[$status] :
            $this->preprocessors[self::DEFAULT_STATUS];

        return ($preprocessor instanceof HttpStatusPreprocessorInterface) ?
            $preprocessor : new $preprocessor;

    }
1051428
private function getMessage($status) {
		if($this->messages === false) {
			$this->messages = require(__DIR__ . '/messages.php');
		}

		return isset($this->messages[$status]) ? $this->messages[$status] : "Error: $status";
	}
523001
public function setStatus($status) {
        if (!is_int($status)) throw new IllegalTypeException('Illegal type of parameter $status: '.gettype($status));
        if ($status < 1)      throw new InvalidArgumentException('Invalid argument $status: '.$status);

        $this->status = $status;
        return $this;
    }
618565
protected function getStatus($statusId)
    {
        if (!isset($this->cachedStatuses[$statusId])) {
            $this->cachedStatuses[$statusId] = $this->statusRepository->findOneById($statusId);
        }

        return $this->cachedStatuses[$statusId];
    }
70969
public function status($status = null)
    {
        if (null === $status) {
            return $this->status;
        }

        $this->status = $status;
        return $this;
    }
846991
public function getStatusMessage($status = null)
    {
        if (! $status) $status = $this->getStatus();

        if (! $status || ! isset($this->status_messages[$status])) throw new \LogicException("No such status. -> {$status}");

        return $this->status_messages[$status];
    }
976578
public function withStatus(string $status): self
    {
        $this->status = JobEventStatusEnum::ensureValid($status);
        return $this;
    }
206560
public static function getMessageForCode($status)
    {
        if (isset(self::$messages[$status])) {
            return self::$messages[$status];
        } else {
            return null;
        }
    }
1269035
private function mapStatusToVersionInfoStatus($status)
    {
        if (array_key_exists($status, self::VERSION_STATUS)) {
            return self::VERSION_STATUS[$status];
        }

        throw new InvalidArgumentException(
            'status',
            sprintf(
                "Status %s can't be mapped to VersionInfo status.",
                $status
            )
        );
    }
962348
public function statusExist($status)
    {
        $generator = $this->getStatuses();
        $list = iterator_to_array($generator);

        return in_array($status, $list);
    }
1345899
public function status($status = null) {
			if ($status != null) {
				if (array_key_exists($status, $this->_statusCode)) {
					$this->_status = $status;
				}

				return true;
			}
			else {
				return $this->_status;
			}
		}
1176922
public function setStatus($status)
    {
        $allowed_values = array('active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted');
        if ((!in_array($status, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted'");
        }
        $this->container['status'] = $status;

        return $this;
    }
1049336
public function setStatus($status)
    {
        if (!in_array($status, static::getAvailableStatuses(), true)) {
            throw new InvalidArgumentException(sprintf('Status not recognized ; Had "%s", expected one of "%s"', $status, implode('", "', static::getAvailableStatuses())));
        }

        $this->status = $status;

        return $this;
    }
239054
public static function get_request_status_string($status) {
        $statuses = self::get_request_statuses();
        if (!isset($statuses[$status])) {
            throw new moodle_exception('errorinvalidrequeststatus', 'tool_dataprivacy');
        }

        return $statuses[$status];
    }
567048
public static function createIncorrectStatus($status, \Exception $e = null)
    {
        $message = 'Expected server status to be "OK", got "%s" instead';

        return new static(sprintf($message, $status), null, $e);
    }
548786
public function setStatus($status) {
        if($this->setModified('status', $status)->isModified()) {
            $this->status = $status;
        }

        return $this;
    }
391920
public function setStatus($status)
    {
        $result = \Eix\Services\Net\Http::isStatusCodeValid($status);
        if ($result) {
            $this->status = $status;
        }

        return $result;
    }