src/Exceptions/Exception.php
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;
    }
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;
    }
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 ; }
Set status code.

@author Morten Rugaard <moru@nodes.dk>

@param int    $statusCode
@param string $message

@return $this
Set status code .