summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Date.php2
-rw-r--r--app/Functions/FunctionsCharts.php6
-rw-r--r--app/Functions/FunctionsEdit.php2
-rw-r--r--app/Functions/FunctionsPrint.php4
-rw-r--r--app/Functions/FunctionsPrintFacts.php2
-rw-r--r--app/Helpers/functions.php2
-rw-r--r--app/Http/Controllers/EditIndividualController.php4
-rw-r--r--app/Http/Middleware/Housekeeping.php2
-rw-r--r--app/Http/Middleware/UseLocale.php2
-rw-r--r--app/Http/Middleware/UseTheme.php4
-rw-r--r--app/Location.php4
-rw-r--r--app/Module/FamilyBookChartModule.php6
-rw-r--r--app/Module/FamilyTreeStatisticsModule.php2
-rw-r--r--app/Module/FanChartModule.php2
-rw-r--r--app/Module/GoogleAnalyticsModule.php4
-rw-r--r--app/Module/HitCountFooterModule.php4
-rw-r--r--app/Module/HourglassChartModule.php24
-rw-r--r--app/Module/HtmlBlockModule.php2
-rw-r--r--app/Module/LoggedInUsersModule.php2
-rw-r--r--app/Module/ModuleThemeTrait.php2
-rw-r--r--app/Module/ThemeSelectModule.php2
-rw-r--r--app/Module/TopGivenNamesModule.php2
-rw-r--r--app/Place.php2
-rw-r--r--app/Services/ModuleService.php2
-rw-r--r--app/Services/UserService.php6
-rw-r--r--app/Statistics/Google/ChartBirth.php2
-rw-r--r--app/Statistics/Google/ChartCommonGiven.php2
-rw-r--r--app/Statistics/Google/ChartCommonSurname.php2
-rw-r--r--app/Statistics/Google/ChartDeath.php2
-rw-r--r--app/Statistics/Google/ChartDistribution.php2
-rw-r--r--app/Statistics/Google/ChartDivorce.php2
-rw-r--r--app/Statistics/Google/ChartFamilyLargest.php2
-rw-r--r--app/Statistics/Google/ChartFamilyWithSources.php2
-rw-r--r--app/Statistics/Google/ChartIndividualWithSources.php2
-rw-r--r--app/Statistics/Google/ChartMarriage.php2
-rw-r--r--app/Statistics/Google/ChartMedia.php2
-rw-r--r--app/View.php2
-rw-r--r--index.php10
-rw-r--r--modules_v4/README.md2
-rw-r--r--resources/views/family-page.phtml2
-rw-r--r--resources/views/layouts/default.phtml12
-rw-r--r--resources/views/media-page-menu.phtml2
-rw-r--r--resources/views/modules/ckeditor/ckeditor-js.phtml2
-rw-r--r--resources/views/modules/gedcom_favorites/favorites.phtml2
-rw-r--r--resources/views/modules/relatives/family.phtml6
-rw-r--r--resources/views/modules/user_favorites/favorites.phtml2
-rw-r--r--routes/web.php2
-rw-r--r--tests/app/Http/Controllers/Admin/LocationControllerTest.php16
-rw-r--r--tests/app/Http/Controllers/Admin/MapProviderControllerTest.php4
-rw-r--r--tests/app/Http/Controllers/Admin/MediaControllerTest.php14
-rw-r--r--tests/app/Http/Controllers/Admin/ModuleControllerTest.php50
-rw-r--r--tests/app/TreeUserTest.php2
-rw-r--r--tests/feature/UserAdminTest.php10
53 files changed, 129 insertions, 129 deletions
diff --git a/app/Date.php b/app/Date.php
index c2567c79a2..4daf8c70ff 100644
--- a/app/Date.php
+++ b/app/Date.php
@@ -257,7 +257,7 @@ class Date
public function display($url = false, $date_format = null, $convert_calendars = true)
{
// Do we need a new DateFormatterService class?
- $tree = app()->make(Tree::class);
+ $tree = app(Tree::class);
$CALENDAR_FORMAT = $tree->getPreference('CALENDAR_FORMAT');
diff --git a/app/Functions/FunctionsCharts.php b/app/Functions/FunctionsCharts.php
index c5a6ba8521..bebe88f641 100644
--- a/app/Functions/FunctionsCharts.php
+++ b/app/Functions/FunctionsCharts.php
@@ -100,7 +100,7 @@ class FunctionsCharts
*/
public static function printFamilyParents(Family $family, int $sosa = 0, string $daboville = '', string $parid = '', string $gparid = '')
{
- $pbheight = app()->make(ModuleThemeInterface::class)->parameter('chart-box-y') + 14;
+ $pbheight = app(ModuleThemeInterface::class)->parameter('chart-box-y') + 14;
$husb = $family->husband();
if ($husb) {
@@ -309,7 +309,7 @@ class FunctionsCharts
string $label = '',
bool $show_cousins = false
) {
- $bheight = app()->make(ModuleThemeInterface::class)->parameter('chart-box-y');
+ $bheight = app(ModuleThemeInterface::class)->parameter('chart-box-y');
$pbheight = $bheight + 14;
$children = $family->children();
$numchil = $children->count();
@@ -506,7 +506,7 @@ class FunctionsCharts
*/
private static function printCousins(Family $family)
{
- $bheight = app()->make(ModuleThemeInterface::class)->parameter('chart-box-y');
+ $bheight = app(ModuleThemeInterface::class)->parameter('chart-box-y');
$fchildren = $family->children();
$kids = $fchildren->count();
diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php
index c8a9b7d674..5cd085448c 100644
--- a/app/Functions/FunctionsEdit.php
+++ b/app/Functions/FunctionsEdit.php
@@ -461,7 +461,7 @@ class FunctionsEdit
*/
public static function addSimpleTag(Tree $tree, $tag, $upperlevel = '', $label = ''): string
{
- $request = app()->make(Request::class);
+ $request = app(Request::class);
$xref = $request->get('xref', '');
// Some form fields need access to previous form fields.
diff --git a/app/Functions/FunctionsPrint.php b/app/Functions/FunctionsPrint.php
index ecf14bf930..fd5eed18d8 100644
--- a/app/Functions/FunctionsPrint.php
+++ b/app/Functions/FunctionsPrint.php
@@ -53,9 +53,9 @@ class FunctionsPrint
public static function printPedigreePerson(Individual $person = null): string
{
if ($person instanceof Individual) {
- return app()->make(ModuleThemeInterface::class)->individualBox($person);
+ return app(ModuleThemeInterface::class)->individualBox($person);
} else {
- return app()->make(ModuleThemeInterface::class)->individualBoxEmpty();
+ return app(ModuleThemeInterface::class)->individualBoxEmpty();
}
}
diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php
index 71aedbd691..7e3ad4528d 100644
--- a/app/Functions/FunctionsPrintFacts.php
+++ b/app/Functions/FunctionsPrintFacts.php
@@ -178,7 +178,7 @@ class FunctionsPrintFacts
echo '<th scope="row">';
if ($tree->getPreference('SHOW_FACT_ICONS')) {
- echo app()->make(ModuleThemeInterface::class)->icon($fact), ' ';
+ echo app(ModuleThemeInterface::class)->icon($fact), ' ';
}
switch ($fact->getTag()) {
diff --git a/app/Helpers/functions.php b/app/Helpers/functions.php
index bbb3216392..6e641a23f7 100644
--- a/app/Helpers/functions.php
+++ b/app/Helpers/functions.php
@@ -25,7 +25,7 @@ use Illuminate\Cache\Repository;
*
* @param string|null $abstract
*
- * @return Application|Repository|mixed
+ * @return mixed
*/
function app(string $abstract = null)
{
diff --git a/app/Http/Controllers/EditIndividualController.php b/app/Http/Controllers/EditIndividualController.php
index 9e1c13ed2a..409a3dff28 100644
--- a/app/Http/Controllers/EditIndividualController.php
+++ b/app/Http/Controllers/EditIndividualController.php
@@ -620,7 +620,7 @@ class EditIndividualController extends AbstractEditController
Auth::checkIndividualAccess($individual, true);
// @TODO - Move the name-specific code to this function?
- return app()->make(EditGedcomRecordController::class)->updateFact($request, $tree);
+ return app(EditGedcomRecordController::class)->updateFact($request, $tree);
}
/**
@@ -669,7 +669,7 @@ class EditIndividualController extends AbstractEditController
// @TODO - Move the name-specific code to this function?
- return app()->make(EditGedcomRecordController::class)->updateFact($request, $tree);
+ return app(EditGedcomRecordController::class)->updateFact($request, $tree);
}
/**
diff --git a/app/Http/Middleware/Housekeeping.php b/app/Http/Middleware/Housekeeping.php
index 4886a5cda3..bb1423d615 100644
--- a/app/Http/Middleware/Housekeeping.php
+++ b/app/Http/Middleware/Housekeeping.php
@@ -89,7 +89,7 @@ class Housekeeping implements MiddlewareInterface
*/
private function runHousekeeping()
{
- $data_filesystem = app()->make(FilesystemInterface::class);
+ $data_filesystem = app(FilesystemInterface::class);
$root_filesystem = new Filesystem(new Local(WT_ROOT));
// Clear files in the (user-specified) data folder - which might not be local files
diff --git a/app/Http/Middleware/UseLocale.php b/app/Http/Middleware/UseLocale.php
index a5e1acd75c..a888e07dc0 100644
--- a/app/Http/Middleware/UseLocale.php
+++ b/app/Http/Middleware/UseLocale.php
@@ -41,7 +41,7 @@ class UseLocale implements MiddlewareInterface
*/
public function handle(Request $request, Closure $next): Response
{
- $tree = app()->make(Tree::class);
+ $tree = app(Tree::class);
// Select a locale
define('WT_LOCALE', I18N::init('', $tree));
diff --git a/app/Http/Middleware/UseTheme.php b/app/Http/Middleware/UseTheme.php
index 94bfe98ee1..750a05e125 100644
--- a/app/Http/Middleware/UseTheme.php
+++ b/app/Http/Middleware/UseTheme.php
@@ -84,7 +84,7 @@ class UseTheme implements MiddlewareInterface
yield $themes->get(Session::get('theme_id', ''));
// Default for tree
- $tree = app()->make(Tree::class);
+ $tree = app(Tree::class);
if ($tree instanceof Tree) {
yield $themes->get($tree->getPreference('THEME_DIR'));
@@ -94,6 +94,6 @@ class UseTheme implements MiddlewareInterface
yield $themes->get(Site::getPreference('THEME_DIR'));
// Default for application
- yield app()->make(WebtreesTheme::class);
+ yield app(WebtreesTheme::class);
}
}
diff --git a/app/Location.php b/app/Location.php
index 55da3d916c..61c75d0d4e 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -66,7 +66,7 @@ class Location
*/
public function id(): int
{
- return app()->make('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->location_name, function () {
+ return app('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->location_name, function () {
// The "top-level" location won't exist in the database.
if ($this->parts->isEmpty()) {
return 0;
@@ -127,7 +127,7 @@ class Location
*/
private function details(): stdClass
{
- return app()->make('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->id(), function () {
+ return app('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->id(), function () {
// The "top-level" location won't exist in the database.
if ($this->parts->isEmpty()) {
return (object) [
diff --git a/app/Module/FamilyBookChartModule.php b/app/Module/FamilyBookChartModule.php
index 059eac3dd9..dcf4d763cd 100644
--- a/app/Module/FamilyBookChartModule.php
+++ b/app/Module/FamilyBookChartModule.php
@@ -182,8 +182,8 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa
public function chart(Individual $individual, int $generations, int $book_size, bool $show_spouse): Response
{
$this->box = (object) [
- 'width' => app()->make(ModuleThemeInterface::class)->parameter('chart-box-x'),
- 'height' => app()->make(ModuleThemeInterface::class)->parameter('chart-box-y'),
+ 'width' => app(ModuleThemeInterface::class)->parameter('chart-box-x'),
+ 'height' => app(ModuleThemeInterface::class)->parameter('chart-box-y'),
];
$this->show_spouse = $show_spouse;
@@ -487,7 +487,7 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa
private function printEmptyBox()
{
- echo app()->make(ModuleThemeInterface::class)->individualBoxEmpty();
+ echo app(ModuleThemeInterface::class)->individualBoxEmpty();
}
/**
diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php
index 62e1dd4c4e..62e3b9732e 100644
--- a/app/Module/FamilyTreeStatisticsModule.php
+++ b/app/Module/FamilyTreeStatisticsModule.php
@@ -70,7 +70,7 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn
*/
public function getBlock(Tree $tree, int $block_id, string $ctype = '', array $cfg = []): string
{
- $statistics = app()->make(Statistics::class);
+ $statistics = app(Statistics::class);
$show_last_update = $this->getBlockSetting($block_id, 'show_last_update', '1');
$show_common_surnames = $this->getBlockSetting($block_id, 'show_common_surnames', '1');
diff --git a/app/Module/FanChartModule.php b/app/Module/FanChartModule.php
index 03f8457f20..db19cc6773 100644
--- a/app/Module/FanChartModule.php
+++ b/app/Module/FanChartModule.php
@@ -203,7 +203,7 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface
$transparent = imagecolorallocate($image, 0, 0, 0);
imagecolortransparent($image, $transparent);
- $theme = app()->make(ModuleThemeInterface::class);
+ $theme = app(ModuleThemeInterface::class);
$foreground = $this->imageColor($image, $theme->parameter('chart-font-color'));
diff --git a/app/Module/GoogleAnalyticsModule.php b/app/Module/GoogleAnalyticsModule.php
index cf35226e37..52543d5fc1 100644
--- a/app/Module/GoogleAnalyticsModule.php
+++ b/app/Module/GoogleAnalyticsModule.php
@@ -82,8 +82,8 @@ class GoogleAnalyticsModule extends AbstractModule implements ModuleAnalyticsInt
public function analyticsSnippet(array $parameters): string
{
// Add extra dimensions (i.e. filtering categories)
- $tree = app()->make(Tree::class);
- $user = app()->make(UserInterface::class);
+ $tree = app(Tree::class);
+ $user = app(UserInterface::class);
$parameters['dimensions'] = (object) [
'dimension1' => $tree instanceof Tree ? $tree->name() : '-',
diff --git a/app/Module/HitCountFooterModule.php b/app/Module/HitCountFooterModule.php
index dd1c29aa2e..9c2dea09c1 100644
--- a/app/Module/HitCountFooterModule.php
+++ b/app/Module/HitCountFooterModule.php
@@ -155,7 +155,7 @@ class HitCountFooterModule extends AbstractModule implements ModuleFooterInterfa
*/
public function handle(Request $request, Closure $next): Response
{
- $tree = app()->make(Tree::class);
+ $tree = app(Tree::class);
if ($tree instanceof Tree && $tree->getPreference('SHOW_COUNTER')) {
$route = $request->get('route');
@@ -177,7 +177,7 @@ class HitCountFooterModule extends AbstractModule implements ModuleFooterInterfa
break;
case 'user-page':
- $user = app()->make(UserInterface::class);
+ $user = app(UserInterface::class);
$this->page_hits = $this->countHit($tree, $page_name, 'user:' . $user->id());
break;
}
diff --git a/app/Module/HourglassChartModule.php b/app/Module/HourglassChartModule.php
index 7ab237c9eb..0689e095dd 100644
--- a/app/Module/HourglassChartModule.php
+++ b/app/Module/HourglassChartModule.php
@@ -153,7 +153,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac
return new Response(view('modules/hourglass-chart/chart', [
'descendants' => $descendants,
'ancestors' => $ancestors,
- 'bhalfheight' => (int) (app()->make(ModuleThemeInterface::class)->parameter('chart-box-y') / 2),
+ 'bhalfheight' => (int) (app(ModuleThemeInterface::class)->parameter('chart-box-y') / 2),
'module_name' => $this->name(),
]));
}
@@ -275,21 +275,21 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac
echo '</table>';
}
echo '</td>';
- echo '<td class="myCharts" width="', app()->make(ModuleThemeInterface::class)->parameter('chart-box-x'), '">';
+ echo '<td class="myCharts" width="', app(ModuleThemeInterface::class)->parameter('chart-box-x'), '">';
}
// Print the descendency expansion arrow
if ($generation == $generations) {
- $tbwidth = app()->make(ModuleThemeInterface::class)->parameter('chart-box-x') + 16;
+ $tbwidth = app(ModuleThemeInterface::class)->parameter('chart-box-x') + 16;
for ($j = $generation; $j < $generations; $j++) {
- echo "<div style='width: ", $tbwidth, "px;'><br></div></td><td style='width:", app()->make(ModuleThemeInterface::class)->parameter('chart-box-x'), "px'>";
+ echo "<div style='width: ", $tbwidth, "px;'><br></div></td><td style='width:", app(ModuleThemeInterface::class)->parameter('chart-box-x'), "px'>";
}
$kcount = 0;
foreach ($families as $family) {
$kcount += $family->numberOfChildren();
}
if ($kcount == 0) {
- echo "</td><td style='width:", app()->make(ModuleThemeInterface::class)->parameter('chart-box-x'), "px'>";
+ echo "</td><td style='width:", app(ModuleThemeInterface::class)->parameter('chart-box-x'), "px'>";
} else {
echo '<a href="#" title="' . I18N::translate('Children') . '" data-route="Descendants" data-xref="' . e($pid) . '" data-spouses="' . e($show_spouse) . '" data-tree="' . e($individual->tree()->name()) . '">' . view('icons/arrow-left') . '</a>';
@@ -297,7 +297,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac
if ($show_spouse) {
echo str_repeat('<br><br><br>', count($families));
}
- echo "</td><td style='width:", app()->make(ModuleThemeInterface::class)->parameter('chart-box-x'), "px'>";
+ echo "</td><td style='width:", app(ModuleThemeInterface::class)->parameter('chart-box-x'), "px'>";
}
}
@@ -314,14 +314,14 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac
}
//-- add offset divs to make things line up better
if ($generation == $generations) {
- echo "<tr><td colspan '2'><div style='height:", (app()->make(ModuleThemeInterface::class)->parameter('chart-box-y') / 4), 'px; width:', app()->make(ModuleThemeInterface::class)->parameter('chart-box-x'), "px;'><br></div>";
+ echo "<tr><td colspan '2'><div style='height:", (app(ModuleThemeInterface::class)->parameter('chart-box-y') / 4), 'px; width:', app(ModuleThemeInterface::class)->parameter('chart-box-x'), "px;'><br></div>";
}
}
echo '</td></tr></table>';
// For the root individual, print a down arrow that allows changing the root of tree
if ($show_menu && $generation == 1) {
- echo '<div class="text-center" id="childarrow" style="position:absolute; width:', app()->make(ModuleThemeInterface::class)->parameter('chart-box-x'), 'px;">';
+ echo '<div class="text-center" id="childarrow" style="position:absolute; width:', app(ModuleThemeInterface::class)->parameter('chart-box-x'), 'px;">';
echo '<a href="#" title="' . I18N::translate('Family') . '" id="spouse-child-links">' . view('icons/arrow-down') . '</a>';
echo '<div id="childbox">';
echo '<table cellspacing="0" cellpadding="0" border="0" class="person_box"><tr><td> ';
@@ -421,12 +421,12 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac
if ($family === null) {
// Prints empty table columns for children w/o parents up to the max generation
// This allows vertical line spacing to be consistent
- echo '<table><tr><td> ' . app()->make(ModuleThemeInterface::class)->individualBoxEmpty() . '</td>';
+ echo '<table><tr><td> ' . app(ModuleThemeInterface::class)->individualBoxEmpty() . '</td>';
echo '<td> ';
// Recursively get the father’s family
$this->printPersonPedigree($individual, $generation + 1, $generations, $show_spouse);
echo '</td></tr>';
- echo '<tr><td> ' . app()->make(ModuleThemeInterface::class)->individualBoxEmpty() . '</td>';
+ echo '<tr><td> ' . app(ModuleThemeInterface::class)->individualBoxEmpty() . '</td>';
echo '<td> ';
// Recursively get the mother’s family
$this->printPersonPedigree($individual, $generation + 1, $generations, $show_spouse);
@@ -455,9 +455,9 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac
if ($generation < $genoffset - 1) {
echo '<table>';
for ($i = $generation; $i < ((2 ** (($genoffset - 1) - $generation)) / 2) + 2; $i++) {
- echo app()->make(ModuleThemeInterface::class)->individualBoxEmpty();
+ echo app(ModuleThemeInterface::class)->individualBoxEmpty();
echo '</tr>';
- echo app()->make(ModuleThemeInterface::class)->individualBoxEmpty();
+ echo app(ModuleThemeInterface::class)->individualBoxEmpty();
echo '</tr>';
}
echo '</table>';
diff --git a/app/Module/HtmlBlockModule.php b/app/Module/HtmlBlockModule.php
index cd08cf15db..6434081d72 100644
--- a/app/Module/HtmlBlockModule.php
+++ b/app/Module/HtmlBlockModule.php
@@ -65,7 +65,7 @@ class HtmlBlockModule extends AbstractModule implements ModuleBlockInterface
*/
public function getBlock(Tree $tree, int $block_id, string $ctype = '', array $cfg = []): string
{
- $statistics = app()->make(Statistics::class);
+ $statistics = app(Statistics::class);
$title = $this->getBlockSetting($block_id, 'title', '');
$content = $this->getBlockSetting($block_id, 'html', '');
diff --git a/app/Module/LoggedInUsersModule.php b/app/Module/LoggedInUsersModule.php
index 1c79d66cd0..8ae423a185 100644
--- a/app/Module/LoggedInUsersModule.php
+++ b/app/Module/LoggedInUsersModule.php
@@ -80,7 +80,7 @@ class LoggedInUsersModule extends AbstractModule implements ModuleBlockInterface
public function getBlock(Tree $tree, int $block_id, string $ctype = '', array $cfg = []): string
{
/** @var Statistics $statistics */
- $statistics = app()->make(Statistics::class);
+ $statistics = app(Statistics::class);
$content = '<div class="logged_in_count">' . $statistics->usersLoggedInList() . '</div>';
diff --git a/app/Module/ModuleThemeTrait.php b/app/Module/ModuleThemeTrait.php
index 09ae533064..4a99c4cad2 100644
--- a/app/Module/ModuleThemeTrait.php
+++ b/app/Module/ModuleThemeTrait.php
@@ -502,7 +502,7 @@ trait ModuleThemeTrait
{
$themes = app(ModuleService::class)->findByInterface(ModuleThemeInterface::class);
- $current_theme = app()->make(ModuleThemeInterface::class);
+ $current_theme = app(ModuleThemeInterface::class);
if ($themes->count() > 1) {
$submenus = $themes->map(function (ModuleThemeInterface $theme) use ($current_theme): Menu {
diff --git a/app/Module/ThemeSelectModule.php b/app/Module/ThemeSelectModule.php
index a700214c92..b06e15a962 100644
--- a/app/Module/ThemeSelectModule.php
+++ b/app/Module/ThemeSelectModule.php
@@ -62,7 +62,7 @@ class ThemeSelectModule extends AbstractModule implements ModuleBlockInterface
*/
public function getBlock(Tree $tree, int $block_id, string $ctype = '', array $cfg = []): string
{
- $menu = app()->make(ModuleThemeInterface::class)->menuThemes();
+ $menu = app(ModuleThemeInterface::class)->menuThemes();
if ($menu) {
$content = '<ul class="nav text-justify">' . $menu->bootstrap4() . '</ul>';
diff --git a/app/Module/TopGivenNamesModule.php b/app/Module/TopGivenNamesModule.php
index a62b483c15..1c4ceac502 100644
--- a/app/Module/TopGivenNamesModule.php
+++ b/app/Module/TopGivenNamesModule.php
@@ -68,7 +68,7 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface
*/
public function getBlock(Tree $tree, int $block_id, string $ctype = '', array $cfg = []): string
{
- $statistics = app()->make(Statistics::class);
+ $statistics = app(Statistics::class);
$num = $this->getBlockSetting($block_id, 'num', self::DEFAULT_NUMBER);
$infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE);
diff --git a/app/Place.php b/app/Place.php
index a1487f02c9..861f33c7a5 100644
--- a/app/Place.php
+++ b/app/Place.php
@@ -74,7 +74,7 @@ class Place
*/
public function id(): int
{
- return app()->make('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->place_name, function () {
+ return app('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->place_name, function () {
// The "top-level" place won't exist in the database.
if ($this->parts->isEmpty()) {
return 0;
diff --git a/app/Services/ModuleService.php b/app/Services/ModuleService.php
index 5f5e9ec306..70d53b441f 100644
--- a/app/Services/ModuleService.php
+++ b/app/Services/ModuleService.php
@@ -275,7 +275,7 @@ class ModuleService
{
return Collection::make(self::CORE_MODULES)
->map(function (string $class, string $name): ModuleInterface {
- $module = app()->make($class);
+ $module = app($class);
$module->setName($name);
diff --git a/app/Services/UserService.php b/app/Services/UserService.php
index 0b05bbb58b..a6404b3328 100644
--- a/app/Services/UserService.php
+++ b/app/Services/UserService.php
@@ -324,9 +324,9 @@ class UserService
*/
public function contactLink(User $contact_user): string
{
- $tree = app()->make(Tree::class);
- $user = app()->make(UserInterface::class);
- $request = app()->make(Request::class);
+ $tree = app(Tree::class);
+ $user = app(UserInterface::class);
+ $request = app(Request::class);
if ($contact_user->getPreference('contactmethod') === 'mailto') {
$url = 'mailto:' . $contact_user->email();
diff --git a/app/Statistics/Google/ChartBirth.php b/app/Statistics/Google/ChartBirth.php
index 482b0d7cc5..e679cd4645 100644
--- a/app/Statistics/Google/ChartBirth.php
+++ b/app/Statistics/Google/ChartBirth.php
@@ -57,7 +57,7 @@ class ChartBirth
public function __construct(Tree $tree)
{
$this->tree = $tree;
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->century_service = new CenturyService();
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartCommonGiven.php b/app/Statistics/Google/ChartCommonGiven.php
index c9f3a7e700..ea710ba8cf 100644
--- a/app/Statistics/Google/ChartCommonGiven.php
+++ b/app/Statistics/Google/ChartCommonGiven.php
@@ -41,7 +41,7 @@ class ChartCommonGiven
*/
public function __construct()
{
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartCommonSurname.php b/app/Statistics/Google/ChartCommonSurname.php
index 311578142a..50a99ebde2 100644
--- a/app/Statistics/Google/ChartCommonSurname.php
+++ b/app/Statistics/Google/ChartCommonSurname.php
@@ -49,7 +49,7 @@ class ChartCommonSurname
*/
public function __construct(Tree $tree)
{
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->surname_tradition = $tree->getPreference('SURNAME_TRADITION');
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartDeath.php b/app/Statistics/Google/ChartDeath.php
index 5ea88c9c73..5f50ebe57f 100644
--- a/app/Statistics/Google/ChartDeath.php
+++ b/app/Statistics/Google/ChartDeath.php
@@ -57,7 +57,7 @@ class ChartDeath
public function __construct(Tree $tree)
{
$this->tree = $tree;
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->century_service = new CenturyService();
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartDistribution.php b/app/Statistics/Google/ChartDistribution.php
index fd09c6c9b7..b8adcef137 100644
--- a/app/Statistics/Google/ChartDistribution.php
+++ b/app/Statistics/Google/ChartDistribution.php
@@ -69,7 +69,7 @@ class ChartDistribution
public function __construct(Tree $tree)
{
$this->tree = $tree;
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->country_service = new CountryService();
$this->individualRepository = new IndividualRepository($tree);
$this->placeRepository = new PlaceRepository($tree);
diff --git a/app/Statistics/Google/ChartDivorce.php b/app/Statistics/Google/ChartDivorce.php
index 8878329793..68b9444232 100644
--- a/app/Statistics/Google/ChartDivorce.php
+++ b/app/Statistics/Google/ChartDivorce.php
@@ -57,7 +57,7 @@ class ChartDivorce
public function __construct(Tree $tree)
{
$this->tree = $tree;
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->century_service = new CenturyService();
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartFamilyLargest.php b/app/Statistics/Google/ChartFamilyLargest.php
index cd8a761ac1..80f3783934 100644
--- a/app/Statistics/Google/ChartFamilyLargest.php
+++ b/app/Statistics/Google/ChartFamilyLargest.php
@@ -52,7 +52,7 @@ class ChartFamilyLargest
public function __construct(Tree $tree)
{
$this->tree = $tree;
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartFamilyWithSources.php b/app/Statistics/Google/ChartFamilyWithSources.php
index 0db2467cf8..7c725fe16f 100644
--- a/app/Statistics/Google/ChartFamilyWithSources.php
+++ b/app/Statistics/Google/ChartFamilyWithSources.php
@@ -41,7 +41,7 @@ class ChartFamilyWithSources
*/
public function __construct()
{
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartIndividualWithSources.php b/app/Statistics/Google/ChartIndividualWithSources.php
index 09166f15e3..0a468ac0b1 100644
--- a/app/Statistics/Google/ChartIndividualWithSources.php
+++ b/app/Statistics/Google/ChartIndividualWithSources.php
@@ -41,7 +41,7 @@ class ChartIndividualWithSources
*/
public function __construct()
{
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartMarriage.php b/app/Statistics/Google/ChartMarriage.php
index 117d594d93..bb0c387be7 100644
--- a/app/Statistics/Google/ChartMarriage.php
+++ b/app/Statistics/Google/ChartMarriage.php
@@ -57,7 +57,7 @@ class ChartMarriage
public function __construct(Tree $tree)
{
$this->tree = $tree;
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->century_service = new CenturyService();
$this->color_service = new ColorService();
}
diff --git a/app/Statistics/Google/ChartMedia.php b/app/Statistics/Google/ChartMedia.php
index ff505ea595..9348917b9e 100644
--- a/app/Statistics/Google/ChartMedia.php
+++ b/app/Statistics/Google/ChartMedia.php
@@ -42,7 +42,7 @@ class ChartMedia
*/
public function __construct()
{
- $this->theme = app()->make(ModuleThemeInterface::class);
+ $this->theme = app(ModuleThemeInterface::class);
$this->color_service = new ColorService();
}
diff --git a/app/View.php b/app/View.php
index 375ed14e05..7dcc6554f0 100644
--- a/app/View.php
+++ b/app/View.php
@@ -200,7 +200,7 @@ class View
//$paths = glob(WT_ROOT . Webtrees::MODULES_PATH . '*/' . self::TEMPLATE_PATH);
// Theme views
// @TODO - this won't work during setup.
- //$paths[] = WT_ROOT . Webtrees::THEMES_PATH . app()->make(ModuleThemeInterface::class)->name() . '/' . self::TEMPLATE_PATH;
+ //$paths[] = WT_ROOT . Webtrees::THEMES_PATH . app(ModuleThemeInterface::class)->name() . '/' . self::TEMPLATE_PATH;
// Core views
$paths[] = WT_ROOT . self::TEMPLATE_PATH;
diff --git a/index.php b/index.php
index a8f62bc0cf..f298ab65fc 100644
--- a/index.php
+++ b/index.php
@@ -77,7 +77,7 @@ try {
define('WT_DATA_DIR', 'data/');
/** @var SetupController $controller */
- $controller = app()->make(SetupController::class);
+ $controller = app(SetupController::class);
$response = $controller->setup($request);
$response->prepare($request)->send();
@@ -94,7 +94,7 @@ try {
Database::connect($database_config);
// Update the database schema, if necessary.
- app()->make(MigrationService::class)->updateSchema('\Fisharebest\Webtrees\Schema', 'WT_SCHEMA_VERSION', Webtrees::SCHEMA_VERSION);
+ app(MigrationService::class)->updateSchema('\Fisharebest\Webtrees\Schema', 'WT_SCHEMA_VERSION', Webtrees::SCHEMA_VERSION);
$middleware_stack = [
CheckForMaintenanceMode::class,
@@ -120,7 +120,7 @@ try {
}
// Allow modules to provide middleware.
- foreach (app()->make(ModuleService::class)->findByInterface(MiddlewareInterface::class) as $middleware) {
+ foreach (app(ModuleService::class)->findByInterface(MiddlewareInterface::class) as $middleware) {
$middleware_stack[] = $middleware;
}
@@ -129,7 +129,7 @@ try {
// Create the middleware *after* loading the modules, to give modules the opportunity to replace middleware.
$middleware_stack = array_map(function ($middleware): MiddlewareInterface {
- return $middleware instanceof MiddlewareInterface ? $middleware : app()->make($middleware);
+ return $middleware instanceof MiddlewareInterface ? $middleware : app($middleware);
}, $middleware_stack);
// Apply the middleware using the "onion" pattern.
@@ -148,7 +148,7 @@ try {
[$controller_name, $action] = explode('@', $controller_action);
$controller_class = '\\Fisharebest\\Webtrees\\Http\\Controllers\\' . $controller_name;
- $controller = app()->make($controller_class);
+ $controller = app($controller_class);
return app()->dispatch($controller, $action);
});
diff --git a/modules_v4/README.md b/modules_v4/README.md
index ae62c661de..dbe74ccc28 100644
--- a/modules_v4/README.md
+++ b/modules_v4/README.md
@@ -144,7 +144,7 @@ created until after the modules.
as these objects are not created until after the module is created.
Instead, you can fetch these items when they are needed from the "application container" using:
-``` $user = app()->make('UserInterface')```
+``` $user = app(UserInterface::class)```
```php
<?php
diff --git a/resources/views/family-page.phtml b/resources/views/family-page.phtml
index 9f9dbe1dbc..669ddaa0b3 100644
--- a/resources/views/family-page.phtml
+++ b/resources/views/family-page.phtml
@@ -31,7 +31,7 @@
<div class="wt-page-content">
<table id="family-table" class="w-100" role="presentation">
<tr style="vertical-align:top;">
- <td style="width: <?= app()->make(ModuleThemeInterface::class)->parameter('chart-box-x') + 30 ?>px;">
+ <td style="width: <?= app(ModuleThemeInterface::class)->parameter('chart-box-x') + 30 ?>px;">
<?php FunctionsCharts::printFamilyChildren($record) ?>
</td>
<td>
diff --git a/resources/views/layouts/default.phtml b/resources/views/layouts/default.phtml
index e95b0d291c..c70096a3e6 100644
--- a/resources/views/layouts/default.phtml
+++ b/resources/views/layouts/default.phtml
@@ -49,18 +49,18 @@
<meta name="msapplication-config" content="<?= e(asset('browserconfig.xml')) ?>">
<link rel="stylesheet" href="<?= e(asset('css/vendor.min.css')) ?>">
- <?php foreach (app()->make(ModuleThemeInterface::class)->stylesheets() as $stylesheet) : ?>
+ <?php foreach (app(ModuleThemeInterface::class)->stylesheets() as $stylesheet) : ?>
<link rel="stylesheet" href="<?= e($stylesheet) ?>">
<?php endforeach ?>
<?= View::stack('styles') ?>
- <?= app()->make(ModuleService::class)->findByInterface(ModuleAnalyticsInterface::class)->filter(function (ModuleAnalyticsInterface $module): bool { return $module->analyticsCanShow(); })->map(function (ModuleAnalyticsInterface $module): string { return $module->analyticsSnippet($module->analyticsParameters()); })->implode('') ?>
+ <?= app(ModuleService::class)->findByInterface(ModuleAnalyticsInterface::class)->filter(function (ModuleAnalyticsInterface $module): bool { return $module->analyticsCanShow(); })->map(function (ModuleAnalyticsInterface $module): string { return $module->analyticsSnippet($module->analyticsParameters()); })->implode('') ?>
<?= DebugBar::renderHead() ?>
</head>
- <body class="wt-global wt-theme-<?= e(app()->make(ModuleThemeInterface::class)->name()) ?> wt-route-<?= e(e(app()->make(Request::class)->get('route'))) ?>">
+ <body class="wt-global wt-theme-<?= e(app(ModuleThemeInterface::class)->name()) ?> wt-route-<?= e(e(app(Request::class)->get('route'))) ?>">
<header class="wt-header-wrapper d-print-none">
<div class="container wt-header-container">
<div class="row wt-header-content">
@@ -93,7 +93,7 @@
<div class="col wt-secondary-navigation">
<ul class="nav wt-user-menu">
- <?php foreach (app()->make(ModuleThemeInterface::class)->userMenu($tree) as $menu) : ?>
+ <?php foreach (app(ModuleThemeInterface::class)->userMenu($tree) as $menu) : ?>
<?= $menu->bootstrap4() ?>
<?php endforeach ?>
</ul>
@@ -102,7 +102,7 @@
<?php if ($tree !== null) : ?>
<nav class="col wt-primary-navigation">
<ul class="nav wt-genealogy-menu">
- <?php foreach (app()->make(ModuleThemeInterface::class)->genealogyMenu($tree) as $menu) : ?>
+ <?php foreach (app(ModuleThemeInterface::class)->genealogyMenu($tree) as $menu) : ?>
<?= $menu->bootstrap4() ?>
<?php endforeach ?>
</ul>
@@ -130,7 +130,7 @@
</main>
<footer class="wt-footers container d-print-none">
- <?= app()->make(ModuleService::class)->findByInterface(ModuleFooterInterface::class)->map(function (ModuleFooterInterface $module) use ($tree): string { return $module->getFooter($tree); })->implode('') ?>
+ <?= app(ModuleService::class)->findByInterface(ModuleFooterInterface::class)->map(function (ModuleFooterInterface $module) use ($tree): string { return $module->getFooter($tree); })->implode('') ?>
</footer>
<script src="<?= e(asset('js/vendor.min.js')) ?>"></script>
diff --git a/resources/views/media-page-menu.phtml b/resources/views/media-page-menu.phtml
index db15244f43..205fc7f66b 100644
--- a/resources/views/media-page-menu.phtml
+++ b/resources/views/media-page-menu.phtml
@@ -10,7 +10,7 @@
</button>
<div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
- <?php if (false && app()->make(ModuleService::class)->findByInterface(CensusAssistantModule::class)) : ?>
+ <?php if (false && app(ModuleService::class)->findByInterface(CensusAssistantModule::class)) : ?>
<a class="dropdown-item menu-obje-link" href="#" onclick="return ilinkitem('<?= e($record->xref()) ?>','manage','<?= e($record->tree()->name()) ?>');">
<?= I18N::translate('Manage the links') ?>
</a>
diff --git a/resources/views/modules/ckeditor/ckeditor-js.phtml b/resources/views/modules/ckeditor/ckeditor-js.phtml
index 96d6dd3a6b..7c41367e77 100644
--- a/resources/views/modules/ckeditor/ckeditor-js.phtml
+++ b/resources/views/modules/ckeditor/ckeditor-js.phtml
@@ -2,7 +2,7 @@
<?php use Fisharebest\Webtrees\Services\ModuleService; ?>
<?php use Fisharebest\Webtrees\View; ?>
-<?php if (app()->make(ModuleService::class)->findByInterface(CkeditorModule::class)): ?>
+<?php if (app(ModuleService::class)->findByInterface(CkeditorModule::class)): ?>
<?php View::push('javascript') ?>
<script src="<?= e(CkeditorModule::CKEDITOR_PATH) ?>ckeditor.js"></script>
<script src="<?= e(CkeditorModule::CKEDITOR_PATH) ?>adapters/jquery.js"></script>
diff --git a/resources/views/modules/gedcom_favorites/favorites.phtml b/resources/views/modules/gedcom_favorites/favorites.phtml
index e2456c1bdd..0684eff874 100644
--- a/resources/views/modules/gedcom_favorites/favorites.phtml
+++ b/resources/views/modules/gedcom_favorites/favorites.phtml
@@ -7,7 +7,7 @@
<?php if ($favorite->favorite_type === 'URL') : ?>
<a href="<?= e($favorite->url) ?>"><b><?= e($favorite->title) ?></b></a>
<?php elseif ($favorite->record instanceof Individual) : ?>
- <?= app()->make(ModuleThemeInterface::class)->individualBoxLarge($favorite->record) ?>
+ <?= app(ModuleThemeInterface::class)->individualBoxLarge($favorite->record) ?>
<?php elseif ($favorite->record !== null) : ?>
<?= $favorite->record->formatList() ?>
<?php endif ?>
diff --git a/resources/views/modules/relatives/family.phtml b/resources/views/modules/relatives/family.phtml
index 5a47c868ed..16b493d2b0 100644
--- a/resources/views/modules/relatives/family.phtml
+++ b/resources/views/modules/relatives/family.phtml
@@ -32,7 +32,7 @@
<?= Functions::getCloseRelationshipName($individual, $person) ?>
</th>
<td class="border-0 p-0">
- <?= app()->make(ModuleThemeInterface::class)->individualBoxLarge($person) ?>
+ <?= app(ModuleThemeInterface::class)->individualBoxLarge($person) ?>
</td>
</tr>
<?php
@@ -70,7 +70,7 @@
<?= Functions::getCloseRelationshipName($individual, $person) ?>
</th>
<td class="border-0 p-0">
- <?= app()->make(ModuleThemeInterface::class)->individualBoxLarge($person) ?>
+ <?= app(ModuleThemeInterface::class)->individualBoxLarge($person) ?>
</td>
</tr>
<?php
@@ -179,7 +179,7 @@
<?= Functions::getCloseRelationshipName($individual, $person) ?>
</th>
<td class="border-0 p-0">
- <?= app()->make(ModuleThemeInterface::class)->individualBoxLarge($person) ?>
+ <?= app(ModuleThemeInterface::class)->individualBoxLarge($person) ?>
</td>
</tr>
<?php
diff --git a/resources/views/modules/user_favorites/favorites.phtml b/resources/views/modules/user_favorites/favorites.phtml
index 1429780524..8e2026ba4b 100644
--- a/resources/views/modules/user_favorites/favorites.phtml
+++ b/resources/views/modules/user_favorites/favorites.phtml
@@ -7,7 +7,7 @@
<?php if ($favorite->favorite_type === 'URL') : ?>
<a href="<?= e($favorite->url) ?>"><b><?= e($favorite->title) ?></b></a>
<?php elseif ($favorite->record instanceof Individual) : ?>
- <?= app()->make(ModuleThemeInterface::class)->individualBoxLarge($favorite->record) ?>
+ <?= app(ModuleThemeInterface::class)->individualBoxLarge($favorite->record) ?>
<?php elseif ($favorite->record !== null) : ?>
<?= $favorite->record->formatList() ?>
<?php endif ?>
diff --git a/routes/web.php b/routes/web.php
index 760094bf9c..9d50f5ffbb 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -18,7 +18,7 @@ declare(strict_types=1);
namespace Fisharebest\Webtrees;
/** @var Tree|null $tree */
-$tree = app()->make(Tree::class);
+$tree = app(Tree::class);
$routes = [];
diff --git a/tests/app/Http/Controllers/Admin/LocationControllerTest.php b/tests/app/Http/Controllers/Admin/LocationControllerTest.php
index 7d7469dae6..9ab0be3b7b 100644
--- a/tests/app/Http/Controllers/Admin/LocationControllerTest.php
+++ b/tests/app/Http/Controllers/Admin/LocationControllerTest.php
@@ -36,7 +36,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testMapData(): void
{
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'mapData');
$this->assertInstanceOf(Response::class, $response);
@@ -47,7 +47,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testMapDataEdit(): void
{
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'mapDataEdit');
$this->assertInstanceOf(Response::class, $response);
@@ -58,7 +58,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testMapDataSave(): void
{
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'mapDataSave');
$this->assertInstanceOf(Response::class, $response);
@@ -69,7 +69,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testMapDataDelete(): void
{
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'mapDataDelete');
$this->assertInstanceOf(Response::class, $response);
@@ -80,7 +80,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testExportLocations(): void
{
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'exportLocations');
$this->assertInstanceOf(Response::class, $response);
@@ -91,7 +91,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testImportLocations(): void
{
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'importLocations');
$this->assertInstanceOf(Response::class, $response);
@@ -106,7 +106,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
app()->instance(Request::class, new Request([], [], [], [], ['localfile' => $csv]));
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'importLocationsAction');
$this->assertInstanceOf(Response::class, $response);
@@ -119,7 +119,7 @@ class LocationControllerTest extends \Fisharebest\Webtrees\TestCase
{
app()->instance(Tree::class, Tree::create('name', 'title'));
- $controller = app()->make(LocationController::class);
+ $controller = app(LocationController::class);
$response = app()->dispatch($controller, 'importLocationsFromTree');
$this->assertInstanceOf(Response::class, $response);
diff --git a/tests/app/Http/Controllers/Admin/MapProviderControllerTest.php b/tests/app/Http/Controllers/Admin/MapProviderControllerTest.php
index 6dd24b6ac1..aeffefe1bc 100644
--- a/tests/app/Http/Controllers/Admin/MapProviderControllerTest.php
+++ b/tests/app/Http/Controllers/Admin/MapProviderControllerTest.php
@@ -33,7 +33,7 @@ class MapProviderControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testMapProviderEdit(): void
{
- $controller = app()->make(MapProviderController::class);
+ $controller = app(MapProviderController::class);
$response = app()->dispatch($controller, 'mapProviderEdit');
$this->assertInstanceOf(Response::class, $response);
@@ -44,7 +44,7 @@ class MapProviderControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testMapProviderSave(): void
{
- $controller = app()->make(MapProviderController::class);
+ $controller = app(MapProviderController::class);
$response = app()->dispatch($controller, 'mapProviderSave');
$this->assertInstanceOf(Response::class, $response);
diff --git a/tests/app/Http/Controllers/Admin/MediaControllerTest.php b/tests/app/Http/Controllers/Admin/MediaControllerTest.php
index 95a31919ed..75bb205ff1 100644
--- a/tests/app/Http/Controllers/Admin/MediaControllerTest.php
+++ b/tests/app/Http/Controllers/Admin/MediaControllerTest.php
@@ -34,7 +34,7 @@ class MediaControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testIndex(): void
{
- $controller = app()->make(MediaController::class);
+ $controller = app(MediaController::class);
$response = app()->dispatch($controller, 'index');
$this->assertInstanceOf(Response::class, $response);
@@ -46,7 +46,7 @@ class MediaControllerTest extends \Fisharebest\Webtrees\TestCase
public function testDataLocal(): void
{
app()->instance(Request::class, new Request(['files' => 'local']));
- $controller = app()->make(MediaController::class);
+ $controller = app(MediaController::class);
$response = app()->dispatch($controller, 'data');
$this->assertInstanceOf(Response::class, $response);
@@ -58,7 +58,7 @@ class MediaControllerTest extends \Fisharebest\Webtrees\TestCase
public function testDataExternal(): void
{
app()->instance(Request::class, new Request(['files' => 'external']));
- $controller = app()->make(MediaController::class);
+ $controller = app(MediaController::class);
$response = app()->dispatch($controller, 'data');
$this->assertInstanceOf(Response::class, $response);
@@ -70,7 +70,7 @@ class MediaControllerTest extends \Fisharebest\Webtrees\TestCase
public function testDataUnused(): void
{
app()->instance(Request::class, new Request(['files' => 'unused']));
- $controller = app()->make(MediaController::class);
+ $controller = app(MediaController::class);
$response = app()->dispatch($controller, 'data');
$this->assertInstanceOf(Response::class, $response);
@@ -81,7 +81,7 @@ class MediaControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testDelete(): void
{
- $controller = app()->make(MediaController::class);
+ $controller = app(MediaController::class);
$response = app()->dispatch($controller, 'delete');
$this->assertInstanceOf(Response::class, $response);
@@ -92,7 +92,7 @@ class MediaControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testUpload(): void
{
- $controller = app()->make(MediaController::class);
+ $controller = app(MediaController::class);
$response = app()->dispatch($controller, 'upload');
$this->assertInstanceOf(Response::class, $response);
@@ -103,7 +103,7 @@ class MediaControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testUploadAction(): void
{
- $controller = app()->make(MediaController::class);
+ $controller = app(MediaController::class);
$response = app()->dispatch($controller, 'uploadAction');
$this->assertInstanceOf(Response::class, $response);
diff --git a/tests/app/Http/Controllers/Admin/ModuleControllerTest.php b/tests/app/Http/Controllers/Admin/ModuleControllerTest.php
index eff2b9ba90..de9d412ce4 100644
--- a/tests/app/Http/Controllers/Admin/ModuleControllerTest.php
+++ b/tests/app/Http/Controllers/Admin/ModuleControllerTest.php
@@ -34,7 +34,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testList(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'list');
$this->assertInstanceOf(Response::class, $response);
@@ -45,7 +45,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListAnalytics(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listAnalytics');
$this->assertInstanceOf(Response::class, $response);
@@ -56,7 +56,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListBlocks(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listBlocks');
$this->assertInstanceOf(Response::class, $response);
@@ -67,7 +67,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListCharts(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listCharts');
$this->assertInstanceOf(Response::class, $response);
@@ -78,7 +78,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListFooters(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listFooters');
$this->assertInstanceOf(Response::class, $response);
@@ -89,7 +89,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListHistory(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listHistory');
$this->assertInstanceOf(Response::class, $response);
@@ -100,7 +100,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListLanguages(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listLanguages');
$this->assertInstanceOf(Response::class, $response);
@@ -111,7 +111,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListMenus(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listMenus');
$this->assertInstanceOf(Response::class, $response);
@@ -122,7 +122,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListReports(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listReports');
$this->assertInstanceOf(Response::class, $response);
@@ -133,7 +133,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListSidebars(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listSidebars');
$this->assertInstanceOf(Response::class, $response);
@@ -144,7 +144,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListTabs(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listTabs');
$this->assertInstanceOf(Response::class, $response);
@@ -155,7 +155,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testListThemes(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'listThemes');
$this->assertInstanceOf(Response::class, $response);
@@ -167,7 +167,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdate(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'update');
$this->assertInstanceOf(Response::class, $response);
@@ -179,7 +179,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateAnalytics(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateAnalytics');
$this->assertInstanceOf(Response::class, $response);
@@ -191,7 +191,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateBlocks(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateBlocks');
$this->assertInstanceOf(Response::class, $response);
@@ -203,7 +203,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateCharts(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateCharts');
$this->assertInstanceOf(Response::class, $response);
@@ -215,7 +215,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateFooters(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateFooters');
$this->assertInstanceOf(Response::class, $response);
@@ -227,7 +227,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateHistory(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateHistory');
$this->assertInstanceOf(Response::class, $response);
@@ -239,7 +239,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateLanguages(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateLanguages');
$this->assertInstanceOf(Response::class, $response);
@@ -251,7 +251,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateMenus(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateMenus');
$this->assertInstanceOf(Response::class, $response);
@@ -263,7 +263,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateReports(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateReports');
$this->assertInstanceOf(Response::class, $response);
@@ -275,7 +275,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateSidebars(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateSidebars');
$this->assertInstanceOf(Response::class, $response);
@@ -287,7 +287,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateTabs(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateTabs');
$this->assertInstanceOf(Response::class, $response);
@@ -299,7 +299,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
public function testUpdateThemes(): void
{
Tree::create('name', 'title');
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'updateThemes');
$this->assertInstanceOf(Response::class, $response);
@@ -310,7 +310,7 @@ class ModuleControllerTest extends \Fisharebest\Webtrees\TestCase
*/
public function testDeleteModuleSettings(): void
{
- $controller = app()->make(ModuleController::class);
+ $controller = app(ModuleController::class);
$response = app()->dispatch($controller, 'deleteModuleSettings');
$this->assertInstanceOf(Response::class, $response);
diff --git a/tests/app/TreeUserTest.php b/tests/app/TreeUserTest.php
index 9303a32630..2f8d926349 100644
--- a/tests/app/TreeUserTest.php
+++ b/tests/app/TreeUserTest.php
@@ -45,7 +45,7 @@ class TreeUserTest extends TestCase
$this->assertSame('title', $user->realName());
$this->assertSame('', $user->userName());
- app()->make('cache.array')->flush();
+ app('cache.array')->flush();
$tree->setPreference('WEBTREES_EMAIL', 'foo@example.com');
$this->assertSame('foo@example.com', $user->email());
}
diff --git a/tests/feature/UserAdminTest.php b/tests/feature/UserAdminTest.php
index 4dd3e3b553..2656504ff6 100644
--- a/tests/feature/UserAdminTest.php
+++ b/tests/feature/UserAdminTest.php
@@ -39,7 +39,7 @@ class UserAdminTest extends TestCase
$user_service->create('AdminName', 'Administrator', 'admin@example.com', 'secret');
$user_service->create('UserName', 'RealName', 'user@example.com', 'secret');
- $controller = app()->make(UsersController::class);
+ $controller = app(UsersController::class);
$response = app()->dispatch($controller, 'data');
$this->assertContains('AdminName', $response->getContent());
@@ -63,7 +63,7 @@ class UserAdminTest extends TestCase
$request = new Request(['search' => ['value' => 'admin']]);
app()->instance(Request::class, $request);
- $controller = app()->make(UsersController::class);
+ $controller = app(UsersController::class);
$response = app()->dispatch($controller, 'data');
$this->assertContains('AdminName', $response->getContent());
@@ -87,7 +87,7 @@ class UserAdminTest extends TestCase
$request = new Request(['length' => 1]);
app()->instance(Request::class, $request);
- $controller = app()->make(UsersController::class);
+ $controller = app(UsersController::class);
$response = app()->dispatch($controller, 'data');
$this->assertContains('AdminName', $response->getContent());
@@ -107,7 +107,7 @@ class UserAdminTest extends TestCase
$request = new Request(['order' => [['column' => 2, 'dir' => 'asc']]]);
app()->instance(Request::class, $request);
- $controller = app()->make(UsersController::class);
+ $controller = app(UsersController::class);
$response = app()->dispatch($controller, 'data');
$pos1 = strpos($response->getContent(), 'AdminName');
@@ -116,7 +116,7 @@ class UserAdminTest extends TestCase
$request = new Request(['order' => [['column' => 2, 'dir' => 'desc']]]);
app()->instance(Request::class, $request);
- $controller = app()->make(UsersController::class);
+ $controller = app(UsersController::class);
$response = app()->dispatch($controller, 'data');
$pos1 = strpos($response->getContent(), 'AdminName');