Skip to content

Commit

Permalink
Issue #760: accept some of the reformatting done by Perl::Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Feb 20, 2021
1 parent cacfb8a commit bba8042
Show file tree
Hide file tree
Showing 35 changed files with 374 additions and 183 deletions.
2 changes: 0 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,5 +612,3 @@

# OTOBO 10.0.0 beta1 2020-01-30
- First official OTOBO release, yippie!


4 changes: 2 additions & 2 deletions Kernel/Autoload/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use Kernel::System::Valid; ## no critic (Modules::RequireExplicitPackage)
use Kernel::System::Valid; ## no critic (Modules::RequireExplicitPackage)

package Kernel::System::Valid; ## no critic (Modules::RequireFilenameMatchesPackage)
package Kernel::System::Valid; ## no critic (Modules::RequireFilenameMatchesPackage)

use strict;
use warnings;
Expand Down
6 changes: 3 additions & 3 deletions Kernel/Autoload/Znuny4OTOBOPasswordPolicy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

use Kernel::Output::HTML::Layout; ## no critic (Modules::RequireExplicitPackage)
use Kernel::Output::HTML::Layout; ## no critic (Modules::RequireExplicitPackage)

package Kernel::Output::HTML::Layout; ## no critic (Modules::RequireFilenameMatchesPackage)
package Kernel::Output::HTML::Layout; ## no critic (Modules::RequireFilenameMatchesPackage)

use strict;
use warnings;
Expand All @@ -29,7 +29,7 @@ our @ObjectDependencies = (

# disable redefine warnings in this scope
{
no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)
no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)

# backup original Redirect()
my $Redirect = \&Kernel::Output::HTML::Layout::Redirect;
Expand Down
3 changes: 1 addition & 2 deletions Kernel/GenericInterface/ErrorHandling/RequestRetry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ sub Run {
# Calculate interval for next execution.
my $RetryInterval;
if ( IsStringWithData( $Param{PastExecutionData}->{RetryInterval} ) ) {
$RetryInterval
= int( $Param{PastExecutionData}->{RetryInterval} * $Param{ModuleConfig}->{RetryIntervalFactor} );
$RetryInterval = int( $Param{PastExecutionData}->{RetryInterval} * $Param{ModuleConfig}->{RetryIntervalFactor} );
if (
IsStringWithData( $Param{ModuleConfig}->{RetryIntervalMax} )
&& $RetryInterval > $Param{ModuleConfig}->{RetryIntervalMax}
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Language.pm
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ sub Translate {

# Expecting that the replacements do not contain a '%'.
# That the substitutions stop at the first undefined replacement can be considered a bug.
for my $Replacement ( @Replacements ) {
for my $Replacement (@Replacements) {
return $Text unless defined $Replacement;

$Text =~ s/\%(?:s|d)/$Replacement/;
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/AgentTicketActionCommon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ sub Run {
# Do not validate only if object type is Article and CreateArticle value is not defined, or Field is invisible.
if (
!( $DynamicFieldConfig->{ObjectType} eq 'Article' && !$GetParam{CreateArticle} )
&& $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} }
&& $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} }
)
{

Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/AgentTicketEmail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ sub Run {
my $ValidationResult;

# do not validate on invisible fields
if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) {
if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) {

$ValidationResult = $DynamicFieldBackendObject->EditFieldValueValidate(
DynamicFieldConfig => $DynamicFieldConfig,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/AgentTicketPhone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ sub Run {
my $ValidationResult;

# do not validate on invisible fields
if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) {
if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) {

$ValidationResult = $DynamicFieldBackendObject->EditFieldValueValidate(
DynamicFieldConfig => $DynamicFieldConfig,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/CustomerTicketMessage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ sub Run {
my $ValidationResult;

# do not validate on insisible fields
if ( $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) {
if ( $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) {

$ValidationResult = $BackendObject->EditFieldValueValidate(
DynamicFieldConfig => $DynamicFieldConfig,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/CustomerTicketZoom.pm
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ sub Run {
my $ValidationResult;

# do not validate invisible fields
if ( $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) {
if ( $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) {
$ValidationResult = $BackendObject->EditFieldValueValidate(
DynamicFieldConfig => $DynamicFieldConfig,
PossibleValuesFilter => $PossibleValuesFilter,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/Installer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ sub Run {

# Only if we have mod_perl we have to restart.
if ( exists $ENV{MOD_PERL} ) {
eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval)
eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval)
if ( defined $mod_perl::VERSION ) {
$Webserver = 'Apache2 + mod_perl';
if ( -f '/etc/SuSE-release' ) {
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/MigrateFromOTRS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ sub _Finish {

# Only if we have mod_perl we have to restart.
if ( exists $ENV{MOD_PERL} ) {
eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval)
eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval)
if ( defined $mod_perl::VERSION ) {
$Webserver = 'systemctl restart apache2';
if ( -f '/etc/SuSE-release' ) {
Expand Down
25 changes: 11 additions & 14 deletions Kernel/Output/HTML/Layout.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sub new {
my ( $Type, %Param ) = @_;

# allocate new hash for object
my $Self = bless { %Param }, $Type;
my $Self = bless {%Param}, $Type;

# set debug
$Self->{Debug} = 0;
Expand Down Expand Up @@ -146,7 +146,7 @@ sub new {

# set charset if there is no charset given
$Self->{UserCharset} = 'utf-8';
$Self->{Charset} = $Self->{UserCharset}; # just for compat.
$Self->{Charset} = $Self->{UserCharset}; # just for compat.
$Self->{SessionID} = $Param{SessionID} || '';
$Self->{SessionName} = $Param{SessionName} || 'SessionID';
$Self->{CGIHandle} = $Kernel::OM->Get('Kernel::System::Web::Request')->ScriptName() || 'No-$ENV{"SCRIPT_NAME"}';
Expand Down Expand Up @@ -377,7 +377,7 @@ EOF

# force a theme based on host name
my $DefaultThemeHostBased = $ConfigObject->Get('DefaultTheme::HostBased');
my $Host = $ENV{HTTP_HOST};
my $Host = $ENV{HTTP_HOST};
if ( $DefaultThemeHostBased && $Host ) {

THEME:
Expand Down Expand Up @@ -658,7 +658,7 @@ sub Redirect {
}

sub Login {
my ($Self, %Param) = @_;
my ( $Self, %Param ) = @_;

# set Action parameter for the loader
$Self->{Action} = 'Login';
Expand Down Expand Up @@ -1221,8 +1221,7 @@ sub NotifyNonUpdatedTickets {
);

return $Self->Notify(
Info => $Self->{LanguageObject}
->Translate( "The following tickets are not updated: %s.", $NonUpdatedTicketsString ),
Info => $Self->{LanguageObject}->Translate( "The following tickets are not updated: %s.", $NonUpdatedTicketsString ),
);

}
Expand All @@ -1243,7 +1242,7 @@ generates the HTML for the page begin in the Agent interface.
=cut

sub Header {
my ($Self, %Param) = @_;
my ( $Self, %Param ) = @_;

# extract params
my $Type = $Param{Type} || '';
Expand Down Expand Up @@ -1521,8 +1520,7 @@ sub Header {
# See bug#13790 (https://bugs.otrs.org/show_bug.cgi?id=13790).
if ( $ConfigObject->Get('Ticket::ArchiveSystem') && $Modules{$Key}->{Block} eq 'ToolBarSearchFulltext' )
{
$Modules{$Key}->{SearchInArchive}
= $ConfigObject->Get('Ticket::Frontend::AgentTicketSearch')->{Defaults}->{SearchInArchive};
$Modules{$Key}->{SearchInArchive} = $ConfigObject->Get('Ticket::Frontend::AgentTicketSearch')->{Defaults}->{SearchInArchive};
}

$Self->Block(
Expand Down Expand Up @@ -1559,8 +1557,7 @@ sub Header {
if ( $ConfigObject->Get('Frontend::AvatarEngine') eq 'Gravatar' && $Self->{UserEmail} ) {
my $DefaultIcon = $ConfigObject->Get('Frontend::Gravatar::DefaultImage') || 'mp';
$Kernel::OM->Get('Kernel::System::Encode')->EncodeOutput( \$Self->{UserEmail} );
$Param{Avatar}
= '//www.gravatar.com/avatar/' . md5_hex( lc $Self->{UserEmail} ) . '?s=100&d=' . $DefaultIcon;
$Param{Avatar} = '//www.gravatar.com/avatar/' . md5_hex( lc $Self->{UserEmail} ) . '?s=100&d=' . $DefaultIcon;
}
else {
my %User = $Kernel::OM->Get('Kernel::System::User')->GetUserData(
Expand Down Expand Up @@ -1801,7 +1798,7 @@ sub Print {
my ( $Self, %Param ) = @_;

# the string referenced by $Param{Content} might be modified here
$Self->ApplyOutputFilters( %Param );
$Self->ApplyOutputFilters(%Param);

# There seems to be a bug in FastCGI that it cannot handle unicode output properly.
# Work around this by converting to an utf8 byte stream instead.
Expand All @@ -1814,7 +1811,7 @@ sub Print {

# Disable perl warnings in case of printing unicode private chars,
# see https://rt.perl.org/Public/Bug/Display.html?id=121226.
no warnings 'nonchar'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)
no warnings 'nonchar'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)

print ${ $Param{Output} };

Expand Down Expand Up @@ -5109,7 +5106,7 @@ sub RichTextDocumentServe {

$Param{Data}->{Content} = $SafetyCheckResult{String};

# Show confirmation button to load external content explicitly only if BlockLoadingRemoteContent is disabled.
# Show confirmation button to load external content explicitly only if BlockLoadingRemoteContent is disabled.
if (
$SafetyCheckResult{Replace}
&& !$Kernel::OM->Get('Kernel::Config')->Get('Ticket::Frontend::BlockLoadingRemoteContent')
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Output/PDF/Ticket.pm
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ sub _PDFOutputTicketInfos {
$Responsible = $Ticket{Responsible} || '-';
}

if ( $Responsible ) {
if ($Responsible) {
my $Row = {
Key => $LayoutObject->{LanguageObject}->Translate('Responsible'),
Value => $Responsible,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/Calendar/Export/ICal.pm
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ sub Export {
}

{
no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)
no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)

# Include product name and version in product ID property for debugging purposes, by redefining
# external library method.
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/Calendar/Import/ICal.pm
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ sub _FormatTime {
}

{
no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)
no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings)

# Include additional optional repeatable properties used by some iCalendar implementations, in
# order to prevent Perl warnings.
Expand Down
6 changes: 3 additions & 3 deletions Kernel/System/Console/Command/Dev/Tools/ImportFakeEmails.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ package MyIMAP { ## no critic qw(Modules::ProhibitMultiplePackages)
our $AUTOLOAD;

sub new {
my ($Class, %Param) = @_;
my ( $Class, %Param ) = @_;

$Param{TotalProcessed} = 0;
$Param{Processed} = {};
Expand Down Expand Up @@ -110,7 +110,7 @@ test %s';
return wantarray ? @Lines : \@Lines;
}

sub select { ## no critic qw(Subroutines::ProhibitBuiltinHomonyms)
sub select { ## no critic qw(Subroutines::ProhibitBuiltinHomonyms)
my $Self = shift;

return $Self->{Total} - $Self->{TotalProcessed};
Expand Down Expand Up @@ -249,7 +249,7 @@ sub _ImportEmails {

# Redefine PostMaster::Run so we can fail some messages
# and keep this change local to the current scope
no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict)
no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict)

local *{'Kernel::System::MailAccount::IMAP::Connect'} = sub {
my ( $Self, %Param ) = @_;
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/DB/mysql.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sub new {
my ( $Class, %Param ) = @_;

# allocate new hash for object
return bless { %Param }, $Class;
return bless {%Param}, $Class;
}

sub LoadPreferences {
Expand Down
2 changes: 1 addition & 1 deletion Kernel/System/Email/Sendmail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ sub Send {
my $FH;
my $GenErrorMessage = sub { return sprintf( q{Can't send message: %s!}, shift, ); };

if ( !open( $FH, '|-', "$Sendmail $Arg " ) ) { ## no critic qw(InputOutput::RequireBriefOpen)
if ( !open( $FH, '|-', "$Sendmail $Arg " ) ) { ## no critic qw(InputOutput::RequireBriefOpen)
my $ErrorMessage = $GenErrorMessage->($!);

$Param{CommunicationLogObject}->ObjectLog(
Expand Down
3 changes: 1 addition & 2 deletions Kernel/System/Main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ sub RequireBaseClass {
# Load the module, if not already loaded.
return if !$Self->Require($Module);


my $CallingClass = caller(0);

{
no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict)
no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict)

# Check if the base class was already loaded.
# This can happen in persistent environments as mod_perl (see bug#9686).
Expand Down
Loading

0 comments on commit bba8042

Please sign in to comment.