Open sirbrillig opened 6 years ago
This is what the sniff should detect:
public function get_for_user( $user_id, $table ) {
$exchanges = get_results( prepare( "SELECT * FROM {$table} " .
'WHERE user_id = %d', $user_id ) );
return array_map( [ $this, 'convert_data_types' ], $exchanges );
}
And it should replace it with this:
public function get_for_user( $user_id, $table ) {
$exchanges = get_results( prepare( "SELECT * FROM {$table} " .
'WHERE user_id = %d', $user_id ) );
return array_map( [ $this, 'convert_data_types' ], $exchanges );
}
PEAR.Functions.FunctionCallSignature.Indent is good at finding incorrect indentation, but since auto-fix must be per-sniff and not per error, the current auto-fix requires running all of PEAR.Functions.FunctionCallSignature and there's some awkward formatting in that sniff.
Let's duplicate it and do a better job of fixing the indentation.