src/Wrep/Notificato/Apns/MessageEnvelope.php
public function setStatus($status, $envelope = null)
	{
		// Check if we're not in a final state yet
		if ($this->status > 0) {
			throw new \RuntimeException('Cannot change status from final state ' . $this->status . ' to state ' . $status . '.');
		}

		// Check if this is a valid state
		if ( !in_array($status, array_keys(self::$statusDescriptionMapping)) ) {
			throw new \InvalidArgumentException('Status ' . $status . ' is not a valid status.');
		}

		// Check if the retry envelope is not this envelope
		if ($this === $envelope) {
			throw new \InvalidArgumentException('Retry envelope cannot be set to this envelope.');
		}

		// Save it!
		$this->status = $status;
		$this->retryEnvelope = $envelope;
	}
public function setStatus($status, $envelope = null)
	{
		// Check if we're not in a final state yet
		if ($this->status > 0) {
			throw new \RuntimeException('Cannot change status from final state ' . $this->status . ' to state ' . $status . '.');
		}

		// Check if this is a valid state
		if ( !in_array($status, array_keys(self::$statusDescriptionMapping)) ) {
			throw new \InvalidArgumentException('Status ' . $status . ' is not a valid status.');
		}

		// Check if the retry envelope is not this envelope
		if ($this === $envelope) {
			throw new \InvalidArgumentException('Retry envelope cannot be set to this envelope.');
		}

		// Save it!
		$this->status = $status;
		$this->retryEnvelope = $envelope;
	}
public function setStatus ( $ status , $ envelope = null ) { // Check if we're not in a final state yet if ( $ this -> status > 0 ) { throw new \ RuntimeException ( 'Cannot change status from final state ' . $ this -> status . ' to state ' . $ status . '.' ) ; } // Check if this is a valid state if ( ! in_array ( $ status , array_keys ( self :: $ statusDescriptionMapping ) ) ) { throw new \ InvalidArgumentException ( 'Status ' . $ status . ' is not a valid status.' ) ; } // Check if the retry envelope is not this envelope if ( $ this === $ envelope ) { throw new \ InvalidArgumentException ( 'Retry envelope cannot be set to this envelope.' ) ; } // Save it! $ this -> status = $ status ; $ this -> retryEnvelope = $ envelope ; }
Set the status of this message envelope
only possible if there is no final state set yet.

@param int One of the keys in self::$statusDescriptionMapping
@param MessageEnvelope|null Envelope for the retry of this MessageEnvelope
Set the status of this message envelope only possible if there is no final state set yet .