Skip to content

Commit 29cfbf1

Browse files
committed
Use in_array in if-sentence
1 parent 4992912 commit 29cfbf1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Phpbb/TranslationValidator/Validator/FileListValidator.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,10 @@ public function validate()
120120
$sourceFiles[] = $this->sourceLanguagePath . 'LICENSE';
121121
$sourceFiles = array_unique($sourceFiles);
122122

123-
/*
124-
* Get $lang['direction'] of translation to allow additional rtl-files for rtl-translations
125-
*/
123+
//Get $lang['direction'] of translation to allow additional rtl-files for rtl-translations
126124
include($this->originPath . '/' . $this->originLanguagePath . 'common.php');
127125
$direction = $lang['DIRECTION'];
128-
// Throw error, if invalid direction is used
126+
// Throw error, if invalid direction is used
129127
if (!in_array($direction, array('rtl', 'ltr')))
130128
{
131129
$this->output->addMessage(Output::FATAL, 'DIRECTION needs to be rtl or ltr');
@@ -206,13 +204,16 @@ public function validate()
206204
{
207205
$level = Output::FATAL;
208206
}
209-
else if (substr($origin_file, -4 === array('.gif', '.png')) && $direction === 'rtl') {
207+
else if (in_array(substr($origin_file, -4), array('.gif', '.png')) && $direction === 'rtl')
208+
{
210209
$level = Output::WARNING;
211210
}
212-
else if (substr($origin_file, -3) !== '.md') {
211+
else if (substr($origin_file, -3) !== '.md')
212+
{
213213
$level = Output::FATAL;
214214
}
215-
else {
215+
else
216+
{
216217
$level = Output::ERROR;
217218
}
218219

0 commit comments

Comments
 (0)