@param int $flag

@throws \InvalidArgumentException
439728
public function setFlag(int $flag): void
    {
        if ($flag < 0 || $flag > static::MAX_FLAG) {
            throw new \InvalidArgumentException('Flag must be an unsigned integer on the range [0-255]');
        }

        $this->flag = $flag;
    }
572133
public function setRank($rank)
    {
        if (! is_int($rank)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be an int value. Valued passed is of type ' . gettype($rank));
        }
        
        $this->rank = $rank;
    }
345907
public function where($flag, $value = null)
    {
        if (!in_array(strtolower($flag), static::$searchCriteria)) {
            throw new InvalidArgumentException("Invalid where criteria '{$flag}'");
        }

        $this->where[$flag] = $value;
        return $this;
    }
670804
public function toggle($flag, $name)
    {
        switch ($flag) {
            case 'on':
                $onoff = true;
                break;
            case 'off':
                $onoff = false;
                break;
            default:
                throw new \InvalidArgumentException("Flag must be 'on' or 'off'");
        }

        switch ($name) {
            case 'debug':
                $this->debug = $onoff;
                break;
            case 'info':
                $this->info = $onoff;
                break;
            case 'notice':
                $this->notice = $onoff;
                break;
            case 'warn':
                $this->warn = $onoff;
                break;
            case 'error':
                $this->error = $onoff;
                break;
            case 'critical':
                $this->critical = $onoff;
                break;
            case 'alert':
                $this->alert = $onoff;
                break;
            case 'emergency':
                $this->emergency = $onoff;
                break;
            default:
                throw new \InvalidArgumentException("Name must be on (debug|info|notice|warn|error|critical|alert|emergency)");
        }
    }
1022711
public function renderExceptions($flag = null)
    {
        if (null !== $flag)
        {
            $this->_renderExceptions = $flag ? true : false;
        }

        return $this->_renderExceptions;
    }
902551
public function extractFlags($flag)
    {
        $flags = [];

        for ($i = 0; $i <= 26; $i++) {
            if ((int) $flag & (1 << $i)) {
                array_push($flags, 1 << $i);
            }
        }

        return $flags;
    }
395588
public function hasFlag($flag) : bool
    {
        if (is_array($flag)) {
            return $this->hasFlags($flag);
        }

        return in_array($flag, $this->getUserFlags());
    }
1135879
private function validateBitTable(int $flags, string $message)
    {
        if (! ($flags && !($flags & ($flags-1)))) throw new \Exception($message);
    }
45627
public function setEnd($position)
    {
        if (! is_int($position)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be of type integer. Argument type is ' . gettype($position));
        }

        $this->end = $position;
    }
1138776
protected function modifiesPart(bool $flag): void
  {
    if ($this->spType!=='SELECT')
    {
      $this->codeStore->append('modifies sql data');
    }
    else
    {
      $this->codeStore->append('reads sql data');
    }

    switch ($this->spType)
    {
      case 'UPDATE':
      case 'DELETE':
        $this->codeStore->append('-- type: none');
        break;

      case 'SELECT':
        $this->codeStore->append('-- type: row1');
        break;

      case 'INSERT':
        if ($flag)
        {
          $this->codeStore->append('-- type: singleton1');
        }
        else
        {
          $this->codeStore->append('-- type: none');
        }
        break;

      default:
        throw new FallenException("Unknown stored routine type '%s'", $this->spType);
    }
  }
1102521
public function isForceInitialization($flag = null)
    {
        if ($flag === null) {
            return $this->forceInit;
        }
        $this->forceInit = $flag;
        return $this;
    }
773853
public static function fromInt($int){
		
		if(!\is_int($int)){
			throw new \InvalidArgumentException('$int must be an integer');
		}
		
		$flags = new static();
		
		foreach(static::getEnumValues() as $const){			
			if(($int & $const) === $const){
				$flags->addFlag($const);
			}
		}

		return $flags;
		
	}
74247
public function setDebug($flag = true)
    {
        $this->debug = $this->getSession()->debug = (bool) $flag;
        if (true == $this->debug) {
            if (isset($this->options['debugOptions'])
                && is_array($this->options['debugOptions'])) {
                    $this->initializeOptions($this->options['debugOptions']);
                }
        } else {
            $this->initializeOptions($this->options);
        }
    }
149594
public function isGranted($flag)
    {
        if (is_string($flag) && defined('static::' . strtoupper($flag))) {
            $flag = constant('static::' . strtoupper($flag));
        }

        return $this->mask & $flag;
    }
878952
public function withoutFlag($flag): void
    {
        $flag = $this->parseFlag($flag);

        $this->flags = $this->flags & ~$flag;
    }
23185
public function grant($flag)
    {
        if (is_string($flag) && defined('static::' . strtoupper($flag))) {
            $flag = constant('static::' . strtoupper($flag));
        }

        $this->mask |= $flag;

        return $this;
    }
260922
public function setAmbiguityIdentity($flag)
    {
        if (is_integer($flag)) {
            $this->ambiguityIdentity = (1 === $flag ? true : false);
        } elseif (is_bool($flag)) {
            $this->ambiguityIdentity = $flag;
        }
        return $this;
    }