From: Dagfinn Ilmari Mannsåker Date: Thu, 13 Apr 2017 10:13:38 +0000 (+0100) Subject: Whitespace cleanup X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca4f826a37ccb5194b0b5b9b4190b4007d647d9c;p=scpubgit%2FQ-Branch.git Whitespace cleanup --- diff --git a/lib/DBIx/Class/Storage/Debug/PrettyPrint.pm b/lib/DBIx/Class/Storage/Debug/PrettyPrint.pm index 1d5fd2e..251d03d 100644 --- a/lib/DBIx/Class/Storage/Debug/PrettyPrint.pm +++ b/lib/DBIx/Class/Storage/Debug/PrettyPrint.pm @@ -73,7 +73,7 @@ sub print { sub query_start { my ($self, $string, @bind) = @_; - if(defined $self->callback) { + if (defined $self->callback) { $string =~ m/^(\w+)/; $self->callback->($1, "$string: ".join(', ', @bind)."\n"); return; diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 5b2c23f..eb048d0 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -219,7 +219,7 @@ sub insert { $sql = join " ", $self->_sqlcase('insert into'), $table, $sql; if ($options->{returning}) { - my ($s, @b) = $self->_insert_returning ($options); + my ($s, @b) = $self->_insert_returning($options); $sql .= $s; push @bind, @b; } @@ -406,7 +406,7 @@ sub update { if (@rest or not $op =~ /^\-(.+)/); local $self->{_nested_func_lhs} = $k; - my ($sql, @bind) = $self->_where_unary_op ($1, $arg); + my ($sql, @bind) = $self->_where_unary_op($1, $arg); push @set, "$label = $sql"; push @all_bind, @bind; @@ -429,7 +429,7 @@ sub update { } if ($options->{returning}) { - my ($returning_sql, @returning_bind) = $self->_update_returning ($options); + my ($returning_sql, @returning_bind) = $self->_update_returning($options); $sql .= $returning_sql; push @all_bind, @returning_bind; } @@ -481,7 +481,7 @@ sub delete { my $sql = $self->_sqlcase('delete from') . " $table" . $where_sql; if ($options->{returning}) { - my ($returning_sql, @returning_bind) = $self->_delete_returning ($options); + my ($returning_sql, @returning_bind) = $self->_delete_returning($options); $sql .= $returning_sql; push @bind, @returning_bind; } @@ -629,7 +629,7 @@ sub _where_HASHREF { $op =~ s/^not_/NOT /i; $self->_debug("Unary OP(-$op) within hashref, recursing..."); - my ($s, @b) = $self->_where_unary_op ($op, $v); + my ($s, @b) = $self->_where_unary_op($op, $v); # top level vs nested # we assume that handled unary ops will take care of their ()s @@ -668,9 +668,9 @@ sub _where_unary_op { # top level special ops are illegal in general # this includes the -ident/-value ops (dual purpose unary and special) puke "Illegal use of top-level '-$op'" - if ! defined $self->{_nested_func_lhs} and List::Util::first {$op =~ $_->{regex}} @{$self->{special_ops}}; + if ! defined $self->{_nested_func_lhs} and List::Util::first { $op =~ $_->{regex} } @{$self->{special_ops}}; - if (my $op_entry = List::Util::first {$op =~ $_->{regex}} @{$self->{unary_ops}}) { + if (my $op_entry = List::Util::first { $op =~ $_->{regex} } @{$self->{unary_ops}}) { my $handler = $op_entry->{handler}; if (not ref $handler) { @@ -678,7 +678,7 @@ sub _where_unary_op { belch 'Use of [and|or|nest]_N modifiers is deprecated and will be removed in SQLA v2.0. ' . "You probably wanted ...-and => [ -$op => COND1, -$op => COND2 ... ]"; } - return $self->$handler ($op, $rhs); + return $self->$handler($op, $rhs); } elsif (ref $handler eq 'CODE') { return $handler->($self, $op, $rhs); @@ -692,7 +692,7 @@ sub _where_unary_op { $self->_assert_pass_injection_guard($op); - my ($sql, @bind) = $self->_SWITCH_refkind ($rhs, { + my ($sql, @bind) = $self->_SWITCH_refkind($rhs, { SCALAR => sub { puke "Illegal use of top-level '-$op'" unless defined $self->{_nested_func_lhs}; @@ -703,11 +703,11 @@ sub _where_unary_op { ); }, FALLBACK => sub { - $self->_recurse_where ($rhs) + $self->_recurse_where($rhs) }, }); - $sql = sprintf ('%s %s', + $sql = sprintf('%s %s', $self->_sqlcase($op), $sql, ); @@ -724,8 +724,8 @@ sub _where_op_ANDOR { }, HASHREF => sub { - return ( $op =~ /^or/i ) - ? $self->_where_ARRAYREF( [ map { $_ => $v->{$_} } ( sort keys %$v ) ], $op ) + return ($op =~ /^or/i) + ? $self->_where_ARRAYREF([ map { $_ => $v->{$_} } (sort keys %$v) ], $op) : $self->_where_HASHREF($v); }, @@ -771,7 +771,7 @@ sub _where_op_NEST { }, FALLBACK => sub { - $self->_recurse_where ($v); + $self->_recurse_where($v); }, }); @@ -791,7 +791,7 @@ sub _where_op_BOOL { }, FALLBACK => sub { - $self->_recurse_where ($v); + $self->_recurse_where($v); }, }); @@ -834,8 +834,8 @@ sub _where_op_VALUE { } my @bind = - $self->_bindtype ( - ( defined $lhs ? $lhs : $self->{_nested_func_lhs} ), + $self->_bindtype( + (defined $lhs ? $lhs : $self->{_nested_func_lhs}), $rhs, ) ; @@ -855,7 +855,7 @@ sub _where_op_VALUE { sub _where_hashpair_ARRAYREF { my ($self, $k, $v) = @_; - if( @$v ) { + if (@$v) { my @v = @$v; # need copy because of shift below $self->_debug("ARRAY($k) means distribute over elements"); @@ -920,17 +920,17 @@ sub _where_hashpair_HASHREF { my ($sql, @bind); # CASE: col-value logic modifiers - if ( $orig_op =~ /^ \- (and|or) $/xi ) { + if ($orig_op =~ /^ \- (and|or) $/xi) { ($sql, @bind) = $self->_where_hashpair_HASHREF($k, $val, $1); } # CASE: special operators like -in or -between - elsif ( my $special_op = List::Util::first {$op =~ $_->{regex}} @{$self->{special_ops}} ) { + elsif (my $special_op = List::Util::first { $op =~ $_->{regex} } @{$self->{special_ops}}) { my $handler = $special_op->{handler}; if (! $handler) { puke "No handler supplied for special operator $orig_op"; } elsif (not ref $handler) { - ($sql, @bind) = $self->$handler ($k, $op, $val); + ($sql, @bind) = $self->$handler($k, $op, $val); } elsif (ref $handler eq 'CODE') { ($sql, @bind) = $handler->($self, $k, $op, $val); @@ -968,9 +968,9 @@ sub _where_hashpair_HASHREF { }, FALLBACK => sub { # CASE: col => {op/func => $stuff} - ($sql, @bind) = $self->_where_unary_op ($op, $val); + ($sql, @bind) = $self->_where_unary_op($op, $val); - $sql = join (' ', + $sql = join(' ', $self->_convert($self->_quote($k)), $self->{_nested_func_lhs} eq $k ? $sql : "($sql)", # top level vs nested ); @@ -1006,15 +1006,15 @@ sub _where_field_op_ARRAYREF { my @vals = @$vals; #always work on a copy - if(@vals) { + if (@vals) { $self->_debug(sprintf '%s means multiple elements: [ %s ]', $vals, - join (', ', map { defined $_ ? "'$_'" : 'NULL' } @vals ), + join(', ', map { defined $_ ? "'$_'" : 'NULL' } @vals ), ); # see if the first element is an -and/-or op my $logic; - if (defined $vals[0] && $vals[0] =~ /^ - ( AND|OR ) $/ix) { + if (defined $vals[0] && $vals[0] =~ /^ - (AND|OR) $/ix) { $logic = uc $1; shift @vals; } @@ -1027,7 +1027,7 @@ sub _where_field_op_ARRAYREF { and (!$logic or $logic eq 'OR') and - ( $op =~ $self->{inequality_op} or $op =~ $self->{not_like_op} ) + ($op =~ $self->{inequality_op} or $op =~ $self->{not_like_op}) ) { my $o = uc($op); belch "A multi-element arrayref as an argument to the inequality op '$o' " @@ -1077,7 +1077,7 @@ sub _where_hashpair_SCALAR { $self->_sqlcase($self->{cmp}), $self->_convert('?'); my @bind = $self->_bindtype($k, $v); - return ( $sql, @bind); + return ($sql, @bind); } @@ -1163,7 +1163,7 @@ sub _where_field_BETWEEN { my ($func, $arg, @rest) = %$val; puke "Only simple { -func => arg } functions accepted as sub-arguments to BETWEEN" if (@rest or $func !~ /^ \- (.+)/x); - $self->_where_unary_op ($1 => $arg); + $self->_where_unary_op($1 => $arg); }, FALLBACK => sub { puke $invalid_args, @@ -1220,7 +1220,7 @@ sub _where_field_IN { my ($func, $arg, @rest) = %$val; puke "Only simple { -func => arg } functions accepted as sub-arguments to IN" if (@rest or $func !~ /^ \- (.+)/x); - $self->_where_unary_op ($1 => $arg); + $self->_where_unary_op($1 => $arg); }, UNDEF => sub { puke( @@ -1236,10 +1236,10 @@ sub _where_field_IN { } return ( - sprintf ('%s %s ( %s )', + sprintf('%s %s ( %s )', $label, $op, - join (', ', @all_sql) + join(', ', @all_sql) ), $self->_bindtype($k, @all_bind), ); @@ -1251,13 +1251,13 @@ sub _where_field_IN { }, SCALARREF => sub { # literal SQL - my $sql = $self->_open_outer_paren ($$vals); + my $sql = $self->_open_outer_paren($$vals); return ("$label $op ( $sql )"); }, ARRAYREFREF => sub { # literal SQL with bind my ($sql, @bind) = @$$vals; $self->_assert_bindval_matches_bindtype(@bind); - $sql = $self->_open_outer_paren ($sql); + $sql = $self->_open_outer_paren($sql); return ("$label $op ( $sql )", @bind); }, @@ -1279,17 +1279,17 @@ sub _where_field_IN { sub _open_outer_paren { my ($self, $sql) = @_; - while ( my ($inner) = $sql =~ /^ \s* \( (.*) \) \s* $/xs ) { + while (my ($inner) = $sql =~ /^ \s* \( (.*) \) \s* $/xs) { # there are closing parens inside, need the heavy duty machinery # to reevaluate the extraction starting from $sql (full reevaluation) - if ( $inner =~ /\)/ ) { + if ($inner =~ /\)/) { require Text::Balanced; my (undef, $remainder) = do { # idiotic design - writes to $@ but *DOES NOT* throw exceptions local $@; - Text::Balanced::extract_bracketed( $sql, '()', qr/\s*/ ); + Text::Balanced::extract_bracketed($sql, '()', qr/\s*/); }; # the entire expression needs to be a balanced bracketed thing @@ -1312,17 +1312,17 @@ sub _order_by { my ($self, $arg) = @_; my (@sql, @bind); - for my $c ($self->_order_by_chunks ($arg) ) { - $self->_SWITCH_refkind ($c, { + for my $c ($self->_order_by_chunks($arg) ) { + $self->_SWITCH_refkind($c, { SCALAR => sub { push @sql, $c }, ARRAYREF => sub { push @sql, shift @$c; push @bind, @$c }, }); } my $sql = @sql - ? sprintf ('%s %s', + ? sprintf('%s %s', $self->_sqlcase(' order by'), - join (', ', @sql) + join(', ', @sql) ) : '' ; @@ -1336,7 +1336,7 @@ sub _order_by_chunks { return $self->_SWITCH_refkind($arg, { ARRAYREF => sub { - map { $self->_order_by_chunks ($_ ) } @$arg; + map { $self->_order_by_chunks($_ ) } @$arg; }, ARRAYREFREF => sub { @@ -1357,17 +1357,17 @@ sub _order_by_chunks { return () unless $key; - if ( @rest or not $key =~ /^-(desc|asc)/i ) { + if (@rest or not $key =~ /^-(desc|asc)/i) { puke "hash passed to _order_by must have exactly one key (-desc or -asc)"; } my $direction = $1; my @ret; - for my $c ($self->_order_by_chunks ($val)) { + for my $c ($self->_order_by_chunks($val)) { my ($sql, @bind); - $self->_SWITCH_refkind ($c, { + $self->_SWITCH_refkind($c, { SCALAR => sub { $sql = $c; }, @@ -1425,7 +1425,7 @@ sub _quote { my $esc = $_[0]->{escape_char} || $r; # parts containing * are naturally unquoted - return join( $_[0]->{name_sep}||'', map + return join($_[0]->{name_sep}||'', map +( $_ eq '*' ? $_ : do { (my $n = $_) =~ s/(\Q$esc\E|\Q$r\E)/$esc$1/g; $l . $n . $r } ), ( $_[0]->{name_sep} ? split (/\Q$_[0]->{name_sep}\E/, $_[1] ) : $_[1] ) ); @@ -1568,7 +1568,7 @@ sub values { unless ref $data eq 'HASH'; my @all_bind; - foreach my $k ( sort keys %$data ) { + foreach my $k (sort keys %$data) { my $v = $data->{$k}; $self->_SWITCH_refkind($v, { ARRAYREF => sub { @@ -3013,7 +3013,7 @@ the expected return is C<< ($sql, @bind) >>. When supplied with a method name, it is simply called on the L object as: - $self->$method_name ($field, $op, $arg) + $self->$method_name($field, $op, $arg) Where: @@ -3089,7 +3089,7 @@ the expected return is C<< $sql >>. When supplied with a method name, it is simply called on the L object as: - $self->$method_name ($op, $arg) + $self->$method_name($op, $arg) Where: diff --git a/lib/SQL/Abstract/Test.pm b/lib/SQL/Abstract/Test.pm index 5a82064..8eeab4c 100644 --- a/lib/SQL/Abstract/Test.pm +++ b/lib/SQL/Abstract/Test.pm @@ -28,7 +28,7 @@ sub _unpack_arrayrefref { for (1,2) { my $chunk = shift @_; - if ( ref $chunk eq 'REF' and ref $$chunk eq 'ARRAY' ) { + if (ref $chunk eq 'REF' and ref $$chunk eq 'ARRAY') { my ($sql, @bind) = @$$chunk; push @args, ($sql, \@bind); } @@ -112,14 +112,14 @@ sub dumper { } sub diag_where{ - $tb->diag( "Search term:\n" . &dumper ); + $tb->diag("Search term:\n" . &dumper); } sub _sql_differ_diag { my $sql1 = shift || ''; my $sql2 = shift || ''; - $tb->${\( $tb->in_todo ? 'note' : 'diag')} ( + $tb->${\($tb->in_todo ? 'note' : 'diag')} ( "SQL expressions differ\n" ." got: $sql1\n" ."want: $sql2\n" @@ -130,7 +130,7 @@ sub _sql_differ_diag { sub _bind_differ_diag { my ($bind_ref1, $bind_ref2) = @_; - $tb->${\( $tb->in_todo ? 'note' : 'diag')} ( + $tb->${\($tb->in_todo ? 'note' : 'diag')} ( "BIND values differ " . dumper({ got => $bind_ref1, want => $bind_ref2 }) ); } @@ -159,8 +159,8 @@ sub _eq_sql { my ($left, $right) = @_; # one is defined the other not - if ( (defined $left) xor (defined $right) ) { - $sql_differ = sprintf ("[%s] != [%s]\n", map { defined $_ ? $sqlat->unparse ($_) : 'N/A' } ($left, $right) ); + if ((defined $left) xor (defined $right)) { + $sql_differ = sprintf ("[%s] != [%s]\n", map { defined $_ ? $sqlat->unparse($_) : 'N/A' } ($left, $right) ); return 0; } @@ -176,14 +176,14 @@ sub _eq_sql { # one is empty if (@$left == 0 or @$right == 0) { - $sql_differ = sprintf ("left: %s\nright: %s\n", map { @$_ ? $sqlat->unparse ($_) : 'N/A'} ($left, $right) ); + $sql_differ = sprintf ("left: %s\nright: %s\n", map { @$_ ? $sqlat->unparse($_) : 'N/A'} ($left, $right) ); return 0; } # one is a list, the other is an op with a list elsif (ref $left->[0] xor ref $right->[0]) { $sql_differ = sprintf ("[%s] != [%s]\nleft: %s\nright: %s\n", map - { ref $_ ? $sqlat->unparse ($_) : $_ } + { ref $_ ? $sqlat->unparse($_) : $_ } ($left->[0], $right->[0], $left, $right) ); return 0; @@ -196,7 +196,7 @@ sub _eq_sql { if (! $sql_differ or $sql_differ !~ /left\:\s .+ right:\s/xs) { $sql_differ ||= ''; $sql_differ .= "\n" unless $sql_differ =~ /\n\z/; - $sql_differ .= sprintf ("left: %s\nright: %s\n", map { $sqlat->unparse ($_) } ($left, $right) ); + $sql_differ .= sprintf ("left: %s\nright: %s\n", map { $sqlat->unparse($_) } ($left, $right) ); } return 0; } @@ -208,7 +208,7 @@ sub _eq_sql { else { # unroll parenthesis if possible/allowed - unless ( $parenthesis_significant ) { + unless ($parenthesis_significant) { $sqlat->_parenthesis_unroll($_) for $left, $right; } @@ -217,7 +217,7 @@ sub _eq_sql { $sqlat->_strip_asc_from_order_by($_) for $left, $right; } - if ( $left->[0] ne $right->[0] ) { + if ($left->[0] ne $right->[0]) { $sql_differ = sprintf "OP [$left->[0]] != [$right->[0]] in\nleft: %s\nright: %s\n", $sqlat->unparse($left), $sqlat->unparse($right) @@ -237,7 +237,7 @@ sub _eq_sql { # if operators are identical, compare operands else { my $eq = _eq_sql($left->[1], $right->[1]); - $sql_differ ||= sprintf ("left: %s\nright: %s\n", map { $sqlat->unparse ($_) } ($left, $right) ) if not $eq; + $sql_differ ||= sprintf ("left: %s\nright: %s\n", map { $sqlat->unparse($_) } ($left, $right) ) if not $eq; return $eq; } } diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index 79e6ef3..3791fe9 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -340,7 +340,7 @@ sub _recurse_parse { my @left; while (1) { # left-associative parsing - if ( ! @$tokens + if (! @$tokens or ($state == PARSE_IN_PARENS && $tokens->[0] eq ')') or @@ -418,19 +418,19 @@ sub _recurse_parse { } # unary op keywords - elsif ( $token =~ $unary_op_re ) { + elsif ($token =~ $unary_op_re) { my $op = uc $token; # normalize RNO explicitly $op = 'ROW_NUMBER() OVER' if $op =~ /^$rno_re$/; - my @right = $self->_recurse_parse ($tokens, PARSE_RHS); + my @right = $self->_recurse_parse($tokens, PARSE_RHS); push @left, [ $op => \@right ]; } # expression terminator keywords - elsif ( $token =~ $expr_start_re ) { + elsif ($token =~ $expr_start_re) { my $op = uc $token; my @right = $self->_recurse_parse($tokens, PARSE_IN_EXPR); @@ -438,7 +438,7 @@ sub _recurse_parse { } # a '?' - elsif ( $token =~ $placeholder_re) { + elsif ($token =~ $placeholder_re) { push @left, [ -PLACEHOLDER => [ $token ] ]; } @@ -462,7 +462,7 @@ sub _recurse_parse { and $tokens->[0] !~ $all_std_keywords_re and - ! ( @$tokens > 1 and $tokens->[1] eq '(' ) + ! (@$tokens > 1 and $tokens->[1] eq '(') ) { push @lits, [ -LITERAL => [ shift @$tokens ] ]; } diff --git a/t/01generate.t b/t/01generate.t index e6d1c6c..ebe3aad 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -4,7 +4,7 @@ use Test::More; use Test::Warn; use Test::Exception; -use SQL::Abstract::Test import => [qw( is_same_sql_bind diag_where dumper )]; +use SQL::Abstract::Test import => [qw(is_same_sql_bind diag_where dumper)]; use SQL::Abstract; @@ -619,7 +619,7 @@ my @tests = ( ); # check is( not) => undef -for my $op ( qw(not is is_not), 'is not' ) { +for my $op (qw(not is is_not), 'is not') { (my $sop = uc $op) =~ s/_/ /gi; $sop = 'IS NOT' if $sop eq 'NOT'; @@ -638,7 +638,7 @@ for my $op ( qw(not is is_not), 'is not' ) { } # check single-element inequality ops for no warnings -for my $op ( qw(!= <>) ) { +for my $op (qw(!= <>)) { for my $val (undef, 42) { push @tests, { func => 'where', @@ -674,7 +674,7 @@ for my $op (qw(not_like not_rlike), 'not like', 'not rlike', 'is not like','is n } # check all multi-element inequality/not-like ops for warnings -for my $op ( qw(!= <> not_like not_rlike), 'not like', 'not rlike', 'is not like','is not rlike') { +for my $op (qw(!= <> not_like not_rlike), 'not like', 'not rlike', 'is not like','is not rlike') { (my $sop = uc $op) =~ s/_/ /gi; push @tests, { @@ -688,7 +688,7 @@ for my $op ( qw(!= <> not_like not_rlike), 'not like', 'not rlike', 'is not like } # check all like/not-like ops for empty-arrayref warnings -for my $op ( qw(like rlike not_like not_rlike), 'not like', 'not rlike', 'is like', 'is not like', 'is rlike', 'is not rlike') { +for my $op (qw(like rlike not_like not_rlike), 'not like', 'not rlike', 'is like', 'is not like', 'is rlike', 'is not rlike') { (my $sop = uc $op) =~ s/_/ /gi; push @tests, { @@ -840,20 +840,20 @@ for my $t (@tests) { my $cref = sub { my $op = $t->{func}; - ($stmt, @bind) = $maker->$op (@ { $t->{args} } ); + ($stmt, @bind) = $maker->$op(@{ $t->{args} }); }; if (my $e = $t->{throws}) { throws_ok( sub { $cref->() }, $e, - ) || diag dumper ({ args => $t->{args}, result => $stmt }); + ) || diag dumper({ args => $t->{args}, result => $stmt }); } else { warnings_like( sub { $cref->() }, $t->{warns} || [], - ) || diag dumper ({ args => $t->{args}, result => $stmt }); + ) || diag dumper({ args => $t->{args}, result => $stmt }); is_same_sql_bind( $stmt, diff --git a/t/03values.t b/t/03values.t index 9915712..e6bd4de 100644 --- a/t/03values.t +++ b/t/03values.t @@ -74,7 +74,7 @@ for my $record (@data) { is ( $h_stmt, $insert_hash, 'Hash-based insert statement unchanged' ); is_deeply ( \@a_bind, \@h_bind, 'Bind values match after both insert() calls' ); - is_deeply ( [$h_sql->values ($record)] , \@h_bind, 'values() output matches bind values after insert()' ); + is_deeply ( [$h_sql->values($record)] , \@h_bind, 'values() output matches bind values after insert()' ); is ( scalar @h_bind, $numfields, 'Number of fields unchanged' ); } @@ -99,7 +99,7 @@ for my $record (@data) { zzlast => 'zzstuff', }; - my ($stmt, @bind) = $sql->insert ('table', $data); + my ($stmt, @bind) = $sql->insert('table', $data); is_same_sql_bind ( $stmt, @@ -109,7 +109,7 @@ for my $record (@data) { ); is_same_bind ( - [$sql->values ($data)], + [$sql->values($data)], [@bind], 'values() output matches that of initial bind' ) || diag "Corresponding SQL statement: $stmt"; diff --git a/t/04modifiers.t b/t/04modifiers.t index 57519ee..702c299 100644 --- a/t/04modifiers.t +++ b/t/04modifiers.t @@ -382,7 +382,7 @@ for my $case (@and_or_tests) { TODO: { local $TODO = $case->{todo} if $case->{todo}; - my $sql = SQL::Abstract->new ($case->{args} || {}); + my $sql = SQL::Abstract->new($case->{args} || {}); my $where_copy = dclone($case->{where}); @@ -406,7 +406,7 @@ for my $case (@nest_tests) { local $SQL::Abstract::Test::parenthesis_significant = 1; - my $sql = SQL::Abstract->new ($case->{args} || {}); + my $sql = SQL::Abstract->new($case->{args} || {}); lives_ok (sub { my ($stmt, @bind) = $sql->where($case->{where}); is_same_sql_bind( @@ -427,7 +427,7 @@ for my $case (@numbered_mods) { my @w; local $SIG{__WARN__} = sub { push @w, @_ }; - my $sql = SQL::Abstract->new ($case->{args} || {}); + my $sql = SQL::Abstract->new($case->{args} || {}); { my ($old_s, @old_b) = $sql->where($case->{backcompat}); my ($new_s, @new_b) = $sql->where($case->{correct}); diff --git a/t/05in_between.t b/t/05in_between.t index 00fbd21..14c8f4e 100644 --- a/t/05in_between.t +++ b/t/05in_between.t @@ -296,7 +296,7 @@ for my $case (@in_between_tests) { local $SQL::Abstract::Test::parenthesis_significant = $case->{parenthesis_significant}; my $label = $case->{test} || 'in-between test'; - my $sql = SQL::Abstract->new ($case->{args} || {}); + my $sql = SQL::Abstract->new($case->{args} || {}); if (my $e = $case->{throws}) { my $stmt; diff --git a/t/06order_by.t b/t/06order_by.t index 42abaa6..7d1213e 100644 --- a/t/06order_by.t +++ b/t/06order_by.t @@ -107,7 +107,7 @@ my @cases = my $sql = SQL::Abstract->new; my $sqlq = SQL::Abstract->new({quote_char => '`'}); -for my $case( @cases) { +for my $case (@cases) { my ($stat, @bind); ($stat, @bind) = $sql->where(undef, $case->{given}); diff --git a/t/10test.t b/t/10test.t index dc56f23..2e1e559 100644 --- a/t/10test.t +++ b/t/10test.t @@ -972,7 +972,7 @@ my @bind_tests = ( }, ); -for my $test ( @sql_tests ) { +for my $test (@sql_tests) { # this does not work on 5.8.8 and earlier :( #local @{*SQL::Abstract::Test::}{keys %{$test->{opts}}} = map { \$_ } values %{$test->{opts}} diff --git a/t/21op_ident.t b/t/21op_ident.t index 29ff46f..a0e566b 100644 --- a/t/21op_ident.t +++ b/t/21op_ident.t @@ -17,7 +17,7 @@ for my $q ('', '"') { $sql_maker->where({ foo => { -ident => undef } }) } qr/-ident requires a single plain scalar argument/; - my ($sql, @bind) = $sql_maker->select ('artist', '*', { 'artist.name' => { -ident => 'artist.pseudonym' } } ); + my ($sql, @bind) = $sql_maker->select('artist', '*', { 'artist.name' => { -ident => 'artist.pseudonym' } } ); is_same_sql_bind ( $sql, \@bind, @@ -28,7 +28,7 @@ for my $q ('', '"') { [], ); - ($sql, @bind) = $sql_maker->update ('artist', + ($sql, @bind) = $sql_maker->update('artist', { 'artist.name' => { -ident => 'artist.pseudonym' } }, { 'artist.name' => { '!=' => { -ident => 'artist.pseudonym' } } }, ); diff --git a/t/22op_value.t b/t/22op_value.t index 2992ff6..8ccc52b 100644 --- a/t/22op_value.t +++ b/t/22op_value.t @@ -14,7 +14,7 @@ for my $col_btype (0,1) { $col_btype ? (bindtype => 'columns') : (), ); - my ($sql, @bind) = $sql_maker->select ('artist', '*', { arr1 => { -value => [1,2] }, arr2 => { '>', { -value => [3,4] } }, field => [5,6] } ); + my ($sql, @bind) = $sql_maker->select('artist', '*', { arr1 => { -value => [1,2] }, arr2 => { '>', { -value => [3,4] } }, field => [5,6] } ); is_same_sql_bind ( $sql, @@ -44,7 +44,7 @@ for my $col_btype (0,1) { { local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /Supplying an undefined argument to '(?:NOT )?LIKE'/ }; - ($sql, @bind) = $sql_maker->where ({ + ($sql, @bind) = $sql_maker->where({ c1 => undef, c2 => { -value => undef }, c3 => { '=' => { -value => undef } },