public function setProtectionPolicy($protectionPolicy)
    {
        if ($protectionPolicy !== GuardInterface::POLICY_ALLOW && $protectionPolicy !== GuardInterface::POLICY_DENY) {
            throw new Exception\RuntimeException(sprintf(
                'An invalid protection policy was set. Can only be "deny" or "allow", "%s" given',
                $protectionPolicy
            ));
        }

        $this->protectionPolicy = (string) $protectionPolicy;
    }
public function setProtectionPolicy($protectionPolicy)
    {
        if ($protectionPolicy !== GuardInterface::POLICY_ALLOW && $protectionPolicy !== GuardInterface::POLICY_DENY) {
            throw new Exception\RuntimeException(sprintf(
                'An invalid protection policy was set. Can only be "deny" or "allow", "%s" given',
                $protectionPolicy
            ));
        }

        $this->protectionPolicy = (string) $protectionPolicy;
    }
public function setProtectionPolicy ( $ protectionPolicy ) { if ( $ protectionPolicy !== GuardInterface :: POLICY_ALLOW && $ protectionPolicy !== GuardInterface :: POLICY_DENY ) { throw new Exception \ RuntimeException ( sprintf ( 'An invalid protection policy was set. Can only be "deny" or "allow", "%s" given' , $ protectionPolicy ) ) ; } $ this -> protectionPolicy = ( string ) $ protectionPolicy ; }
Set the protection policy for guards

@param  string $protectionPolicy
@throws Exception\RuntimeException
@return void
Set the protection policy for guards