I hate you all.
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / Statistics.pm
index 60b59cd..3b9d7d6 100644 (file)
@@ -30,9 +30,10 @@ Returns a new L<DBIx::Class::Storage::Statistics> object.
 
 =cut
 sub new {
-    my $self = bless({}, ref($_[0]) || $_[0]);
+  my $self = {};
+  bless $self, (ref($_[0]) || $_[0]);
 
-    return $self;
+  return $self;
 }
 
 =head2 debugfh
@@ -48,9 +49,9 @@ Called when a transaction begins.
 
 =cut
 sub txn_begin {
-    my $self = shift();
+  my $self = shift;
 
-    $self->debugfh->print("BEGIN WORK\n");
+  $self->debugfh->print("BEGIN WORK\n");
 }
 
 =head2 txn_rollback
@@ -59,9 +60,9 @@ Called when a transaction is rolled back.
 
 =cut
 sub txn_rollback {
-    my $self = shift();
+  my $self = shift;
 
-    $self->debugfh->print("ROLLBACK\n");
+  $self->debugfh->print("ROLLBACK\n");
 }
 
 =head2 txn_commit
@@ -70,9 +71,9 @@ Called when a transaction is committed.
 
 =cut
 sub txn_commit {
-    my $self = shift();
+  my $self = shift;
 
-    $self->debugfh->print("COMMIT\n");
+  $self->debugfh->print("COMMIT\n");
 }
 
 =head2 query_start
@@ -82,16 +83,17 @@ executed and subsequent arguments are the parameters used for the query.
 
 =cut
 sub query_start {
-    my $self = shift();
-    my $string = shift();
+  my ($self, $string, @bind) = @_;
 
-    if(defined($self->callback())) {
-      $string =~ m/^(\w+)/;
-      $self->callback()->($1, $string);
-      return;
-    }
+  my $message = "$string: ".join(', ', @bind)."\n";
 
-    $self->debugfh->print("$string: " . join(', ', @_) . "\n");
+  if(defined($self->callback)) {
+    $string =~ m/^(\w+)/;
+    $self->callback->($1, $message);
+    return;
+  }
+
+  $self->debugfh->print($message);
 }
 
 =head2 query_end
@@ -100,8 +102,7 @@ Called when a query finishes executing.  Has the same arguments as query_start.
 
 =cut
 sub query_end {
-    my $self = shift();
-    my $string = shift();
+  my ($self, $string) = @_;
 }
 
 1;