public function setPolicy(string $policy)
    {
        // allow (all is deny, allow part) | deny (all is allow, deny part) | none (all is allow, ignore part)
        if (!in_array($policy, [self::POLICY_NONE, self::POLICY_ALLOW, self::POLICY_DENY])) {
            throw new Exception('Unsupported policy type: ' . $policy);
        }
        $this->policy = $policy;

        $this->init();   // init data after set policy (in extension)!
    }
public function setPolicy(string $policy)
    {
        // allow (all is deny, allow part) | deny (all is allow, deny part) | none (all is allow, ignore part)
        if (!in_array($policy, [self::POLICY_NONE, self::POLICY_ALLOW, self::POLICY_DENY])) {
            throw new Exception('Unsupported policy type: ' . $policy);
        }
        $this->policy = $policy;

        $this->init();   // init data after set policy (in extension)!
    }
public function setPolicy ( string $ policy ) { // allow (all is deny, allow part) | deny (all is allow, deny part) | none (all is allow, ignore part) if ( ! in_array ( $ policy , [ self :: POLICY_NONE , self :: POLICY_ALLOW , self :: POLICY_DENY ] ) ) { throw new Exception ( 'Unsupported policy type: ' . $ policy ) ; } $ this -> policy = $ policy ; $ this -> init ( ) ; // init data after set policy (in extension)! }
Set policy.

@param string $policy
@throws Exception
Set policy .