original_string: public function check($user, $request, array $options = []) {
  		$defaults = ['rules' => $this->_defaults, 'allowAny' => $this->_allowAny];
  		$options += $defaults;
  
  		if (empty($options['rules'])) {
  			throw new RuntimeException("Missing `'rules'` option.");
  		}
  
  		$rules = (array) $options['rules'];
  		$this->_error = [];
  		$params = array_diff_key($options, $defaults);
  
  		if (!isset($user) && is_callable($this->_user)) {
  			$user = $this->_user->__invoke();
  		}
  
  		foreach ($rules as $name => $rule) {
  
  			$result = $this->_check($user, $request, $name, $rule, $params);
  
  			if ($result === false && !$options['allowAny']) {
  				return false;
  			}
  			if ($result === true && $options['allowAny']) {
  				return true;
  			}
  		}
  		return !$options['allowAny'];
  	}
code: public function check($user, $request, array $options = []) {
  		$defaults = ['rules' => $this->_defaults, 'allowAny' => $this->_allowAny];
  		$options += $defaults;
  
  		if (empty($options['rules'])) {
  			throw new RuntimeException("Missing `'rules'` option.");
  		}
  
  		$rules = (array) $options['rules'];
  		$this->_error = [];
  		$params = array_diff_key($options, $defaults);
  
  		if (!isset($user) && is_callable($this->_user)) {
  			$user = $this->_user->__invoke();
  		}
  
  		foreach ($rules as $name => $rule) {
  
  			$result = $this->_check($user, $request, $name, $rule, $params);
  
  			if ($result === false && !$options['allowAny']) {
  				return false;
  			}
  			if ($result === true && $options['allowAny']) {
  				return true;
  			}
  		}
  		return !$options['allowAny'];
  	}
code_tokens: public function check ( $ user , $ request , array $ options = [ ] ) { $ defaults = [ 'rules' => $ this -> _defaults , 'allowAny' => $ this -> _allowAny ] ; $ options += $ defaults ; if ( empty ( $ options [ 'rules' ] ) ) { throw new RuntimeException ( "Missing `'rules'` option." ) ; } $ rules = ( array ) $ options [ 'rules' ] ; $ this -> _error = [ ] ; $ params = array_diff_key ( $ options , $ defaults ) ; if ( ! isset ( $ user ) && is_callable ( $ this -> _user ) ) { $ user = $ this -> _user -> __invoke ( ) ; } foreach ( $ rules as $ name => $ rule ) { $ result = $ this -> _check ( $ user , $ request , $ name , $ rule , $ params ) ; if ( $ result === false && ! $ options [ 'allowAny' ] ) { return false ; } if ( $ result === true && $ options [ 'allowAny' ] ) { return true ; } } return ! $ options [ 'allowAny' ] ; }
docstring: The check method
  
  @param mixed $user The user data array that holds all necessary information about
  the user requesting access. If set to `null`, the default `Rules::_user()`
  will be used.
  @param object $request The requested object.
  @param array $options Options array to pass to the rule closure.
  @return boolean `true` if access is ok, `false` otherwise.
docstring_tokens: The check method