src/Wrep/Notificato/Apns/Message.php
private function setDeviceToken($deviceToken)
	{
		// Check if a devicetoken is given
		if (null == $deviceToken) {
			throw new \InvalidArgumentException('No device token given.');
		}

		// Check if the devicetoken is a valid hexadecimal string
		if (!ctype_xdigit($deviceToken)) {
			throw new \InvalidArgumentException('Invalid device token given, no hexadecimal: ' . $deviceToken);
		}

		// Check if the length of the devicetoken is correct
		if (64 != strlen($deviceToken)) {
			throw new \InvalidArgumentException('Invalid device token given, incorrect length: ' . $deviceToken . ' (' . strlen($deviceToken) . ')');
		}

		// Set the devicetoken
		$this->deviceToken = $deviceToken;
	}
private function setDeviceToken($deviceToken)
	{
		// Check if a devicetoken is given
		if (null == $deviceToken) {
			throw new \InvalidArgumentException('No device token given.');
		}

		// Check if the devicetoken is a valid hexadecimal string
		if (!ctype_xdigit($deviceToken)) {
			throw new \InvalidArgumentException('Invalid device token given, no hexadecimal: ' . $deviceToken);
		}

		// Check if the length of the devicetoken is correct
		if (64 != strlen($deviceToken)) {
			throw new \InvalidArgumentException('Invalid device token given, incorrect length: ' . $deviceToken . ' (' . strlen($deviceToken) . ')');
		}

		// Set the devicetoken
		$this->deviceToken = $deviceToken;
	}
private function setDeviceToken ( $ deviceToken ) { // Check if a devicetoken is given if ( null == $ deviceToken ) { throw new \ InvalidArgumentException ( 'No device token given.' ) ; } // Check if the devicetoken is a valid hexadecimal string if ( ! ctype_xdigit ( $ deviceToken ) ) { throw new \ InvalidArgumentException ( 'Invalid device token given, no hexadecimal: ' . $ deviceToken ) ; } // Check if the length of the devicetoken is correct if ( 64 != strlen ( $ deviceToken ) ) { throw new \ InvalidArgumentException ( 'Invalid device token given, incorrect length: ' . $ deviceToken . ' (' . strlen ( $ deviceToken ) . ')' ) ; } // Set the devicetoken $ this -> deviceToken = $ deviceToken ; }
Set the receiver of the message

@param string Receiver of this message
@throws \InvalidArgumentException On invalid or missing arguments
Set the receiver of the message