original_string: public function create_rule( array $rules, $logical = 'and' ) {
  		if ( empty( $rules ) ) {
  			return null;
  		}
  
  		if ( static::is_proposition( $rules ) ) {
  			$rules = [ $rules ];
  		}
  
  		if ( ! $props = $this->build_propositions( $rules ) ) {
  			return null;
  		}
  
  		// Correct the "or" logical in case we have only one prop.
  		if ( static::LOGICAL_OR === $logical && count( $props ) === 1 ) {
  			$logical = static::LOGICAL_AND;
  		}
  
  		$logical = static::$logicals[ $logical ];
  
  		return new Rule( new $logical( $props ) );
  	}
code: public function create_rule( array $rules, $logical = 'and' ) {
  		if ( empty( $rules ) ) {
  			return null;
  		}
  
  		if ( static::is_proposition( $rules ) ) {
  			$rules = [ $rules ];
  		}
  
  		if ( ! $props = $this->build_propositions( $rules ) ) {
  			return null;
  		}
  
  		// Correct the "or" logical in case we have only one prop.
  		if ( static::LOGICAL_OR === $logical && count( $props ) === 1 ) {
  			$logical = static::LOGICAL_AND;
  		}
  
  		$logical = static::$logicals[ $logical ];
  
  		return new Rule( new $logical( $props ) );
  	}
code_tokens: public function create_rule ( array $ rules , $ logical = 'and' ) { if ( empty ( $ rules ) ) { return null ; } if ( static :: is_proposition ( $ rules ) ) { $ rules = [ $ rules ] ; } if ( ! $ props = $ this -> build_propositions ( $ rules ) ) { return null ; } // Correct the "or" logical in case we have only one prop. if ( static :: LOGICAL_OR === $ logical && count ( $ props ) === 1 ) { $ logical = static :: LOGICAL_AND ; } $ logical = static :: $ logicals [ $ logical ] ; return new Rule ( new $ logical ( $ props ) ) ; }
docstring: Create new rule based on an array of rules.
  
  @param  array  $rules
  @param  string $logical
  @return \WPLibs\Rules\Rule|null
docstring_tokens: Create new rule based on an array of rules .