feat: perltidy

This commit is contained in:
sergiotarxz 2020-08-15 18:45:57 +02:00
parent c3134f71cf
commit e535987d5b

View File

@ -2,6 +2,7 @@ use strict;
use warnings;
package Kernel::Config {
sub new {
my $class = shift;
my %params = @_;
@ -27,8 +28,8 @@ package Kernel::Config {
my %params = @_;
my $file = $params{file};
open my $fh, '<', $file or die "Cannot open $file for read";
my $lines = [ <$fh> ];
$lines = [ grep { !(/#/ || /^\s*$/) } @$lines];
my $lines = [<$fh>];
$lines = [ grep { !( /#/ || /^\s*$/ ) } @$lines ];
my $hash_config = $self->_parseConfigLinesToHash( lines => $lines );
$self->{hash_config} = $hash_config;
}
@ -63,7 +64,7 @@ package Kernel::Config {
)
} @$keys
};
$self->hashConfig( $new_hash_config );
$self->hashConfig($new_hash_config);
$self;
}
@ -74,9 +75,9 @@ package Kernel::Config {
my $hash_config = $params{hash_config};
my $remote_hash_config = $params{remote_hash_config};
if ( defined $hash_config->{$key} && $hash_config->{$key} !~ /^\s*$/ ) {
return ( $key => $hash_config->{$key} )
return ( $key => $hash_config->{$key} );
} else {
return ( $key => ($remote_hash_config->{$key} // ""));
return ( $key => ( $remote_hash_config->{$key} // "" ) );
}
}
@ -88,4 +89,5 @@ package Kernel::Config {
return $plain_config;
}
}
print Kernel::Config->new( file => $ARGV[0] )->merge( kernel_config => Kernel::Config->new( file => $ARGV[1] ))->plainConfig;
print Kernel::Config->new( file => $ARGV[0] )->merge( kernel_config => Kernel::Config->new( file => $ARGV[1] ) )
->plainConfig;