summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2023-07-13 21:07:55 +0100
committerGreg Roach <greg@subaqua.co.uk>2023-07-14 12:09:38 +0100
commitc540224494b4c0b9f7d890f59f1cd44e9f6d92ea (patch)
treebd6235a8b916d77130a9f3371410b84116d27b7f
parente317c4747ec6781bd32c689682eb1eb98b8b503c (diff)
downloadwebtrees-c540224494b4c0b9f7d890f59f1cd44e9f6d92ea.tar.gz
webtrees-c540224494b4c0b9f7d890f59f1cd44e9f6d92ea.tar.bz2
webtrees-c540224494b4c0b9f7d890f59f1cd44e9f6d92ea.zip
Remove unused code
-rw-r--r--app/Report/ReportParserGenerate.php4
-rw-r--r--resources/views/admin/components.phtml2
-rw-r--r--resources/views/admin/merge-records-step-2.phtml6
-rw-r--r--resources/views/individual-page-name.phtml2
-rw-r--r--resources/views/lists/individuals-table.phtml2
-rw-r--r--resources/views/lists/surnames-column-list.phtml5
-rw-r--r--resources/views/lists/surnames-table.phtml2
-rw-r--r--resources/views/media-page-details.phtml6
-rw-r--r--resources/views/media-page.phtml17
-rw-r--r--resources/views/modules/media-list/page.phtml3
-rw-r--r--resources/views/modules/random_media/slide-show.phtml20
-rw-r--r--resources/views/modules/statistics-chart/page.phtml2
-rw-r--r--resources/views/report-setup-page.phtml1
-rw-r--r--resources/views/selects/family.phtml4
-rw-r--r--resources/views/setup/config.ini.phtml1
15 files changed, 33 insertions, 44 deletions
diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php
index 8d1c4b6fee..67b1c544e8 100644
--- a/app/Report/ReportParserGenerate.php
+++ b/app/Report/ReportParserGenerate.php
@@ -1938,7 +1938,7 @@ class ReportParserGenerate extends ReportParserBase
});
// Search the DB only if there is any name supplied
$names = explode(' ', $match[1]);
- foreach ($names as $n => $name) {
+ foreach ($names as $name) {
$query->where($attr . '.n_full', 'LIKE', '%' . addcslashes($name, '\\%_') . '%');
}
@@ -2038,7 +2038,7 @@ class ReportParserGenerate extends ReportParserBase
// Search the DB only if there is any name supplied
if ($match[1] != '') {
$names = explode(' ', $match[1]);
- foreach ($names as $n => $name) {
+ foreach ($names as $name) {
$query->where($attr . '.n_full', 'LIKE', '%' . addcslashes($name, '\\%_') . '%');
}
}
diff --git a/resources/views/admin/components.phtml b/resources/views/admin/components.phtml
index 7144722530..7f861295ed 100644
--- a/resources/views/admin/components.phtml
+++ b/resources/views/admin/components.phtml
@@ -50,7 +50,7 @@ use Illuminate\Support\Collection;
</thead>
<tbody>
- <?php foreach ($modules as $module_name => $module) : ?>
+ <?php foreach ($modules as $module) : ?>
<tr>
<th scope="col">
<input type="hidden" name="order[]" value="<?= e($module->name()) ?>">
diff --git a/resources/views/admin/merge-records-step-2.phtml b/resources/views/admin/merge-records-step-2.phtml
index c32741c9cf..2e8848d6c7 100644
--- a/resources/views/admin/merge-records-step-2.phtml
+++ b/resources/views/admin/merge-records-step-2.phtml
@@ -53,7 +53,7 @@ use Fisharebest\Webtrees\Tree;
</tr>
</thead>
<tbody>
- <?php foreach ($facts as $fact_id => $fact) : ?>
+ <?php foreach ($facts as $fact) : ?>
<tr>
<td>
<input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked>
@@ -100,7 +100,7 @@ use Fisharebest\Webtrees\Tree;
</tr>
</thead>
<tbody>
- <?php foreach ($facts1 as $fact_id => $fact) : ?>
+ <?php foreach ($facts1 as $fact) : ?>
<tr>
<td>
<input type="checkbox" name="keep1[]" value="<?= $fact->id() ?>" checked>
@@ -146,7 +146,7 @@ use Fisharebest\Webtrees\Tree;
</tr>
</thead>
<tbody>
- <?php foreach ($facts2 as $fact_id => $fact) : ?>
+ <?php foreach ($facts2 as $fact) : ?>
<tr>
<td>
<input type="checkbox" name="keep2[]" value="<?= $fact->id() ?>" checked>
diff --git a/resources/views/individual-page-name.phtml b/resources/views/individual-page-name.phtml
index d46a039baf..4b912637c2 100644
--- a/resources/views/individual-page-name.phtml
+++ b/resources/views/individual-page-name.phtml
@@ -57,7 +57,7 @@ if ($fact->isPendingDeletion()) {
<dd class="col-md-8 col-lg-9"><bdi><?= e($fact->value()) ?></bdi></dd>
<?php preg_match_all('/\n2 (\w+) (.+)/', $fact->gedcom(), $matches, PREG_SET_ORDER) ?>
- <?php foreach ($matches as $key => $match) : ?>
+ <?php foreach ($matches as $match) : ?>
<?php [, $tag, $value] = $match ?>
<?php $element = Registry::elementFactory()->make($fact->tag() . ':' . $tag) ?>
<?php if ($tag !== 'SOUR' && $tag !== 'NOTE') : ?>
diff --git a/resources/views/lists/individuals-table.phtml b/resources/views/lists/individuals-table.phtml
index b5b5a4a4b1..1f7db91ea0 100644
--- a/resources/views/lists/individuals-table.phtml
+++ b/resources/views/lists/individuals-table.phtml
@@ -256,7 +256,7 @@ $("#<?= e($table_id) ?>")
<!-- Death date -->
<?php $death_dates = $individual->getAllDeathDates() ?>
<td data-sort="<?= $individual->getEstimatedDeathDate()->julianDay() ?>">
- <?php foreach ($death_dates as $num => $death_date) : ?>
+ <?php foreach ($death_dates as $death_date) : ?>
<div><?= $death_date->display($tree, null, true) ?></div>
<?php endforeach ?>
diff --git a/resources/views/lists/surnames-column-list.phtml b/resources/views/lists/surnames-column-list.phtml
index 984756ba5d..b2eed27254 100644
--- a/resources/views/lists/surnames-column-list.phtml
+++ b/resources/views/lists/surnames-column-list.phtml
@@ -16,17 +16,12 @@ use Fisharebest\Webtrees\Tree;
* @var Tree $tree
*/
-$maximum = max(array_map(static fn (array $x): int => max($x), $surnames));
-$minimum = min(array_map(static fn (array $x): int => min($x), $surnames));
-
?>
<div class="wt-surnames-column-list px-3" style="columns: 15rem; column-rule: solid thin gray; border: solid thin gray;">
<?php foreach ($surnames as $surn => $surns) : ?>
<?php foreach ($surns as $surname => $count) : ?>
<?php
- $size = 1.0 + ($maximum === $minimum ? 0 : 1.5 * ($count - $minimum) / ($maximum - $minimum));
-
if ($surn === Individual::NOMEN_NESCIO) {
$label = I18N::translateContext('Unknown surname', '…');
$url = $module instanceof ModuleListInterface ? $module->listUrl($tree, ['surname' => $surname] + $params) : '';
diff --git a/resources/views/lists/surnames-table.phtml b/resources/views/lists/surnames-table.phtml
index f49879e029..d2b7f477e5 100644
--- a/resources/views/lists/surnames-table.phtml
+++ b/resources/views/lists/surnames-table.phtml
@@ -49,7 +49,7 @@ use Fisharebest\Webtrees\Tree;
<tr>
<td data-sort="<?= $n = 1 + ($n ?? 0) ?>">
<!-- Multiple surname variants, e.g. von Groot, van Groot, van der Groot, etc. -->
- <?php foreach ($surns as $surname => $count) : ?>
+ <?php foreach (array_keys($surns) as $surname) : ?>
<?php if ($module instanceof IndividualListModule) : ?>
<?php if ($surname === Individual::NOMEN_NESCIO) : ?>
<a href="<?= e($module->listUrl($tree, ['surname' => $surname] + $params)) ?>"><?= I18N::translateContext('Unknown surname', '…') ?></a>
diff --git a/resources/views/media-page-details.phtml b/resources/views/media-page-details.phtml
index 673f430c85..a2ade96c16 100644
--- a/resources/views/media-page-details.phtml
+++ b/resources/views/media-page-details.phtml
@@ -13,9 +13,9 @@ use Fisharebest\Webtrees\Tree;
use Illuminate\Support\Collection;
/**
- * @var Collection $clipboard_facts
- * @var Media $record
- * @var Tree $tree
+ * @var Collection<int,Fact> $clipboard_facts
+ * @var Media $record
+ * @var Tree $tree
*/
?>
diff --git a/resources/views/media-page.phtml b/resources/views/media-page.phtml
index 5dfd90f57d..47ee403add 100644
--- a/resources/views/media-page.phtml
+++ b/resources/views/media-page.phtml
@@ -2,6 +2,7 @@
declare(strict_types=1);
+use Fisharebest\Webtrees\Fact;
use Fisharebest\Webtrees\Family;
use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Location;
@@ -12,14 +13,14 @@ use Fisharebest\Webtrees\Tree;
use Illuminate\Support\Collection;
/**
- * @var Collection $clipboard_facts
- * @var Collection<Family> $linked_families
- * @var Collection<Individual> $linked_individuals
- * @var Collection<Location> $linked_locations
- * @var Collection<Note> $linked_notes
- * @var Collection<Source> $linked_sources
- * @var Media $record
- * @var Tree $tree
+ * @var Collection<int,Fact> $clipboard_facts
+ * @var Collection<int,Family> $linked_families
+ * @var Collection<int,Individual> $linked_individuals
+ * @var Collection<int,Location> $linked_locations
+ * @var Collection<int,Note> $linked_notes
+ * @var Collection<int,Source> $linked_sources
+ * @var Media $record
+ * @var Tree $tree
*/
?>
diff --git a/resources/views/modules/media-list/page.phtml b/resources/views/modules/media-list/page.phtml
index e4ba3fa391..19e811840f 100644
--- a/resources/views/modules/media-list/page.phtml
+++ b/resources/views/modules/media-list/page.phtml
@@ -98,7 +98,7 @@ use Illuminate\Support\Collection;
<?= view('modules/media-list/pagination', ['module' => $module, 'page' => $page, 'pages' => $pages, 'folder' => $folder, 'subdirs' => $subdirs, 'filter' => $filter, 'format' => $format, 'max' => $max, 'tree' => $tree]) ?>
<div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 g-4">
- <?php foreach ($media_objects as $n => $media_object) : ?>
+ <?php foreach ($media_objects as $media_object) : ?>
<div class="col">
<div class="card h-100">
<div class="card-header">
@@ -116,7 +116,6 @@ use Illuminate\Support\Collection;
<p class="card-text">
<?php
// Show file details
- $mediatype = $media_file->type();
if ($media_file->type() !== '') {
$element = Registry::elementFactory()->make('OBJE:FILE:FORM:TYPE');
echo $element->labelValue($media_file->type(), $media_object->tree());
diff --git a/resources/views/modules/random_media/slide-show.phtml b/resources/views/modules/random_media/slide-show.phtml
index 67bdeb1b44..f8fd3a04af 100644
--- a/resources/views/modules/random_media/slide-show.phtml
+++ b/resources/views/modules/random_media/slide-show.phtml
@@ -12,16 +12,16 @@ use Fisharebest\Webtrees\Tree;
use Illuminate\Support\Collection;
/**
- * @var int $block_id
- * @var int $delay
- * @var Collection<Family> $linked_families
- * @var Collection<Individual> $linked_individuals
- * @var Collection<Source> $linked_sources
- * @var Media $media
- * @var MediaFile $media_file
- * @var bool $show_controls
- * @var bool $start_automatically
- * @var Tree $tree
+ * @var int $block_id
+ * @var int $delay
+ * @var Collection<int,Family> $linked_families
+ * @var Collection<int,Individual> $linked_individuals
+ * @var Collection<int,Source> $linked_sources
+ * @var Media $media
+ * @var MediaFile $media_file
+ * @var bool $show_controls
+ * @var bool $start_automatically
+ * @var Tree $tree
*/
?>
diff --git a/resources/views/modules/statistics-chart/page.phtml b/resources/views/modules/statistics-chart/page.phtml
index 4758e4af0b..864ae2bb4f 100644
--- a/resources/views/modules/statistics-chart/page.phtml
+++ b/resources/views/modules/statistics-chart/page.phtml
@@ -27,7 +27,7 @@ use Fisharebest\Webtrees\View;
</ul>
<div class="tab-content">
- <?php foreach ($tabs as $label => $url) : ?>
+ <?php foreach ($tabs as $url) : ?>
<div class="tab-pane fade wt-ajax-load" role="tabpanel" id="tab-<?= e(md5($url)) ?>"></div>
<?php endforeach ?>
</div>
diff --git a/resources/views/report-setup-page.phtml b/resources/views/report-setup-page.phtml
index 4fbab65fa0..f1481bfc7d 100644
--- a/resources/views/report-setup-page.phtml
+++ b/resources/views/report-setup-page.phtml
@@ -10,7 +10,6 @@ use Fisharebest\Webtrees\I18N;
* @var string $destination
* @var string $format
* @var array<array<string>> $inputs
- * @var string $format
*/
?>
diff --git a/resources/views/selects/family.phtml b/resources/views/selects/family.phtml
index 9f3eeac56a..f843ef0daf 100644
--- a/resources/views/selects/family.phtml
+++ b/resources/views/selects/family.phtml
@@ -2,9 +2,7 @@
declare(strict_types=1);
-use Fisharebest\Webtrees\Elements\Marriage;
use Fisharebest\Webtrees\Family;
-use Fisharebest\Webtrees\I18N;
/**
* @var Family $family
@@ -12,8 +10,6 @@ use Fisharebest\Webtrees\I18N;
$marriage_date = $family->getMarriageDate();
-$marriage = new Marriage(I18N::translate('Marriage'))
-
?>
<?= $family->fullName() ?>
<?php if ($marriage_date->isOK()) : ?>
diff --git a/resources/views/setup/config.ini.phtml b/resources/views/setup/config.ini.phtml
index ab82251a80..fb20da9378 100644
--- a/resources/views/setup/config.ini.phtml
+++ b/resources/views/setup/config.ini.phtml
@@ -10,7 +10,6 @@ declare(strict_types=1);
* @var string $dbpass
* @var string $dbport
* @var string $dbtype
- * @var string $dbuser
* @var string $tblpfx
*/