Skip to content

Commit ff96e3b

Browse files
committed
Code revised with reactor
Applied rules: * ChangeOrIfContinueToMultiContinueRector
1 parent c259398 commit ff96e3b

File tree

6 files changed

+42
-24
lines changed

6 files changed

+42
-24
lines changed

firstLogin.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,12 @@ function notifyGlobalAdmins(&$dbHandler, &$userObj)
190190
$dest = [];
191191
$validator = new Zend_Validate_EmailAddress();
192192
foreach ($mail['to'] as $mm) {
193-
$ema = trim($mm);
194-
if ($ema == '' || ! $validator->isValid($ema)) {
195-
continue;
193+
$ema = trim($mm);
194+
if ($ema == '') {
195+
continue;
196+
}
197+
if (! $validator->isValid($ema)) {
198+
continue;
196199
}
197200
$dest[] = $ema;
198201
}

lib/functions/plugin_api.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,12 @@ function plugin_find_all()
413413

414414
if ($t_dir = opendir($t_plugin_path)) {
415415
while (($t_file = readdir($t_dir)) !== false) {
416-
if ('.' == $t_file || '..' == $t_file) {
417-
continue;
418-
}
416+
if ('.' == $t_file) {
417+
continue;
418+
}
419+
if ('..' == $t_file) {
420+
continue;
421+
}
419422
if (is_dir($t_plugin_path . $t_file)) {
420423
$t_plugin = plugin_register($t_file, true);
421424

@@ -609,9 +612,12 @@ function get_all_available_plugins($existing_plugins)
609612
// Find all plugins that are newly available (And not already registered)
610613
if ($t_dir = opendir(TL_PLUGIN_PATH)) {
611614
while (($t_file = readdir($t_dir)) !== false) {
612-
if ('.' == $t_file || '..' == $t_file) {
613-
continue;
614-
}
615+
if ('.' == $t_file) {
616+
continue;
617+
}
618+
if ('..' == $t_file) {
619+
continue;
620+
}
615621
if (! in_array($t_file, $registered_plugin_names) &&
616622
is_dir(TL_PLUGIN_PATH . $t_file) && plugin_include($t_file)) {
617623
$t_classname = $t_file . 'Plugin';

lib/functions/print.inc.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,12 @@ function renderTestSpecTreeForPrinting(&$db, &$node, &$options, $env, $context,
828828
$childNodes = $node['childNodes'];
829829
$children_qty = count($childNodes);
830830
for ($idx = 0; $idx < $children_qty; $idx ++) {
831-
$current = $childNodes[$idx];
832-
if (is_null($current) || $current == REMOVEME) {
833-
continue;
831+
$current = $childNodes[$idx];
832+
if (is_null($current)) {
833+
continue;
834+
}
835+
if ($current == REMOVEME) {
836+
continue;
834837
}
835838

836839
if (isset($current['node_type_id']) &&

lib/functions/treeMenu.inc.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -957,10 +957,12 @@ function renderExecTreeNode($level, &$node, &$tcase_node, $hash_id_descr,
957957
// Can not assign anymore to intermediate variables.
958958
$nodes_qty = count($node['childNodes']);
959959
for ($idx = 0; $idx < $nodes_qty; $idx ++) {
960-
if (is_null($node['childNodes'][$idx]) ||
961-
$node['childNodes'][$idx] == REMOVEME) {
962-
continue;
963-
}
960+
if (is_null($node['childNodes'][$idx])) {
961+
continue;
962+
}
963+
if ($node['childNodes'][$idx] == REMOVEME) {
964+
continue;
965+
}
964966
renderExecTreeNode($level + 1, $node['childNodes'][$idx],
965967
$tcase_node, $hash_id_descr, $linkto, $testCasePrefix, $opt);
966968
}

lib/plan/planAddTC.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,12 @@ function sendMailToTesters(&$dbHandler, &$tcaseMgr, &$guiObj, &$argsObj,
839839
$guiObj->testPlanName;
840840
foreach ($tester_set as $user_id => $value) {
841841
$userObj = $userData[$user_id];
842-
$email['to_address'] = trim($userObj->emailAddress);
843-
if ($email['to_address'] == '' ||
844-
! $validator->isValid($email['to_address'])) {
845-
continue;
842+
$email['to_address'] = trim($userObj->emailAddress);
843+
if ($email['to_address'] == '') {
844+
continue;
845+
}
846+
if (! $validator->isValid($email['to_address'])) {
847+
continue;
846848
}
847849

848850
$email['body'] = $body_first_lines;

lib/plan/tc_exec_assignment.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,12 @@ function sendMailToTesters(&$dbHandler, &$tcaseMgr, &$guiObj, &$argsObj,
529529
}
530530

531531
$userObj = $guiObj->all_users[$user_id];
532-
$email['to_address'] = trim($userObj->emailAddress);
533-
if ($email['to_address'] == '' ||
534-
! $validator->isValid($email['to_address'])) {
535-
continue;
532+
$email['to_address'] = trim($userObj->emailAddress);
533+
if ($email['to_address'] == '') {
534+
continue;
535+
}
536+
if (! $validator->isValid($email['to_address'])) {
537+
continue;
536538
}
537539

538540
$email['body'] = $body_header;

0 commit comments

Comments
 (0)