Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9c1048cc

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 9c1048cc631d86456cf684d7c8db4d66e8f162c3
  • Vorgänger 0bf192cd
  • Nachfolger 5324155e

Kosmetik: Einrückung nach Entfernung umliegender "if ()"

Unterschiede anzeigen:

SL/LXDebug.pm
152 152
sub dump {
153 153
  my ($self, $level, $name, $variable, %options) = @_;
154 154

  
155
    my $password;
156
    if ($variable && ('Form' eq ref $variable) && defined $variable->{password}) {
157
      $password             = $variable->{password};
158
      $variable->{password} = 'X' x 8;
159
    }
160

  
161
    my $dumper = Data::Dumper->new([$variable]);
162
    $dumper->Sortkeys(1);
163
    $dumper->Indent(2);
164
    $dumper->$_($options{$_}) for keys %options;
165
    my $output = $dumper->Dump();
166
    $self->message($level, "dumping ${name}:\n" . $output);
167

  
168
    $variable->{password} = $password if (defined $password);
169

  
170
    # Data::Dumper does not reset the iterator belonging to this hash
171
    # if 'Sortkeys' is true. Therefore clear the iterator manually.
172
    # See "perldoc -f each".
173
    if ($variable && (('HASH' eq ref $variable) || ('Form' eq ref $variable))) {
174
      keys %{ $variable };
175
    }
176

  
177
    return $output;
155
  my $password;
156
  if ($variable && ('Form' eq ref $variable) && defined $variable->{password}) {
157
    $password             = $variable->{password};
158
    $variable->{password} = 'X' x 8;
159
  }
160

  
161
  my $dumper = Data::Dumper->new([$variable]);
162
  $dumper->Sortkeys(1);
163
  $dumper->Indent(2);
164
  $dumper->$_($options{$_}) for keys %options;
165
  my $output = $dumper->Dump();
166
  $self->message($level, "dumping ${name}:\n" . $output);
167

  
168
  $variable->{password} = $password if (defined $password);
169

  
170
  # Data::Dumper does not reset the iterator belonging to this hash
171
  # if 'Sortkeys' is true. Therefore clear the iterator manually.
172
  # See "perldoc -f each".
173
  if ($variable && (('HASH' eq ref $variable) || ('Form' eq ref $variable))) {
174
    keys %{ $variable };
175
  }
176

  
177
  return $output;
178 178
}
179 179

  
180 180
sub dump_yaml {

Auch abrufbar als: Unified diff