Checks auto reset mode

@param int|array $mode

@return bool
189484
public function inMode( $mode )
	{
		if ( !is_array($mode) )
		{
			$mode = func_get_args();
		}

		return in_array( $this->reset_mode, $mode );
	}
417023
private function chmod(string $path, int $mode): bool
    {
        if (!@chmod($path, $mode)) {
            $message = 'Could not change file mode.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return true;
    }
481214
public function count($mode = COUNT_NORMAL)
    {
        if($mode == COUNT_RECURSIVE)
        {
            $count = 0;
            $data  = $this->__options;
            foreach ($data as $key => $value)
            {
                if(is_array($value) || $value instanceof KObjectConfig)
                {
                    if ($value instanceof KObjectConfigInterface) {
                        $count += $value->count($mode);
                    } else {
                        $count += count($value);
                    }
                }
            }
        }
        else $count = count($this->__options);

        return $count;
    }
991062
public static function setMode($mode = '')
    {
        static::$MODE = 0;
        if (empty($mode)) {
            return;
        }
        $mode = explode(',', $mode);
        foreach ($mode as $m) {
            static::$MODE |= constant('static::SQL_MODE_' . $m);
        }
    }
622734
static public function checkMode(int $mode) {
        if (!in_array($mode, array(self::NONE, self::READ, self::WRITE))) {
            throw new AclException('wrong mode');
        }
    }
480464
public static function setDefaultMode(int $mode) : void
    {
        if (in_array($mode, [self::MODE_REGEX, self::MODE_STRING])) {
            self::$mode = $mode;
            return;
        }

        // Unknown mode
        throw new \UnexpectedValueException('Invalid route mode');
    }
1276995
public function open($mode)
    {
        if ($this->handle) $this->close();
        $this->handle = $this->fs->fopen($this->name, $mode);
        return true;
    }
753998
public static function setCacheMode($mode = 1)
    {
        $instance = self::getInstance();
        if ($mode == 1) {
            $instance->_options['mode'] = 1;
        } else {
            $instance->_options['mode'] = 2;
        }

        return $instance;
    }
1170278
public function clear_cache($item, $mode): self
  {
    $cache_name = $this->_cache_name($item, $mode);
    if ( $this->cache_has($cache_name) ){
      $this->cache_delete($cache_name);
    }
    return $this;
  }
719029
public static function getMode(string $mode): array
    {
        $options = [
            "shuffle"   =>  false,
            "repeat"    =>  false,
        ];

        if (in_array($mode, ["REPEAT_ALL", "SHUFFLE"])) {
            $options["repeat"] = true;
        }
        if (in_array($mode, ["SHUFFLE_NOREPEAT", "SHUFFLE"])) {
            $options["shuffle"] = true;
        }

        return $options;
    }
313074
static public function isValidSelectionMode($mode, $throw = false)
    {
        $valid = in_array($mode, [
            static::SELECTION_SINGLE,
            static::SELECTION_MULTIPLE,
        ], true);

        if (!$valid && $throw) {
            throw new Exception\InvalidArgumentException("Invalid selection mode '{$mode}'.");
        }

        return $valid;
    }
725608
public function setBlocking(int $mode): bool
	{
		if ($this->connected() === false)
		{
			throw new \Exception('Not connected');
		}

		return stream_set_blocking($this->connection, $mode);
	}
744449
public function createDir($mode = 0777)
    {
        return is_dir($this->absoluteFileName) || mkdir($this->absoluteFileName, $mode, true);
    }
568451
public function setMode($mode) {
		$editMode = ($mode=="on")?true:false;
		//SessionUtils::setMessageEditionMode($editMode);
		if ($editMode) {
			$_SESSION["FINE_MESSAGE_EDITION_MODE"] = true;
			$this->isMessageEditionMode = true;
		} else {
			unset($_SESSION["FINE_MESSAGE_EDITION_MODE"]);
		}

		$this->content->addFile('../utils.i18n.fine/src/views/enableDisableEdition.php', $this);
		$this->template->toHtml();
	}
251867
public function clear_cache( $mode = 'all' ) {
		$mode = $mode ? : 'all';
		$cleared = Command::clear_cache( $mode );
		if ( $cleared ) {
			\WP_CLI::success("Cleared {$mode} cached contents");
		} else {
			\WP_CLI::warning("Failed to clear {$mode} cached contents");
		}
	}
399601
public function has($key, $mode = self::HAS_EXISTS)
    {
        $key = $this->normalizeKey($key);

        switch ($mode) {
            case self::HAS_EXISTS:
                return array_key_exists($key, $this->data);

            case self::HAS_ISSET:
                return isset($this->data[$key]);

            case self::HAS_NONEMPTY:
                return !empty($this->data[$key]);

            case self::HAS_LENGTH:
                return isset($this->data[$key]) && strlen($this->data[$key]);

            default:
                throw new InvalidArgumentException("Mode {$mode} not supported");
        }
    }
46493
private function createDirectory(string $directory, int $mode): bool {
    $auth = false;
    if (is_dir($directory)) {
      $auth = true;
    } else {
      @mkdir($directory, $mode, true);
    }
    @chmod($directory, $mode);
    return is_dir($directory);
  }