original_string: protected function mapRules($rules) : Collection
  	{
  		return Collection::make($rules)
  			->only($this->allowed)
  			->flatMap(function ($item, $key) {
  				if ($key == 'required') {
  					$rule[] = $item ? 'required' : '';
  				} else {
  					$rule[] = $key . ':' . $item;
  				}
  				return $rule;
  			});
  	}
code: protected function mapRules($rules) : Collection
  	{
  		return Collection::make($rules)
  			->only($this->allowed)
  			->flatMap(function ($item, $key) {
  				if ($key == 'required') {
  					$rule[] = $item ? 'required' : '';
  				} else {
  					$rule[] = $key . ':' . $item;
  				}
  				return $rule;
  			});
  	}
code_tokens: protected function mapRules ( $ rules ) : Collection { return Collection :: make ( $ rules ) -> only ( $ this -> allowed ) -> flatMap ( function ( $ item , $ key ) { if ( $ key == 'required' ) { $ rule [ ] = $ item ? 'required' : '' ; } else { $ rule [ ] = $ key . ':' . $ item ; } return $ rule ; } ) ; }
docstring: Returns a collection with the given rules.
  
  @param  array $rules
  
  @return Collection
docstring_tokens: Returns a collection with the given rules .