private function assertValidWill()
    {
        if ($this->hasWill()) {
            $this->assertValidQosLevel($this->getWillQosLevel(), true);
        } else {
            if ($this->getWillQosLevel() > 0) {
                $this->throwException(
                    sprintf(
                        'Expected a will quality of service level of zero but got %d.',
                        $this->getWillQosLevel()
                    ),
                    true
                );
            }

            if ($this->isWillRetained()) {
                $this->throwException('There is not will but the will retain flag is set.', true);
            }
        }
    }
private function assertValidWill()
    {
        if ($this->hasWill()) {
            $this->assertValidQosLevel($this->getWillQosLevel(), true);
        } else {
            if ($this->getWillQosLevel() > 0) {
                $this->throwException(
                    sprintf(
                        'Expected a will quality of service level of zero but got %d.',
                        $this->getWillQosLevel()
                    ),
                    true
                );
            }

            if ($this->isWillRetained()) {
                $this->throwException('There is not will but the will retain flag is set.', true);
            }
        }
    }
private function assertValidWill ( ) { if ( $ this -> hasWill ( ) ) { $ this -> assertValidQosLevel ( $ this -> getWillQosLevel ( ) , true ) ; } else { if ( $ this -> getWillQosLevel ( ) > 0 ) { $ this -> throwException ( sprintf ( 'Expected a will quality of service level of zero but got %d.' , $ this -> getWillQosLevel ( ) ) , true ) ; } if ( $ this -> isWillRetained ( ) ) { $ this -> throwException ( 'There is not will but the will retain flag is set.' , true ) ; } } }
Asserts that all will flags and quality of service are correct.

@throws MalformedPacketException
Asserts that all will flags and quality of service are correct .