diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2021-10-29 16:11:54 +0100 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2021-10-29 16:19:12 +0100 |
| commit | dd71ff6b9f8508a26dabb8d3203ec5b96f870208 (patch) | |
| tree | 4e3edda14b1412b5ad80c73e4a7ebadc79353b2f | |
| parent | 782714c25b2e0603372cf1f9c70d436bee339713 (diff) | |
| download | webtrees-dd71ff6b9f8508a26dabb8d3203ec5b96f870208.tar.gz webtrees-dd71ff6b9f8508a26dabb8d3203ec5b96f870208.tar.bz2 webtrees-dd71ff6b9f8508a26dabb8d3203ec5b96f870208.zip | |
CodeStyle - remove unnecessary parentheses
| -rw-r--r-- | app/Elements/AgeAtEvent.php | 8 | ||||
| -rw-r--r-- | app/Functions/FunctionsRtl.php | 4 | ||||
| -rw-r--r-- | app/GedcomRecord.php | 2 | ||||
| -rw-r--r-- | app/Http/RequestHandlers/CalendarEvents.php | 4 | ||||
| -rw-r--r-- | app/Services/CalendarService.php | 2 | ||||
| -rw-r--r-- | app/Soundex.php | 2 | ||||
| -rw-r--r-- | app/Statistics/Repository/FamilyRepository.php | 2 | ||||
| -rw-r--r-- | resources/views/admin/changes-log.phtml | 4 | ||||
| -rw-r--r-- | resources/views/lists/families-table.phtml | 8 | ||||
| -rw-r--r-- | resources/views/lists/individuals-table.phtml | 8 | ||||
| -rw-r--r-- | resources/views/modules/timeline-chart/chart.phtml | 10 |
11 files changed, 27 insertions, 27 deletions
diff --git a/app/Elements/AgeAtEvent.php b/app/Elements/AgeAtEvent.php index 697c383636..e1b21681e1 100644 --- a/app/Elements/AgeAtEvent.php +++ b/app/Elements/AgeAtEvent.php @@ -78,10 +78,10 @@ class AgeAtEvent extends AbstractElement '/CHILD/' => fn () => I18N::translate('Child'), '/INFANT/' => fn () => I18N::translate('Infant'), '/STILLBORN/' => fn () => I18N::translate('Stillborn'), - '/\b(\d+)y\b/' => fn (array $match) => I18N::plural('%s year', '%s years', (int) ($match[1]), I18N::number((float) $match[1])), - '/\b(\d+)m\b/' => fn (array $match) => I18N::plural('%s month', '%s months', (int) ($match[1]), I18N::number((float) $match[1])), - '/\b(\d+)w\b/' => fn (array $match) => I18N::plural('%s week', '%s weeks', (int) ($match[1]), I18N::number((float) $match[1])), - '/\b(\d+)d\b/' => fn (array $match) => I18N::plural('%s day', '%s days', (int) ($match[1]), I18N::number((float) $match[1])), + '/\b(\d+)y\b/' => fn (array $match) => I18N::plural('%s year', '%s years', (int) $match[1], I18N::number((float) $match[1])), + '/\b(\d+)m\b/' => fn (array $match) => I18N::plural('%s month', '%s months', (int) $match[1], I18N::number((float) $match[1])), + '/\b(\d+)w\b/' => fn (array $match) => I18N::plural('%s week', '%s weeks', (int) $match[1], I18N::number((float) $match[1])), + '/\b(\d+)d\b/' => fn (array $match) => I18N::plural('%s day', '%s days', (int) $match[1], I18N::number((float) $match[1])), ], e($canonical)); } } diff --git a/app/Functions/FunctionsRtl.php b/app/Functions/FunctionsRtl.php index 43b906947e..a98846b8f8 100644 --- a/app/Functions/FunctionsRtl.php +++ b/app/Functions/FunctionsRtl.php @@ -283,7 +283,7 @@ class FunctionsRtl $newState = 'LTR'; break; } - if (($currentLen !== 1) || ($currentLetter >= 'A' && $currentLetter <= 'Z') || ($currentLetter >= 'a' && $currentLetter <= 'z')) { + if ($currentLen !== 1 || $currentLetter >= 'A' && $currentLetter <= 'Z' || $currentLetter >= 'a' && $currentLetter <= 'z') { // Since it’s neither Hebrew nor Arabic, this UTF-8 character or ASCII letter must be LTR $newState = 'LTR'; break; @@ -1111,7 +1111,7 @@ class FunctionsRtl if ($countLeadingSpaces !== 0) { $newLength = strlen($textSpan) + $countLeadingSpaces; - $textSpan = str_pad($textSpan, $newLength, ' ', (I18N::direction() === 'rtl' ? STR_PAD_LEFT : STR_PAD_RIGHT)); + $textSpan = str_pad($textSpan, $newLength, ' ', I18N::direction() === 'rtl' ? STR_PAD_LEFT : STR_PAD_RIGHT); } if ($countTrailingSpaces !== 0) { if (I18N::direction() === 'ltr') { diff --git a/app/GedcomRecord.php b/app/GedcomRecord.php index c0bfb942c4..e79c638dec 100644 --- a/app/GedcomRecord.php +++ b/app/GedcomRecord.php @@ -1224,7 +1224,7 @@ class GedcomRecord $sublevel = $level + 1; $subsublevel = $sublevel + 1; foreach ($facts as $fact) { - if (preg_match_all('/^' . $level . ' (' .$fact_type . ') (.+)((\n[' . $sublevel . '-9].+)*)/m', $fact->gedcom(), $matches, PREG_SET_ORDER)) { + if (preg_match_all('/^' . $level . ' (' . $fact_type . ') (.+)((\n[' . $sublevel . '-9].+)*)/m', $fact->gedcom(), $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { // Treat 1 NAME / 2 TYPE married the same as _MARNM if ($match[1] === 'NAME' && str_contains($match[3], "\n2 TYPE married")) { diff --git a/app/Http/RequestHandlers/CalendarEvents.php b/app/Http/RequestHandlers/CalendarEvents.php index 20a81df93a..550635d49d 100644 --- a/app/Http/RequestHandlers/CalendarEvents.php +++ b/app/Http/RequestHandlers/CalendarEvents.php @@ -184,9 +184,9 @@ class CalendarEvents implements RequestHandlerInterface for ($week_day = 0; $week_day < $days_in_week; ++$week_day) { $day_name = $cal_date->dayNames(($week_day + $week_start) % $days_in_week); if ($week_day === $weekend_start || $week_day === $weekend_end) { - echo '<th class="wt-page-options-label weekend" width="' . (100 / $days_in_week) . '%">', $day_name, '</th>'; + echo '<th class="wt-page-options-label weekend" width="', 100 / $days_in_week, '%">', $day_name, '</th>'; } else { - echo '<th class="wt-page-options-label" width="' . (100 / $days_in_week) . '%">', $day_name, '</th>'; + echo '<th class="wt-page-options-label" width="', 100 / $days_in_week, '%">', $day_name, '</th>'; } } echo '</tr>'; diff --git a/app/Services/CalendarService.php b/app/Services/CalendarService.php index 7dc5ed63df..36df192483 100644 --- a/app/Services/CalendarService.php +++ b/app/Services/CalendarService.php @@ -180,7 +180,7 @@ class CalendarService foreach ($record->facts([$row->d_fact]) as $fact) { // For date ranges, we need a match on either the start/end. - if (($fact->date()->minimumJulianDay() === $anniv_date->minimumJulianDay() || $fact->date()->maximumJulianDay() === $anniv_date->maximumJulianDay())) { + if ($fact->date()->minimumJulianDay() === $anniv_date->minimumJulianDay() || $fact->date()->maximumJulianDay() === $anniv_date->maximumJulianDay()) { $fact->anniv = 0; $found_facts[] = $fact; } diff --git a/app/Soundex.php b/app/Soundex.php index 4a7f5b3d15..9bdd7d0841 100644 --- a/app/Soundex.php +++ b/app/Soundex.php @@ -3586,7 +3586,7 @@ class Soundex // Initialize $name_script = I18N::textScript($name); - $noVowels = ($name_script === 'Hebr' || $name_script === 'Arab'); + $noVowels = $name_script === 'Hebr' || $name_script === 'Arab'; $lastPos = strlen($name) - 1; $currPos = 0; diff --git a/app/Statistics/Repository/FamilyRepository.php b/app/Statistics/Repository/FamilyRepository.php index cfdbf72e14..c8ab93f933 100644 --- a/app/Statistics/Repository/FamilyRepository.php +++ b/app/Statistics/Repository/FamilyRepository.php @@ -1127,7 +1127,7 @@ class FamilyRepository $husb = $family->husband(); $wife = $family->wife(); - if (($husb && ($husb->getAllDeathDates() || !$husb->isDead())) && ($wife && ($wife->getAllDeathDates() || !$wife->isDead()))) { + if ($husb && ($husb->getAllDeathDates() || !$husb->isDead()) && $wife && ($wife->getAllDeathDates() || !$wife->isDead())) { if ($family !== null && $family->canShow()) { if ($type === 'list') { $top10[] = '<li><a href="' . e($family->url()) . '">' . $family->fullName() . '</a> (' . $age . ')' . '</li>'; diff --git a/resources/views/admin/changes-log.phtml b/resources/views/admin/changes-log.phtml index e5359c599e..3083cc2834 100644 --- a/resources/views/admin/changes-log.phtml +++ b/resources/views/admin/changes-log.phtml @@ -105,12 +105,12 @@ use Fisharebest\Webtrees\Tree; <?= view('icons/cancel') ?> <?= /* I18N: A button label. */ I18N::translate('reset') ?> </a> - <a class="btn btn-secondary" href="<?= (route(PendingChangesLogDownload::class, ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'tree' => $tree->name(), 'username' => $username])) ?>"> + <a class="btn btn-secondary" href="<?= route(PendingChangesLogDownload::class, ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'tree' => $tree->name(), 'username' => $username]) ?>"> <?= view('icons/download') ?> <?= /* I18N: A button label. */ I18N::translate('download') ?> </a> - <a href="#" class="btn btn-danger" data-wt-confirm="<?= I18N::translate('Permanently delete these records?') ?>" data-wt-post-url="<?= (route(PendingChangesLogDelete::class, ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'tree' => $tree->name(), 'username' => $username])) ?>"> + <a href="#" class="btn btn-danger" data-wt-confirm="<?= I18N::translate('Permanently delete these records?') ?>" data-wt-post-url="<?= route(PendingChangesLogDelete::class, ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'tree' => $tree->name(), 'username' => $username]) ?>"> <?= view('icons/delete') ?> <?= I18N::translate('delete') ?> </a> diff --git a/resources/views/lists/families-table.phtml b/resources/views/lists/families-table.phtml index ab0942a68f..176c5f90d6 100644 --- a/resources/views/lists/families-table.phtml +++ b/resources/views/lists/families-table.phtml @@ -440,7 +440,7 @@ $marriageAgeData = [ </div><div class="card-body"> <?php foreach ($birt_by_decade as $century => $values) { - if (($values['M'] + $values['F']) > 0) { + if ($values['M'] + $values['F'] > 0) { $birthData[] = [ [ 'v' => 'Date(' . $century . ', 0, 1)', @@ -461,7 +461,7 @@ $marriageAgeData = [ </div><div class="card-body"> <?php foreach ($marr_by_decade as $century => $values) { - if (($values['M'] + $values['F']) > 0) { + if ($values['M'] + $values['F'] > 0) { $marriageData[] = [ [ 'v' => 'Date(' . $century . ', 0, 1)', @@ -487,8 +487,8 @@ $marriageAgeData = [ $max = 0; foreach ($marr_by_age as $age => $values) { - if (($values['M'] + $values['F']) > 0) { - if (($values['M'] + $values['F']) > $max) { + if ($values['M'] + $values['F'] > 0) { + if ($values['M'] + $values['F'] > $max) { $max = $values['M'] + $values['F']; } diff --git a/resources/views/lists/individuals-table.phtml b/resources/views/lists/individuals-table.phtml index 5931e86374..c85e05e9b6 100644 --- a/resources/views/lists/individuals-table.phtml +++ b/resources/views/lists/individuals-table.phtml @@ -448,7 +448,7 @@ $deathAgeData = [ <div class="card-body"> <?php foreach ($birt_by_decade as $century => $values) { - if (($values['M'] + $values['F']) > 0) { + if ($values['M'] + $values['F'] > 0) { $birthData[] = [ [ 'v' => 'Date(' . $century . ', 0, 1)', @@ -470,7 +470,7 @@ $deathAgeData = [ <div class="card-body"> <?php foreach ($deat_by_decade as $century => $values) { - if (($values['M'] + $values['F']) > 0) { + if ($values['M'] + $values['F'] > 0) { $deathData[] = [ [ 'v' => 'Date(' . $century . ', 0, 1)', @@ -496,8 +496,8 @@ $deathAgeData = [ $max = 0; foreach ($deat_by_age as $age => $values) { - if (($values['M'] + $values['F']) > 0) { - if (($values['M'] + $values['F']) > $max) { + if ($values['M'] + $values['F'] > 0) { + if ($values['M'] + $values['F'] > $max) { $max = $values['M'] + $values['F']; } diff --git a/resources/views/modules/timeline-chart/chart.phtml b/resources/views/modules/timeline-chart/chart.phtml index 6c5de0e06f..9e973d1a31 100644 --- a/resources/views/modules/timeline-chart/chart.phtml +++ b/resources/views/modules/timeline-chart/chart.phtml @@ -268,7 +268,7 @@ use Fisharebest\Webtrees\Individual; } for ($i = $baseyear + 1; $i < $topyear; $i++) { if ($i % $mod === 0) { - echo '<div id="scale' . $i . '" style="position:absolute; ' . (I18N::direction() === 'ltr' ? 'left:0;' : 'right:0;') . ' top:' . ((($i - $baseyear) * $scale) - $scale / 2) . 'px; font-size: 7pt; text-align:' . (I18N::direction() === 'ltr' ? 'left' : 'right') . ';">'; + echo '<div id="scale' . $i . '" style="position:absolute; ' . (I18N::direction() === 'ltr' ? 'left:0;' : 'right:0;') . ' top:' . (($i - $baseyear) * $scale - $scale / 2) . 'px; font-size: 7pt; text-align:' . (I18N::direction() === 'ltr' ? 'left' : 'right') . ';">'; echo $i; echo '</div>'; } @@ -372,7 +372,7 @@ use Fisharebest\Webtrees\Individual; $img = asset('css/images/dline.png'); $ypos = '100%'; } - $dyoffset = ($yoffset - $tyoffset) + $bheight / 3; + $dyoffset = $yoffset - $tyoffset + $bheight / 3; if ($tyoffset < 0) { $dyoffset = $yoffset + $bheight / 3; if (I18N::direction() === 'ltr') { @@ -386,13 +386,13 @@ use Fisharebest\Webtrees\Individual; ?> <!-- diagonal line --> - <div id="dbox<?= $factcount ?>" style="position:absolute; <?= (I18N::direction() === 'ltr' ? 'left: ' . (0 + 25) : 'right: ' . (0 + 25)) ?>px; top:<?= ($dyoffset) ?>px; font-size: 8pt; height: <?= abs($tyoffset) ?>px; width: <?= abs($tyoffset) ?>px; background-image: url('<?= e($img) ?>'); background-position: 0 <?= $ypos ?>;"> + <div id="dbox<?= $factcount ?>" style="position:absolute; <?= I18N::direction() === 'ltr' ? 'left: ' . (0 + 25) : 'right: ' . (0 + 25) ?>px; top:<?= $dyoffset ?>px; font-size: 8pt; height: <?= abs($tyoffset) ?>px; width: <?= abs($tyoffset) ?>px; background-image: url('<?= e($img) ?>'); background-position: 0 <?= $ypos ?>;"> </div> <?php endforeach ?> <!-- age cursors --> <?php foreach ($individuals as $p => $indi) : ?> - <?php $ageyoffset = 0 + ($bheight * $p); ?> + <?php $ageyoffset = 0 + $bheight * $p; ?> <div id="agebox<?= $p ?>" style="cursor:move; position:absolute; <?= I18N::direction() === 'ltr' ? 'left:20px;' : 'right:20px;' ?> top:<?= $ageyoffset ?>px; height:<?= $bheight ?>px; display:none;" onmousedown="ageCursorMouseDown(this, <?= $p ?>);"> <table cellspacing="0" cellpadding="0"> <tr> @@ -401,7 +401,7 @@ use Fisharebest\Webtrees\Individual; </td> <td> <?php if (!empty($birthyears[$indi->xref()])) : ?> - <?php $tyear = round(($ageyoffset + ($bheight / 2)) / $scale) + $baseyear; ?> + <?php $tyear = round(($ageyoffset + $bheight / 2) / $scale) + $baseyear; ?> <table class="person<?= $p % 6 ?>" style="cursor: grab;"> <tr> <td> |
