diff --git a/app/Barrier.php b/app/Barrier.php index 0e1d5a9f97..d90829c677 100644 --- a/app/Barrier.php +++ b/app/Barrier.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; class Barrier extends Model @@ -11,7 +12,7 @@ class Barrier extends Model protected $hidden = []; public $timestamps = false; - public function barriers() + public function barriers(): BelongsToMany { return $this->belongsToMany(\App\Device::class, 'devices_barriers', 'barrier_id', 'device_id'); } diff --git a/app/Category.php b/app/Category.php index e681d44394..c49e50d18d 100644 --- a/app/Category.php +++ b/app/Category.php @@ -37,7 +37,7 @@ class Category extends Model public function findAll() { try { - return DB::select(DB::raw('SELECT * FROM `'.$this->table.'` WHERE `revision` = :rev'), ['rev' => $this->revision]); + return DB::select("SELECT * FROM `{$this->table}` WHERE `revision` = :rev", ['rev' => $this->revision]); } catch (\Illuminate\Database\QueryException $e) { return false; } @@ -45,12 +45,12 @@ public function findAll() public function listed() { - $clusters = DB::select(DB::raw('SELECT * FROM clusters ORDER BY idclusters ASC')); + $clusters = DB::select('SELECT * FROM clusters ORDER BY idclusters ASC'); - $sql = 'SELECT * FROM `'.$this->table.'` WHERE `revision` = :rev AND `cluster` = :cluster ORDER BY `idcategories` ASC'; + $sql = "SELECT * FROM `{$this->table}` WHERE `revision` = :rev AND `cluster` = :cluster ORDER BY `idcategories` ASC"; foreach ($clusters as $k => $cluster) { - $clusters[$k]->categories = DB::select(DB::raw($sql), ['rev' => $this->revision, 'cluster' => $cluster->idclusters]); + $clusters[$k]->categories = DB::select($sql, ['rev' => $this->revision, 'cluster' => $cluster->idclusters]); } return $clusters; @@ -59,7 +59,7 @@ public function listed() public function findAllByRevision($rev) { try { - DB::select(DB::raw('SELECT * FROM `'.$this->table.'` WHERE `revision` = :rev'), ['rev' => $rev]); + return DB::select("SELECT * FROM `{$this->table}` WHERE `revision` = :rev", ['rev' => $rev]); } catch (\Illuminate\Database\QueryException $e) { return false; } diff --git a/app/Cluster.php b/app/Cluster.php index 5c1fcae448..b599d07182 100644 --- a/app/Cluster.php +++ b/app/Cluster.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Model; class Cluster extends Model @@ -23,7 +24,7 @@ class Cluster extends Model */ protected $hidden = []; - public function categories() + public function categories(): HasMany { return $this->hasMany(\App\Category::class, 'cluster', 'idclusters'); } diff --git a/app/Console/Commands/AlertCreate.php b/app/Console/Commands/AlertCreate.php index 8d56290f68..cf9b10a631 100644 --- a/app/Console/Commands/AlertCreate.php +++ b/app/Console/Commands/AlertCreate.php @@ -37,10 +37,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $title = trim($this->argument('title')); $html = trim($this->argument('html')); diff --git a/app/Console/Commands/AnonymiseUsersForTest.php b/app/Console/Commands/AnonymiseUsersForTest.php index cedd287be5..07e4910813 100644 --- a/app/Console/Commands/AnonymiseUsersForTest.php +++ b/app/Console/Commands/AnonymiseUsersForTest.php @@ -24,10 +24,8 @@ class AnonymiseUsersForTest extends Command /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { if (env('APP_ENV') !== 'local') { $this->error('This command is only designed to be run during local development.'); diff --git a/app/Console/Commands/CheckGroupLocations.php b/app/Console/Commands/CheckGroupLocations.php index 7a44642e22..4866b50fcf 100644 --- a/app/Console/Commands/CheckGroupLocations.php +++ b/app/Console/Commands/CheckGroupLocations.php @@ -33,10 +33,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::where('approved', true)->get(); $geocoder = new \App\Helpers\Geocoder(); diff --git a/app/Console/Commands/CheckTranslations.php b/app/Console/Commands/CheckTranslations.php index 7c1418294a..e6a75518cc 100644 --- a/app/Console/Commands/CheckTranslations.php +++ b/app/Console/Commands/CheckTranslations.php @@ -32,10 +32,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): int { // We want to scan all English translations. $files = scandir(base_path() . '/lang/en'); diff --git a/app/Console/Commands/CreateDiscourseGroups.php b/app/Console/Commands/CreateDiscourseGroups.php index 2c284d6dd5..2adde2a3ed 100644 --- a/app/Console/Commands/CreateDiscourseGroups.php +++ b/app/Console/Commands/CreateDiscourseGroups.php @@ -33,10 +33,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::where('approved', true)->whereNull('discourse_group')->get(); diff --git a/app/Console/Commands/CrystalliseEventTimezone.php b/app/Console/Commands/CrystalliseEventTimezone.php index 02082a9366..d4961e103b 100644 --- a/app/Console/Commands/CrystalliseEventTimezone.php +++ b/app/Console/Commands/CrystalliseEventTimezone.php @@ -36,10 +36,8 @@ public function __construct(DiscourseService $discourseService) /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $events = Party::past()->where('timezone', null)->get(); diff --git a/app/Console/Commands/DiscourseAnonymiseUser.php b/app/Console/Commands/DiscourseAnonymiseUser.php index 68a094d795..4ee677243e 100644 --- a/app/Console/Commands/DiscourseAnonymiseUser.php +++ b/app/Console/Commands/DiscourseAnonymiseUser.php @@ -57,10 +57,8 @@ public function __construct(DiscourseService $discourseService) /** * Execute the console command. - * - * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $id = $this->argument('id'); $user = User::findOrFail($id); diff --git a/app/Console/Commands/DiscourseChangeSetting.php b/app/Console/Commands/DiscourseChangeSetting.php index 066163e0d1..e0c09807cd 100644 --- a/app/Console/Commands/DiscourseChangeSetting.php +++ b/app/Console/Commands/DiscourseChangeSetting.php @@ -56,10 +56,8 @@ public function __construct(DiscourseService $discourseService) /** * Execute the console command. - * - * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $setting = $this->argument('setting'); $value = $this->argument('value'); diff --git a/app/Console/Commands/DiscourseCreateThread.php b/app/Console/Commands/DiscourseCreateThread.php index f99251ef81..b08d953476 100644 --- a/app/Console/Commands/DiscourseCreateThread.php +++ b/app/Console/Commands/DiscourseCreateThread.php @@ -39,10 +39,8 @@ public function __construct(DiscourseService $discourseService) /** * Execute the console command. - * - * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $id = $this->argument('partyid'); diff --git a/app/Console/Commands/FixViews.php b/app/Console/Commands/FixViews.php index 1e76c43d3f..f3602f2491 100644 --- a/app/Console/Commands/FixViews.php +++ b/app/Console/Commands/FixViews.php @@ -23,10 +23,8 @@ class FixViews extends Command /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { if (env('APP_ENV') !== 'local') { $this->error('This command is only designed to be run during local development.'); @@ -34,13 +32,13 @@ public function handle() return; } - $results = DB::select(DB::raw(' + $results = DB::select(' SELECT table_name as viewName, CONCAT("ALTER DEFINER=`'.env('DB_USERNAME').'`@`'.env('DB_HOST').'` VIEW `",table_name,"` AS ", view_definition,";") as alter_statement FROM information_schema.views -WHERE table_schema="'.env('DB_DATABASE').'"')); +WHERE table_schema="'.env('DB_DATABASE').'"'); foreach ($results as $result) { - DB::unprepared(DB::raw($result->alter_statement)); + DB::unprepared($result->alter_statement); $this->info('Fixed '.$result->viewName); } } diff --git a/app/Console/Commands/FixVolunteerCount.php b/app/Console/Commands/FixVolunteerCount.php index 1ff50f3e3b..f5d517cfb3 100644 --- a/app/Console/Commands/FixVolunteerCount.php +++ b/app/Console/Commands/FixVolunteerCount.php @@ -24,10 +24,8 @@ class FixVolunteerCount extends Command /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $events = Party::all(); diff --git a/app/Console/Commands/GroupCountryField.php b/app/Console/Commands/GroupCountryField.php index fe5f8c8883..97a044518d 100644 --- a/app/Console/Commands/GroupCountryField.php +++ b/app/Console/Commands/GroupCountryField.php @@ -24,10 +24,8 @@ class GroupCountryField extends Command /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::all(); diff --git a/app/Console/Commands/ImportGroups.php b/app/Console/Commands/ImportGroups.php index bf4aa49532..0dbe49b3c1 100644 --- a/app/Console/Commands/ImportGroups.php +++ b/app/Console/Commands/ImportGroups.php @@ -35,10 +35,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $input = $this->argument('input'); $inputFile = fopen($input, 'r'); diff --git a/app/Console/Commands/ImportMRES.php b/app/Console/Commands/ImportMRES.php index 193ca3c284..55c18d851f 100644 --- a/app/Console/Commands/ImportMRES.php +++ b/app/Console/Commands/ImportMRES.php @@ -37,10 +37,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $input = $this->argument('input'); diff --git a/app/Console/Commands/LanguageSync.php b/app/Console/Commands/LanguageSync.php index a99a6a0aa0..efdde941b6 100644 --- a/app/Console/Commands/LanguageSync.php +++ b/app/Console/Commands/LanguageSync.php @@ -33,10 +33,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { // We want to sync the language preference from restarters to mediawiki. // diff --git a/app/Console/Commands/MigrateWikiPasswords.php b/app/Console/Commands/MigrateWikiPasswords.php index c21f38b3ec..7782d47e4b 100644 --- a/app/Console/Commands/MigrateWikiPasswords.php +++ b/app/Console/Commands/MigrateWikiPasswords.php @@ -33,10 +33,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $users = User::whereNotNull('mediawiki')->whereNull('deleted_at')->get(); diff --git a/app/Console/Commands/NetworkCoordinator.php b/app/Console/Commands/NetworkCoordinator.php index d37bdef7a4..953a69ce10 100644 --- a/app/Console/Commands/NetworkCoordinator.php +++ b/app/Console/Commands/NetworkCoordinator.php @@ -35,10 +35,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $networkname = $this->argument('networkname'); diff --git a/app/Console/Commands/NetworkCreate.php b/app/Console/Commands/NetworkCreate.php index 48f5a1b757..867a2155f9 100644 --- a/app/Console/Commands/NetworkCreate.php +++ b/app/Console/Commands/NetworkCreate.php @@ -34,10 +34,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $name = $this->argument('name'); $shortname = $this->argument('shortname'); diff --git a/app/Console/Commands/NetworkGroup.php b/app/Console/Commands/NetworkGroup.php index 4df46a4a51..69628c18ac 100644 --- a/app/Console/Commands/NetworkGroup.php +++ b/app/Console/Commands/NetworkGroup.php @@ -35,10 +35,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $networkname = $this->argument('networkname'); $groupname = $this->argument('groupname'); diff --git a/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php b/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php index 8bf63d5a57..5da704fc80 100644 --- a/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php +++ b/app/Console/Commands/PopulateUniqueCodeToEventsAndGroups.php @@ -25,10 +25,8 @@ class PopulateUniqueCodeToEventsAndGroups extends Command /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::whereNull('shareable_code') ->get(); diff --git a/app/Console/Commands/SetPlaceNetworkData.php b/app/Console/Commands/SetPlaceNetworkData.php index 23194d97d2..0eafc6b475 100644 --- a/app/Console/Commands/SetPlaceNetworkData.php +++ b/app/Console/Commands/SetPlaceNetworkData.php @@ -37,10 +37,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $networkname = $this->argument('networkname'); diff --git a/app/Console/Commands/SetRepairTogetherPasswords.php b/app/Console/Commands/SetRepairTogetherPasswords.php index 74cd3acd3f..3b980ea375 100644 --- a/app/Console/Commands/SetRepairTogetherPasswords.php +++ b/app/Console/Commands/SetRepairTogetherPasswords.php @@ -26,10 +26,8 @@ class SetRepairTogetherPasswords extends Command /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $users = User::where('repair_network', 3) ->where('password', '') diff --git a/app/Console/Commands/SyncDiscourseGroups.php b/app/Console/Commands/SyncDiscourseGroups.php index 19d09683d0..ca36a7efe0 100644 --- a/app/Console/Commands/SyncDiscourseGroups.php +++ b/app/Console/Commands/SyncDiscourseGroups.php @@ -35,10 +35,8 @@ public function __construct(DiscourseService $discourseService) /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $this->discourseService->syncGroups(); } diff --git a/app/Console/Commands/SyncDiscourseUsernames.php b/app/Console/Commands/SyncDiscourseUsernames.php index 67a550e8ae..001b82ce24 100644 --- a/app/Console/Commands/SyncDiscourseUsernames.php +++ b/app/Console/Commands/SyncDiscourseUsernames.php @@ -55,10 +55,8 @@ public function __construct(DiscourseService $discourseService) /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $usersFoundInRestarters = 0; $updatedUsers = 0; diff --git a/app/Console/Commands/SyncEvents.php b/app/Console/Commands/SyncEvents.php index 9e6d3600a8..04425d897b 100644 --- a/app/Console/Commands/SyncEvents.php +++ b/app/Console/Commands/SyncEvents.php @@ -46,10 +46,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $eventsQuery = Party::whereNotNull('wordpress_post_id')->where('approved', true); if (! is_null($this->option('datefrom'))) { diff --git a/app/Console/Commands/SyncGroups.php b/app/Console/Commands/SyncGroups.php index 051f7b4f9c..098c054468 100644 --- a/app/Console/Commands/SyncGroups.php +++ b/app/Console/Commands/SyncGroups.php @@ -44,10 +44,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $groups = Group::where('approved', true)->whereNotNull('wordpress_post_id')->get(); diff --git a/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php b/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php index a02ab4aa2e..77e2b056b4 100644 --- a/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php +++ b/app/Console/Commands/SyncNetworkUsersToDiscourseGroup.php @@ -42,10 +42,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Console/Commands/UserCreate.php b/app/Console/Commands/UserCreate.php index 4e2c5897b4..02c5307713 100644 --- a/app/Console/Commands/UserCreate.php +++ b/app/Console/Commands/UserCreate.php @@ -39,10 +39,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle(DiscourseService $discourseService) + public function handle(DiscourseService $discourseService): void { $name = $this->argument('name'); $email = $this->argument('email'); diff --git a/app/Console/Commands/UserMakeHost.php b/app/Console/Commands/UserMakeHost.php index eadf82d771..4db77898ec 100644 --- a/app/Console/Commands/UserMakeHost.php +++ b/app/Console/Commands/UserMakeHost.php @@ -38,10 +38,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $email = $this->argument('email'); $groupname = $this->argument('groupname'); diff --git a/app/Console/Commands/WordpressCreateEvent.php b/app/Console/Commands/WordpressCreateEvent.php index da4fba53ee..8f966b3fa7 100644 --- a/app/Console/Commands/WordpressCreateEvent.php +++ b/app/Console/Commands/WordpressCreateEvent.php @@ -34,10 +34,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $id = $this->argument('id'); $event = Party::findOrFail($id); diff --git a/app/Console/Commands/WordpressCreateEventFailed.php b/app/Console/Commands/WordpressCreateEventFailed.php index 584c2973f0..0131c3c0fc 100644 --- a/app/Console/Commands/WordpressCreateEventFailed.php +++ b/app/Console/Commands/WordpressCreateEventFailed.php @@ -35,10 +35,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $wordpressClient = new \HieuLe\WordpressXmlrpcClient\WordpressClient(); $wordpressClient->setCredentials(env('WP_XMLRPC_ENDPOINT'), env('WP_XMLRPC_USER'), env('WP_XMLRPC_PSWD')); diff --git a/app/Console/Commands/WordpressCreateEventMissing.php b/app/Console/Commands/WordpressCreateEventMissing.php index f8bac85185..857241b743 100644 --- a/app/Console/Commands/WordpressCreateEventMissing.php +++ b/app/Console/Commands/WordpressCreateEventMissing.php @@ -34,10 +34,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $events = Party::future()->where('approved', true)->where('wordpress_post_id', null)->get(); diff --git a/app/Console/Commands/WordpressCreateGroup.php b/app/Console/Commands/WordpressCreateGroup.php index 1bb2ccb81a..96850c163c 100644 --- a/app/Console/Commands/WordpressCreateGroup.php +++ b/app/Console/Commands/WordpressCreateGroup.php @@ -34,10 +34,8 @@ public function __construct() /** * Execute the console command. - * - * @return mixed */ - public function handle() + public function handle(): void { $id = $this->argument('id'); $group = Group::findOrFail($id); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index af6e170b0c..a33477ed8d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -16,11 +16,8 @@ class Kernel extends ConsoleKernel { /** * Define the application's command schedule. - * - * @param \Illuminate\Console\Scheduling\Schedule $schedule - * @return void */ - protected function schedule(Schedule $schedule) + protected function schedule(Schedule $schedule): void { $schedule->call(function () { $parties = Party::doesnthave('devices') @@ -51,10 +48,8 @@ protected function schedule(Schedule $schedule) /** * Register the commands for the application. - * - * @return void */ - protected function commands() + protected function commands(): void { $this->load(__DIR__.'/Commands'); diff --git a/app/Device.php b/app/Device.php index 8d71743555..e264e22be8 100644 --- a/app/Device.php +++ b/app/Device.php @@ -2,6 +2,8 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Events\DeviceCreatedOrUpdated; use DB; @@ -96,7 +98,7 @@ public static function getDisplacementFactor() public function ofThisEvent($event) { //Tested - return DB::select(DB::raw('SELECT * FROM `'.$this->table.'` AS `d` + return DB::select("SELECT * FROM `{$this->table}` AS `d` INNER JOIN `categories` AS `c` ON `c`.`idcategories` = `d`.`category` LEFT JOIN ( SELECT * FROM xref @@ -104,22 +106,22 @@ public function ofThisEvent($event) WHERE object_type = '.env('TBL_IMAGES').' AND reference_type = '.env('TBL_DEVICES').' ) AS i ON i.reference = d.iddevices - WHERE `event` = :event'), ['event' => $event]); + WHERE `event` = :event", ['event' => $event]); } public function ofThisGroup($group) { //Tested - return DB::select(DB::raw('SELECT * FROM `'.$this->table.'` AS `d` + return DB::select("SELECT * FROM `{$this->table}` AS `d` INNER JOIN `categories` AS `c` ON `c`.`idcategories` = `d`.`category` INNER JOIN `events` AS `e` ON `e`.`idevents` = `d`.`event` - WHERE `group` = :group'), ['group' => $group]); + WHERE `group` = :group", ['group' => $group]); } public function statusCount($g = null, $year = null) { - $sql = 'SELECT COUNT(*) AS `counter`, `d`.`repair_status` AS `status`, `d`.`event` - FROM `'.$this->table.'` AS `d`'; + $sql = "SELECT COUNT(*) AS `counter`, `d`.`repair_status` AS `status`, `d`.`event` + FROM `{$this->table}` AS `d`"; $sql .= ' INNER JOIN `events` AS `e` ON `e`.`idevents` = `d`.`event` '; $sql .= ' WHERE `repair_status` > 0 '; @@ -141,14 +143,14 @@ public function statusCount($g = null, $year = null) } if (! is_null($g) && is_numeric($g) && is_null($year)) { - return DB::select(DB::raw($sql), ['g' => $g]); + return DB::select($sql, ['g' => $g]); } elseif (! is_null($year) && is_numeric($year) && is_null($g)) { - return DB::select(DB::raw($sql), ['year' => $year]); + return DB::select($sql, ['year' => $year]); } elseif (! is_null($year) && is_numeric($year) && ! is_null($g) && is_numeric($g)) { - return DB::select(DB::raw($sql), ['year' => $year, 'g' => $g]); + return DB::select($sql, ['year' => $year, 'g' => $g]); } - return DB::select(DB::raw($sql)); + return DB::select($sql); } public function countByCluster($cluster, $group = null, $year = null) @@ -172,14 +174,14 @@ public function countByCluster($cluster, $group = null, $year = null) '; if (! is_null($group) && is_numeric($group) && is_null($year)) { - return DB::select(DB::raw($sql), ['group' => $group, 'cluster' => $cluster]); + return DB::select($sql, ['group' => $group, 'cluster' => $cluster]); } elseif (! is_null($year) && is_numeric($year) && is_null($group)) { - return DB::select(DB::raw($sql), ['year' => $year, 'cluster' => $cluster]); + return DB::select($sql, ['year' => $year, 'cluster' => $cluster]); } elseif (! is_null($year) && is_numeric($year) && ! is_null($group) && is_numeric($group)) { - return DB::select(DB::raw($sql), ['year' => $year, 'group' => $group, 'cluster' => $cluster]); + return DB::select($sql, ['year' => $year, 'group' => $group, 'cluster' => $cluster]); } - return DB::select(DB::raw($sql), ['cluster' => $cluster]); + return DB::select($sql, ['cluster' => $cluster]); } public function countByClustersYearStatus($group) @@ -193,7 +195,7 @@ public function countByClustersYearStatus($group) GROUP BY `cluster`, YEAR(`event_start_utc`) , `repair_status` ORDER BY `year` ASC, `repair_status` ASC;"; - return DB::select(DB::raw($sql), ['group' => $group]); + return DB::select($sql, ['group' => $group]); } public function findMostSeen($status = null, $cluster = null, $group = null) @@ -222,38 +224,38 @@ public function findMostSeen($status = null, $cluster = null, $group = null) if (! is_null($cluster) && is_numeric($cluster)) { if (! is_null($group) && is_numeric($group) && is_null($status)) { - return DB::select(DB::raw($sql), ['group' => $group, 'cluster' => $cluster]); + return DB::select($sql, ['group' => $group, 'cluster' => $cluster]); } elseif (! is_null($status) && is_numeric($status) && is_null($group)) { - return DB::select(DB::raw($sql), ['status' => $status, 'cluster' => $cluster]); + return DB::select($sql, ['status' => $status, 'cluster' => $cluster]); } elseif (! is_null($status) && is_numeric($status) && ! is_null($group) && is_numeric($group)) { - return DB::select(DB::raw($sql), ['status' => $status, 'group' => $group, 'cluster' => $cluster]); + return DB::select($sql, ['status' => $status, 'group' => $group, 'cluster' => $cluster]); } - return DB::select(DB::raw($sql), ['cluster' => $cluster]); + return DB::select($sql, ['cluster' => $cluster]); } else { if (! is_null($group) && is_numeric($group) && is_null($status)) { - return DB::select(DB::raw($sql), ['group' => $group]); + return DB::select($sql, ['group' => $group]); } elseif (! is_null($status) && is_numeric($status) && is_null($group)) { - return DB::select(DB::raw($sql), ['status' => $status]); + return DB::select($sql, ['status' => $status]); } elseif (! is_null($status) && is_numeric($status) && ! is_null($group) && is_numeric($group)) { - return DB::select(DB::raw($sql), ['status' => $status, 'group' => $group]); + return DB::select($sql, ['status' => $status, 'group' => $group]); } - return DB::select(DB::raw($sql)); + return DB::select($sql); } } - public function deviceCategory() + public function deviceCategory(): HasOne { return $this->hasOne(\App\Category::class, 'idcategories', 'category'); } - public function deviceEvent() + public function deviceEvent(): HasOne { return $this->hasOne(\App\Party::class, 'idevents', 'event'); } - public function barriers() + public function barriers(): BelongsToMany { return $this->belongsToMany(\App\Barrier::class, 'devices_barriers', 'device_id', 'barrier_id'); } @@ -457,7 +459,7 @@ public static function getItemTypes() if (Cache::has('item_types')) { $types = Cache::get('item_types'); } else { - $types = DB::select(DB::raw(" + $types = DB::select(" SELECT item_type, powered, idcategories, @@ -484,7 +486,7 @@ public static function getItemTypes() WHERE t.count = t.max_count AND LENGTH(t.item_type) > 0 GROUP BY t.item_type, t.powered; -")); +"); \Cache::put('item_types', $types, 24 * 3600); } diff --git a/app/DripEvent.php b/app/DripEvent.php index e94c731531..3b6af16d0e 100644 --- a/app/DripEvent.php +++ b/app/DripEvent.php @@ -22,7 +22,6 @@ class DripEvent extends Model * Create or Update a Subscriber * @author Christopher Kelker * @date 2019-05-29T15:55:02+010 - * @param User $user * @return [type] */ public static function createOrUpdateSubscriber(User $user, $opted_in = false, $old_email = false, $new_email = false) diff --git a/app/Events/DeviceCreatedOrUpdated.php b/app/Events/DeviceCreatedOrUpdated.php index 4734826f0e..74592d6800 100644 --- a/app/Events/DeviceCreatedOrUpdated.php +++ b/app/Events/DeviceCreatedOrUpdated.php @@ -13,8 +13,6 @@ class DeviceCreatedOrUpdated /** * Create a new event instance. - * - * @param \App\Device $device */ public function __construct(Device $device) { diff --git a/app/Events/EventDeleted.php b/app/Events/EventDeleted.php index c119ea2d51..ee35cccc1f 100644 --- a/app/Events/EventDeleted.php +++ b/app/Events/EventDeleted.php @@ -32,8 +32,10 @@ public function __construct(Party $repairEvent) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { - return new PrivateChannel('channel-name'); + return [ + new PrivateChannel('channel-name'), + ]; } } diff --git a/app/Events/EventImagesUploaded.php b/app/Events/EventImagesUploaded.php index 6c8d46b312..be84570081 100644 --- a/app/Events/EventImagesUploaded.php +++ b/app/Events/EventImagesUploaded.php @@ -19,11 +19,7 @@ class EventImagesUploaded */ public $auth_user_id; - /** - * @param Party $party - * @param int $auth_user_id - */ - public function __construct(Party $party, $auth_user_id) + public function __construct(Party $party, int $auth_user_id) { $this->party = $party; $this->auth_user_id = $auth_user_id; diff --git a/app/Events/UserDeleted.php b/app/Events/UserDeleted.php index d322b2dba6..4c9672e238 100644 --- a/app/Events/UserDeleted.php +++ b/app/Events/UserDeleted.php @@ -14,9 +14,6 @@ class UserDeleted */ public $user; - /** - * @param User $user - */ public function __construct(User $user) { $this->user = $user; diff --git a/app/Events/UserEmailUpdated.php b/app/Events/UserEmailUpdated.php index f711cb700a..3dc88b00d1 100644 --- a/app/Events/UserEmailUpdated.php +++ b/app/Events/UserEmailUpdated.php @@ -20,9 +20,6 @@ class UserEmailUpdated */ public $user; - /** - * @param User $user - */ public function __construct(User $user) { $this->user = $user; @@ -33,8 +30,10 @@ public function __construct(User $user) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { - return new PrivateChannel('channel-name'); + return [ + new PrivateChannel('channel-name'), + ]; } } diff --git a/app/Events/UserLanguageUpdated.php b/app/Events/UserLanguageUpdated.php index d8b03064ea..cf41999ccd 100644 --- a/app/Events/UserLanguageUpdated.php +++ b/app/Events/UserLanguageUpdated.php @@ -20,9 +20,6 @@ class UserLanguageUpdated */ public $user; - /** - * @param User $user - */ public function __construct(User $user) { $this->user = $user; @@ -33,8 +30,10 @@ public function __construct(User $user) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { - return new PrivateChannel('channel-name'); + return [ + new PrivateChannel('channel-name'), + ]; } } diff --git a/app/Events/UserRegistered.php b/app/Events/UserRegistered.php index 029b602afc..018aaa1ff6 100644 --- a/app/Events/UserRegistered.php +++ b/app/Events/UserRegistered.php @@ -20,9 +20,6 @@ class UserRegistered */ public $user; - /** - * @param User $user - */ public function __construct(User $user) { $this->user = $user; @@ -33,8 +30,10 @@ public function __construct(User $user) * * @return \Illuminate\Broadcasting\Channel|array */ - public function broadcastOn() + public function broadcastOn(): array { - return new PrivateChannel('channel-name'); + return [ + new PrivateChannel('channel-name'), + ]; } } diff --git a/app/Events/UserUpdated.php b/app/Events/UserUpdated.php index 86294c4860..e7972670bd 100644 --- a/app/Events/UserUpdated.php +++ b/app/Events/UserUpdated.php @@ -14,9 +14,6 @@ class UserUpdated */ public $user; - /** - * @param User $user - */ public function __construct(User $user) { $this->user = $user; diff --git a/app/EventsUsers.php b/app/EventsUsers.php index 23546bc0bd..0a094b6cd7 100644 --- a/app/EventsUsers.php +++ b/app/EventsUsers.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use DB; use Illuminate\Database\Eloquent\Model; @@ -27,18 +28,18 @@ class EventsUsers extends Model public $timestamps = false; //Table Relations - public function role() + public function role(): HasOne { return $this->hasOne(\App\Role::class, 'role', 'role'); } //Table Relations - public function volunteer() + public function volunteer(): HasOne { return $this->hasOne(\App\User::class, 'id', 'user'); } - public function event() + public function event(): HasOne { return $this->hasOne(\App\Party::class, 'id', 'event'); } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 576c74f831..f4ab2037c8 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -8,15 +8,6 @@ class Handler extends ExceptionHandler { - /** - * A list of the exception types that are not reported. - * - * @var array - */ - protected $dontReport = [ - - ]; - /** * A list of the inputs that are never flashed for validation exceptions. * @@ -32,7 +23,6 @@ class Handler extends ExceptionHandler * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @param \Throwable $exception * @return \Illuminate\Http\Response */ public function render($request, Throwable $exception) diff --git a/app/Group.php b/app/Group.php index a00865ca1b..d242ae00a1 100644 --- a/app/Group.php +++ b/app/Group.php @@ -2,6 +2,10 @@ namespace App; +use App\User; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use DB; use Illuminate\Database\Eloquent\Model; @@ -95,7 +99,7 @@ public function addTag($tag) // NGM: when tests in place, this method name should be changed to just `tags`. // It's on a group, the group_ prefix is superfluous. - public function group_tags() + public function group_tags(): BelongsToMany { return $this->belongsToMany(\App\GroupTags::class, 'grouptags_groups', 'group', 'group_tag'); } @@ -106,7 +110,7 @@ public function group_tags() public function findAll() { try { - return DB::select(DB::raw('SELECT + return DB::select('SELECT `g`.`idgroups` AS `id`, `g`.`name` AS `name`, `g`.`location` AS `location`, @@ -121,7 +125,7 @@ public function findAll() LEFT JOIN `users_groups` AS `ug` ON `g`.`idgroups` = `ug`.`group` LEFT JOIN `users` AS `u` ON `ug`.`user` = `u`.`id` GROUP BY `g`.`idgroups` - ORDER BY `g`.`name` ASC')); + ORDER BY `g`.`name` ASC'); } catch (\Illuminate\Database\QueryException $e) { dd($e); } @@ -130,7 +134,7 @@ public function findAll() public function findList() { try { - return DB::select(DB::raw('SELECT + return DB::select('SELECT `g`.`idgroups` AS `id`, `g`.`name` AS `name`, `g`.`location` AS `location`, @@ -151,7 +155,7 @@ public function findList() GROUP BY `g`.`idgroups` - ORDER BY `g`.`name` ASC')); + ORDER BY `g`.`name` ASC'); } catch (\Illuminate\Database\QueryException $e) { dd($e); } @@ -159,7 +163,7 @@ public function findList() public function ofThisUser($id) { - return DB::select(DB::raw('SELECT * FROM `'.$this->table.'` AS `g` + return DB::select('SELECT * FROM `'.$this->table.'` AS `g` INNER JOIN `users_groups` AS `ug` ON `ug`.`group` = `g`.`idgroups` @@ -173,25 +177,25 @@ public function ofThisUser($id) ON `xi`.`reference` = `g`.`idgroups` WHERE `ug`.`user` = :id - ORDER BY `g`.`name` ASC'), ['id' => $id]); + ORDER BY `g`.`name` ASC', ['id' => $id]); } - public function groupImage() + public function groupImage(): HasOne { return $this->hasOne(\App\Xref::class, 'reference', 'idgroups')->where('reference_type', env('TBL_GROUPS'))->where('object_type', 5); } - public function allHosts() + public function allHosts(): HasMany { return $this->hasMany(\App\UserGroups::class, 'group', 'idgroups')->where('role', Role::HOST); } - public function allRestarters() + public function allRestarters(): HasMany { return $this->hasMany(\App\UserGroups::class, 'group', 'idgroups')->where('role', Role::RESTARTER); } - public function allVolunteers() + public function allVolunteers(): HasMany { return $this->hasMany(\App\UserGroups::class, 'group', 'idgroups')->orderBy('role', 'ASC'); } @@ -269,7 +273,7 @@ public function getGroupStats($eEmissionRatio = null, $uEmissionratio = null) * * @param \App\User $volunteer A registered user. */ - public function addVolunteer($volunteer) + public function addVolunteer(User $volunteer) { UserGroups::updateOrCreate([ 'user' => $volunteer->id, @@ -311,18 +315,14 @@ public function getShareableLinkAttribute() return ''; } - /** - * @param int|null $user_id - * @return bool - */ - public function isVolunteer($user_id = null) + public function isVolunteer(?int $user_id = null): bool { $attributes = ['user' => $user_id ?: auth()->id()]; return $this->allConfirmedVolunteers()->where($attributes)->exists(); } - public function parties() + public function parties(): HasMany { return $this->hasMany(Party::class, 'group', 'idgroups'); } @@ -379,7 +379,7 @@ public function getNextUpcomingEvent() return $event->first(); } - public function networks() + public function networks(): BelongsToMany { return $this->belongsToMany(Network::class, 'group_network', 'group_id', 'network_id'); } @@ -662,10 +662,8 @@ public function scopeUnapprovedVisibleTo($query, $user_id) { /** * Get a name for the Discourse group. - * - * @return string */ - public function getDiscourseGroupName($unique) + public function getDiscourseGroupName($unique): string { // Restricted characters allowed in name, and only 20 characters. // diff --git a/app/GroupTags.php b/app/GroupTags.php index 4c7a91e3ce..57bbddeb09 100644 --- a/app/GroupTags.php +++ b/app/GroupTags.php @@ -2,6 +2,8 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -27,13 +29,13 @@ class GroupTags extends Model protected $hidden = []; //Table Relations - public function group_tags() + public function group_tags(): BelongsToMany { return $this->belongsToMany(\App\GrouptagsGroups::class); } //Table Relations - public function groupTagGroups() + public function groupTagGroups(): HasMany { return $this->hasMany(GrouptagsGroups::class, 'group_tag', 'id'); } diff --git a/app/GrouptagsGroups.php b/app/GrouptagsGroups.php index 84e0fb3302..6603cc97f6 100644 --- a/app/GrouptagsGroups.php +++ b/app/GrouptagsGroups.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Model; class GrouptagsGroups extends Model @@ -33,7 +34,7 @@ class GrouptagsGroups extends Model * @version 1.0.0 * @return [type] */ - public function theGroup() + public function theGroup(): HasOne { return $this->hasOne(Group::class, 'idgroups', 'group'); } diff --git a/app/Helpers/Fixometer.php b/app/Helpers/Fixometer.php index 9a6a981346..f338a98a54 100644 --- a/app/Helpers/Fixometer.php +++ b/app/Helpers/Fixometer.php @@ -384,10 +384,10 @@ public static function hasImage($id, $table, $return_rows = false) try { if ($return_rows) { - return DB::select(DB::raw($sql), ['id' => $id, 'object' => $object]); + return DB::select($sql, ['id' => $id, 'object' => $object]); } - return count(DB::select(DB::raw($sql), ['id' => $id, 'object' => $object])) > 0 ? true : false; + return count(DB::select($sql, ['id' => $id, 'object' => $object])) > 0 ? true : false; } catch (\Illuminate\Database\QueryException $e) { return db($e); } @@ -432,12 +432,12 @@ public static function removeImage($id, $table, $image) `xref`.`reference_type` = :object AND `xref`.`reference` = :id '; - DB::delete(DB::raw($sql), ['id' => $id, 'object' => $object]); + DB::delete($sql, ['id' => $id, 'object' => $object]); /** delete image from db **/ $sql = 'DELETE FROM `images` WHERE `images`.`idimages` = :image'; - DB::delete(DB::raw($sql), ['image' => $image->idimages]); + DB::delete($sql, ['image' => $image->idimages]); /** delete image from disk **/ unlink($_SERVER['DOCUMENT_ROOT'].'/uploads/'.$image->path); @@ -639,9 +639,8 @@ public static function hasPermission($slug) * Returns users who have a particular preference by slug * * @param $slug - * @return Collection */ - public static function usersWhoHavePreference($slug) + public static function usersWhoHavePreference($slug): Collection { return User::join('users_preferences', 'users_preferences.user_id', '=', 'users.id') ->join('preferences', 'preferences.id', '=', 'users_preferences.preference_id') diff --git a/app/Helpers/FixometerFile.php b/app/Helpers/FixometerFile.php index b88de61bcd..dac2c8ad7b 100644 --- a/app/Helpers/FixometerFile.php +++ b/app/Helpers/FixometerFile.php @@ -185,7 +185,7 @@ public function findImages($of_ref_type, $ref_id) `x`.`reference` = :refId'; try { - return DB::select(DB::raw($sql), ['refType' => $of_ref_type, 'refId' => $ref_id]); + return DB::select($sql, ['refType' => $of_ref_type, 'refId' => $ref_id]); } catch (\Illuminate\Database\QueryException $e) { return db($e); } @@ -196,6 +196,6 @@ public function deleteImage($idxref) // Delete the xref. This is sufficient to stop the image being attached to the device. We leave the // file in existence in case we want it later for debugging/mining. $sql = 'DELETE FROM `xref` WHERE `idxref` = :id AND `object_type` = '.env('TBL_IMAGES'); - DB::delete(DB::raw($sql), ['id' => $idxref]); + DB::delete($sql, ['id' => $idxref]); } } diff --git a/app/Helpers/LcaStats.php b/app/Helpers/LcaStats.php index f7c19cba22..cf7c26227c 100644 --- a/app/Helpers/LcaStats.php +++ b/app/Helpers/LcaStats.php @@ -54,6 +54,6 @@ public static function getWasteStats($group = null) FROM ($t1) t1 "; - return DB::select(DB::raw($sql)); + return DB::select($sql); } } diff --git a/app/Helpers/RobustTranslator.php b/app/Helpers/RobustTranslator.php index 02a0e367a2..24206c530e 100644 --- a/app/Helpers/RobustTranslator.php +++ b/app/Helpers/RobustTranslator.php @@ -8,14 +8,11 @@ class RobustTranslator extends BaseTranslator { /** - * @param string $key - * @param array $replace * @param null $locale - * @param bool $fallback * * @return array|null|string|void */ - public function get($key, array $replace = [], $locale = null, $fallback = true) + public function get(string $key, array $replace = [], $locale = null, bool $fallback = true) { $translation = parent::get($key, $replace, $locale, $fallback); diff --git a/app/Http/Controllers/API/DeviceController.php b/app/Http/Controllers/API/DeviceController.php index 674899da57..2fed4219d8 100644 --- a/app/Http/Controllers/API/DeviceController.php +++ b/app/Http/Controllers/API/DeviceController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\API; +use Illuminate\Http\JsonResponse; use App\Barrier; use App\Device; use App\DeviceBarrier; @@ -344,7 +345,7 @@ public function createDevicev2(Request $request) * ) * ) */ - public function updateDevicev2(Request $request, $iddevices) + public function updateDevicev2(Request $request, $iddevices): JsonResponse { $user = $this->getUser(); @@ -440,7 +441,7 @@ public function updateDevicev2(Request $request, $iddevices) * ) */ - public function deleteDevicev2(Request $request, $iddevices) + public function deleteDevicev2(Request $request, $iddevices): JsonResponse { $user = $this->getUser(); diff --git a/app/Http/Controllers/API/DiscourseController.php b/app/Http/Controllers/API/DiscourseController.php index d8dee88ab2..8935171367 100644 --- a/app/Http/Controllers/API/DiscourseController.php +++ b/app/Http/Controllers/API/DiscourseController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\API; +use Illuminate\Http\JsonResponse; use App\Http\Controllers\Controller; use App\Services\DiscourseService; use App\User; @@ -13,12 +14,8 @@ class DiscourseController extends Controller { /** * Get top Talk topics. - * - * @param \Illuminate\Http\Request $request - * @param string $tag - * @return \Illuminate\Http\Response */ - public function discussionTopics(Request $request, DiscourseService $discourseService, $tag = NULL) + public function discussionTopics(Request $request, DiscourseService $discourseService, string $tag = NULL): JsonResponse { $topics = []; diff --git a/app/Http/Controllers/API/EventController.php b/app/Http/Controllers/API/EventController.php index 38859a52d4..17546793b6 100644 --- a/app/Http/Controllers/API/EventController.php +++ b/app/Http/Controllers/API/EventController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\API; +use Illuminate\Http\JsonResponse; use App\Events\EditEvent; use App\EventsUsers; use App\Group; @@ -145,7 +146,7 @@ public function getEventsByUsersNetworks(Request $request, $date_from = null, $d return $collection; } - public function addVolunteer(Request $request, $idevents) + public function addVolunteer(Request $request, $idevents): JsonResponse { $request->validate([ 'volunteer_email_address' => ['nullable', 'email'], @@ -236,7 +237,7 @@ public function addVolunteer(Request $request, $idevents) } - public function listVolunteers(Request $request, $idevents) + public function listVolunteers(Request $request, $idevents): JsonResponse { $party = Party::findOrFail($idevents); @@ -455,7 +456,7 @@ public function moderateEventsv2(Request $request) * ) * ) */ - public function createEventv2(Request $request) + public function createEventv2(Request $request): JsonResponse { $user = $this->getUser(); @@ -624,7 +625,7 @@ public function createEventv2(Request $request) * ) * ) */ - public function updateEventv2(Request $request, $idEvents) + public function updateEventv2(Request $request, $idEvents): JsonResponse { $user = $this->getUser(); @@ -740,7 +741,7 @@ function ($attribute, $value, $fail) use ($request) { $longitude = $geocoded['longitude']; } - return array( + return [ $groupid, $start, $end, @@ -753,6 +754,6 @@ function ($attribute, $value, $fail) use ($request) { $online, $link, $network_data - ); + ]; } } diff --git a/app/Http/Controllers/API/GroupController.php b/app/Http/Controllers/API/GroupController.php index 25076f9334..c5056746e5 100644 --- a/app/Http/Controllers/API/GroupController.php +++ b/app/Http/Controllers/API/GroupController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\API; +use Illuminate\Http\JsonResponse; use App\Events\ApproveGroup; use App\Events\EditGroup; use App\Group; @@ -60,7 +61,7 @@ public static function getGroupChanges(Request $request) return response()->json($groupChanges); } - public static function getGroupsByUsersNetworks(Request $request) + public static function getGroupsByUsersNetworks(Request $request): JsonResponse { $authenticatedUser = Auth::user(); @@ -213,7 +214,7 @@ public static function mapDetailsAndAuditToChange($group, $groupAudit) return $groupChange; } - public static function getGroupList() + public static function getGroupList(): JsonResponse { $groups = Group::orderBy('created_at', 'desc'); @@ -644,7 +645,7 @@ private function getUser() { * ), * ) */ - public function moderateGroupsv2(Request $request) { + public function moderateGroupsv2(Request $request): JsonResponse { $user = $this->getUser(); $ret = \App\Http\Resources\GroupCollection::make(Group::unapprovedVisibleTo($user->id)); return response()->json($ret); @@ -726,7 +727,7 @@ public function moderateGroupsv2(Request $request) { * ) * ) */ - public function createGroupv2(Request $request) { + public function createGroupv2(Request $request): JsonResponse { $user = $this->getUser(); $user->convertToHost(); @@ -874,7 +875,7 @@ public function createGroupv2(Request $request) { * ) * ) */ - public function updateGroupv2(Request $request, $idGroup) { + public function updateGroupv2(Request $request, $idGroup): JsonResponse { $user = $this->getUser(); list($name, $area, $postcode, $location, $phone, $website, $description, $timezone, @@ -1053,7 +1054,7 @@ private function validateGroupParams(Request $request, $create): array { $country_code = $geocoded['country_code']; } - return array( + return [ $name, $area, $postcode, @@ -1068,6 +1069,6 @@ private function validateGroupParams(Request $request, $create): array { $network_data, $email, $archived_at - ); + ]; } } diff --git a/app/Http/Controllers/API/NetworkController.php b/app/Http/Controllers/API/NetworkController.php index d70a0b6b18..146cb8ce3f 100644 --- a/app/Http/Controllers/API/NetworkController.php +++ b/app/Http/Controllers/API/NetworkController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\API; +use Illuminate\Http\JsonResponse; use App\Group; use App\Http\Controllers\Controller; use App\Network; @@ -13,7 +14,7 @@ class NetworkController extends Controller { - public function stats(Network $network) + public function stats(Network $network): JsonResponse { if (! Auth::user()->can('view', $network)) { abort(403, 'You do not have access to this network'); diff --git a/app/Http/Controllers/API/UserController.php b/app/Http/Controllers/API/UserController.php index e27f32361c..54904b8993 100644 --- a/app/Http/Controllers/API/UserController.php +++ b/app/Http/Controllers/API/UserController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\API; +use Illuminate\Http\JsonResponse; use App\Http\Controllers\Controller; use App\User; use Auth; @@ -91,12 +92,8 @@ protected static function mapUserAndAuditToUserChange($user, $audit) /** * Get notification counts for a user. - * - * @param \Illuminate\Http\Request $request - * @param int $id - * @return \Illuminate\Http\Response */ - public function notifications(Request $request, $id) + public function notifications(Request $request, int $id): JsonResponse { $user = User::findOrFail($id); $restartersNotifications = $user->unReadNotifications->count(); diff --git a/app/Http/Controllers/API/UserGroupsController.php b/app/Http/Controllers/API/UserGroupsController.php index b6194192dd..31806594f6 100644 --- a/app/Http/Controllers/API/UserGroupsController.php +++ b/app/Http/Controllers/API/UserGroupsController.php @@ -92,11 +92,9 @@ protected static function mapDetailsAndAuditToChange($userGroupAssociation, $aud /** * Leave the specified group. * - * @param \Illuminate\Http\Request $request - * @param int $id * @return \Illuminate\Http\Response */ - public function leave(Request $request, $id) + public function leave(Request $request, int $id) { $authenticatedUser = Auth::user(); if (! $authenticatedUser) { diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 9b581c099b..e23e0a3c54 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\View\View; use App\Device; use App\Party; @@ -10,7 +11,7 @@ */ class AdminController extends Controller { - public static function stats($section = 1, $paragraph_only = false) + public static function stats($section = 1, $paragraph_only = false): View { if ($section == 1) { $stats = self::getStats1(); diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index 277105e504..edc8613fcd 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\JsonResponse; use App\Device; use App\Group; use App\Party; @@ -46,7 +47,7 @@ class ApiController extends Controller /** * Embedded at https://therestartproject.org */ - public static function homepage_data() + public static function homepage_data(): JsonResponse { $result = []; @@ -98,7 +99,7 @@ public static function homepage_data() ->json($result, 200); } - public static function partyStats($partyId) + public static function partyStats($partyId): JsonResponse { $event = Party::where('idevents', $partyId)->first(); @@ -128,7 +129,7 @@ public static function partyStats($partyId) return response()->json($result, 200); } - public static function groupStats($groupId) + public static function groupStats($groupId): JsonResponse { $group = Group::where('idgroups', $groupId)->first(); @@ -159,7 +160,7 @@ public static function groupStats($groupId) return response()->json($result, 200); } - public static function getUserInfo() + public static function getUserInfo(): JsonResponse { $user = Auth::user(); @@ -184,11 +185,8 @@ public static function getUserList() /** * List/search devices. - * - * @param Request $request - * @return Response */ - public static function getDevices(Request $request, $page, $size) + public static function getDevices(Request $request, $page, $size): JsonResponse { $powered = $request->input('powered'); $sortBy = $request->input('sortBy'); @@ -275,7 +273,7 @@ public static function getDevices(Request $request, $page, $size) ]); } - public function timezones() { + public function timezones(): JsonResponse { $zones = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC); $ret = []; diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 7d2196db02..f0d375a79f 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Auth; +use Illuminate\View\View; use App\Device; use App\Helpers\Fixometer; use App\Http\Controllers\Controller; @@ -48,7 +49,6 @@ public function __construct() /** * Override login from AuthenticateUsers * - * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse * * @throws \Illuminate\Validation\ValidationException @@ -82,11 +82,8 @@ public function login(Request $request) /** * Override validateLogin from AuthenticateUsers - * - * @param \Illuminate\Http\Request $request - * @return void */ - protected function validateLogin(Request $request) + protected function validateLogin(Request $request): void { if (env('HONEYPOT_DISABLE', false)) { // This is used in Playwright testing where we get many requests in a short time. @@ -104,10 +101,8 @@ protected function validateLogin(Request $request) /** * Override showLoginForm from AuthenticateUsers - * - * @return \Illuminate\Http\Response */ - public function showLoginForm() + public function showLoginForm(): View { $stats = Fixometer::loginRegisterStats(); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index fa1217a820..cd9ab74050 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -42,11 +42,8 @@ public function __construct() /** * Get a validator for an incoming registration request. - * - * @param array $data - * @return \Illuminate\Contracts\Validation\Validator */ - protected function validator(array $data) + protected function validator(array $data): \Illuminate\Contracts\Validation\Validator { return Validator::make($data, [ 'name' => 'required|string|max:255', @@ -59,11 +56,8 @@ protected function validator(array $data) /** * Create a new user instance after a valid registration. - * - * @param array $data - * @return \App\User */ - protected function create(array $data) + protected function create(array $data): User { $user = User::create([ 'name' => $data['name'], diff --git a/app/Http/Controllers/BrandsController.php b/app/Http/Controllers/BrandsController.php index 52fb24807f..ebbf752ec1 100644 --- a/app/Http/Controllers/BrandsController.php +++ b/app/Http/Controllers/BrandsController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use App\Brands; use App\Helpers\Fixometer; use Auth; @@ -24,7 +25,7 @@ public function index() ]); } - public function postCreateBrand(Request $request) + public function postCreateBrand(Request $request): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); @@ -51,7 +52,7 @@ public function getEditBrand($id) ]); } - public function postEditBrand($id, Request $request) + public function postEditBrand($id, Request $request): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); @@ -64,7 +65,7 @@ public function postEditBrand($id, Request $request) return Redirect::back()->with('success', __('brands.update_success')); } - public function getDeleteBrand($id) + public function getDeleteBrand($id): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index ee1bde1d20..336ca3c3c4 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers; +use Illuminate\View\View; +use Illuminate\Http\RedirectResponse; use App\Category; use App\Helpers\Fixometer; use App\User; @@ -11,7 +13,7 @@ class CategoryController extends Controller { - public function index() + public function index(): View { $Category = new Category; @@ -39,7 +41,7 @@ public function getEditCategory($id) ]); } - public function postEditCategory($id, Request $request) + public function postEditCategory($id, Request $request): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 6c28bcb782..4c97f6f73e 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -3,12 +3,11 @@ namespace App\Http\Controllers; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; -use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; use Party; class Controller extends BaseController { - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; + use AuthorizesRequests, ValidatesRequests; } diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index bf41ee9e39..34286640f0 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\View\View; use App\Group; use App\Party; use App\User; @@ -81,7 +82,7 @@ public function index() ); } - public function getHostDash() + public function getHostDash(): View { return view('dashboard.host'); } diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php index ae8942b466..97801d9bf1 100644 --- a/app/Http/Controllers/DeviceController.php +++ b/app/Http/Controllers/DeviceController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use App\Brands; use App\Cluster; use App\Device; @@ -26,7 +27,7 @@ class DeviceController extends Controller { - public function index($search = null) + public function index($search = null): \Illuminate\View\View { $user = User::getProfile(Auth::id()); $clusters = Cluster::with(['categories'])->get()->all(); @@ -105,7 +106,7 @@ public function imageUpload(Request $request, $id) } } - public function deleteImage($device_id, $idxref) + public function deleteImage($device_id, $idxref): RedirectResponse { $user = Auth::user(); diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php index 560def735e..e776661868 100644 --- a/app/Http/Controllers/GroupController.php +++ b/app/Http/Controllers/GroupController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use App\Device; use App\Events\ApproveGroup; use App\Events\EditGroup; @@ -287,7 +288,7 @@ public function view($groupid) ]); } - public function postSendInvite(Request $request) + public function postSendInvite(Request $request): RedirectResponse { $request->validate([ 'manual_invite_box' => [(new Delimited('email'))->min(1)], @@ -379,7 +380,7 @@ public function postSendInvite(Request $request) ])); } - public function confirmInvite($group_id, $hash) + public function confirmInvite($group_id, $hash): RedirectResponse { // Find user/group relationship based on the invitation hash. $user_group = UserGroups::where('status', $hash)->where('group', $group_id)->first(); @@ -435,7 +436,7 @@ public function edit(Request $request, $id, Geocoder $geocoder) ]); } - public function delete($id) + public function delete($id): RedirectResponse { $group = Group::where('idgroups', $id)->first(); @@ -541,7 +542,7 @@ public static function stats($id, $format = 'row') return view('group.stats', $groupStats); } - public function getJoinGroup($group_id) + public function getJoinGroup($group_id): RedirectResponse { $user_id = Auth::id(); $alreadyInGroup = UserGroups::where('group', $group_id) @@ -636,11 +637,10 @@ public function ajaxDeleteImage($group_id, $id, $path) * @author Christopher Kelker - @date 2019-03-25 * @editor Christopher Kelker * @version 1.0.0 - * @param Request $request * @param [type] $code * @return [type] */ - public function confirmCodeInvite(Request $request, $code) + public function confirmCodeInvite(Request $request, $code): RedirectResponse { // Variables $group = Group::where('shareable_code', $code)->first(); diff --git a/app/Http/Controllers/GroupTagsController.php b/app/Http/Controllers/GroupTagsController.php index bc52e4446c..9a616d6225 100644 --- a/app/Http/Controllers/GroupTagsController.php +++ b/app/Http/Controllers/GroupTagsController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use App\GroupTags; use App\Helpers\Fixometer; use Auth; @@ -24,7 +25,7 @@ public function index() ]); } - public function postCreateTag(Request $request) + public function postCreateTag(Request $request): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); @@ -55,7 +56,7 @@ public function getEditTag($id) ]); } - public function postEditTag($id, Request $request) + public function postEditTag($id, Request $request): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); @@ -72,7 +73,7 @@ public function postEditTag($id, Request $request) return Redirect::back()->with('success', __('group-tags.update_success')); } - public function getDeleteTag($id) + public function getDeleteTag($id): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); diff --git a/app/Http/Controllers/InformationAlertCookieController.php b/app/Http/Controllers/InformationAlertCookieController.php index f0528c2fde..4aa4994c2d 100644 --- a/app/Http/Controllers/InformationAlertCookieController.php +++ b/app/Http/Controllers/InformationAlertCookieController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\JsonResponse; use Cookie; use Illuminate\Http\Request; @@ -26,9 +27,8 @@ public function __construct() * Show the profile for the given user. * * @param int $id - * @return View */ - public function __invoke(Request $request) + public function __invoke(Request $request): JsonResponse { if (! $request->has('dismissable_id')) { return response()->json(false); diff --git a/app/Http/Controllers/NetworkController.php b/app/Http/Controllers/NetworkController.php index a605faa874..d41c26db0a 100644 --- a/app/Http/Controllers/NetworkController.php +++ b/app/Http/Controllers/NetworkController.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers; +use Illuminate\View\View; +use Illuminate\Http\RedirectResponse; use App\Group; use App\Network; use Auth; @@ -13,10 +15,8 @@ class NetworkController extends Controller { /** * Display a listing of the resource. - * - * @return \Illuminate\Http\Response */ - public function index() + public function index(): View { $user = Auth::user(); @@ -42,11 +42,8 @@ public function index() /** * Display the specified network. - * - * @param \App\Network $network - * @return \Illuminate\Http\Response */ - public function show(Network $network) + public function show(Network $network): View { $user = Auth::user(); @@ -66,11 +63,8 @@ public function show(Network $network) /** * Show the form for editing the specified resource. - * - * @param \App\Network $network - * @return \Illuminate\Http\Response */ - public function edit(Network $network) + public function edit(Network $network): View { $this->authorize('update', $network); @@ -81,12 +75,8 @@ public function edit(Network $network) /** * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param \App\Network $network - * @return \Illuminate\Http\Response */ - public function update(Request $request, Network $network) + public function update(Request $request, Network $network): RedirectResponse { $this->authorize('update', $network); @@ -110,11 +100,8 @@ public function update(Request $request, Network $network) /** * Associate groups to the specified network. - * - * @param \App\Network $network - * @return \Illuminate\Http\Response */ - public function associateGroup(Request $request, Network $network) + public function associateGroup(Request $request, Network $network): RedirectResponse { $this->authorize('associateGroups', $network); diff --git a/app/Http/Controllers/PartyController.php b/app/Http/Controllers/PartyController.php index bdcdbbb693..56d1cf2005 100644 --- a/app/Http/Controllers/PartyController.php +++ b/app/Http/Controllers/PartyController.php @@ -2,6 +2,9 @@ namespace App\Http\Controllers; +use Illuminate\View\View; +use Illuminate\Http\JsonResponse; +use Illuminate\Http\RedirectResponse; use App\Audits; use App\Brands; use App\Cluster; @@ -117,7 +120,7 @@ public static function expandEvent($event, $group = null, $countries = null, $at return $thisone; } - public function index($group_id = null) + public function index($group_id = null): View { $events = []; @@ -187,7 +190,7 @@ public function index($group_id = null) ]); } - public function create(Request $request, $group_id = null) + public function create(Request $request, $group_id = null): View { $user = Auth::user(); $autoapprove = $group_id ? Group::where('idgroups', $group_id)->first()->auto_approve : false; @@ -308,7 +311,7 @@ public function duplicate($id, Request $request) ]); } - public function view($id) + public function view($id): View { $File = new FixometerFile; $Party = new Party; @@ -412,7 +415,7 @@ public function generateAddToCalendarLinks($event) } } - public function getJoinEvent($event_id) + public function getJoinEvent($event_id): RedirectResponse { $user_id = Auth::id(); $not_in_event = EventsUsers::where('event', $event_id) @@ -490,7 +493,7 @@ public function notifyHostsOfRsvp($user_event, $event_id) } } - public static function stats($id) + public static function stats($id): View { $event = Party::where('idevents', $id)->first(); @@ -511,7 +514,7 @@ public static function stats($id) * * @return Response json formatted array of relevant info on users in the group. */ - public function getGroupEmailsWithNames($event_id) + public function getGroupEmailsWithNames(int $event_id): Response { $group_user_ids = UserGroups::where('group', Party::find($event_id)->group) ->where('user', '!=', Auth::user()->id) @@ -534,7 +537,7 @@ public function getGroupEmailsWithNames($event_id) return response()->json($group_users); } - public function updateQuantity(Request $request) + public function updateQuantity(Request $request): JsonResponse { $event_id = $request->input('event_id'); $quantity = $request->input('quantity'); @@ -556,7 +559,7 @@ public function updateQuantity(Request $request) return response()->json($return); } - public function updateVolunteerQuantity(Request $request) + public function updateVolunteerQuantity(Request $request): JsonResponse { $event_id = $request->input('event_id'); $quantity = $request->input('quantity'); @@ -578,7 +581,7 @@ public function updateVolunteerQuantity(Request $request) return response()->json($return); } - public function removeVolunteer(Request $request) + public function removeVolunteer(Request $request): JsonResponse { // The id that's passed in is that of the events_users table, because the entry may refer to a user without // an id. @@ -609,7 +612,7 @@ public function removeVolunteer(Request $request) } } - public function postSendInvite(Request $request) + public function postSendInvite(Request $request): RedirectResponse { $from_id = Auth::id(); $request->validate([ @@ -708,7 +711,7 @@ public function postSendInvite(Request $request) return redirect()->back()->with('warning', __('events.invite_noemails')); } - public function confirmInvite($event_id, $hash) + public function confirmInvite($event_id, $hash): RedirectResponse { $user_event = EventsUsers::where('status', $hash)->where('event', $event_id)->first(); @@ -727,7 +730,7 @@ public function confirmInvite($event_id, $hash) return redirect('/party/view/'.intval($event_id))->with('warning', __('events.invite_invalid')); } - public function cancelInvite($event_id) + public function cancelInvite($event_id): RedirectResponse { // We have to do a loop to avoid the gotcha where bulk delete operations don't invoke observers. foreach (EventsUsers::where('user', Auth::user()->id)->where('event', $event_id)->get() as $delete) { @@ -767,7 +770,7 @@ public function imageUpload(Request $request, $id) } } - public function deleteImage($event_id, $id, $path) + public function deleteImage($event_id, $id, $path): RedirectResponse { $user = Auth::user(); @@ -788,7 +791,7 @@ public function deleteImage($event_id, $id, $path) * This sends an email to all user except the host logged in an email to ask for contributions * */ - public function getContributions($event_id) + public function getContributions($event_id): RedirectResponse { $event = Party::find($event_id); @@ -816,7 +819,7 @@ public function getContributions($event_id) * Called via AJAX. * @param id The event id. */ - public function deleteEvent($id) + public function deleteEvent($id): RedirectResponse { $event = Party::findOrFail($id); $user = Auth::user(); @@ -854,11 +857,10 @@ public function deleteEvent($id) * @author Christopher Kelker - @date 2019-03-25 * @editor Christopher Kelker * @version 1.0.0 - * @param Request $request * @param [type] $code * @return [type] */ - public function confirmCodeInvite(Request $request, $code) + public function confirmCodeInvite(Request $request, $code): RedirectResponse { // Variables $party = Party::where('shareable_code', $code)->first(); diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index d89aef3eec..278467af94 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\View\View; use App\Helpers\Fixometer; use App\Providers\RouteServiceProvider; use App\Role; @@ -33,7 +34,7 @@ public function index() return redirect(RouteServiceProvider::HOME); } - public function edit($id, Request $request) + public function edit($id, Request $request): View { $user = Auth::user(); diff --git a/app/Http/Controllers/SkillsController.php b/app/Http/Controllers/SkillsController.php index b9b63fbb0a..89331d84ff 100644 --- a/app/Http/Controllers/SkillsController.php +++ b/app/Http/Controllers/SkillsController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use App\Helpers\Fixometer; use App\Skills; use App\UsersSkills; @@ -25,7 +26,7 @@ public function index() ]); } - public function postCreateSkill(Request $request) + public function postCreateSkill(Request $request): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); @@ -53,7 +54,7 @@ public function getEditSkill($id) ]); } - public function postEditSkill($id, Request $request) + public function postEditSkill($id, Request $request): RedirectResponse { if (! Fixometer::hasRole(Auth::user(), 'Administrator')) { return redirect('/user/forbidden'); @@ -68,7 +69,7 @@ public function postEditSkill($id, Request $request) return Redirect::back()->with('success', __('skills.update_success')); } - public function getDeleteSkill($id) + public function getDeleteSkill($id): RedirectResponse { // Are you an admin? diff --git a/app/Http/Controllers/StyleController.php b/app/Http/Controllers/StyleController.php index 950948e174..44a949b859 100644 --- a/app/Http/Controllers/StyleController.php +++ b/app/Http/Controllers/StyleController.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; +use Illuminate\View\View; use Auth; use Illuminate\Http\Request; @@ -9,10 +11,8 @@ class StyleController extends Controller { /** * Nothing to see here. - * - * @return \Illuminate\Http\Response */ - public function index(Request $request) + public function index(Request $request): RedirectResponse { return redirect()->action([\App\Http\Controllers\HomeController::class, 'index']); } @@ -26,7 +26,7 @@ public function guide(Request $request) return view('test.styles', []); } - public function find(Request $request) + public function find(Request $request): View { $result = $this->findClassElements(); logger($result); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index d4d2657906..cb161a45e0 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -2,6 +2,9 @@ namespace App\Http\Controllers; +use Illuminate\View\View; +use Illuminate\Http\RedirectResponse; +use Illuminate\Http\JsonResponse; use App; use App\Device; use App\DripEvent; @@ -47,10 +50,8 @@ class UserController extends Controller { /** * Show the application dashboard. - * - * @return \Illuminate\Http\Response */ - public function index($id = null) + public function index($id = null): View { if (is_null($id)) { $id = Auth::id(); @@ -67,7 +68,7 @@ public function index($id = null) ]); } - public function getProfileEdit($id = null) + public function getProfileEdit($id = null): View { if (is_null($id)) { $user = Auth::user(); @@ -122,7 +123,7 @@ public function getProfileEdit($id = null) ]); } - public function getNotifications() + public function getNotifications(): View { $user = Auth::user(); $notifications = $user->notifications()->paginate(10); @@ -133,7 +134,7 @@ public function getNotifications() ]); } - public function postProfileInfoEdit(Request $request, App\Helpers\Geocoder $geocoder) + public function postProfileInfoEdit(Request $request, App\Helpers\Geocoder $geocoder): RedirectResponse { $rules = [ 'name' => 'required|string|max:255', @@ -189,7 +190,7 @@ public function postProfileInfoEdit(Request $request, App\Helpers\Geocoder $geoc return redirect()->back()->with('message', __('profile.profile_updated')); } - public function postProfilePasswordEdit(Request $request) + public function postProfilePasswordEdit(Request $request): RedirectResponse { if ($request->input('id') !== null) { $id = $request->input('id'); @@ -221,7 +222,7 @@ public function postProfilePasswordEdit(Request $request) return redirect()->back()->with('error', __('profile.password_old_mismatch')); } - public function postProfileRepairDirectory(Request $request) + public function postProfileRepairDirectory(Request $request): RedirectResponse { $rules = [ 'role' => 'required|digits_between:'.Role::REPAIR_DIRECTORY_SUPERADMIN.','.Role::REPAIR_DIRECTORY_EDITOR, @@ -249,7 +250,7 @@ public function postProfileRepairDirectory(Request $request) return redirect()->back()->with('message', __('profile.profile_updated')); } - public function storeLanguage(Request $request) + public function storeLanguage(Request $request): RedirectResponse { if ($request->input('id') !== null) { $userId = $request->input('id'); @@ -275,7 +276,7 @@ public function storeLanguage(Request $request) return redirect()->back()->with('message', Lang::get('profile.language_updated')); } - public function postSoftDeleteUser(Request $request) + public function postSoftDeleteUser(Request $request): RedirectResponse { if ($request->input('id') !== null) { $id = $request->input('id'); @@ -302,7 +303,7 @@ public function postSoftDeleteUser(Request $request) } } - public function postProfilePreferencesEdit(Request $request) + public function postProfilePreferencesEdit(Request $request): RedirectResponse { if ($request->input('id') !== null) { $id = $request->input('id'); @@ -322,7 +323,7 @@ public function postProfilePreferencesEdit(Request $request) return redirect()->back()->with('message', Lang::get('profile.preferences_updated')); } - public function postProfileTagsEdit(Request $request) + public function postProfileTagsEdit(Request $request): RedirectResponse { if ($request->input('id') !== null) { $id = $request->input('id'); @@ -345,7 +346,7 @@ public function postProfileTagsEdit(Request $request) return redirect()->back()->with('message', Lang::get('profile.skills_updated')); } - public function postProfilePictureEdit(Request $request) + public function postProfilePictureEdit(Request $request): RedirectResponse { if ($request->input('id') !== null) { $id = $request->input('id'); @@ -363,7 +364,7 @@ public function postProfilePictureEdit(Request $request) return redirect()->back()->with('error', __('profile.picture_error')); } - public function postAdminEdit(Request $request) + public function postAdminEdit(Request $request): RedirectResponse { if ($request->input('id') !== null) { $user_id = $request->input('id'); @@ -407,7 +408,7 @@ public function postAdminEdit(Request $request) return redirect()->back()->with('message', __('profile.admin_success')); } - public function recover(Request $request) + public function recover(Request $request): View { $User = new User; @@ -737,7 +738,7 @@ public function create(Request $request) } } - public function edit($id, Request $request) + public function edit($id, Request $request): View { global $fixometer_languages; @@ -849,7 +850,7 @@ public function edit($id, Request $request) } } - public function logout() + public function logout(): RedirectResponse { Auth::logout(); @@ -879,7 +880,7 @@ public function getRegister($hash = null) ]); } - public function postRegister(Request $request, $hash = null) + public function postRegister(Request $request, $hash = null): RedirectResponse { $geocoder = new \App\Helpers\Geocoder(); @@ -1057,14 +1058,14 @@ public function getOnboardingComplete() return 'true'; } - public function postEmail(Request $request) + public function postEmail(Request $request): JsonResponse { if (User::where('email', '=', $request->get('email'))->exists()) { return response()->json(['message' => __('auth.email_address_validation')]); } } - public static function getThumbnail(Request $request) + public static function getThumbnail(Request $request): JsonResponse { $user = User::where('mediawiki', $request->input('wiki_username'))->first(); @@ -1081,7 +1082,7 @@ public static function getThumbnail(Request $request) return response()->json($thumbnailPath); } - public function getUserMenus(Request $request) + public function getUserMenus(Request $request): JsonResponse { $user = User::where('mediawiki', $request->input('wiki_username'))->first(); diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 7c1a359ba1..dcf15edb83 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -45,25 +45,26 @@ class Kernel extends HttpKernel \App\Http\Middleware\VerifyTranslationAccess::class, ], 'api' => [ - 'throttle:api', + \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; /** - * The application's route middleware. + * The application's middleware aliases. * - * These middleware may be assigned to groups or used individually. + * Aliases may be used to conveniently assign middleware to routes and groups. * * @var array */ - protected $routeMiddleware = [ + protected $middlewareAliases = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verifyUserConsent' => \App\Http\Middleware\VerifyUserConsent::class, diff --git a/app/Http/Middleware/APISetLocale.php b/app/Http/Middleware/APISetLocale.php index ef3277c2e7..6a069587f9 100644 --- a/app/Http/Middleware/APISetLocale.php +++ b/app/Http/Middleware/APISetLocale.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; use Illuminate\Auth\Middleware\Authenticate; @@ -11,7 +13,7 @@ */ class APISetLocale extends Authenticate { - public function handle($request, Closure $next, ...$guards) + public function handle(Request $request, Closure $next, ...$guards): Response { if ($request->has('locale')) { $locale = $request->input('locale'); diff --git a/app/Http/Middleware/AcceptUserInvites.php b/app/Http/Middleware/AcceptUserInvites.php index 9747f527d5..cd700b6753 100644 --- a/app/Http/Middleware/AcceptUserInvites.php +++ b/app/Http/Middleware/AcceptUserInvites.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\EventsUsers; use App\Invite; use App\UserGroups; @@ -12,12 +14,8 @@ class AcceptUserInvites { /** * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { // Check if there are existing Groups/Events Shareable Invites for the // Current User diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index a4be5c587e..d4ef6447a9 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -3,19 +3,15 @@ namespace App\Http\Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware; +use Illuminate\Http\Request; class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. - * - * @param \Illuminate\Http\Request $request - * @return string */ - protected function redirectTo($request) + protected function redirectTo(Request $request): ?string { - if (! $request->expectsJson()) { - return route('login'); - } + return $request->expectsJson() ? null : route('login'); } } diff --git a/app/Http/Middleware/CheckForRepairNetwork.php b/app/Http/Middleware/CheckForRepairNetwork.php index d14cd62ac9..9a33198f83 100644 --- a/app/Http/Middleware/CheckForRepairNetwork.php +++ b/app/Http/Middleware/CheckForRepairNetwork.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App; use App\Network; use Auth; @@ -16,11 +18,8 @@ class CheckForRepairNetwork * on the website * @author Dean Appleton-Claydon * @date 2019-03-20 - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $host = $request->getHost(); $update_user = []; diff --git a/app/Http/Middleware/EnsureAPIToken.php b/app/Http/Middleware/EnsureAPIToken.php index 69924758a7..a378c91fb5 100644 --- a/app/Http/Middleware/EnsureAPIToken.php +++ b/app/Http/Middleware/EnsureAPIToken.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\User; use Auth; use Closure; @@ -10,12 +12,8 @@ class EnsureAPIToken { /** * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { if (Auth::check() && Auth::user()) { // We want to ensure that every user has an API token. This is because the Vue client's use of the API diff --git a/app/Http/Middleware/HttpsProtocol.php b/app/Http/Middleware/HttpsProtocol.php index b7c100ebfc..045a8d2126 100644 --- a/app/Http/Middleware/HttpsProtocol.php +++ b/app/Http/Middleware/HttpsProtocol.php @@ -2,18 +2,16 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; class HttpsProtocol { /** * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { if (! $request->secure() && (env('APP_ENV') === 'development' || env('APP_ENV') === 'production')) { return redirect()->secure($request->getRequestUri(), 301); diff --git a/app/Http/Middleware/LanguageSwitcher.php b/app/Http/Middleware/LanguageSwitcher.php index a8c6fe8400..e395fb1ab3 100644 --- a/app/Http/Middleware/LanguageSwitcher.php +++ b/app/Http/Middleware/LanguageSwitcher.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App; use Auth; use Closure; @@ -13,12 +15,8 @@ class LanguageSwitcher { /** * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { // A query string parameter of locale overrides all other places to attempt to determine the locale. if ($request->exists('locale')) { diff --git a/app/Http/Middleware/LogHTTPErrorsToSentry.php b/app/Http/Middleware/LogHTTPErrorsToSentry.php index 49834b97df..3bbb228653 100644 --- a/app/Http/Middleware/LogHTTPErrorsToSentry.php +++ b/app/Http/Middleware/LogHTTPErrorsToSentry.php @@ -2,17 +2,15 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; class LogHTTPErrorsToSentry { /** * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $response = $next($request); diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index a2813a0648..4b2af74dfe 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -6,18 +6,16 @@ use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use Symfony\Component\HttpFoundation\Response; class RedirectIfAuthenticated { /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next - * @param string|null ...$guards - * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ - public function handle(Request $request, Closure $next, ...$guards) + public function handle(Request $request, Closure $next, string ...$guards): Response { $guards = empty($guards) ? [null] : $guards; diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index 7186414c65..c9c58bddce 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -11,7 +11,7 @@ class TrustHosts extends Middleware * * @return array */ - public function hosts() + public function hosts(): array { return [ $this->allSubdomainsOfApplicationUrl(), diff --git a/app/Http/Middleware/VerifyTranslationAccess.php b/app/Http/Middleware/VerifyTranslationAccess.php index 1b1fe65e2c..7da689d1c7 100644 --- a/app/Http/Middleware/VerifyTranslationAccess.php +++ b/app/Http/Middleware/VerifyTranslationAccess.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\Helpers\Fixometer; use App\User; use Auth; @@ -11,12 +13,8 @@ class VerifyTranslationAccess { /** * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $has_permission = User::join('users_permissions', 'users_permissions.user_id', '=', 'users.id') ->join('permissions', 'permissions.idpermissions', '=', 'users_permissions.permission_id') diff --git a/app/Http/Middleware/VerifyUserConsent.php b/app/Http/Middleware/VerifyUserConsent.php index a652e0f1a5..d89f183a2c 100644 --- a/app/Http/Middleware/VerifyUserConsent.php +++ b/app/Http/Middleware/VerifyUserConsent.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\User; use Auth; use Closure; @@ -10,12 +12,8 @@ class VerifyUserConsent { /** * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { if (Auth::check() && Auth::user()->hasUserGivenConsent()) { return $next($request); diff --git a/app/Http/Resources/Alert.php b/app/Http/Resources/Alert.php index f5268aab58..58dde80f8d 100644 --- a/app/Http/Resources/Alert.php +++ b/app/Http/Resources/Alert.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -72,11 +73,8 @@ class Alert extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { $ret = [ 'id' => $this->id, diff --git a/app/Http/Resources/AlertCollection.php b/app/Http/Resources/AlertCollection.php index f850ac63d3..0861f36b23 100644 --- a/app/Http/Resources/AlertCollection.php +++ b/app/Http/Resources/AlertCollection.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; /** @@ -20,11 +21,8 @@ class AlertCollection extends ResourceCollection { /** * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Category.php b/app/Http/Resources/Category.php index fcd8d1ac13..e25a1ae1ef 100644 --- a/app/Http/Resources/Category.php +++ b/app/Http/Resources/Category.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; /** @@ -37,11 +38,8 @@ class Category extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'id' => $this->idcategories, diff --git a/app/Http/Resources/Device.php b/app/Http/Resources/Device.php index d41a316cd7..fbef390d1e 100644 --- a/app/Http/Resources/Device.php +++ b/app/Http/Resources/Device.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use App\Party; use Illuminate\Http\Resources\Json\JsonResource; @@ -181,11 +182,8 @@ class Device extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { $event = \App\Party::find($this->event); $group = $event ? \App\Group::find($event->group) : NULL; diff --git a/app/Http/Resources/Group.php b/app/Http/Resources/Group.php index 211a9088fd..c4bc6e435e 100644 --- a/app/Http/Resources/Group.php +++ b/app/Http/Resources/Group.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -268,11 +269,8 @@ class Group extends JsonResource /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { $stats = $this->resource->getGroupStats(); $stats['events'] = $stats['parties']; diff --git a/app/Http/Resources/GroupCollection.php b/app/Http/Resources/GroupCollection.php index 23008f02ea..d109264c2a 100644 --- a/app/Http/Resources/GroupCollection.php +++ b/app/Http/Resources/GroupCollection.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; /** @@ -20,11 +21,8 @@ class GroupCollection extends ResourceCollection { /** * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/GroupLocation.php b/app/Http/Resources/GroupLocation.php index ec4f75d22d..c4e3949ccb 100644 --- a/app/Http/Resources/GroupLocation.php +++ b/app/Http/Resources/GroupLocation.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\Facades\Auth; @@ -62,11 +63,8 @@ class GroupLocation extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { $ret = [ 'location' => $this->location, diff --git a/app/Http/Resources/GroupSummary.php b/app/Http/Resources/GroupSummary.php index 2d8a493d9f..b4af5cf306 100644 --- a/app/Http/Resources/GroupSummary.php +++ b/app/Http/Resources/GroupSummary.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -81,11 +82,8 @@ class GroupSummary extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { $ret = [ 'id' => $this->idgroups, diff --git a/app/Http/Resources/Image.php b/app/Http/Resources/Image.php index 436b508a52..0a49c50117 100644 --- a/app/Http/Resources/Image.php +++ b/app/Http/Resources/Image.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; /** @@ -30,11 +31,8 @@ class Image extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'id' => $this->idimages, diff --git a/app/Http/Resources/Item.php b/app/Http/Resources/Item.php index fd9a870d2b..03c53b1288 100644 --- a/app/Http/Resources/Item.php +++ b/app/Http/Resources/Item.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; /** @@ -44,11 +45,8 @@ class Item extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'type' => $this->item_type, diff --git a/app/Http/Resources/ItemCollection.php b/app/Http/Resources/ItemCollection.php index e89c2619b6..3fe9835e25 100644 --- a/app/Http/Resources/ItemCollection.php +++ b/app/Http/Resources/ItemCollection.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; /** @@ -20,11 +21,8 @@ class ItemCollection extends ResourceCollection { /** * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Network.php b/app/Http/Resources/Network.php index db727b23b7..a9cbbd655e 100644 --- a/app/Http/Resources/Network.php +++ b/app/Http/Resources/Network.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; /** @@ -206,11 +207,8 @@ class Network extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/NetworkSummary.php b/app/Http/Resources/NetworkSummary.php index 2be5f0b2bb..6a63d7e94d 100644 --- a/app/Http/Resources/NetworkSummary.php +++ b/app/Http/Resources/NetworkSummary.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; /** @@ -45,11 +46,8 @@ class NetworkSummary extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/NetworkSummaryCollection.php b/app/Http/Resources/NetworkSummaryCollection.php index 605a03a8d4..056a3c2d7b 100644 --- a/app/Http/Resources/NetworkSummaryCollection.php +++ b/app/Http/Resources/NetworkSummaryCollection.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; /** @@ -20,11 +21,8 @@ class NetworkSummaryCollection extends ResourceCollection { /** * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Party.php b/app/Http/Resources/Party.php index e0e78b56fb..e79eb523cb 100644 --- a/app/Http/Resources/Party.php +++ b/app/Http/Resources/Party.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -238,11 +239,8 @@ class Party extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { // We return information which can be public, and we rename fields to look more consistent. $networkData = gettype($this->network_data) == 'string' ? json_decode($this->network_data, true) : $this->network_data; diff --git a/app/Http/Resources/PartySummary.php b/app/Http/Resources/PartySummary.php index 86855eb8fc..2ed021d79d 100644 --- a/app/Http/Resources/PartySummary.php +++ b/app/Http/Resources/PartySummary.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; @@ -107,11 +108,8 @@ class PartySummary extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { // We return information which can be public, and we rename fields to look more consistent. // diff --git a/app/Http/Resources/Skill.php b/app/Http/Resources/Skill.php index 137cc36436..7dd62cea1a 100644 --- a/app/Http/Resources/Skill.php +++ b/app/Http/Resources/Skill.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; /** @@ -44,11 +45,8 @@ class Skill extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/SkillCollection.php b/app/Http/Resources/SkillCollection.php index 03ac5b12fd..80d412f4a3 100644 --- a/app/Http/Resources/SkillCollection.php +++ b/app/Http/Resources/SkillCollection.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; /** @@ -20,11 +21,8 @@ class SkillCollection extends ResourceCollection { /** * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Tag.php b/app/Http/Resources/Tag.php index 55edeeb13f..d0c3a0756d 100644 --- a/app/Http/Resources/Tag.php +++ b/app/Http/Resources/Tag.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; /** @@ -37,11 +38,8 @@ class Tag extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'id' => $this->id, diff --git a/app/Http/Resources/TagCollection.php b/app/Http/Resources/TagCollection.php index 886cd77d14..828af4b2fe 100644 --- a/app/Http/Resources/TagCollection.php +++ b/app/Http/Resources/TagCollection.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; /** @@ -20,11 +21,8 @@ class TagCollection extends ResourceCollection { /** * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/app/Http/Resources/Volunteer.php b/app/Http/Resources/Volunteer.php index 801f7f4c75..d944f8e458 100644 --- a/app/Http/Resources/Volunteer.php +++ b/app/Http/Resources/Volunteer.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use App\Role; use App\Skills; use App\User; @@ -64,11 +65,8 @@ class Volunteer extends JsonResource { /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { if (\Cache::has('all_skills')) { $allSkills = \Cache::get('all_skills'); diff --git a/app/Http/Resources/VolunteerCollection.php b/app/Http/Resources/VolunteerCollection.php index a5ed8e82a9..a44f340d57 100644 --- a/app/Http/Resources/VolunteerCollection.php +++ b/app/Http/Resources/VolunteerCollection.php @@ -2,6 +2,7 @@ namespace App\Http\Resources; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\ResourceCollection; /** @@ -20,11 +21,8 @@ class VolunteerCollection extends ResourceCollection { /** * Transform the resource collection into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return parent::toArray($request); } diff --git a/app/Invite.php b/app/Invite.php index cd79974c8f..8acc00d8e2 100644 --- a/app/Invite.php +++ b/app/Invite.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; use Illuminate\Notifications\Notifiable; @@ -18,14 +19,14 @@ class Invite extends Model 'email', 'record_id', 'hash', 'type', ]; - public function group() + public function group(): BelongsTo { if ($this->type == 'group') { return $this->belongsTo(Group::class, 'record_id', 'idgroups'); } } - public function event() + public function event(): BelongsTo { if ($this->type == 'event') { return $this->belongsTo(Party::class, 'record_id', 'idevents'); diff --git a/app/Listeners/AddUserToDiscourseGroup.php b/app/Listeners/AddUserToDiscourseGroup.php index afd44a0482..3c793aff6e 100644 --- a/app/Listeners/AddUserToDiscourseGroup.php +++ b/app/Listeners/AddUserToDiscourseGroup.php @@ -21,11 +21,8 @@ public function __construct() /** * Handle the event. - * - * @param UserFollowedGroup $event - * @return void */ - public function handle(UserFollowedGroup $event) + public function handle(UserFollowedGroup $event): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Listeners/AddUserToDiscourseThreadForEvent.php b/app/Listeners/AddUserToDiscourseThreadForEvent.php index 4868768806..f07369c4ce 100644 --- a/app/Listeners/AddUserToDiscourseThreadForEvent.php +++ b/app/Listeners/AddUserToDiscourseThreadForEvent.php @@ -29,7 +29,7 @@ private function getHost($idevents) { return $hosts->count() ? $hosts[0] : null; } - public function handle(UserConfirmedEvent $e) { + public function handle(UserConfirmedEvent $e): void { // This call can block for a long time - add our own timeout so that we can fail it rather than block // the whole queue. pcntl_signal(SIGALRM, function () { diff --git a/app/Listeners/AnonymiseSoftDeletedUser.php b/app/Listeners/AnonymiseSoftDeletedUser.php index 73091b12d1..db209225c2 100644 --- a/app/Listeners/AnonymiseSoftDeletedUser.php +++ b/app/Listeners/AnonymiseSoftDeletedUser.php @@ -6,10 +6,7 @@ class AnonymiseSoftDeletedUser extends BaseEvent { - /** - * @param UserDeleted $event - */ - public function handle(UserDeleted $event) + public function handle(UserDeleted $event): void { $event->user->anonymise()->save(); } diff --git a/app/Listeners/ChangeWikiPassword.php b/app/Listeners/ChangeWikiPassword.php index d99230c16d..2a875d75f2 100644 --- a/app/Listeners/ChangeWikiPassword.php +++ b/app/Listeners/ChangeWikiPassword.php @@ -24,11 +24,8 @@ public function __construct(Request $request) /** * Handle the event. - * - * @param PasswordChanged $event - * @return void */ - public function handle(PasswordChanged $event) + public function handle(PasswordChanged $event): void { $user = $event->user; $oldpw = $event->oldPassword; diff --git a/app/Listeners/CreateDiscourseGroupForGroup.php b/app/Listeners/CreateDiscourseGroupForGroup.php index 40fcb652a7..bca3fdb0fc 100644 --- a/app/Listeners/CreateDiscourseGroupForGroup.php +++ b/app/Listeners/CreateDiscourseGroupForGroup.php @@ -24,11 +24,8 @@ public function __construct() /** * Handle the event. - * - * @param ApproveGroup $event - * @return void */ - public function handle(ApproveGroup $event) + public function handle(ApproveGroup $event): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Listeners/CreateDiscourseThreadForEvent.php b/app/Listeners/CreateDiscourseThreadForEvent.php index 4ca7920a98..d3bab8dc48 100644 --- a/app/Listeners/CreateDiscourseThreadForEvent.php +++ b/app/Listeners/CreateDiscourseThreadForEvent.php @@ -22,11 +22,8 @@ public function __construct() /** * Handle the event. - * - * @param ApproveEvent $event - * @return void */ - public function handle(ApproveEvent $event) + public function handle(ApproveEvent $event): void { if (! config('restarters.features.discourse_integration')) { return; diff --git a/app/Listeners/CreateWordpressPostForEvent.php b/app/Listeners/CreateWordpressPostForEvent.php index 4f8af507f4..051ffef977 100644 --- a/app/Listeners/CreateWordpressPostForEvent.php +++ b/app/Listeners/CreateWordpressPostForEvent.php @@ -27,11 +27,8 @@ public function __construct(WordpressClient $wpClient) /** * Handle the event. - * - * @param ApproveEvent $event - * @return void */ - public function handle(ApproveEvent $event) + public function handle(ApproveEvent $event): void { $partyId = $event->party->idevents; diff --git a/app/Listeners/CreateWordpressPostForGroup.php b/app/Listeners/CreateWordpressPostForGroup.php index 61ffed8bc5..9060029a5d 100644 --- a/app/Listeners/CreateWordpressPostForGroup.php +++ b/app/Listeners/CreateWordpressPostForGroup.php @@ -24,11 +24,8 @@ public function __construct(WordpressClient $wpClient) /** * Handle the event. - * - * @param ApproveGroup $event - * @return void */ - public function handle(ApproveGroup $event) + public function handle(ApproveGroup $event): void { $id = $event->group->idgroups; $data = $event->data; diff --git a/app/Listeners/DeleteEventFromWordPress.php b/app/Listeners/DeleteEventFromWordPress.php index d1e452dae2..5093b3d075 100644 --- a/app/Listeners/DeleteEventFromWordPress.php +++ b/app/Listeners/DeleteEventFromWordPress.php @@ -25,11 +25,8 @@ public function __construct(WordpressClient $wpClient) /** * Handle the event. - * - * @param EventDeleted $event - * @return void */ - public function handle(EventDeleted $event) + public function handle(EventDeleted $event): void { // Slightly confusing name clash - usually we refer to community repair events as 'events' in the system. Here explicitly calling it repairEvent. diff --git a/app/Listeners/DeviceUpdatedAt.php b/app/Listeners/DeviceUpdatedAt.php index 2c24543642..f555b765dc 100644 --- a/app/Listeners/DeviceUpdatedAt.php +++ b/app/Listeners/DeviceUpdatedAt.php @@ -11,11 +11,8 @@ class DeviceUpdatedAt extends BaseEvent { /** * Handle the event. - * - * @param DeviceCreatedOrUpdated $event - * @return void */ - public function handle(DeviceCreatedOrUpdated $event) + public function handle(DeviceCreatedOrUpdated $event): void { // We've been passed a device id, and we want to record in the event and group that the devices have been // updated. diff --git a/app/Listeners/DiscourseUserEventSubscriber.php b/app/Listeners/DiscourseUserEventSubscriber.php index 0d42a5b03f..43cc721810 100644 --- a/app/Listeners/DiscourseUserEventSubscriber.php +++ b/app/Listeners/DiscourseUserEventSubscriber.php @@ -2,6 +2,7 @@ namespace App\Listeners; +use Illuminate\Events\Dispatcher; use App\Events\UserEmailUpdated; use App\Events\UserLanguageUpdated; use App\Events\UserRegistered; @@ -136,10 +137,8 @@ public function onUserDeleted(UserDeleted $event) /** * Register the listeners for the subscriber. - * - * @param \Illuminate\Events\Dispatcher $events */ - public function subscribe($events) + public function subscribe(Dispatcher $events) { // We subscribe to all the events irrespective of whether the feature is enabled so that we can test them. $events->listen( diff --git a/app/Listeners/EditWordpressPostForEvent.php b/app/Listeners/EditWordpressPostForEvent.php index c0aff9d9d0..784dab4e2f 100644 --- a/app/Listeners/EditWordpressPostForEvent.php +++ b/app/Listeners/EditWordpressPostForEvent.php @@ -27,11 +27,8 @@ public function __construct(WordpressClient $wpClient) /** * Handle the event. - * - * @param EditEvent $event - * @return void */ - public function handle(EditEvent $event) + public function handle(EditEvent $event): void { $id = $event->party->idevents; $data = $event->data; diff --git a/app/Listeners/EditWordpressPostForGroup.php b/app/Listeners/EditWordpressPostForGroup.php index e10527db1d..f4c5677af0 100644 --- a/app/Listeners/EditWordpressPostForGroup.php +++ b/app/Listeners/EditWordpressPostForGroup.php @@ -24,11 +24,8 @@ public function __construct(WordpressClient $wpClient) /** * Handle the event. - * - * @param EditGroup $event - * @return void */ - public function handle(EditGroup $event) + public function handle(EditGroup $event): void { $id = $event->group->idgroups; $data = $event->data; diff --git a/app/Listeners/LogInToWiki.php b/app/Listeners/LogInToWiki.php index 193d30d80b..8dd2740aba 100644 --- a/app/Listeners/LogInToWiki.php +++ b/app/Listeners/LogInToWiki.php @@ -33,11 +33,8 @@ public function __construct(Request $request, UserCreator $mediawikiUserCreator) /** * Handle the event. - * - * @param Login $event - * @return void */ - public function handle(Login $event) + public function handle(Login $event): void { $user = $event->user; diff --git a/app/Listeners/LogOutOfWiki.php b/app/Listeners/LogOutOfWiki.php index f82617ec33..81a508276c 100644 --- a/app/Listeners/LogOutOfWiki.php +++ b/app/Listeners/LogOutOfWiki.php @@ -22,11 +22,8 @@ public function __construct(Request $request) /** * Handle the event. - * - * @param Logout $event - * @return void */ - public function handle(Logout $event) + public function handle(Logout $event): void { $user = $event->user; diff --git a/app/Listeners/LogSuccessfulLogin.php b/app/Listeners/LogSuccessfulLogin.php index 5e2ec09d66..ecc813e8d2 100644 --- a/app/Listeners/LogSuccessfulLogin.php +++ b/app/Listeners/LogSuccessfulLogin.php @@ -22,11 +22,8 @@ public function __construct(Request $request) /** * Handle the event. - * - * @param Login $event - * @return void */ - public function handle(Login $event) + public function handle(Login $event): void { $user = $event->user; diff --git a/app/Listeners/NotifyApprovedEvent.php b/app/Listeners/NotifyApprovedEvent.php index 3e712d6e45..8a8deca9ce 100644 --- a/app/Listeners/NotifyApprovedEvent.php +++ b/app/Listeners/NotifyApprovedEvent.php @@ -17,11 +17,8 @@ class NotifyApprovedEvent extends BaseEvent { /** * Handle the event. - * - * @param ApproveEvent $event - * @return void */ - public function handle(ApproveEvent $event) + public function handle(ApproveEvent $event): void { $partyId = $event->party->idevents; diff --git a/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php b/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php index faf90d6f4d..ae28bd16c6 100644 --- a/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php +++ b/app/Listeners/RemoveSoftDeletedUserFromAllGroups.php @@ -7,10 +7,7 @@ class RemoveSoftDeletedUserFromAllGroups extends BaseEvent { - /** - * @param UserDeleted $event - */ - public function handle(UserDeleted $event) + public function handle(UserDeleted $event): void { UserGroups::where('user', $event->user->id)->delete(); } diff --git a/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php b/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php index 2c1f085dcf..61f21d68c5 100644 --- a/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php +++ b/app/Listeners/RemoveUserFromDiscourseThreadForEvent.php @@ -27,7 +27,7 @@ private function getHost($idevents) { return $hosts->count() ? $hosts[0] : null; } - public function handle(UserLeftEvent $e) { + public function handle(UserLeftEvent $e): void { if ($e->iduser) { $event = Party::find($e->idevents); $user = User::find($e->iduser); diff --git a/app/Listeners/SendAdminModerateEventPhotosNotification.php b/app/Listeners/SendAdminModerateEventPhotosNotification.php index 2e69775a97..4c2710a648 100644 --- a/app/Listeners/SendAdminModerateEventPhotosNotification.php +++ b/app/Listeners/SendAdminModerateEventPhotosNotification.php @@ -33,10 +33,7 @@ class SendAdminModerateEventPhotosNotification extends BaseEvent */ protected $party; - /** - * @param EventImagesUploaded $event - */ - public function handle(EventImagesUploaded $event) + public function handle(EventImagesUploaded $event): void { $this->event = $event; $this->party = $event->party; diff --git a/app/Listeners/SendAdminUserDeletedNotification.php b/app/Listeners/SendAdminUserDeletedNotification.php index 9982751aa1..580be608e4 100644 --- a/app/Listeners/SendAdminUserDeletedNotification.php +++ b/app/Listeners/SendAdminUserDeletedNotification.php @@ -9,10 +9,7 @@ class SendAdminUserDeletedNotification extends BaseEvent { - /** - * @param UserDeleted $event - */ - public function handle(UserDeleted $event) + public function handle(UserDeleted $event): void { $notify_users = Fixometer::usersWhoHavePreference('admin-user-deleted'); diff --git a/app/Listeners/SyncUserProperties.php b/app/Listeners/SyncUserProperties.php index b7b1cad9ca..07d054f59c 100644 --- a/app/Listeners/SyncUserProperties.php +++ b/app/Listeners/SyncUserProperties.php @@ -22,11 +22,8 @@ public function __construct() /** * Handle the event. - * - * @param UserUpdated $event - * @return void */ - public function handle(UserUpdated $event) + public function handle(UserUpdated $event): void { if ($event->user->isDirty('email')) { event(new UserEmailUpdated($event->user)); diff --git a/app/Misccat.php b/app/Misccat.php index f972a2d73f..6c8863d222 100644 --- a/app/Misccat.php +++ b/app/Misccat.php @@ -30,10 +30,8 @@ class Misccat extends Model * The list of excluded iddevices is because those records have * useless problem text: * "Like all data in Y1, this data is an estimate based on participation" - * - * @return array */ - public function fetchMisc() + public function fetchMisc(): array { return DB::select( " diff --git a/app/Network.php b/app/Network.php index acc2376d46..0f61ccf35b 100644 --- a/app/Network.php +++ b/app/Network.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Group; use Illuminate\Database\Eloquent\Model; @@ -10,7 +11,7 @@ class Network extends Model { use HasFactory; - public function groups() + public function groups(): BelongsToMany { return $this->belongsToMany(Group::class, 'group_network', 'network_id', 'group_id'); } @@ -25,7 +26,7 @@ public function containsGroup($group) return $this->groups->contains($group); } - public function coordinators() + public function coordinators(): BelongsToMany { return $this->belongsToMany(User::class, 'user_network', 'network_id', 'user_id'); } diff --git a/app/Notifications/AdminAbnormalDevices.php b/app/Notifications/AdminAbnormalDevices.php index 7fdc86277e..abd1a34bf4 100644 --- a/app/Notifications/AdminAbnormalDevices.php +++ b/app/Notifications/AdminAbnormalDevices.php @@ -10,9 +10,8 @@ class AdminAbnormalDevices extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject(__('notifications.abnormal_devices_subject', [], $notifiable->language)) @@ -34,9 +33,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.abnormal_devices_title', [], $notifiable->language), diff --git a/app/Notifications/AdminModerationEvent.php b/app/Notifications/AdminModerationEvent.php index 316929722c..7046c4e66f 100644 --- a/app/Notifications/AdminModerationEvent.php +++ b/app/Notifications/AdminModerationEvent.php @@ -10,9 +10,8 @@ class AdminModerationEvent extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject( @@ -39,9 +38,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.moderation_event_subject', [ diff --git a/app/Notifications/AdminModerationEventPhotos.php b/app/Notifications/AdminModerationEventPhotos.php index 817e6dd99a..defc50f602 100644 --- a/app/Notifications/AdminModerationEventPhotos.php +++ b/app/Notifications/AdminModerationEventPhotos.php @@ -10,9 +10,8 @@ class AdminModerationEventPhotos extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -44,9 +43,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminModerationGroup.php b/app/Notifications/AdminModerationGroup.php index 43c7fbcc16..e5fee8ca9b 100644 --- a/app/Notifications/AdminModerationGroup.php +++ b/app/Notifications/AdminModerationGroup.php @@ -10,9 +10,8 @@ class AdminModerationGroup extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -40,9 +39,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminNewUser.php b/app/Notifications/AdminNewUser.php index 83eca44b84..5aae2d0360 100644 --- a/app/Notifications/AdminNewUser.php +++ b/app/Notifications/AdminNewUser.php @@ -10,9 +10,8 @@ class AdminNewUser extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -35,9 +34,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminUserDeleted.php b/app/Notifications/AdminUserDeleted.php index 9d7b1ea56d..470e6815c7 100644 --- a/app/Notifications/AdminUserDeleted.php +++ b/app/Notifications/AdminUserDeleted.php @@ -10,9 +10,8 @@ class AdminUserDeleted extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -35,9 +34,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressCreateEventFailure.php b/app/Notifications/AdminWordPressCreateEventFailure.php index e1eda41661..e5b6129fb5 100644 --- a/app/Notifications/AdminWordPressCreateEventFailure.php +++ b/app/Notifications/AdminWordPressCreateEventFailure.php @@ -10,9 +10,8 @@ class AdminWordPressCreateEventFailure extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -35,9 +34,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressCreateGroupFailure.php b/app/Notifications/AdminWordPressCreateGroupFailure.php index 43a5afe220..96b76199aa 100644 --- a/app/Notifications/AdminWordPressCreateGroupFailure.php +++ b/app/Notifications/AdminWordPressCreateGroupFailure.php @@ -10,9 +10,8 @@ class AdminWordPressCreateGroupFailure extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -35,9 +34,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressEditEventFailure.php b/app/Notifications/AdminWordPressEditEventFailure.php index 630fb55a08..05a14fc480 100644 --- a/app/Notifications/AdminWordPressEditEventFailure.php +++ b/app/Notifications/AdminWordPressEditEventFailure.php @@ -10,9 +10,8 @@ class AdminWordPressEditEventFailure extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -35,9 +34,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/AdminWordPressEditGroupFailure.php b/app/Notifications/AdminWordPressEditGroupFailure.php index 88fdaaeca2..1d7c95cb9f 100644 --- a/app/Notifications/AdminWordPressEditGroupFailure.php +++ b/app/Notifications/AdminWordPressEditGroupFailure.php @@ -10,9 +10,8 @@ class AdminWordPressEditGroupFailure extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -35,9 +34,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/BaseNotification.php b/app/Notifications/BaseNotification.php index 0a3aeaec3f..9d4c2bf0e9 100644 --- a/app/Notifications/BaseNotification.php +++ b/app/Notifications/BaseNotification.php @@ -25,7 +25,7 @@ public function __construct($arr, $user = null) * @param mixed $notifiable * @return array */ - public function via($notifiable) + public function via($notifiable): array { // If user being notified has opted in to receive emails. if ($notifiable->invites == 1) diff --git a/app/Notifications/DeleteEventFromWordpressFailed.php b/app/Notifications/DeleteEventFromWordpressFailed.php index 96c6dc0fcd..a996228b28 100644 --- a/app/Notifications/DeleteEventFromWordpressFailed.php +++ b/app/Notifications/DeleteEventFromWordpressFailed.php @@ -10,9 +10,8 @@ class DeleteEventFromWordpressFailed extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -42,9 +41,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/EventConfirmed.php b/app/Notifications/EventConfirmed.php index 3b875d76c7..373d867f3e 100644 --- a/app/Notifications/EventConfirmed.php +++ b/app/Notifications/EventConfirmed.php @@ -23,9 +23,8 @@ public function __construct(Party $party) * Get the notification's delivery channels. * * @param mixed $notifiable - * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -34,9 +33,8 @@ public function via($notifiable) * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; $url = url('/party/view/' . $this->party->idevents); @@ -64,9 +62,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; $url = url('/party/view/' . $this->party->idevents); diff --git a/app/Notifications/EventDevices.php b/app/Notifications/EventDevices.php index 1115445e49..a41bdb2117 100644 --- a/app/Notifications/EventDevices.php +++ b/app/Notifications/EventDevices.php @@ -10,9 +10,8 @@ class EventDevices extends BaseNotification * Get the notification's delivery channels. * * @param mixed $notifiable - * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -21,9 +20,8 @@ public function via($notifiable) * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { if ($notifiable !== null && $notifiable->invites == 1) { @@ -49,9 +47,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/EventRepairs.php b/app/Notifications/EventRepairs.php index cc65b1c3bd..2ea2feaf0d 100644 --- a/app/Notifications/EventRepairs.php +++ b/app/Notifications/EventRepairs.php @@ -10,9 +10,8 @@ class EventRepairs extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -40,9 +39,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; diff --git a/app/Notifications/GroupConfirmed.php b/app/Notifications/GroupConfirmed.php index 09604c0f80..081bf25b3e 100644 --- a/app/Notifications/GroupConfirmed.php +++ b/app/Notifications/GroupConfirmed.php @@ -22,9 +22,8 @@ public function __construct($group) * Get the notification's delivery channels. * * @param mixed $notifiable - * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -33,9 +32,8 @@ public function via($notifiable) * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -59,9 +57,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'name' => $this->group->name, diff --git a/app/Notifications/JoinEvent.php b/app/Notifications/JoinEvent.php index f07ced7e9c..abfedb83a4 100644 --- a/app/Notifications/JoinEvent.php +++ b/app/Notifications/JoinEvent.php @@ -10,9 +10,8 @@ class JoinEvent extends BaseNotification * Get the notification's delivery channels. * * @param mixed $notifiable - * @return array */ - public function via($notifiable) + public function via($notifiable): array { if ($notifiable == null) { @@ -41,9 +40,8 @@ public function via($notifiable) * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; $subject = __('notifications.join_event_subject', [ @@ -129,9 +127,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.join_event_title', [], $notifiable->locale), diff --git a/app/Notifications/JoinGroup.php b/app/Notifications/JoinGroup.php index 79b02bbb20..6a987e9a53 100644 --- a/app/Notifications/JoinGroup.php +++ b/app/Notifications/JoinGroup.php @@ -10,9 +10,8 @@ class JoinGroup extends BaseNotification * Get the notification's delivery channels. * * @param mixed $notifiable - * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -21,9 +20,8 @@ public function via($notifiable) * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; $subject = __('notifications.join_group_title', [ @@ -104,9 +102,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ diff --git a/app/Notifications/NewDiscourseMember.php b/app/Notifications/NewDiscourseMember.php index 696a7e26ce..4b1811d687 100644 --- a/app/Notifications/NewDiscourseMember.php +++ b/app/Notifications/NewDiscourseMember.php @@ -10,9 +10,8 @@ class NewDiscourseMember extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage) ->subject( @@ -37,9 +36,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('groups.talk_group_add_title', [ diff --git a/app/Notifications/NewGroupMember.php b/app/Notifications/NewGroupMember.php index a2d2ec3cbe..da9182fe62 100644 --- a/app/Notifications/NewGroupMember.php +++ b/app/Notifications/NewGroupMember.php @@ -10,9 +10,8 @@ class NewGroupMember extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -41,9 +40,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.new_member_title', [ diff --git a/app/Notifications/NewGroupWithinRadius.php b/app/Notifications/NewGroupWithinRadius.php index 7262b93c4c..668804b935 100644 --- a/app/Notifications/NewGroupWithinRadius.php +++ b/app/Notifications/NewGroupWithinRadius.php @@ -10,9 +10,8 @@ class NewGroupWithinRadius extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -40,9 +39,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.new_group_title', [], $notifiable->language), diff --git a/app/Notifications/NotifyAdminNoDevices.php b/app/Notifications/NotifyAdminNoDevices.php index 98c66978d6..6804484317 100644 --- a/app/Notifications/NotifyAdminNoDevices.php +++ b/app/Notifications/NotifyAdminNoDevices.php @@ -10,9 +10,8 @@ class NotifyAdminNoDevices extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; return (new MailMessage) @@ -35,9 +34,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { $locale = $notifiable->language; return [ diff --git a/app/Notifications/NotifyRestartersOfNewEvent.php b/app/Notifications/NotifyRestartersOfNewEvent.php index f7388e484f..30b5894c62 100644 --- a/app/Notifications/NotifyRestartersOfNewEvent.php +++ b/app/Notifications/NotifyRestartersOfNewEvent.php @@ -10,9 +10,8 @@ class NotifyRestartersOfNewEvent extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -41,9 +40,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.new_event_title', [ diff --git a/app/Notifications/RSVPEvent.php b/app/Notifications/RSVPEvent.php index 198c8b809c..185a8c5f45 100644 --- a/app/Notifications/RSVPEvent.php +++ b/app/Notifications/RSVPEvent.php @@ -10,9 +10,8 @@ class RSVPEvent extends BaseNotification * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -41,9 +40,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ 'title' => __('notifications.rsvp_title', [ diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php index 032e6030ab..3f645b9e76 100644 --- a/app/Notifications/ResetPassword.php +++ b/app/Notifications/ResetPassword.php @@ -10,9 +10,8 @@ class ResetPassword extends BaseNotification * Get the notification's delivery channels. * * @param mixed $notifiable - * @return array */ - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -21,9 +20,8 @@ public function via($notifiable) * Get the mail representation of the notification. * * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $locale = $notifiable->language; @@ -39,9 +37,8 @@ public function toMail($notifiable) * Get the array representation of the notification. * * @param mixed $notifiable - * @return array */ - public function toArray($notifiable) + public function toArray($notifiable): array { return [ diff --git a/app/Observers/EventsUsersObserver.php b/app/Observers/EventsUsersObserver.php index cff09f19b2..39f63e6a4b 100644 --- a/app/Observers/EventsUsersObserver.php +++ b/app/Observers/EventsUsersObserver.php @@ -26,11 +26,8 @@ public function __construct(DiscourseService $discourseService) /** * Listen to the created event. - * - * @param \App\EventsUsers $eu - * @return void */ - public function created(EventsUsers $eu) + public function created(EventsUsers $eu): void { $idevents = $eu->event; $event = \App\Party::find($idevents); @@ -49,11 +46,8 @@ public function created(EventsUsers $eu) /** * Listen to the updated event. - * - * @param \App\EventsUsers $eu - * @return void */ - public function updating(EventsUsers $eu) { + public function updating(EventsUsers $eu): void { $idevents = $eu->event; $event = \App\Party::find($idevents); $iduser = $eu->user; @@ -74,11 +68,8 @@ public function updating(EventsUsers $eu) { /** * Listen to the deleted event. - * - * @param \App\EventsUsers $eu - * @return void */ - public function deleted(EventsUsers $eu) + public function deleted(EventsUsers $eu): void { $idevents = $eu->event; $event = \App\Party::find($idevents); @@ -89,12 +80,7 @@ public function deleted(EventsUsers $eu) $this->removed($event, $user, true, $eu->status == 1); } - /** - * @param Party $event - * @param User $user - * @return void - */ - private function confirmed($event, $user, $count): void + private function confirmed(Party $event, User $user, $count): void { if ($count) { $event->increment('volunteers'); @@ -103,12 +89,7 @@ private function confirmed($event, $user, $count): void event(new UserConfirmedEvent($event->idevents, $user ? $user->id : null)); } - /** - * @param Party $event - * @param User $user - * @return void - */ - private function removed($event, $user, $count): void + private function removed(Party $event, User $user, $count): void { if ($count) { $event->decrement('volunteers'); diff --git a/app/Party.php b/app/Party.php index cfa9c0d035..6abe18f855 100644 --- a/app/Party.php +++ b/app/Party.php @@ -2,6 +2,9 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Events\ApproveEvent; use Auth; @@ -64,7 +67,7 @@ class Party extends Model implements Auditable public function findAllSearchable() { // TODO Can this be replaced by Party::past? - return DB::select(DB::raw('SELECT + return DB::select('SELECT `e`.`idevents` AS `id`, UNIX_TIMESTAMP(`event_start_utc`) AS `event_timestamp`, TIME(CONVERT_TZ(`event_start_utc`, \'GMT\', `e`.`timezone`)) AS `start`, @@ -84,7 +87,7 @@ public function findAllSearchable() INNER JOIN `groups` AS `g` ON `g`.`idgroups` = `e`.`group` WHERE `event_end_utc` < NOW() - ORDER BY `e`.`event_start_utc` DESC')); + ORDER BY `e`.`event_start_utc` DESC'); } public function findThis($id, $devices = false) @@ -119,7 +122,7 @@ public function findThis($id, $devices = false) WHERE `e`.`idevents` = :id ORDER BY `e`.`event_start_utc` DESC'; - $party = DB::select(DB::raw($sql), ['id' => $id]); + $party = DB::select($sql, ['id' => $id]); if ($devices) { $devices = new Device; @@ -131,7 +134,7 @@ public function findThis($id, $devices = false) public function deleteUserList($party) { - return DB::delete(DB::raw('DELETE FROM `events_users` WHERE `event` = :party'), ['party' => $party]); + return DB::delete('DELETE FROM `events_users` WHERE `event` = :party', ['party' => $party]); } public function ofThisGroup($group = 'admin', $only_past = false, $devices = false) @@ -172,13 +175,13 @@ public function findNextParties($group = null) if (! is_null($group)) { try { - return DB::select(DB::raw($sql), ['group' => $group]); + return DB::select($sql, ['group' => $group]); } catch (\Illuminate\Database\QueryException $e) { dd($e); } } else { try { - return DB::select(DB::raw($sql)); + return DB::select($sql); } catch (\Illuminate\Database\QueryException $e) { dd($e); } @@ -334,7 +337,7 @@ public function scopeUpcomingEventsInUserArea($query, $user) $exclude_group_ids = array_merge($exclude_group_ids, Group::where('approved', false)->pluck('idgroups')->toArray()); return $this - ->select(DB::raw('`events`.*, ( 6371 * acos( cos( radians('.$user->latitude.') ) * cos( radians( events.latitude ) ) * cos( radians( events.longitude ) - radians('.$user->longitude.') ) + sin( radians('.$user->latitude.') ) * sin( radians( events.latitude ) ) ) ) AS distance')) + ->select('`events`.*, ( 6371 * acos( cos( radians('.$user->latitude.') ) * cos( radians( events.latitude ) ) * cos( radians( events.longitude ) - radians('.$user->longitude.') ) + sin( radians('.$user->latitude.') ) * sin( radians( events.latitude ) ) ) ) AS distance') ->join('groups', 'groups.idgroups', '=', 'events.group') ->join('group_network', 'groups.idgroups', '=', 'group_network.group_id') ->join('networks', 'networks.id', '=', 'group_network.network_id') @@ -349,17 +352,17 @@ public function scopeUpcomingEventsInUserArea($query, $user) ->orderBy('distance', 'ASC'); } - public function allDevices() + public function allDevices(): HasMany { return $this->hasMany(\App\Device::class, 'event', 'idevents')->join('categories', 'categories.idcategories', '=', 'devices.category'); } - public function allInvited() + public function allInvited(): HasMany { return $this->hasMany(\App\EventsUsers::class, 'event', 'idevents')->where('status', '!=', 1); } - public function allConfirmedVolunteers() + public function allConfirmedVolunteers(): HasMany { return $this->hasMany(EventsUsers::class, 'event', 'idevents') ->where(function ($query) { @@ -369,7 +372,7 @@ public function allConfirmedVolunteers() } // Doesn't work if called 'group' - I guess because a reserved SQL keyword. - public function theGroup() + public function theGroup(): HasOne { return $this->hasOne(\App\Group::class, 'idgroups', 'group'); } @@ -377,10 +380,9 @@ public function theGroup() /** * Return formatted date, in timezone of event. * - * @param string $format * @return false|string */ - public function getFormattedLocalStart($format = 'd/m/Y') + public function getFormattedLocalStart(string $format = 'd/m/Y') { $dt = new Carbon($this->event_start_utc); $dt->setTimezone($this->timezone); @@ -390,10 +392,9 @@ public function getFormattedLocalStart($format = 'd/m/Y') /** * Return formatted date, in timezone of event. * - * @param string $format * @return false|string */ - public function getFormattedLocalEnd($format = 'd/m/Y') + public function getFormattedLocalEnd(string $format = 'd/m/Y') { $dt = new Carbon($this->event_end_utc); $dt->setTimezone($this->timezone); @@ -441,9 +442,8 @@ public function isUpcoming() * If the event is of today, is not in progress and has not finished = true. * @author Christopher Kelker * @date 2019-06-13T15:48:05+010 - * @return bool */ - public function isStartingSoon() + public function isStartingSoon(): bool { $start = new Carbon($this->event_start_utc); @@ -574,7 +574,7 @@ public function getEventStats($eEmissionRatio = null, $uEmissionratio = null, $i return $result; } - public function devices() + public function devices(): HasMany { return $this->hasMany(\App\Device::class, 'event', 'idevents'); } @@ -622,11 +622,7 @@ public function getShareableLinkAttribute() return ''; } - /** - * @param int|null $user_id - * @return bool - */ - public function isVolunteer($user_id = null) + public function isVolunteer(?int $user_id = null): bool { return $this->allConfirmedVolunteers ->contains('user', $user_id ?: auth()->id()); @@ -650,7 +646,7 @@ public function isBeingAttendedBy($userId) * @version 1.0.0 * @return [type] */ - public function owner() + public function owner(): BelongsTo { return $this->belongsTo(User::class, 'user_id', 'id'); } diff --git a/app/Policies/NetworkPolicy.php b/app/Policies/NetworkPolicy.php index 0c7163f316..4aee713fb0 100644 --- a/app/Policies/NetworkPolicy.php +++ b/app/Policies/NetworkPolicy.php @@ -12,12 +12,8 @@ class NetworkPolicy /** * Determine whether the user can view the network. - * - * @param \App\User $user - * @param \App\Network $network - * @return mixed */ - public function view(User $user, Network $network) + public function view(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -32,11 +28,8 @@ public function view(User $user, Network $network) /** * Determine whether the user can create networks. - * - * @param \App\User $user - * @return mixed */ - public function create(User $user) + public function create(User $user): bool { if ($user->hasRole('Administrator')) { return true; @@ -45,12 +38,8 @@ public function create(User $user) /** * Determine whether the user can update the network. - * - * @param \App\User $user - * @param \App\Network $network - * @return mixed */ - public function update(User $user, Network $network) + public function update(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -66,7 +55,6 @@ public function update(User $user, Network $network) /** * Determine whether the user can associate groups to networks. * - * @param \App\User $user * @return mixed */ public function associateGroups(User $user, Network $network) @@ -84,12 +72,8 @@ public function associateGroups(User $user, Network $network) /** * Determine whether the user can delete the network. - * - * @param \App\User $user - * @param \App\Network $network - * @return mixed */ - public function delete(User $user, Network $network) + public function delete(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -98,12 +82,8 @@ public function delete(User $user, Network $network) /** * Determine whether the user can restore the network. - * - * @param \App\User $user - * @param \App\Network $network - * @return mixed */ - public function restore(User $user, Network $network) + public function restore(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; @@ -112,12 +92,8 @@ public function restore(User $user, Network $network) /** * Determine whether the user can permanently delete the network. - * - * @param \App\User $user - * @param \App\Network $network - * @return mixed */ - public function forceDelete(User $user, Network $network) + public function forceDelete(User $user, Network $network): bool { if ($user->hasRole('Administrator')) { return true; diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php index 7994e9732a..46b5fe9d31 100644 --- a/app/Policies/UserPolicy.php +++ b/app/Policies/UserPolicy.php @@ -16,10 +16,9 @@ class UserPolicy * * @param \App\User $user * @param \App\User $user - * @param int $role * @return mixed */ - public function changeRepairDirRole(User $perpetrator, User $victim, $role) + public function changeRepairDirRole(User $perpetrator, User $victim, int $role) { // We have rules for whether you can change the Repair Directory role. Code is structured for readability // of these rules, rather than a single big if. @@ -53,7 +52,6 @@ public function changeRepairDirRole(User $perpetrator, User $victim, $role) /** * Determine whether this user can view the Repair Directory settings for users * - * @param \App\User $user * @return mixed */ public function viewRepairDirectorySettings(User $user) @@ -64,7 +62,6 @@ public function viewRepairDirectorySettings(User $user) /** * Determine whether this user can see the Admin menu. * - * @param \App\User $user * @return mixed */ public function viewAdminMenu(User $user) @@ -79,7 +76,6 @@ public function viewAdminMenu(User $user) /** * Determine whether this user can access the Repair Directory via the menu. * - * @param \App\User $user * @return mixed */ public function accessRepairDirectory(User $user) diff --git a/app/Providers/AgentServiceProvider.php b/app/Providers/AgentServiceProvider.php index 8e34f8c705..3c1dbfb659 100644 --- a/app/Providers/AgentServiceProvider.php +++ b/app/Providers/AgentServiceProvider.php @@ -8,14 +8,14 @@ class AgentServiceProvider extends ServiceProvider { - public function boot() + public function boot(): void { $agent = new Agent(); View::share('agent', $agent); } - public function register() + public function register(): void { // } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2c73288359..4f620ea837 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -17,10 +17,8 @@ class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. - * - * @return void */ - public function boot() + public function boot(): void { // The admin area is unusable without this if (app()->isLocal()) { @@ -44,10 +42,8 @@ public function boot() /** * Register any application services. - * - * @return void */ - public function register() + public function register(): void { $this->app->singleton(Geocoder::class, function () { return new Geocoder(); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index db44fadf7d..d2ecb3c182 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -24,13 +24,9 @@ class AuthServiceProvider extends ServiceProvider /** * Register any authentication / authorization services. - * - * @return void */ - public function boot() + public function boot(): void { - $this->registerPolicies(); - // } } diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 395c518bc4..2be04f5d9d 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -9,10 +9,8 @@ class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. - * - * @return void */ - public function boot() + public function boot(): void { Broadcast::routes(); diff --git a/app/Providers/DiscourseServiceProvider.php b/app/Providers/DiscourseServiceProvider.php index 8bec9af118..69817074a8 100644 --- a/app/Providers/DiscourseServiceProvider.php +++ b/app/Providers/DiscourseServiceProvider.php @@ -22,7 +22,7 @@ class DiscourseServiceProvider extends ServiceProvider private $logger = null; - public function register() + public function register(): void { // We need to register the service whether or not the feature is turned on, so that we can mock it in testing. diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index b510773386..6363171ff5 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -113,10 +113,8 @@ class EventServiceProvider extends ServiceProvider /** * Register any events for your application. - * - * @return void */ - public function boot() + public function boot(): void { if (env('FEATURE__WIKI_INTEGRATION') === true) { @@ -126,10 +124,8 @@ public function boot() /** * Determine if events and listeners should be automatically discovered. - * - * @return bool */ - public function shouldDiscoverEvents() + public function shouldDiscoverEvents(): bool { return false; } diff --git a/app/Providers/MediawikiServiceProvider.php b/app/Providers/MediawikiServiceProvider.php index 697f9de089..a082eb0a19 100644 --- a/app/Providers/MediawikiServiceProvider.php +++ b/app/Providers/MediawikiServiceProvider.php @@ -13,20 +13,16 @@ class MediawikiServiceProvider extends ServiceProvider { /** * Bootstrap services. - * - * @return void */ - public function boot() + public function boot(): void { // } /** * Register services. - * - * @return void */ - public function register() + public function register(): void { if (env('FEATURE__WIKI_INTEGRATION') === false) { return; diff --git a/app/Providers/OurSentryLogging.php b/app/Providers/OurSentryLogging.php index 3ef4ebfad0..90f487913f 100644 --- a/app/Providers/OurSentryLogging.php +++ b/app/Providers/OurSentryLogging.php @@ -10,19 +10,15 @@ class OurSentryLogging extends ServiceProvider { /** * Register services. - * - * @return void */ - public function register() + public function register(): void { } /** * Bootstrap services. - * - * @return void */ - public function boot() + public function boot(): void { Event::listen(MessageLogged::class, function (MessageLogged $e) { if ($e->level == 'error') { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index adb0175cd4..ceb5f81774 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -23,10 +23,8 @@ class RouteServiceProvider extends ServiceProvider * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. - * - * @return void */ - protected function mapWebRoutes() + protected function mapWebRoutes(): void { Route::middleware('web') ->group(base_path('routes/web.php')); @@ -36,10 +34,8 @@ protected function mapWebRoutes() * Define the "api" routes for the application. * * These routes are typically stateless. - * - * @return void */ - protected function mapApiRoutes() + protected function mapApiRoutes(): void { Route::prefix('api') ->middleware('api') @@ -48,28 +44,16 @@ protected function mapApiRoutes() /** * Define your route model bindings, pattern filters, etc. - * - * @return void */ - public function boot() + public function boot(): void { - $this->configureRateLimiting(); + RateLimiter::for('api', function (Request $request) { + return Limit::perMinute(300)->by($request->user()?->id ?: $request->ip()); + }); $this->routes(function () { $this->mapApiRoutes(); $this->mapWebRoutes(); }); } - - /** - * Configure the rate limiters for the application. - * - * @return void - */ - protected function configureRateLimiting() - { - RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(300)->by($request->user()?->id ?: $request->ip()); - }); - } } diff --git a/app/Providers/ScheduleServiceProvider.php b/app/Providers/ScheduleServiceProvider.php index 6055e0d057..963b380fbb 100644 --- a/app/Providers/ScheduleServiceProvider.php +++ b/app/Providers/ScheduleServiceProvider.php @@ -7,7 +7,7 @@ class ScheduleServiceProvider extends ServiceProvider { - public function boot() + public function boot(): void { $this->app->booted(function () { $schedule = $this->app->make(Schedule::class); @@ -16,7 +16,7 @@ public function boot() }); } - public function register() + public function register(): void { } } diff --git a/app/Providers/WordpressServiceProvider.php b/app/Providers/WordpressServiceProvider.php index fc864276cb..6815bd00c5 100644 --- a/app/Providers/WordpressServiceProvider.php +++ b/app/Providers/WordpressServiceProvider.php @@ -10,20 +10,16 @@ class WordpressServiceProvider extends ServiceProvider { /** * Bootstrap services. - * - * @return void */ - public function boot() + public function boot(): void { // } /** * Register services. - * - * @return void */ - public function register() + public function register(): void { $this->app->singleton(WordpressClient::class, function () { try { diff --git a/app/Role.php b/app/Role.php index 6ee341cad8..ee082d6eeb 100644 --- a/app/Role.php +++ b/app/Role.php @@ -53,7 +53,7 @@ class Role extends Model * */ public function findAll() { - return DB::select(DB::raw('SELECT + return DB::select('SELECT `r`.`idroles` AS `id`, `r`.`role` AS `role`, GROUP_CONCAT(`p`.`permission` ORDER BY `p`.`permission` ASC SEPARATOR ", " ) as `permissions_list` @@ -61,22 +61,22 @@ public function findAll() LEFT JOIN `roles_permissions` AS `rp` ON `r`.`idroles` = `rp`.`role` LEFT JOIN `permissions` AS `p` ON `rp`.`permission` = `p`.`idpermissions` GROUP BY `r`.`idroles` - ORDER BY `r`.`idroles` ASC')); + ORDER BY `r`.`idroles` ASC'); } public function permissions() { //Tested! - return DB::select(DB::raw('SELECT * FROM `permissions` ORDER BY `idpermissions` ASC')); + return DB::select('SELECT * FROM `permissions` ORDER BY `idpermissions` ASC'); } public function rolePermissions($role) { //Tested! - return DB::select(DB::raw('SELECT * FROM `permissions` + return DB::select('SELECT * FROM `permissions` INNER JOIN `roles_permissions` ON `roles_permissions`.`permission` = `permissions`.`idpermissions` WHERE `roles_permissions`.`role` = :role - ORDER BY `idpermissions` ASC'), ['role' => $role]); + ORDER BY `idpermissions` ASC', ['role' => $role]); } public function edit($id, $data) @@ -84,14 +84,14 @@ public function edit($id, $data) //Tested! // delete permissions before updating references - DB::delete(DB::raw('DELETE FROM roles_permissions WHERE role = :role'), ['role' => $id]); + DB::delete('DELETE FROM roles_permissions WHERE role = :role', ['role' => $id]); // insert data here $sql = 'INSERT INTO roles_permissions(role, permission) VALUES (:role, :permission)'; foreach ($data as &$p) { try { - DB::insert(DB::raw($sql), ['role' => $id, 'permission' => $p]); + DB::insert($sql, ['role' => $id, 'permission' => $p]); } catch (\Illuminate\Database\QueryException $e) { return false; } diff --git a/app/Rules/Timezone.php b/app/Rules/Timezone.php index 0d0569ecd2..d18e2a9a9e 100644 --- a/app/Rules/Timezone.php +++ b/app/Rules/Timezone.php @@ -2,39 +2,17 @@ namespace App\Rules; -use Illuminate\Contracts\Validation\Rule; +use Illuminate\Contracts\Validation\ValidationRule; -class Timezone implements Rule +class Timezone implements ValidationRule { /** - * Create a new rule instance. - * - * @return void + * Run the validation rule. */ - public function __construct() + public function validate(string $_attribute, mixed $value, \Closure $fail): void { - // - } - - /** - * Determine if the validation rule passes. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function passes($attribute, $value) - { - return in_array($value, \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC)); - } - - /** - * Get the validation error message. - * - * @return string - */ - public function message() - { - return __('partials.validate_timezone'); + if (!in_array($value, \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC))) { + $fail(__('partials.validate_timezone')); + } } } diff --git a/app/Services/CheckAuthService.php b/app/Services/CheckAuthService.php index 395341ad8b..37016af5f1 100644 --- a/app/Services/CheckAuthService.php +++ b/app/Services/CheckAuthService.php @@ -2,6 +2,7 @@ namespace App\Services; +use Illuminate\Http\Request; use App\Helpers\Fixometer; use App\User; use Cookie; @@ -85,11 +86,8 @@ private function handle($email) /** * Transform the resource into an array. - * - * @param \Illuminate\Http\Request $request - * @return array */ - public function toArray($request) + public function toArray(Request $request): array { return [ 'authenticated' => $this->authenticated, diff --git a/app/Session.php b/app/Session.php index 98fcb1b4d5..d6cce30683 100644 --- a/app/Session.php +++ b/app/Session.php @@ -33,7 +33,7 @@ public static function createSession($user) try { DB::insert( - DB::raw('INSERT INTO `sessions`(`session`, `user`, created_at) VALUES (:session, :user, :tm)'), + 'INSERT INTO `sessions`(`session`, `user`, created_at VALUES (:session, :user, :tm)', ['session' => $session, 'user' => $user, 'tm' => $created_at] ); } catch (\Illuminate\Database\QueryException $e) { @@ -48,7 +48,7 @@ public function setSession($user, $sessionToken) $sql = 'UPDATE `sessions` SET `session` = :session WHERE `user` = :user'; try { - DB::update(DB::raw($sql), ['session' => $sessionToken, 'user' => $user]); + DB::update($sql, ['session' => $sessionToken, 'user' => $user]); unset($_SESSION[env('APP_NAME')]); $_SESSION[env('APP_NAME')][env('APP_KEY')] = $sessionToken; //was $_SESSION[APPNAME][SESSIONKEY] will need a config file for SESSIONKEY @@ -79,7 +79,7 @@ protected function getSession() WHERE sessions.session = :session'; try { - $objectUser = DB::select(DB::raw($sql), ['session' => $session]); + $objectUser = DB::select($sql, ['session' => $session]); if (is_object($objectUser)) { $User = new User; diff --git a/app/User.php b/app/User.php index 24e3096bc8..c2fb3bffd2 100644 --- a/app/User.php +++ b/app/User.php @@ -2,6 +2,9 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Events\UserDeleted; use App\Events\UserUpdated; @@ -70,7 +73,7 @@ class User extends Authenticatable implements Auditable, HasLocalePreference 'deleted' => UserDeleted::class, ]; - public function role() + public function role(): HasOne { return $this->hasOne(\App\Role::class, 'idroles', 'role'); } @@ -81,19 +84,19 @@ public function repairdir_role() return $this->repairdir_role ? $this->repairdir_role : Role::REPAIR_DIRECTORY_NONE; } - public function userSkills() + public function userSkills(): HasMany { return $this->hasMany(\App\UsersSkills::class, 'user', 'id'); } - public function skills() + public function skills(): BelongsToMany { return $this->belongsToMany(\App\Skills::class, 'users_skills', 'user', 'skill'); } // This is an incorrect relationship, but leaving it here for now as it is used in a strange way in two legacy places and apparently working in those instances somehow. // Use skills() for correct belongsToMany relationship. - public function skillsold() + public function skillsold(): BelongsToMany { return $this->belongsToMany(\App\UsersSkills::class, 'users_skills', 'user', 'skill'); } @@ -110,7 +113,7 @@ public function assignSkill($skill) } } - public function groups() + public function groups(): BelongsToMany { return $this->belongsToMany(\App\Group::class, 'users_groups', 'user', 'group'); } @@ -121,14 +124,14 @@ public function groups() * @param int $numberOfGroups How many groups to return * @param string String of minimum creation date */ - public function groupsNearby($numberOfGroups = 10, $createdSince = null, $nearby = self::NEARBY_KM) + public function groupsNearby(int $numberOfGroups = 10, $createdSince = null, $nearby = self::NEARBY_KM) { if (is_null($this->latitude) || is_null($this->longitude)) { return []; } $groupsNearbyQuery = Group::select( - DB::raw('*, ( 6371 * acos( cos( radians('.$this->latitude.') ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians('.$this->longitude.') ) + sin( radians('.$this->latitude.') ) * sin( radians( latitude ) ) ) ) AS dist') + '*, ( 6371 * acos( cos( radians('.$this->latitude.' ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians('.$this->longitude.') ) + sin( radians('.$this->latitude.') ) * sin( radians( latitude ) ) ) ) AS dist' )->where(function ($q) { $q->whereNull('archived_at'); @@ -165,12 +168,12 @@ public function groupsNearby($numberOfGroups = 10, $createdSince = null, $nearby return $groupsNearby; } - public function preferences() + public function preferences(): BelongsToMany { return $this->belongsToMany(self::class, 'users_preferences', 'user_id', 'preference_id'); } - public function permissions() + public function permissions(): BelongsToMany { return $this->belongsToMany(self::class, 'users_permissions', 'user_id', 'permission_id'); } @@ -187,18 +190,18 @@ public function addPreference($slug) public function getRolePermissions($role) { - return DB::select(DB::raw('SELECT p.idpermissions, p.permission, r.idroles, r.role FROM permissions AS p + return DB::select('SELECT p.idpermissions, p.permission, r.idroles, r.role FROM permissions AS p INNER JOIN roles_permissions AS rp ON rp.permission = p.idpermissions INNER JOIN roles AS r ON rp.role= r.idroles - WHERE r.role = :role'), ['role' => $role]); + WHERE r.role = :role', ['role' => $role]); } public function getUserGroups($user) { - return DB::select(DB::raw('SELECT * FROM `'.$this->table.'` AS `u` + return DB::select('SELECT * FROM `'.$this->table.'` AS `u` INNER JOIN `users_groups` AS `ug` ON `ug`.`user` = `u`.`id` INNER JOIN `groups` AS `g` ON `ug`.`group` = `g`.`idgroups` - WHERE `u`.`id` = :id'), ['id' => $user]); + WHERE `u`.`id` = :id', ['id' => $user]); } // Setters @@ -238,7 +241,7 @@ public static function getProfile($id) // $sql .= implode(' AND ', $clauses); // // try { - // return DB::select(DB::raw($sql), $params); + // return DB::select($sql, $params); // } catch (\Illuminate\Database\QueryException $e) { // return false; // } @@ -249,9 +252,9 @@ public function getUserList($eloquent = false) //Tested! if (! $eloquent) { - $Users = DB::select(DB::raw('SELECT users.id AS id, users.name, users.email, roles.role FROM users + $Users = DB::select('SELECT users.id AS id, users.name, users.email, roles.role FROM users INNER JOIN roles ON roles.idroles = users.role WHERE users.deleted_at IS NULL - ORDER BY users.id ASC')); //INNER JOIN sessions ON sessions.user = users.id, UNIX_TIMESTAMP(sessions.modified_at) AS modified_at + ORDER BY users.id ASC'); //INNER JOIN sessions ON sessions.user = users.id, UNIX_TIMESTAMP(sessions.modified_at) AS modified_at if (is_array($Users)) { $User = new self; @@ -269,7 +272,7 @@ public function getUserList($eloquent = false) public function partyEligible() { //Tested! - return DB::select(DB::raw('SELECT + return DB::select('SELECT users.id AS id, users.name, users.email, @@ -277,12 +280,12 @@ public function partyEligible() FROM '.$this->table.' INNER JOIN roles ON roles.idroles = users.role WHERE users.role > 1 - ORDER BY users.name ASC')); + ORDER BY users.name ASC'); } public function inGroup($group) { - return DB::select(DB::raw('SELECT + return DB::select('SELECT users.id AS id, users.name, users.email, @@ -292,7 +295,7 @@ public function inGroup($group) WHERE users.role > 1 AND users.id IN (SELECT `user` FROM users_groups WHERE `group` = :group) - ORDER BY users.name ASC'), ['group' => $group]); + ORDER BY users.name ASC', ['group' => $group]); } public function isInGroup($groupId) @@ -309,14 +312,14 @@ public function checkEmail($email) { //Tested! - $r = DB::select(DB::raw('SELECT COUNT(id) AS emails FROM '.$this->table.' WHERE email = :email'), ['email' => $email]); + $r = DB::select('SELECT COUNT(id) AS emails FROM '.$this->table.' WHERE email = :email', ['email' => $email]); return ($r[0]->emails > 0) ? false : true; } public function scopeNearbyRestarters($query, $latitude, $longitude, $radius = 20) { - return $query->select(DB::raw('*, ( 6371 * acos( cos( radians('.$latitude.') ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians('.$longitude.') ) + sin( radians('.$latitude.') ) * sin( radians( latitude ) ) ) ) AS distance')) + return $query->select('*, ( 6371 * acos( cos( radians('.$latitude.' ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians('.$longitude.') ) + sin( radians('.$latitude.') ) * sin( radians( latitude ) ) ) ) AS distance') ->whereNotNull('location') ->whereNotNull('latitude') ->whereNotNull('longitude') @@ -349,7 +352,7 @@ public function hasUserGivenConsent() /** * @return Date when the user last logged in */ - public function lastLogin() + public function lastLogin(): Date { return new \Carbon\Carbon($this->last_login_at); } @@ -402,7 +405,7 @@ public function convertToHost() } } - public function groupTag() + public function groupTag(): HasOne { return $this->hasOne(GroupTags::class, 'id', 'access_group_tag_id'); } @@ -512,7 +515,7 @@ public function isCoordinatorOf($network) return $this->networks->contains($network); } - public function networks() + public function networks(): BelongsToMany { return $this->belongsToMany(Network::class, 'user_network', 'user_id', 'network_id'); } @@ -566,10 +569,8 @@ public function ensureAPIToken() /** * Get the user's preferred locale. This is automatically used by email notifications. - * - * @return string */ - public function preferredLocale() + public function preferredLocale(): string { // TODO Use of preferredLocale should mean we don't have to explicitly pass the locale. But that isn't // working. So at the moment we are passing a locale explicitly in the translations in the notifications diff --git a/app/UserGroups.php b/app/UserGroups.php index 6d3f8b6bae..4e5b3c3828 100644 --- a/app/UserGroups.php +++ b/app/UserGroups.php @@ -2,6 +2,8 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use DB; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; @@ -51,7 +53,7 @@ public function createUsersGroups($iduser, $groups) foreach ($groups as &$group) { try { - DB::insert(DB::raw($sql), ['user' => $iduser, 'group' => $group]); + DB::insert($sql, ['user' => $iduser, 'group' => $group]); } catch (\Illuminate\Database\QueryException $e) { if (env('APP_ENV') == 'local' || env('APP_ENV') == 'development') { dd($e); @@ -76,7 +78,7 @@ public function deleteUsersGroups($iduser) { $sql = 'DELETE FROM `users_groups` WHERE `user` = :id'; try { - DB::delete(DB::raw($sql), ['id' => $iduser]); + DB::delete($sql, ['id' => $iduser]); return true; } catch (\Illuminate\Database\QueryException $e) { @@ -89,7 +91,7 @@ public function deleteUsersGroups($iduser) } //Table Relations - public function volunteer() + public function volunteer(): HasOne { return $this->hasOne(\App\User::class, 'id', 'user'); } @@ -113,11 +115,11 @@ public function getFullName() return 'N/A'; } - public function user() { + public function user(): BelongsTo { return $this->belongsTo(\App\User::class, 'user', 'id'); } - public function group() { + public function group(): BelongsTo { return $this->belongsTo(\App\Groups::class, 'group', 'idgroups'); } } diff --git a/app/UsersSkills.php b/app/UsersSkills.php index 82079a7c60..603540bb2f 100644 --- a/app/UsersSkills.php +++ b/app/UsersSkills.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use DB; use Illuminate\Database\Eloquent\Model; @@ -25,7 +26,7 @@ class UsersSkills extends Model public $timestamps = false; //Table Relations - public function skillName() + public function skillName(): HasOne { return $this->hasOne(\App\Skills::class, 'id', 'skill'); } diff --git a/app/Xref.php b/app/Xref.php index 2145acb475..068b202213 100644 --- a/app/Xref.php +++ b/app/Xref.php @@ -2,6 +2,7 @@ namespace App; +use Illuminate\Database\Eloquent\Relations\HasOne; use DB; use Illuminate\Database\Eloquent\Model; @@ -35,7 +36,7 @@ public function createXref($clear = true) $sql = 'INSERT INTO `'.$this->table.'`(`object`, `object_type`, `reference`, `reference_type`) VALUES (:obj, :objType, :ref, :refType)'; try { - return DB::insert(DB::raw($sql), ['obj' => $this->obj, 'objType' => $this->objType, 'ref' => $this->ref, 'refType' => $this->refType]); + return DB::insert($sql, ['obj' => $this->obj, 'objType' => $this->objType, 'ref' => $this->ref, 'refType' => $this->refType]); } catch (\Illuminate\Database\QueryException $e) { return false; } @@ -50,7 +51,7 @@ public function deleteXref() $sql = 'DELETE FROM `'.$this->table.'` WHERE `reference` = :id AND `reference_type` = :type AND `object_type` = :objectType'; try { - return DB::delete(DB::raw($sql), ['id' => $this->ref, 'type' => $this->refType, 'objectType' => $this->objType]); + return DB::delete($sql, ['id' => $this->ref, 'type' => $this->refType, 'objectType' => $this->objType]); } catch (\Illuminate\Database\QueryException $e) { return false; } @@ -64,13 +65,13 @@ public function deleteObjectXref() $sql = 'DELETE FROM `'.$this->table.'` WHERE `object` = :id AND `object_type` = :type'; try { - return DB::delete(DB::raw($sql), ['id' => $this->obj, 'type' => $this->objType]); + return DB::delete($sql, ['id' => $this->obj, 'type' => $this->objType]); } catch (\Illuminate\Database\QueryException $e) { return false; } } - public function image() + public function image(): HasOne { return $this->hasOne(\App\Images::class, 'idimages', 'object'); } diff --git a/composer.json b/composer.json index 5167f983bd..9dc6b82b1a 100644 --- a/composer.json +++ b/composer.json @@ -8,15 +8,15 @@ "license": "MIT", "type": "project", "require": { - "php": "^8.0", - "addwiki/mediawiki-api": "~0.7.0", + "php": "^8.1", + "addwiki/mediawiki-api": "^2.8", "addwiki/mediawiki-api-base": "~2.0", "barryvdh/laravel-translation-manager": "^0.6.2", "bkwld/croppa": "^6.0.1", "caseyamcl/guzzle_retry_middleware": "^2.6", "cweagans/composer-patches": "^1.7", - "darkaonline/l5-swagger": "^8.0", - "doctrine/dbal": "^2.13", + "darkaonline/l5-swagger": "^8.3", + "doctrine/dbal": "^3.5", "egulias/email-validator": "^3.0.0", "filp/whoops": "^2.14", "geocoder-php/mapbox-provider": "^1.4", @@ -24,41 +24,41 @@ "hieu-le/wordpress-xmlrpc-client": "~2.0", "intervention/image": "^2.7", "jenssegers/agent": "^2.6", - "laravel/framework": "^9.42", - "laravel/tinker": "^2.7", - "laravel/ui": "^3.3", - "laravelcollective/html": "^6.3", + "laravel/framework": "^10.48", + "laravel/tinker": "^2.8", + "laravel/ui": "^4.2", + "laravelcollective/html": "^6.4", "league/csv": "^9.7", "league/flysystem-aws-s3-v3": "^3.0", - "mariuzzo/laravel-js-localization": "^1.9", + "mariuzzo/laravel-js-localization": "^1.10", "mcamara/laravel-localization": "^1.7", - "msurguy/honeypot": "^1.1", - "owen-it/laravel-auditing": "^12.1", - "rennokki/laravel-eloquent-query-cache": "^3.3", - "sentry/sentry-laravel": "^2.11", + "msurguy/honeypot": "^1.2", + "owen-it/laravel-auditing": "^13.1", + "rennokki/laravel-eloquent-query-cache": "^3.4", + "sentry/sentry-laravel": "^3.2", "soundasleep/html2text": "^1.1", "spatie/calendar-links": "^1.6", "spatie/laravel-validation-rules": "^3.4", - "spinen/laravel-discourse-sso": "^2.6", + "spinen/laravel-discourse-sso": "^2.8", "symfony/http-client": "^6.2", - "symfony/http-foundation": "^6.0", + "symfony/http-foundation": "^6.2", "symfony/mailgun-mailer": "^6.2", "toin0u/geocoder-laravel": "^4.6", "twbs/bootstrap": "4.1.0", "wouternl/laravel-drip": "^1.2.4" }, "require-dev": { - "barryvdh/laravel-debugbar": "^3.6", + "barryvdh/laravel-debugbar": "^3.8", "fakerphp/faker": "^1.20.0", - "laravel/dusk": "^6.21", + "laravel/dusk": "^7.4", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^6.3", "osteel/openapi-httpfoundation-testing": "^0.8.0", - "php-coveralls/php-coveralls": "^2.4", + "php-coveralls/php-coveralls": "^2.5", "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ignition": "^1.4", + "spatie/laravel-ignition": "^2.0", "squizlabs/php_codesniffer": "^3.6", - "symfony/dom-crawler": "^6.0" + "symfony/dom-crawler": "^6.2" }, "autoload": { "files": [ @@ -105,6 +105,6 @@ "cweagans/composer-patches": true } }, - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true } diff --git a/config/app.php b/config/app.php index b5d3ef9103..42e770538b 100644 --- a/config/app.php +++ b/config/app.php @@ -1,5 +1,6 @@ [ - - /* - * Laravel Framework Service Providers... - */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - Illuminate\Translation\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, - + 'providers' => ServiceProvider::defaultProviders()->merge([ /* * Package Service Providers... */ @@ -194,7 +168,7 @@ App\Providers\ScheduleServiceProvider::class, Sentry\Laravel\ServiceProvider::class, App\Providers\OurSentryLogging::class, - ], + ])->toArray(), /* |-------------------------------------------------------------------------- diff --git a/config/auth.php b/config/auth.php index 2231b26732..0628b65087 100644 --- a/config/auth.php +++ b/config/auth.php @@ -86,16 +86,20 @@ | than one user table or model in the application and you want to have | separate password reset settings based on the specific user types. | - | The expire time is the number of minutes that each reset token will be + | The expiry time is the number of minutes that each reset token will be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | + | The throttle setting is the number of seconds a user must wait before + | generating more password reset tokens. This prevents the user from + | quickly generating a very large amount of password reset tokens. + | */ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', + 'table' => 'password_reset_tokens', 'expire' => 60, 'throttle' => 60, ], diff --git a/config/broadcasting.php b/config/broadcasting.php index 1688242447..2410485384 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -36,7 +36,8 @@ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 'port' => env('PUSHER_PORT', 443), 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, diff --git a/config/cache.php b/config/cache.php index 33bb29546e..d4171e2212 100644 --- a/config/cache.php +++ b/config/cache.php @@ -52,6 +52,7 @@ 'file' => [ 'driver' => 'file', 'path' => storage_path('framework/cache/data'), + 'lock_path' => storage_path('framework/cache/data'), ], 'memcached' => [ diff --git a/config/database.php b/config/database.php index a09ab0f1cf..edbf228861 100644 --- a/config/database.php +++ b/config/database.php @@ -56,8 +56,6 @@ 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, - // We need strict = 'false' because we have some complex queries which fall foul of Laravel's requirements - // for use of GROUP BY. Note that Laravel Shift will try to set this back TRUE, but don't let it. 'strict' => false, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ @@ -111,6 +109,8 @@ 'charset' => 'utf8', 'prefix' => '', 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), ], ], @@ -151,7 +151,8 @@ 'default' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], @@ -159,7 +160,8 @@ 'cache' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], diff --git a/config/hashing.php b/config/hashing.php index bcd3be4c28..0e8a0bb3ff 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -29,7 +29,8 @@ */ 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), + 'rounds' => env('BCRYPT_ROUNDS', 12), + 'verify' => true, ], /* @@ -47,6 +48,7 @@ 'memory' => 65536, 'threads' => 1, 'time' => 4, + 'verify' => true, ], ]; diff --git a/config/logging.php b/config/logging.php index 51f308d943..5a5b2ad53f 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,5 +1,6 @@ 'single', 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, ], 'daily' => [ @@ -68,6 +70,7 @@ 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), 'days' => 14, + 'replace_placeholders' => true, ], 'discourse' => [ @@ -83,6 +86,7 @@ 'username' => 'Laravel Log', 'emoji' => ':boom:', 'level' => env('LOG_LEVEL', 'critical'), + 'replace_placeholders' => true, ], 'papertrail' => [ @@ -94,6 +98,7 @@ 'port' => env('PAPERTRAIL_PORT'), 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), ], + 'processors' => [PsrLogMessageProcessor::class], ], 'stderr' => [ @@ -104,16 +109,20 @@ 'with' => [ 'stream' => 'php://stderr', ], + 'processors' => [PsrLogMessageProcessor::class], ], 'syslog' => [ 'driver' => 'syslog', 'level' => env('LOG_LEVEL', 'debug'), + 'facility' => LOG_USER, + 'replace_placeholders' => true, ], 'errorlog' => [ 'driver' => 'errorlog', 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, ], 'null' => [ diff --git a/config/mail.php b/config/mail.php index 534395a369..e894b2e5f8 100644 --- a/config/mail.php +++ b/config/mail.php @@ -28,14 +28,15 @@ | sending an e-mail. You will specify which one you are using for your | mailers below. You are free to add additional mailers as required. | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array", "failover" + | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", + | "postmark", "log", "array", "failover", "roundrobin" | */ 'mailers' => [ 'smtp' => [ 'transport' => 'smtp', + 'url' => env('MAIL_URL'), 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'port' => env('MAIL_PORT', 587), 'encryption' => env('MAIL_ENCRYPTION', 'tls'), @@ -49,12 +50,19 @@ 'transport' => 'ses', ], - 'mailgun' => [ - 'transport' => 'mailgun', - ], - 'postmark' => [ 'transport' => 'postmark', + // 'message_stream_id' => null, + // 'client' => [ + // 'timeout' => 5, + // ], + ], + + 'mailgun' => [ + 'transport' => 'mailgun', + // 'client' => [ + // 'timeout' => 5, + // ], ], 'sendmail' => [ @@ -78,6 +86,14 @@ 'log', ], ], + + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + ], ], /* diff --git a/config/session.php b/config/session.php index fa3a0d33d4..1e490f78f7 100644 --- a/config/session.php +++ b/config/session.php @@ -198,4 +198,17 @@ 'same_site' => 'lax', + /* + |-------------------------------------------------------------------------- + | Partitioned Cookies + |-------------------------------------------------------------------------- + | + | Setting this value to true will tie the cookie to the top-level site for + | a cross-site context. Partitioned cookies are accepted by the browser + | when flagged "secure" and the Same-Site attribute is set to "none". + | + */ + + 'partitioned' => false, + ]; diff --git a/database/factories/CategoryFactory.php b/database/factories/CategoryFactory.php index c8721c30c1..c2bf03c893 100644 --- a/database/factories/CategoryFactory.php +++ b/database/factories/CategoryFactory.php @@ -8,10 +8,8 @@ class CategoryFactory extends Factory { /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return []; } diff --git a/database/factories/DeviceFactory.php b/database/factories/DeviceFactory.php index bedcf4823d..74a73a06ca 100644 --- a/database/factories/DeviceFactory.php +++ b/database/factories/DeviceFactory.php @@ -10,10 +10,8 @@ class DeviceFactory extends Factory { /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return [ 'event' => Party::factory()->create()->idevents, diff --git a/database/factories/FaultcatFactory.php b/database/factories/FaultcatFactory.php index 374f4ea436..766ab1af67 100644 --- a/database/factories/FaultcatFactory.php +++ b/database/factories/FaultcatFactory.php @@ -8,10 +8,8 @@ class FaultcatFactory extends Factory { /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return []; } diff --git a/database/factories/GroupFactory.php b/database/factories/GroupFactory.php index 0160f7e5f5..43cde6417b 100644 --- a/database/factories/GroupFactory.php +++ b/database/factories/GroupFactory.php @@ -8,10 +8,8 @@ class GroupFactory extends Factory { /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return [ 'name' => $this->faker->unique()->company(), diff --git a/database/factories/GroupTagsFactory.php b/database/factories/GroupTagsFactory.php index 54eee54ab5..c5792bf450 100644 --- a/database/factories/GroupTagsFactory.php +++ b/database/factories/GroupTagsFactory.php @@ -8,10 +8,8 @@ class GroupTagsFactory extends Factory { /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return [ 'tag_name' => $this->faker->word(), diff --git a/database/factories/MisccatFactory.php b/database/factories/MisccatFactory.php index 948d6b594d..0e08072698 100644 --- a/database/factories/MisccatFactory.php +++ b/database/factories/MisccatFactory.php @@ -8,10 +8,8 @@ class MisccatFactory extends Factory { /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return []; } diff --git a/database/factories/NetworkFactory.php b/database/factories/NetworkFactory.php index f4a7cf277b..5cf42b58fa 100644 --- a/database/factories/NetworkFactory.php +++ b/database/factories/NetworkFactory.php @@ -8,10 +8,8 @@ class NetworkFactory extends Factory { /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return [ 'name' => $this->faker->unique()->company(), diff --git a/database/factories/PartyFactory.php b/database/factories/PartyFactory.php index 9adcbcccb0..ab2fddaec1 100644 --- a/database/factories/PartyFactory.php +++ b/database/factories/PartyFactory.php @@ -10,10 +10,8 @@ class PartyFactory extends Factory { /** * Configure the model factory. - * - * @return $this */ - public function configure() + public function configure(): static { return $this->afterMaking(function ($model) { @@ -50,10 +48,8 @@ public function configure() /** * Define the model's default state. - * - * @return array */ - public function definition() + public function definition(): array { return [ // Need to force the location otherwise the random one may not be geocodable and therefore the event may not diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index c151ae195e..d523e3eaba 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -2,6 +2,7 @@ namespace Database\Factories; +use Illuminate\Support\Facades\Hash; use Illuminate\Database\Eloquent\Factories\Factory; use App\Role; use App\User; @@ -25,13 +26,15 @@ class UserFactory extends Factory * * @return array */ - public function definition() + protected static ?string $password; + + public function definition(): array { return [ 'name' => $this->faker->name(), 'email' => $this->faker->unique()->safeEmail(), 'username' => $this->faker->userName(), - 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret + 'password' => static::$password ??= Hash::make('secret'), 'remember_token' => Str::random(10), 'consent_past_data' => new \DateTime(), 'consent_future_data' => new \DateTime(), diff --git a/database/migrations/2014_04_02_193005_create_translations_table.php b/database/migrations/2014_04_02_193005_create_translations_table.php index 034d183ca1..747850fe33 100644 --- a/database/migrations/2014_04_02_193005_create_translations_table.php +++ b/database/migrations/2014_04_02_193005_create_translations_table.php @@ -7,10 +7,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('ltm_translations', function (Blueprint $table) { $table->increments('id'); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::drop('ltm_translations'); } diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index fcacb80b3e..4f42fe6909 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->index(); @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('password_resets'); } diff --git a/database/migrations/2018_04_19_102108_initialise_fixometer_db.php b/database/migrations/2018_04_19_102108_initialise_fixometer_db.php index e756425551..dbe77bfd06 100644 --- a/database/migrations/2018_04_19_102108_initialise_fixometer_db.php +++ b/database/migrations/2018_04_19_102108_initialise_fixometer_db.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { //Settings @@ -537,10 +535,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135338_password_recovery.php b/database/migrations/2018_04_19_135338_password_recovery.php index c60fa80e62..3cd5e702c7 100644 --- a/database/migrations/2018_04_19_135338_password_recovery.php +++ b/database/migrations/2018_04_19_135338_password_recovery.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `users` ADD COLUMN `recovery` VARCHAR(45) NULL AFTER `role`, @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135433_device_list_view.php b/database/migrations/2018_04_19_135433_device_list_view.php index 9c94da9125..594a4128c6 100644 --- a/database/migrations/2018_04_19_135433_device_list_view.php +++ b/database/migrations/2018_04_19_135433_device_list_view.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // DB::statement('CREATE OR REPLACE VIEW `view_devices_list` AS // SELECT @@ -41,10 +39,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135527_device_age.php b/database/migrations/2018_04_19_135527_device_age.php index 3192a7abf7..095311e7cb 100644 --- a/database/migrations/2018_04_19_135527_device_age.php +++ b/database/migrations/2018_04_19_135527_device_age.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `devices` ADD COLUMN `age` VARCHAR(255) NULL COMMENT "// kept as free text to capture data type after research" AFTER `model`;' @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135647_event_venue.php b/database/migrations/2018_04_19_135647_event_venue.php index 06e39fbe54..f11fa8d726 100644 --- a/database/migrations/2018_04_19_135647_event_venue.php +++ b/database/migrations/2018_04_19_135647_event_venue.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `events` ADD COLUMN `venue` VARCHAR(255) NULL AFTER `end`;' @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135728_lang_pref.php b/database/migrations/2018_04_19_135728_lang_pref.php index 0eb570a73b..47fe08c1c8 100644 --- a/database/migrations/2018_04_19_135728_lang_pref.php +++ b/database/migrations/2018_04_19_135728_lang_pref.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `users` ADD COLUMN `language` VARCHAR(2) NOT NULL DEFAULT "en" AFTER `recovery_expires`;' @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_135801_website.php b/database/migrations/2018_04_19_135801_website.php index 39419fa152..532c5d39f2 100644 --- a/database/migrations/2018_04_19_135801_website.php +++ b/database/migrations/2018_04_19_135801_website.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `groups` ADD COLUMN `website` TEXT NULL DEFAULT NULL AFTER `free_text`;' @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2018_04_19_145002_users_auth.php b/database/migrations/2018_04_19_145002_users_auth.php index 0007ed0144..cf05393f60 100644 --- a/database/migrations/2018_04_19_145002_users_auth.php +++ b/database/migrations/2018_04_19_145002_users_auth.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->rememberToken(); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('remember_token'); diff --git a/database/migrations/2018_04_20_100516_users_location_age_gender.php b/database/migrations/2018_04_20_100516_users_location_age_gender.php index fca09e3952..ebe9050e2d 100644 --- a/database/migrations/2018_04_20_100516_users_location_age_gender.php +++ b/database/migrations/2018_04_20_100516_users_location_age_gender.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('location')->nullable(); @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('location'); diff --git a/database/migrations/2018_05_10_085751_rename_modified_at.php b/database/migrations/2018_05_10_085751_rename_modified_at.php index b7ba918de3..24a11a3cf1 100644 --- a/database/migrations/2018_05_10_085751_rename_modified_at.php +++ b/database/migrations/2018_05_10_085751_rename_modified_at.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->renameColumn('modified_at', 'updated_at'); @@ -29,10 +27,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->renameColumn('updated_at', 'modified_at'); diff --git a/database/migrations/2018_05_16_121333_rename_modified_at_images.php b/database/migrations/2018_05_16_121333_rename_modified_at_images.php index ffd9fad789..984d8348d6 100644 --- a/database/migrations/2018_05_16_121333_rename_modified_at_images.php +++ b/database/migrations/2018_05_16_121333_rename_modified_at_images.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('images', function (Blueprint $table) { $table->renameColumn('modified_at', 'updated_at'); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('images', function (Blueprint $table) { $table->renameColumn('updated_at', 'modified_at'); diff --git a/database/migrations/2018_06_01_142316_Create_Group_Tags.php b/database/migrations/2018_06_01_142316_Create_Group_Tags.php index 9a4e9f8b36..1c3130f60f 100644 --- a/database/migrations/2018_06_01_142316_Create_Group_Tags.php +++ b/database/migrations/2018_06_01_142316_Create_Group_Tags.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('group_tags', function (Blueprint $table) { $table->increments('id'); @@ -26,10 +24,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('group_tags'); Schema::table('groups', function (Blueprint $table) { diff --git a/database/migrations/2018_06_01_145539_Create_Brands.php b/database/migrations/2018_06_01_145539_Create_Brands.php index 711b4c9680..7d0a47e240 100644 --- a/database/migrations/2018_06_01_145539_Create_Brands.php +++ b/database/migrations/2018_06_01_145539_Create_Brands.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('brands', function (Blueprint $table) { $table->increments('id'); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('brands'); Schema::table('devices', function (Blueprint $table) { diff --git a/database/migrations/2018_06_01_152511_Create_Skills.php b/database/migrations/2018_06_01_152511_Create_Skills.php index b7e57793f5..b4a5868ce0 100644 --- a/database/migrations/2018_06_01_152511_Create_Skills.php +++ b/database/migrations/2018_06_01_152511_Create_Skills.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('skills', function (Blueprint $table) { $table->increments('id'); @@ -26,10 +24,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('skills'); Schema::table('users', function (Blueprint $table) { diff --git a/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php b/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php index 6f3507b809..46e414906f 100644 --- a/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php +++ b/database/migrations/2018_06_06_160236_Create_Skills_Pivot.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('users_skills', function (Blueprint $table) { $table->increments('id'); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('users_skills'); Schema::table('users', function (Blueprint $table) { diff --git a/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php b/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php index e9a7b7845e..e3fad194ae 100644 --- a/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php +++ b/database/migrations/2018_06_06_160549_Create_Group_Tags_Pivot.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('grouptags_groups', function (Blueprint $table) { $table->increments('id'); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('grouptags_groups'); Schema::table('groups', function (Blueprint $table) { diff --git a/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php b/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php index c613aa6624..4287a8f41f 100644 --- a/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php +++ b/database/migrations/2018_06_07_144018_Add_New_Fields_Users.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('country')->nullable(); @@ -26,10 +24,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('country'); diff --git a/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php b/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php index 9dd8c895ca..6b8e0f9682 100644 --- a/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php +++ b/database/migrations/2018_06_14_140315_Add_Number_Of_Logins.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->integer('number_of_logins')->default(0); @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('number_of_logins'); diff --git a/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php b/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php index 8d792cbb11..7166abe803 100644 --- a/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php +++ b/database/migrations/2018_06_19_091052_Add_Status_Role_User_Events.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events_users', function (Blueprint $table) { $table->string('status', 50)->nullable(); @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events_users', function (Blueprint $table) { $table->dropColumn('status'); diff --git a/database/migrations/2018_06_27_000057_update_users_brands_registration.php b/database/migrations/2018_06_27_000057_update_users_brands_registration.php index 8f23146183..cf8fb3afc1 100644 --- a/database/migrations/2018_06_27_000057_update_users_brands_registration.php +++ b/database/migrations/2018_06_27_000057_update_users_brands_registration.php @@ -9,10 +9,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->timestamp('consent_past_data')->nullable(); @@ -41,10 +39,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('consent_gdpr'); diff --git a/database/migrations/2018_06_28_204857_create_sessions_table.php b/database/migrations/2018_06_28_204857_create_sessions_table.php index e36514b9e6..f10567c196 100644 --- a/database/migrations/2018_06_28_204857_create_sessions_table.php +++ b/database/migrations/2018_06_28_204857_create_sessions_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::rename('sessions', 'sessions_old'); @@ -27,10 +25,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::rename('sessions_old', 'sessions'); diff --git a/database/migrations/2018_07_01_201744_create_invites_table.php b/database/migrations/2018_07_01_201744_create_invites_table.php index 1d867dbc62..b0db64e656 100644 --- a/database/migrations/2018_07_01_201744_create_invites_table.php +++ b/database/migrations/2018_07_01_201744_create_invites_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('invites', function (Blueprint $table) { $table->increments('id'); @@ -24,10 +22,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('invites'); } diff --git a/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php b/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php index 932f1c3b97..57f3b3fdd3 100644 --- a/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php +++ b/database/migrations/2018_07_01_221529_Add_Status_Role_User_Groups.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users_groups', function (Blueprint $table) { $table->string('status', 50)->nullable(); @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users_groups', function (Blueprint $table) { $table->dropColumn('status'); diff --git a/database/migrations/2018_07_03_104638_user_table_updates.php b/database/migrations/2018_07_03_104638_user_table_updates.php index 689fa02454..077d9cc452 100644 --- a/database/migrations/2018_07_03_104638_user_table_updates.php +++ b/database/migrations/2018_07_03_104638_user_table_updates.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('gender')->nullable()->default(null)->change(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('gender')->nullable(false)->default('N/A')->change(); diff --git a/database/migrations/2018_07_04_082822_invite_type_column.php b/database/migrations/2018_07_04_082822_invite_type_column.php index 3daabd7480..64083733f8 100644 --- a/database/migrations/2018_07_04_082822_invite_type_column.php +++ b/database/migrations/2018_07_04_082822_invite_type_column.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('invites', function (Blueprint $table) { $table->string('type')->nullable(); @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('invites', function (Blueprint $table) { $table->dropColumn('type'); diff --git a/database/migrations/2018_07_04_215949_device_wiki_column.php b/database/migrations/2018_07_04_215949_device_wiki_column.php index 1c1925b9a9..19b767926d 100644 --- a/database/migrations/2018_07_04_215949_device_wiki_column.php +++ b/database/migrations/2018_07_04_215949_device_wiki_column.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('devices', function (Blueprint $table) { $table->integer('wiki')->after('repaired_by')->nullable(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('devices', function (Blueprint $table) { $table->dropColumn('wiki'); diff --git a/database/migrations/2018_07_06_221304_change_bio_length.php b/database/migrations/2018_07_06_221304_change_bio_length.php index 735718707b..2c94120248 100644 --- a/database/migrations/2018_07_06_221304_change_bio_length.php +++ b/database/migrations/2018_07_06_221304_change_bio_length.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->text('biography')->change(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('biography')->change(); diff --git a/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php b/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php index 2810ca7f2d..7eca492354 100644 --- a/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php +++ b/database/migrations/2018_07_06_222838_make_group_tag_desc_nullable.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('group_tags', function (Blueprint $table) { $table->text('description')->nullable()->change(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('group_tags', function (Blueprint $table) { $table->string('description')->nullable(false)->change(); diff --git a/database/migrations/2018_07_12_110255_default_volunteers_value.php b/database/migrations/2018_07_12_110255_default_volunteers_value.php index dd032ce597..f33555c51b 100644 --- a/database/migrations/2018_07_12_110255_default_volunteers_value.php +++ b/database/migrations/2018_07_12_110255_default_volunteers_value.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->integer('volunteers')->nullable(false)->default(0)->change(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->integer('volunteers')->nullable()->change(); diff --git a/database/migrations/2018_07_17_221336_volunteer_event_users.php b/database/migrations/2018_07_17_221336_volunteer_event_users.php index 58ee6d518f..a9b882c780 100644 --- a/database/migrations/2018_07_17_221336_volunteer_event_users.php +++ b/database/migrations/2018_07_17_221336_volunteer_event_users.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events_users', function (Blueprint $table) { $table->string('full_name')->nullable(); @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events_users', function (Blueprint $table) { $table->dropColumn('full_name'); diff --git a/database/migrations/2018_07_26_172108_media_wiki.php b/database/migrations/2018_07_26_172108_media_wiki.php index db18776609..059bf4f350 100644 --- a/database/migrations/2018_07_26_172108_media_wiki.php +++ b/database/migrations/2018_07_26_172108_media_wiki.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->tinyInteger('mediawiki')->default(0); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('mediawiki'); diff --git a/database/migrations/2018_07_31_213315_media_wiki_username.php b/database/migrations/2018_07_31_213315_media_wiki_username.php index 900853237e..152b2a11a3 100644 --- a/database/migrations/2018_07_31_213315_media_wiki_username.php +++ b/database/migrations/2018_07_31_213315_media_wiki_username.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('mediawiki')->default(null)->nullable()->change(); @@ -24,10 +22,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->integer('mediawiki')->default(0)->change(); diff --git a/database/migrations/2018_09_03_091813_create_audits_table.php b/database/migrations/2018_09_03_091813_create_audits_table.php index dc7c72a80c..cd7073a320 100644 --- a/database/migrations/2018_09_03_091813_create_audits_table.php +++ b/database/migrations/2018_09_03_091813_create_audits_table.php @@ -20,10 +20,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('audits', function (Blueprint $table) { $table->increments('id'); @@ -45,10 +43,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::drop('audits'); } diff --git a/database/migrations/2018_09_04_110332_create_preferences_table.php b/database/migrations/2018_09_04_110332_create_preferences_table.php index cf53dece72..29e494ef86 100644 --- a/database/migrations/2018_09_04_110332_create_preferences_table.php +++ b/database/migrations/2018_09_04_110332_create_preferences_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('preferences', function (Blueprint $table) { $table->increments('id'); @@ -36,10 +34,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('users_preferences'); Schema::dropIfExists('preferences'); diff --git a/database/migrations/2018_09_13_114022_soft_delete_event.php b/database/migrations/2018_09_13_114022_soft_delete_event.php index f7a161b1d1..34fa930687 100644 --- a/database/migrations/2018_09_13_114022_soft_delete_event.php +++ b/database/migrations/2018_09_13_114022_soft_delete_event.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->softDeletes(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('deleted_at'); diff --git a/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php b/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php index 516f82a47d..811c49c7a4 100644 --- a/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php +++ b/database/migrations/2018_09_18_101249_create_drop_permissions_tables.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::table('users_preferences')->delete(); DB::table('preferences')->delete(); @@ -48,10 +46,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('users_permissions'); } diff --git a/database/migrations/2018_09_20_120947_soft_delete_permissions.php b/database/migrations/2018_09_20_120947_soft_delete_permissions.php index 64e7bd83cb..a3aa381719 100644 --- a/database/migrations/2018_09_20_120947_soft_delete_permissions.php +++ b/database/migrations/2018_09_20_120947_soft_delete_permissions.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('permissions', function (Blueprint $table) { $table->softDeletes(); @@ -24,10 +22,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('permissions', function (Blueprint $table) { $table->dropColumn('deleted_at'); diff --git a/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php b/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php index 714d3c7d04..fe4ee4b835 100644 --- a/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php +++ b/database/migrations/2018_10_02_162335_add_user_id_to_events_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->integer('user_id')->unsigned()->nullable()->after('volunteers'); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('user_id'); diff --git a/database/migrations/2018_10_04_095031_create_notifications_table.php b/database/migrations/2018_10_04_095031_create_notifications_table.php index 4357c9efa5..d73803223d 100644 --- a/database/migrations/2018_10_04_095031_create_notifications_table.php +++ b/database/migrations/2018_10_04_095031_create_notifications_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('notifications', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('notifications'); } diff --git a/database/migrations/2018_10_31_145415_add_preferences.php b/database/migrations/2018_10_31_145415_add_preferences.php index 8b42ccc1eb..82e7106168 100644 --- a/database/migrations/2018_10_31_145415_add_preferences.php +++ b/database/migrations/2018_10_31_145415_add_preferences.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // Additional preferences DB::table('preferences')->insert([ @@ -70,10 +68,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::table('users_preferences')->delete(); DB::table('preferences')->truncate(); diff --git a/database/migrations/2018_11_05_190951_group_country_field.php b/database/migrations/2018_11_05_190951_group_country_field.php index ecf4b7a590..cc401fae0b 100644 --- a/database/migrations/2018_11_05_190951_group_country_field.php +++ b/database/migrations/2018_11_05_190951_group_country_field.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('country')->after('area')->nullable(); @@ -38,10 +36,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('country'); diff --git a/database/migrations/2018_11_12_135805_additional_device_fields.php b/database/migrations/2018_11_12_135805_additional_device_fields.php index c3a9d411ea..0830efcd2a 100644 --- a/database/migrations/2018_11_12_135805_additional_device_fields.php +++ b/database/migrations/2018_11_12_135805_additional_device_fields.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('barriers', function (Blueprint $table) { $table->increments('id'); @@ -55,10 +53,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('barriers'); Schema::dropIfExists('devices_urls'); diff --git a/database/migrations/2018_12_04_212544_increase_username_field_length.php b/database/migrations/2018_12_04_212544_increase_username_field_length.php index a3014d9234..5c39d8a0e9 100644 --- a/database/migrations/2018_12_04_212544_increase_username_field_length.php +++ b/database/migrations/2018_12_04_212544_increase_username_field_length.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('username', 50)->change(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('username', 20)->change(); diff --git a/database/migrations/2018_12_10_114941_create_jobs_table.php b/database/migrations/2018_12_10_114941_create_jobs_table.php index a786a89100..6098d9b123 100644 --- a/database/migrations/2018_12_10_114941_create_jobs_table.php +++ b/database/migrations/2018_12_10_114941_create_jobs_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('jobs', function (Blueprint $table) { $table->bigIncrements('id'); @@ -26,10 +24,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('jobs'); } diff --git a/database/migrations/2018_12_11_112533_create_failed_jobs_table.php b/database/migrations/2018_12_11_112533_create_failed_jobs_table.php index 23a0faa341..b1b6dfcd54 100644 --- a/database/migrations/2018_12_11_112533_create_failed_jobs_table.php +++ b/database/migrations/2018_12_11_112533_create_failed_jobs_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('failed_jobs', function (Blueprint $table) { $table->bigIncrements('id'); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('failed_jobs'); } diff --git a/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php b/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php index e2e35c3751..92e9399325 100644 --- a/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php +++ b/database/migrations/2019_03_03_191008_add_last_login_field_to_users_table.php @@ -9,10 +9,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->datetime('last_login_at')->nullable(); @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('last_login_at'); diff --git a/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php b/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php index 647de7470d..b48674a36e 100644 --- a/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php +++ b/database/migrations/2019_03_13_162745_add_access_key_column_to_users_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('access_key')->nullable()->unique(); @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('access_key'); diff --git a/database/migrations/2019_03_22_105152_repair_network_update.php b/database/migrations/2019_03_22_105152_repair_network_update.php index b3a51ba670..5a6e8eb309 100644 --- a/database/migrations/2019_03_22_105152_repair_network_update.php +++ b/database/migrations/2019_03_22_105152_repair_network_update.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->tinyInteger('repair_network')->default(1)->after('language'); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('repair_network'); diff --git a/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php b/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php index f6fae67a7e..4a267af07d 100644 --- a/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php +++ b/database/migrations/2019_03_22_154657_add_unique_shareable_code_to_events_and_groups.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('shareable_code')->after('free_text')->nullable(); @@ -24,10 +22,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('shareable_code'); diff --git a/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php b/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php index 47e5450e5b..f55a62b2d9 100644 --- a/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php +++ b/database/migrations/2019_04_06_143811_fix_event_name_in_devices_view.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('DROP VIEW IF EXISTS view_devices_list'); DB::statement('CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `view_devices_list` AS select `devices`.`iddevices` AS `id`,`categories`.`name` AS `category_name`,`categories`.`idcategories` AS `idcategory`,`devices`.`brand` AS `brand`,`devices`.`model` AS `model`,`devices`.`problem` AS `problem`,`groups`.`idgroups` AS `idgroup`,`groups`.`name` AS `group_name`,COALESCE(`events`.`venue`,`events`.`location`) AS event_name, `events`.`location` AS `event_location`,`events`.`latitude` AS `event_latitude`,`events`.`longitude` AS `event_longitude`,unix_timestamp(`events`.`event_date`) AS `event_date`,`users`.`name` AS `restarter`,`devices`.`repair_status` AS `repair_status`,`devices`.`created_at` AS `sorter` from ((((`devices` join `categories` on((`categories`.`idcategories` = `devices`.`category`))) join `events` on((`events`.`idevents` = `devices`.`event`))) join `groups` on((`groups`.`idgroups` = `events`.`group`))) join `users` on((`users`.`id` = `devices`.`repaired_by`)));'); @@ -19,10 +17,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::statement('DROP VIEW IF EXISTS view_devices_list'); DB::statement('CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `view_devices_list` AS select `devices`.`iddevices` AS `id`,`categories`.`name` AS `category_name`,`categories`.`idcategories` AS `idcategory`,`devices`.`brand` AS `brand`,`devices`.`model` AS `model`,`devices`.`problem` AS `problem`,`groups`.`idgroups` AS `idgroup`,`groups`.`name` AS `group_name`,`events`.`location` AS `event_location`,`events`.`latitude` AS `event_latitude`,`events`.`longitude` AS `event_longitude`,unix_timestamp(`events`.`event_date`) AS `event_date`,`users`.`name` AS `restarter`,`devices`.`repair_status` AS `repair_status`,`devices`.`created_at` AS `sorter` from ((((`devices` join `categories` on((`categories`.`idcategories` = `devices`.`category`))) join `events` on((`events`.`idevents` = `devices`.`event`))) join `groups` on((`groups`.`idgroups` = `events`.`group`))) join `users` on((`users`.`id` = `devices`.`repaired_by`)));'); diff --git a/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php b/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php index 2b536d4b77..b440cda54d 100644 --- a/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php +++ b/database/migrations/2019_04_08_123743_alter_users_groups_default_role_to_restarter.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // Using raw SQL as tinyint columns can't be altered. // See https://laravel.com/docs/5.6/migrations#modifying-columns @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::statement("ALTER TABLE `users_groups` CHANGE `role` `role` TINYINT(4) NOT NULL DEFAULT '3'"); } diff --git a/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php b/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php index 319d0f9bec..2f60941b50 100644 --- a/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php +++ b/database/migrations/2019_05_29_142932_add_drip_subscriber_id_to_users_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('drip_subscriber_id')->nullable()->after('newsletter')->unique(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('drip_subscriber_id'); diff --git a/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php b/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php index d5b0e6624b..d1247d6c66 100644 --- a/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php +++ b/database/migrations/2019_06_03_100102_add_wiki_sync_status_to_users_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->boolean('wiki_sync_status')->default(false); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('wiki_sync_status'); diff --git a/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php b/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php index ed303be157..aebbe7d767 100644 --- a/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php +++ b/database/migrations/2019_06_03_112609_add_calendar_hash_to_users_table.php @@ -9,10 +9,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('calendar_hash')->after('drip_subscriber_id')->unique()->nullable(); @@ -33,10 +31,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('calendar_hash'); diff --git a/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php b/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php index 20fd526822..e3f026f2ac 100644 --- a/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php +++ b/database/migrations/2019_06_04_165318_add_admin_user_deleted_preference.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::table('preferences')->insert([ 'name' => 'Admin User Deleted', @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { $id = DB::table('preferences')->where('slug', 'admin-user-deleted')->pluck('id'); DB::table('users_preferences')->where('preference_id', $id)->delete(); diff --git a/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php b/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php index 6cfc04853d..48b91dfa30 100644 --- a/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php +++ b/database/migrations/2019_06_04_165426_add_admin_moderate_event_photos_preference.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::table('preferences')->insert([ 'name' => 'Admin Moderate Event Photos', @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { $id = DB::table('preferences')->where('slug', 'admin-moderate-event-photos')->pluck('id'); DB::table('users_preferences')->where('preference_id', $id)->delete(); diff --git a/database/migrations/2019_11_11_151415_rename_access_key_column.php b/database/migrations/2019_11_11_151415_rename_access_key_column.php index 658b047382..613a2083e2 100644 --- a/database/migrations/2019_11_11_151415_rename_access_key_column.php +++ b/database/migrations/2019_11_11_151415_rename_access_key_column.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->renameColumn('access_key', 'api_token'); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->renameColumn('api_token', 'access_key'); diff --git a/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php b/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php index 28b5c953b0..d77b5d7c93 100644 --- a/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php +++ b/database/migrations/2019_12_01_191304_users_groups_soft_deletes.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users_groups', function (Blueprint $table) { $table->softDeletes(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { $table->dropSoftDeletes(); } diff --git a/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php b/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php index 8003c0344e..5bf71aeb94 100644 --- a/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php +++ b/database/migrations/2019_12_09_112009_add_updated_at_to_devices_faults_opinions_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (Schema::hasTable('devices_faults_opinions')) { if (! Schema::hasColumn('devices_faults_opinions', 'updated_at')) { @@ -36,10 +34,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('devices_faults_opinions', function (Blueprint $table) { $table->dropColumn('updated_at'); diff --git a/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php b/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php index d002a67f9c..c18acc8ab0 100644 --- a/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php +++ b/database/migrations/2019_12_13_110932_add_age_country_to_devices_faults_opinions_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (Schema::hasTable('devices_faults_opinions')) { if (! Schema::hasColumn('devices_faults_opinions', 'age')) { @@ -41,10 +39,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('devices_faults_opinions', function (Blueprint $table) { $table->dropColumn('age'); diff --git a/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php b/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php index ba1650d040..dd34597a57 100644 --- a/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php +++ b/database/migrations/2019_12_20_121135_create_microtask_demographics_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('microtask_demographics', function (Blueprint $table) { $table->increments('id'); @@ -30,10 +28,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('microtask_demographics'); } diff --git a/database/migrations/2020_02_10_182430_add_network_id_to_groups.php b/database/migrations/2020_02_10_182430_add_network_id_to_groups.php index f87259ddd3..64d6b054e3 100644 --- a/database/migrations/2020_02_10_182430_add_network_id_to_groups.php +++ b/database/migrations/2020_02_10_182430_add_network_id_to_groups.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->smallInteger('network_id') @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('network_id'); diff --git a/database/migrations/2020_02_10_184130_add_external_id_to_groups.php b/database/migrations/2020_02_10_184130_add_external_id_to_groups.php index 78ba2a3cb2..e0d5a4abff 100644 --- a/database/migrations/2020_02_10_184130_add_external_id_to_groups.php +++ b/database/migrations/2020_02_10_184130_add_external_id_to_groups.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->smallInteger('external_id') @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('external_id'); diff --git a/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php b/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php index 5e7b17e3e8..af4d596fa0 100644 --- a/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php +++ b/database/migrations/2020_02_10_200747_add_facebook_field_to_groups.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->text('facebook')->after('website'); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('facebook'); diff --git a/database/migrations/2020_02_17_100100_faultcat_refactor.php b/database/migrations/2020_02_17_100100_faultcat_refactor.php index 3f190f903b..af725a04cd 100644 --- a/database/migrations/2020_02_17_100100_faultcat_refactor.php +++ b/database/migrations/2020_02_17_100100_faultcat_refactor.php @@ -11,10 +11,8 @@ * * Includes missed migrations for tables * `devices_faults` and `devices_faults_opinions`. - * - * @return void */ - public function up() + public function up(): void { if (Schema::hasTable('devices_faults')) { Schema::rename('devices_faults', 'devices_faults_events'); @@ -81,10 +79,8 @@ public function up() * Reverse the migrations. * * DO NOT DROP `devices_faults` or `devices_faults_opinions`. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_adjudicated'); diff --git a/database/migrations/2020_02_24_140951_create_misccat_tables.php b/database/migrations/2020_02_24_140951_create_misccat_tables.php index 3be0691f45..c587bb1c85 100644 --- a/database/migrations/2020_02_24_140951_create_misccat_tables.php +++ b/database/migrations/2020_02_24_140951_create_misccat_tables.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('devices_misc_opinions', function (Blueprint $table) { $table->increments('id'); @@ -39,10 +37,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_misc_opinions'); Schema::dropIfExists('devices_misc_adjudicated'); diff --git a/database/migrations/2020_03_11_164903_create_networks_table.php b/database/migrations/2020_03_11_164903_create_networks_table.php index b995781d83..a31b202d69 100644 --- a/database/migrations/2020_03_11_164903_create_networks_table.php +++ b/database/migrations/2020_03_11_164903_create_networks_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('networks', function (Blueprint $table) { $table->increments('id'); @@ -26,10 +24,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('networks'); } diff --git a/database/migrations/2020_03_11_175639_create_group_network_table.php b/database/migrations/2020_03_11_175639_create_group_network_table.php index ff409f6852..70cfbdbba1 100644 --- a/database/migrations/2020_03_11_175639_create_group_network_table.php +++ b/database/migrations/2020_03_11_175639_create_group_network_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('group_network', function (Blueprint $table) { $table->primary(['group_id', 'network_id']); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('group_network'); } diff --git a/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php b/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php index b511de95a4..6c70c40b25 100644 --- a/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php +++ b/database/migrations/2020_03_29_160723_add_wordpress_push_to_networks_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('events_push_to_wordpress')->notNullable()->default(false); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('events_push_to_wordpress'); diff --git a/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php b/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php index eeb6d27df9..926d5203f7 100644 --- a/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php +++ b/database/migrations/2020_03_29_200447_add_include_in_zapier_to_networks_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('include_in_zapier')->nullable(false)->default(false); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('include_in_zapier'); diff --git a/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php b/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php index 7d2b86e601..f6c06cd159 100644 --- a/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php +++ b/database/migrations/2020_03_29_220513_add_shortname_to_networks_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->string('shortname', 255)->nullable(false); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('shortname'); diff --git a/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php b/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php index d1c223fd9a..4635b373a3 100644 --- a/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php +++ b/database/migrations/2020_04_19_095514_add_networkcoordinator_to_roles_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::table('roles')->insert([ 'role' => 'NetworkCoordinator', @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::delete("delete from roles where role = 'NetworkCoordinator'"); } diff --git a/database/migrations/2020_04_19_102144_create_user_network_table.php b/database/migrations/2020_04_19_102144_create_user_network_table.php index f0f1e3e4d8..0d81fd7ec0 100644 --- a/database/migrations/2020_04_19_102144_create_user_network_table.php +++ b/database/migrations/2020_04_19_102144_create_user_network_table.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('user_network', function (Blueprint $table) { $table->primary(['user_id', 'network_id']); @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('user_network'); } diff --git a/database/migrations/2020_04_27_175552_create_default_network.php b/database/migrations/2020_04_27_175552_create_default_network.php index 6198c3bb26..5ed7ed0d0b 100644 --- a/database/migrations/2020_04_27_175552_create_default_network.php +++ b/database/migrations/2020_04_27_175552_create_default_network.php @@ -10,10 +10,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // This is the default 'Restarters' network - that which // groups will be a member of by default, if not part of @@ -34,10 +32,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::table('networks')->where('id', 1)->delete(); } diff --git a/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php b/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php index 67db46aedf..1b409ed488 100644 --- a/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php +++ b/database/migrations/2020_04_28_094252_add_drip_push_column_to_networks.php @@ -9,10 +9,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('users_push_to_drip')->nullable(false)->default(false) @@ -24,10 +22,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('users_push_to_drip'); diff --git a/database/migrations/2020_05_21_173538_add_online_flag_to_events.php b/database/migrations/2020_05_21_173538_add_online_flag_to_events.php index 6258fb212c..1b4c5089f5 100644 --- a/database/migrations/2020_05_21_173538_add_online_flag_to_events.php +++ b/database/migrations/2020_05_21_173538_add_online_flag_to_events.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->boolean('online') @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('online'); diff --git a/database/migrations/2020_05_26_130318_allow_null_location_details.php b/database/migrations/2020_05_26_130318_allow_null_location_details.php index aad571291a..e4ceffb899 100644 --- a/database/migrations/2020_05_26_130318_allow_null_location_details.php +++ b/database/migrations/2020_05_26_130318_allow_null_location_details.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('location', 255)->nullable()->change(); @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->string('location', 255)->nullable(false)->change(); diff --git a/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php b/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php index 7a992c1a44..9eee802682 100644 --- a/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php +++ b/database/migrations/2020_06_08_093140_add_discourse_group_to_networks.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->string('discourse_group', 255)->nullable(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('discourse_group'); diff --git a/database/migrations/2020_06_30_100100_mobifix_setup.php b/database/migrations/2020_06_30_100100_mobifix_setup.php index 86e5fa7c63..f55cc8cd8b 100644 --- a/database/migrations/2020_06_30_100100_mobifix_setup.php +++ b/database/migrations/2020_06_30_100100_mobifix_setup.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('devices_faults_mobiles_opinions', function (Blueprint $table) { $table->increments('id'); @@ -37,10 +35,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_mobiles_adjudicated'); Schema::dropIfExists('devices_faults_mobiles_opinions'); diff --git a/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php b/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php index df09c2ad26..9ad261211f 100644 --- a/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php +++ b/database/migrations/2020_07_17_125259_add_event_deletion_notification_preference.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::table('preferences')->insert([ 'name' => 'Event deletion notification', @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { $id = DB::table('preferences')->where('slug', 'delete-event-notification')->pluck('id'); DB::table('users_preferences')->where('preference_id', $id)->delete(); diff --git a/database/migrations/2020_08_01_110400_mobifix_ora_setup.php b/database/migrations/2020_08_01_110400_mobifix_ora_setup.php index 62bc4264d8..b50438bfc9 100644 --- a/database/migrations/2020_08_01_110400_mobifix_ora_setup.php +++ b/database/migrations/2020_08_01_110400_mobifix_ora_setup.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('devices_faults_mobiles_ora_opinions', function (Blueprint $table) { $table->increments('id'); @@ -238,10 +236,8 @@ protected function _FaultTypes() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_mobiles_ora_adjudicated'); Schema::dropIfExists('devices_faults_mobiles_ora_opinions'); diff --git a/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php b/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php index 560e0fe4cc..cf7018698c 100644 --- a/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php +++ b/database/migrations/2020_08_11_130008_latitude_longitude_three_digits.php @@ -8,20 +8,16 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `users` CHANGE `longitude` `longitude` DECIMAL(10,7), CHANGE `latitude` `latitude` DECIMAL(10,7) NULL DEFAULT NULL;'); } /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::statement('ALTER TABLE `users` CHANGE `longitude` `longitude` DECIMAL(10,8), CHANGE `latitude` `latitude` DECIMAL(10,8) NULL DEFAULT NULL;'); } diff --git a/database/migrations/2020_08_26_110001_support_non_powered_items.php b/database/migrations/2020_08_26_110001_support_non_powered_items.php index 48d89e7a8e..da561e31bf 100644 --- a/database/migrations/2020_08_26_110001_support_non_powered_items.php +++ b/database/migrations/2020_08_26_110001_support_non_powered_items.php @@ -9,10 +9,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // New cluster for non-powered categories. DB::table('clusters')->insert([ @@ -60,10 +58,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('devices', function (Blueprint $table) { $table->dropColumn('item_type'); diff --git a/database/migrations/2020_10_21_121813_alter_table_charsets.php b/database/migrations/2020_10_21_121813_alter_table_charsets.php index 8151e3d35c..40d2e6f47b 100644 --- a/database/migrations/2020_10_21_121813_alter_table_charsets.php +++ b/database/migrations/2020_10_21_121813_alter_table_charsets.php @@ -11,10 +11,8 @@ /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Log::info('START MIGRATE AlterTableCharsets'); @@ -32,10 +30,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { $tables = $this->_tableCharsets(); foreach ($tables as $table) { @@ -135,10 +131,8 @@ private function _dataTables() /** * Report char issues. - * - * @return void */ - private function _report($prefix = '', $suffix = '') + private function _report($prefix = '', $suffix = ''): void { $tables = $this->_dataTables(); $format = 'SELECT @@ -151,7 +145,7 @@ private function _report($prefix = '', $suffix = '') $key = $fields['key']; foreach ($fields['fields'] as $field) { $qry = sprintf($format, $table, $field, $key); - $result = DB::select(DB::raw($qry)); + $result = DB::select($qry); $log = []; foreach ($result as $v) { $log[$v->id] = $v->val; diff --git a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php index f3833f5a98..ec25316aa0 100644 --- a/database/migrations/2020_10_27_101759_repair_status_to_string_data.php +++ b/database/migrations/2020_10_27_101759_repair_status_to_string_data.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (! Schema::hasColumn('devices', 'repair_status_str')) { Schema::table('devices', function (Blueprint $table) { @@ -55,10 +53,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::unprepared('DROP TRIGGER IF EXISTS `repair_status_str_in`'); DB::unprepared('DROP TRIGGER IF EXISTS `repair_status_str_up`'); diff --git a/database/migrations/2021_01_11_161917_cancellations.php b/database/migrations/2021_01_11_161917_cancellations.php index 5779b8c0e3..b3e1808371 100644 --- a/database/migrations/2021_01_11_161917_cancellations.php +++ b/database/migrations/2021_01_11_161917_cancellations.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->boolean('cancelled')->after('deleted_at')->default(false); @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('cancelled'); diff --git a/database/migrations/2021_03_22_092800_tabicat_ora_setup.php b/database/migrations/2021_03_22_092800_tabicat_ora_setup.php index fc90afe418..19e5a4b3d4 100755 --- a/database/migrations/2021_03_22_092800_tabicat_ora_setup.php +++ b/database/migrations/2021_03_22_092800_tabicat_ora_setup.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (! Schema::hasTable('devices_faults_tablets_ora_opinions')) { Schema::create('devices_faults_tablets_ora_opinions', function (Blueprint $table) { @@ -237,10 +235,8 @@ protected function _FaultTypes() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_tablets_ora_adjudicated'); Schema::dropIfExists('devices_faults_tablets_ora_opinions'); diff --git a/database/migrations/2021_04_06_113426_printcat_ora_setup.php b/database/migrations/2021_04_06_113426_printcat_ora_setup.php index 85aebaaff2..59c0e3fc83 100644 --- a/database/migrations/2021_04_06_113426_printcat_ora_setup.php +++ b/database/migrations/2021_04_06_113426_printcat_ora_setup.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (! Schema::hasTable('devices_faults_printers_ora_opinions')) { Schema::create('devices_faults_printers_ora_opinions', function (Blueprint $table) { @@ -222,10 +220,8 @@ protected function _FaultTypes() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_printers_ora_adjudicated'); Schema::dropIfExists('devices_faults_printers_ora_opinions'); diff --git a/database/migrations/2021_04_16_095410_aggregate_categories.php b/database/migrations/2021_04_16_095410_aggregate_categories.php index d73882b367..2b2a92e991 100644 --- a/database/migrations/2021_04_16_095410_aggregate_categories.php +++ b/database/migrations/2021_04_16_095410_aggregate_categories.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('categories', function (Blueprint $table) { $table->boolean('aggregate'); @@ -37,10 +35,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('categories', function (Blueprint $table) { $table->dropColumn('aggregate'); diff --git a/database/migrations/2021_04_26_115247_add_postcode.php b/database/migrations/2021_04_26_115247_add_postcode.php index a5c51e307e..d5b1fc26d9 100644 --- a/database/migrations/2021_04_26_115247_add_postcode.php +++ b/database/migrations/2021_04_26_115247_add_postcode.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('postcode', 32); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('postcode'); diff --git a/database/migrations/2021_05_05_151211_audit_issue.php b/database/migrations/2021_05_05_151211_audit_issue.php index 9a9697863d..a2d98eb551 100644 --- a/database/migrations/2021_05_05_151211_audit_issue.php +++ b/database/migrations/2021_05_05_151211_audit_issue.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('audits', function (Blueprint $table) { $table->string('old_values', '4294967295')->change(); @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('audits', function (Blueprint $table) { $table->string('old_values', '16777215')->change(); diff --git a/database/migrations/2021_05_11_130314_create_microtask_surveys.php b/database/migrations/2021_05_11_130314_create_microtask_surveys.php index c7720d1ff6..374c6aa9dc 100644 --- a/database/migrations/2021_05_11_130314_create_microtask_surveys.php +++ b/database/migrations/2021_05_11_130314_create_microtask_surveys.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (! Schema::hasTable('microtask_surveys')) { Schema::create( @@ -33,10 +31,8 @@ function (Blueprint $table) { /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('microtask_surveys'); } diff --git a/database/migrations/2021_05_14_105028_devices_updated_at.php b/database/migrations/2021_05_14_105028_devices_updated_at.php index 6ffdde3d6b..031e11e209 100644 --- a/database/migrations/2021_05_14_105028_devices_updated_at.php +++ b/database/migrations/2021_05_14_105028_devices_updated_at.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->datetime('devices_updated_at')->nullable(); @@ -24,10 +22,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('devices_updated_at'); diff --git a/database/migrations/2021_05_14_173108_repairdir_role.php b/database/migrations/2021_05_14_173108_repairdir_role.php index ace6d03d97..5077ca6f25 100644 --- a/database/migrations/2021_05_14_173108_repairdir_role.php +++ b/database/migrations/2021_05_14_173108_repairdir_role.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (! Schema::hasColumn('users', 'repairdir_role')) { Schema::table('users', function (Blueprint $table) { @@ -22,10 +20,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2021_05_21_130659_discourse_thread.php b/database/migrations/2021_05_21_130659_discourse_thread.php index fcc485b701..13f64d49ec 100644 --- a/database/migrations/2021_05_21_130659_discourse_thread.php +++ b/database/migrations/2021_05_21_130659_discourse_thread.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('discourse_thread', 255)->nullable(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('discourse_thread'); diff --git a/database/migrations/2021_06_09_164834_no_null_problems.php b/database/migrations/2021_06_09_164834_no_null_problems.php index 713bd5a197..4ef02511f3 100644 --- a/database/migrations/2021_06_09_164834_no_null_problems.php +++ b/database/migrations/2021_06_09_164834_no_null_problems.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // See https://github.com/doctrine/dbal/issues/3161. DB::connection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::connection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); diff --git a/database/migrations/2021_06_21_105938_battcat_ora_setup.php b/database/migrations/2021_06_21_105938_battcat_ora_setup.php index 229c1e69c2..5836575576 100644 --- a/database/migrations/2021_06_21_105938_battcat_ora_setup.php +++ b/database/migrations/2021_06_21_105938_battcat_ora_setup.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('devices_faults_batteries_ora_opinions', function (Blueprint $table) { $table->increments('id'); @@ -138,10 +136,8 @@ protected function _FaultTypes() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_batteries_ora_adjudicated'); Schema::dropIfExists('devices_faults_batteries_ora_opinions'); diff --git a/database/migrations/2021_07_14_125845_battcat_ora_changes.php b/database/migrations/2021_07_14_125845_battcat_ora_changes.php index a786fe4330..9731c11797 100644 --- a/database/migrations/2021_07_14_125845_battcat_ora_changes.php +++ b/database/migrations/2021_07_14_125845_battcat_ora_changes.php @@ -6,10 +6,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::table('fault_types_batteries')->where('id', '=', 14)->update([ 'title' => 'Unrepairable corrosion or leakage', @@ -68,10 +66,8 @@ protected function _FaultTypes() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { } }; diff --git a/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php b/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php index b12335e55f..49a97b9987 100644 --- a/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php +++ b/database/migrations/2021_08_06_234516_drop_view_waste_emission_ratio.php @@ -8,20 +8,16 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('DROP VIEW IF EXISTS `view_waste_emission_ratio`;'); } /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // } diff --git a/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php b/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php index 65ba5580b2..1ecc0da9ff 100644 --- a/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php +++ b/database/migrations/2021_08_13_000439_update_lca_unpowered_categories.php @@ -26,10 +26,8 @@ c2.footprint as footprint_old FROM `restarters_db_test`.categories c1 RIGHT JOIN `restarters.test`.categories c2 ON c2.idcategories = c1.idcategories - * - * @return void */ - public function up() + public function up(): void { DB::statement('SET foreign_key_checks=0'); DB::table('categories')->insert([ @@ -149,15 +147,13 @@ public function up() 'aggregate' => 1, ]); - DB::statement(DB::raw('UPDATE categories SET revision=2')); + DB::statement('UPDATE categories SET revision=2'); } /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::statement('SET foreign_key_checks=0'); DB::table('categories')->where('idcategories', 6)->delete(); @@ -224,6 +220,6 @@ public function down() 'aggregate' => 0, ]); - DB::statement(DB::raw('UPDATE categories SET revision=1')); + DB::statement('UPDATE categories SET revision=1'); } }; diff --git a/database/migrations/2021_08_16_133342_event_link.php b/database/migrations/2021_08_16_133342_event_link.php index 79fbe55384..5810679edc 100644 --- a/database/migrations/2021_08_16_133342_event_link.php +++ b/database/migrations/2021_08_16_133342_event_link.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('link')->nullable(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('link'); diff --git a/database/migrations/2021_09_10_093142_autoapprove_events.php b/database/migrations/2021_09_10_093142_autoapprove_events.php index 3946288e4f..45af2e9cfd 100644 --- a/database/migrations/2021_09_10_093142_autoapprove_events.php +++ b/database/migrations/2021_09_10_093142_autoapprove_events.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->boolean('auto_approve_events')->default(false); @@ -27,10 +25,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('auto_approve_events'); diff --git a/database/migrations/2021_10_04_124708_fix_category_names.php b/database/migrations/2021_10_04_124708_fix_category_names.php index b12ba07d98..9ac3f7e339 100644 --- a/database/migrations/2021_10_04_124708_fix_category_names.php +++ b/database/migrations/2021_10_04_124708_fix_category_names.php @@ -6,10 +6,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { $cats = [ 19 => 'PC accessory', @@ -27,10 +25,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { $cats = [ 19 => 'PC Accessory', diff --git a/database/migrations/2021_10_27_093744_group_discourse_group.php b/database/migrations/2021_10_27_093744_group_discourse_group.php index 9ff618c9eb..2f4b94e9f7 100644 --- a/database/migrations/2021_10_27_093744_group_discourse_group.php +++ b/database/migrations/2021_10_27_093744_group_discourse_group.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('discourse_group', 255)->nullable(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('discourse_group'); diff --git a/database/migrations/2021_12_08_100326_longer_language.php b/database/migrations/2021_12_08_100326_longer_language.php index 651655a874..5613347866 100644 --- a/database/migrations/2021_12_08_100326_longer_language.php +++ b/database/migrations/2021_12_08_100326_longer_language.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('language', 5)->change(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('language', 2)->change(); diff --git a/database/migrations/2022_01_04_123128_group_discourse_logo.php b/database/migrations/2022_01_04_123128_group_discourse_logo.php index 863d5267a8..2e747fd503 100644 --- a/database/migrations/2022_01_04_123128_group_discourse_logo.php +++ b/database/migrations/2022_01_04_123128_group_discourse_logo.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->integer('discourse_logo')->default(null)->nullable()->comment('ID of last Laraval Group image applied to Discourse Group'); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('discourse_group'); diff --git a/database/migrations/2022_01_24_101405_timezones.php b/database/migrations/2022_01_24_101405_timezones.php index 83d01cb831..0e54592213 100644 --- a/database/migrations/2022_01_24_101405_timezones.php +++ b/database/migrations/2022_01_24_101405_timezones.php @@ -5,15 +5,14 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; use App\Party; +use Illuminate\Support\Facades\DB; return new class extends Migration { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { # Timezones for groups and events. Schema::table('groups', function (Blueprint $table) { @@ -31,9 +30,9 @@ public function up() }); # Back up the existing data. - DB::statement(DB::raw('UPDATE events SET event_date_old = event_date')); - DB::statement(DB::raw('UPDATE events SET start_old = start')); - DB::statement(DB::raw('UPDATE events SET end_old = end')); + DB::statement('UPDATE events SET event_date_old = event_date'); + DB::statement('UPDATE events SET start_old = start'); + DB::statement('UPDATE events SET end_old = end'); # Set up the new timestamps. Currently event_start/time/end are all implicitly localised to the timezone # of the group. @@ -53,7 +52,7 @@ public function up() error_log("Event {$event->idevents} {$atts['event_date']} {$atts['start']}-{$atts['end']} => $event_start_utc - $event_end_utc"); - DB::statement(DB::raw("UPDATE events SET timezone = '$tz', event_start_utc = '$event_start_utc', event_end_utc = '$event_end_utc' WHERE idevents = {$event->idevents}")); + DB::statement("UPDATE events SET timezone = '$tz', event_start_utc = '$event_start_utc', event_end_utc = '$event_end_utc' WHERE idevents = {$event->idevents}"); } # Set up virtual generated columns which replicate event_date/start/end but generated from the new timestamps. @@ -73,10 +72,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { # Restore the event_date/state/end fields. Schema::table('events', function (Blueprint $table) { @@ -91,9 +88,9 @@ public function down() $table->time('end'); }); - DB::statement(DB::raw('UPDATE events SET event_date= event_date_old')); - DB::statement(DB::raw('UPDATE events SET start = start_old')); - DB::statement(DB::raw('UPDATE events SET start = end_old')); + DB::statement('UPDATE events SET event_date= event_date_old'); + DB::statement('UPDATE events SET start = start_old'); + DB::statement('UPDATE events SET start = end_old'); Schema::table('groups', function (Blueprint $table) { $table->dropColumn('timezone'); diff --git a/database/migrations/2022_02_04_132146_category_descriptions.php b/database/migrations/2022_02_04_132146_category_descriptions.php index 87b60affd8..f27e2b397b 100644 --- a/database/migrations/2022_02_04_132146_category_descriptions.php +++ b/database/migrations/2022_02_04_132146_category_descriptions.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('categories', function (Blueprint $table) { $table->string('description_short', 255); @@ -77,10 +75,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('categories', function (Blueprint $table) { $table->dropColumn('description_short'); diff --git a/database/migrations/2022_02_04_140651_refactor_estimate_column.php b/database/migrations/2022_02_04_140651_refactor_estimate_column.php index 63a2ed28af..2707d285c6 100644 --- a/database/migrations/2022_02_04_140651_refactor_estimate_column.php +++ b/database/migrations/2022_02_04_140651_refactor_estimate_column.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `devices` ADD `estimate_old` VARCHAR(10) AFTER `estimate`'); DB::statement('UPDATE devices SET `estimate_old` = `estimate`'); @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::statement('ALTER TABLE `devices` DROP `estimate`'); DB::statement('ALTER TABLE `devices` CHANGE `estimate_old` `estimate` VARCHAR(10)'); diff --git a/database/migrations/2022_02_16_085124_refactor_age_column.php b/database/migrations/2022_02_16_085124_refactor_age_column.php index dccf7999d8..8617e0a520 100644 --- a/database/migrations/2022_02_16_085124_refactor_age_column.php +++ b/database/migrations/2022_02_16_085124_refactor_age_column.php @@ -6,10 +6,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { DB::statement('ALTER TABLE `devices` ADD `age_old` VARCHAR(10) AFTER `age`'); DB::statement('UPDATE devices SET `age_old` = `age`'); @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { DB::statement('ALTER TABLE `devices` DROP `age`'); DB::statement('ALTER TABLE `devices` CHANGE `age_old` `age` VARCHAR(10)'); diff --git a/database/migrations/2022_03_02_102531_dustup_ora_setup.php b/database/migrations/2022_03_02_102531_dustup_ora_setup.php index 31bb91809d..11d41f4c48 100644 --- a/database/migrations/2022_03_02_102531_dustup_ora_setup.php +++ b/database/migrations/2022_03_02_102531_dustup_ora_setup.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { if (!Schema::hasTable('devices_faults_vacuums_ora_opinions')) { Schema::create('devices_faults_vacuums_ora_opinions', function (Blueprint $table) { @@ -211,10 +209,8 @@ protected function _FaultTypes() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('devices_faults_vacuums_ora_adjudicated'); Schema::dropIfExists('devices_faults_vacuums_ora_opinions'); diff --git a/database/migrations/2022_07_19_093250_add_brand_indexes.php b/database/migrations/2022_07_19_093250_add_brand_indexes.php index 151ea004cd..34040b03fa 100644 --- a/database/migrations/2022_07_19_093250_add_brand_indexes.php +++ b/database/migrations/2022_07_19_093250_add_brand_indexes.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('brands', function (Blueprint $table) { $table->index('brand_name'); @@ -23,10 +21,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('devices', function (Blueprint $table) { $table->dropIndex('devices_brand_index'); diff --git a/database/migrations/2022_08_10_091731_unique_network_names.php b/database/migrations/2022_08_10_091731_unique_network_names.php index 71fd433587..3a71308bc3 100644 --- a/database/migrations/2022_08_10_091731_unique_network_names.php +++ b/database/migrations/2022_08_10_091731_unique_network_names.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // Make networks table unique on name Schema::table('networks', function (Blueprint $table) { @@ -21,10 +19,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // Restore networks table to be non-unique Schema::table('networks', function (Blueprint $table) { diff --git a/database/migrations/2022_09_19_135345_add_group_phone.php b/database/migrations/2022_09_19_135345_add_group_phone.php index 7b570125cc..2405c389c3 100644 --- a/database/migrations/2022_09_19_135345_add_group_phone.php +++ b/database/migrations/2022_09_19_135345_add_group_phone.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('phone', 40)->nullable(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('phone'); diff --git a/database/migrations/2022_10_06_162442_network_logo.php b/database/migrations/2022_10_06_162442_network_logo.php index f0ed57f2c9..d3e9a982a5 100644 --- a/database/migrations/2022_10_06_162442_network_logo.php +++ b/database/migrations/2022_10_06_162442_network_logo.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('networks', function (Blueprint $table) { $table->string('logo', 255)->nullable(); @@ -36,10 +34,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('networks', function (Blueprint $table) { $table->dropColumn('logo'); diff --git a/database/migrations/2022_11_07_152558_record_approval.php b/database/migrations/2022_11_07_152558_record_approval.php index 7464b73a10..4e862af38f 100644 --- a/database/migrations/2022_11_07_152558_record_approval.php +++ b/database/migrations/2022_11_07_152558_record_approval.php @@ -3,15 +3,14 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Facades\DB; -class RecordApproval extends Migration +return new class extends Migration { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->boolean('approved')->default(false); @@ -21,18 +20,16 @@ public function up() $table->boolean('approved')->default(false); }); - DB::statement(DB::raw("UPDATE `groups` SET approved = wordpress_post_id IS NOT NULL")); - DB::statement(DB::raw("UPDATE `events` SET approved = wordpress_post_id IS NOT NULL")); - DB::statement(DB::raw("UPDATE `groups` SET wordpress_post_id = NULL WHERE wordpress_post_id = '99999'")); - DB::statement(DB::raw("UPDATE `events` SET wordpress_post_id = NULL WHERE wordpress_post_id = '99999'")); + DB::statement("UPDATE `groups` SET approved = wordpress_post_id IS NOT NULL"); + DB::statement("UPDATE `events` SET approved = wordpress_post_id IS NOT NULL"); + DB::statement("UPDATE `groups` SET wordpress_post_id = NULL WHERE wordpress_post_id = '99999'"); + DB::statement("UPDATE `events` SET wordpress_post_id = NULL WHERE wordpress_post_id = '99999'"); } /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('approved'); @@ -42,4 +39,4 @@ public function down() $table->dropColumn('approved'); }); } -} +}; diff --git a/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php b/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php index f6048bb3a9..68c816c691 100644 --- a/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php +++ b/database/migrations/2022_11_30_000000_add_uuid_to_failed_jobs_table.php @@ -10,10 +10,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('failed_jobs', function (Blueprint $table) { $table->string('uuid')->after('id')->nullable()->unique(); @@ -28,10 +26,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('failed_jobs', function (Blueprint $table) { $table->dropColumn('uuid'); diff --git a/database/migrations/2023_04_19_153453_network_data.php b/database/migrations/2023_04_19_153453_network_data.php index 3a7c7db8fc..767e8d0fee 100644 --- a/database/migrations/2023_04_19_153453_network_data.php +++ b/database/migrations/2023_04_19_153453_network_data.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { // Add JSON columns. In older versions of MySQL these will be LONGTEXT rather than JSON, so // if we ever want to do extraction/query/indexing on them we might need to migrate them at that point. @@ -25,10 +23,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('network_data'); diff --git a/database/migrations/2023_05_09_132601_useful_urls.php b/database/migrations/2023_05_09_132601_useful_urls.php index 9e944fe8f2..02fd874ed4 100644 --- a/database/migrations/2023_05_09_132601_useful_urls.php +++ b/database/migrations/2023_05_09_132601_useful_urls.php @@ -8,20 +8,16 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::drop('devices_urls'); } /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::create('devices_urls', function (Blueprint $table) { $table->increments('id'); diff --git a/database/migrations/2023_06_07_130653_new_zealand.php b/database/migrations/2023_06_07_130653_new_zealand.php index e2d196a888..ab25f6adca 100644 --- a/database/migrations/2023_06_07_130653_new_zealand.php +++ b/database/migrations/2023_06_07_130653_new_zealand.php @@ -3,26 +3,23 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Facades\DB; return new class extends Migration { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { - DB::statement(DB::raw("update `groups` set country = 'Aotearoa New Zealand' where country = 'New Zealand';")); + DB::statement("update `groups` set country = 'Aotearoa New Zealand' where country = 'New Zealand';"); } /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { - DB::statement(DB::raw("update `groups` set country = 'New Zealand' where country = 'Aotearoa New Zealand';")); + DB::statement("update `groups` set country = 'New Zealand' where country = 'Aotearoa New Zealand';"); } }; diff --git a/database/migrations/2023_06_12_153317_country_codes.php b/database/migrations/2023_06_12_153317_country_codes.php index 789b2a855c..682bb254a9 100644 --- a/database/migrations/2023_06_12_153317_country_codes.php +++ b/database/migrations/2023_06_12_153317_country_codes.php @@ -9,15 +9,13 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { $countries = array_flip(App\Helpers\Fixometer::getAllCountries('en')); // Users has country column which is a code, except for GBR; fix the contents and rename it. - DB::update(DB::raw("UPDATE users SET country = 'GB' WHERE country = 'GBR'")); + DB::update("UPDATE users SET country = 'GB' WHERE country = 'GBR'"); Schema::table('users', function (Blueprint $table) { $table->renameColumn('country', 'country_code'); @@ -30,7 +28,7 @@ public function up() $table->string('country_code', 2)->after('area')->nullable(); }); - $groups = DB::select(DB::raw('SELECT idgroups, country FROM `groups`')); + $groups = DB::select('SELECT idgroups, country FROM `groups`'); foreach ($groups as $g) { // Countries are stored in English. @@ -46,10 +44,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('country_code'); @@ -59,6 +55,6 @@ public function down() $table->renameColumn('country_code', 'country'); }); - DB::update(DB::raw("UPDATE users SET country = 'GBR' WHERE country = 'GB'")); + DB::update("UPDATE users SET country = 'GBR' WHERE country = 'GB'"); } }; diff --git a/database/migrations/2023_08_02_183803_item_type_collation.php b/database/migrations/2023_08_02_183803_item_type_collation.php index fa7003b823..923a1b9037 100644 --- a/database/migrations/2023_08_02_183803_item_type_collation.php +++ b/database/migrations/2023_08_02_183803_item_type_collation.php @@ -3,26 +3,23 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Facades\DB; return new class extends Migration { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { - DB::statement(DB::raw("ALTER TABLE `devices` CHANGE `item_type` `item_type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL;")); + DB::statement("ALTER TABLE `devices` CHANGE `item_type` `item_type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL;"); } /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { - DB::statement(DB::raw("ALTER TABLE `devices` CHANGE `item_type` `item_type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;")); + DB::statement("ALTER TABLE `devices` CHANGE `item_type` `item_type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;"); } }; diff --git a/database/migrations/2023_08_14_112539_group_email.php b/database/migrations/2023_08_14_112539_group_email.php index 8fed6d9480..229cba61b0 100644 --- a/database/migrations/2023_08_14_112539_group_email.php +++ b/database/migrations/2023_08_14_112539_group_email.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->string('email', 255)->nullable(); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('email'); diff --git a/database/migrations/2023_12_19_161808_customisable_banners.php b/database/migrations/2023_12_19_161808_customisable_banners.php index 26b039c36a..76fcbf0416 100644 --- a/database/migrations/2023_12_19_161808_customisable_banners.php +++ b/database/migrations/2023_12_19_161808_customisable_banners.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::create('alerts', function (Blueprint $table) { $table->increments('id'); @@ -28,10 +26,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::drop('alerts'); } diff --git a/database/migrations/2024_08_27_123452_group_archive.php b/database/migrations/2024_08_27_123452_group_archive.php index 573e813a95..dcd5026a8a 100644 --- a/database/migrations/2024_08_27_123452_group_archive.php +++ b/database/migrations/2024_08_27_123452_group_archive.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { Schema::table('groups', function (Blueprint $table) { $table->date('archived_at')->default(null)->nullable()->comment('Date the group was archived'); @@ -20,10 +18,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { Schema::table('groups', function (Blueprint $table) { $table->dropColumn('archived_at'); diff --git a/database/migrations/2024_09_16_093650_inactive_groups.php b/database/migrations/2024_09_16_093650_inactive_groups.php index 37db481257..62085a3f7a 100644 --- a/database/migrations/2024_09_16_093650_inactive_groups.php +++ b/database/migrations/2024_09_16_093650_inactive_groups.php @@ -8,10 +8,8 @@ { /** * Run the migrations. - * - * @return void */ - public function up() + public function up(): void { $groups = \App\Group::join('grouptags_groups', 'groups.idgroups', '=', 'grouptags_groups.group') ->join('group_tags', 'grouptags_groups.group_tag', '=', 'group_tags.id') @@ -30,10 +28,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // Add [INACTIVE] into all groups with archived_at. $groups = \App\Group::whereNotNull('archived_at')->get(); diff --git a/database/migrations/2025_03_06_110500_retire_workbench.php b/database/migrations/2025_03_06_110500_retire_workbench.php index 788d462252..cfee5b9103 100644 --- a/database/migrations/2025_03_06_110500_retire_workbench.php +++ b/database/migrations/2025_03_06_110500_retire_workbench.php @@ -45,7 +45,7 @@ 'microtask_surveys', ]; - public function up() + public function up(): void { // For each table, rename to 'archived__' + table name. // Using two underscores triggers phpMyAdmin table grouping. @@ -61,10 +61,8 @@ public function up() /** * Reverse the migrations. - * - * @return void */ - public function down() + public function down(): void { // For each table, rename back to original name foreach ($this->tables as $table) { diff --git a/database/migrations/2025_04_19_000000_rename_password_resets_table.php b/database/migrations/2025_04_19_000000_rename_password_resets_table.php new file mode 100644 index 0000000000..f0ad37571b --- /dev/null +++ b/database/migrations/2025_04_19_000000_rename_password_resets_table.php @@ -0,0 +1,24 @@ +truncate(); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 625878c49a..927de3d65b 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -8,10 +8,8 @@ class DatabaseSeeder extends Seeder { /** * Seed the application's database. - * - * @return void */ - public function run() + public function run(): void { $this->call(DefaultSkills::class); $this->call(BrandList::class); diff --git a/database/seeders/DefaultSkills.php b/database/seeders/DefaultSkills.php index 5198f39d6b..6df89611eb 100644 --- a/database/seeders/DefaultSkills.php +++ b/database/seeders/DefaultSkills.php @@ -9,10 +9,8 @@ class DefaultSkills extends Seeder { /** * Run the database seeds. - * - * @return void */ - public function run() + public function run(): void { DB::table('skills')->truncate(); diff --git a/database/seeders/NetworksTableSeeder.php b/database/seeders/NetworksTableSeeder.php index ae5650bf73..66e04101dc 100644 --- a/database/seeders/NetworksTableSeeder.php +++ b/database/seeders/NetworksTableSeeder.php @@ -10,10 +10,8 @@ class NetworksTableSeeder extends Seeder { /** * Run the database seeds. - * - * @return void */ - public function run() + public function run(): void { // Restarters network is REQUIRED, so is created as part of the database // migrations with id = 1. diff --git a/lang/en/auth.php b/lang/en/auth.php index 1b03c1090d..212f0c0d5e 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -5,7 +5,7 @@ 'login' => 'Login', 'delete_account' => 'Delete account', 'failed' => 'Either this email address isn\'t registered on the system or the password is incorrect.', - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + 'email_address' => 'Email address', 'sign_in' => 'I remembered. Let me sign in', 'forgotten_pw' => 'Forgotten your password?', diff --git a/lang/en/pagination.php b/lang/en/pagination.php deleted file mode 100644 index 556ffb5df7..0000000000 --- a/lang/en/pagination.php +++ /dev/null @@ -1,6 +0,0 @@ - '« Previous', - 'next' => 'Next »', -]; diff --git a/lang/en/passwords.php b/lang/en/passwords.php index 347b32df5c..58fc6ca863 100644 --- a/lang/en/passwords.php +++ b/lang/en/passwords.php @@ -1,11 +1,11 @@ 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', - 'token' => 'This password reset token is invalid.', + 'user' => 'We can\'t find a user with that e-mail address.', - 'throttled' => 'Please wait before retrying.', + 'invalid' => 'Please input a valid email.', 'recover_title' => 'Account Recovery', 'match' => 'The passwords do not match', diff --git a/lang/en/validation.php b/lang/en/validation.php deleted file mode 100644 index 5ea01fa77d..0000000000 --- a/lang/en/validation.php +++ /dev/null @@ -1,174 +0,0 @@ - 'The :attribute must be accepted.', - 'accepted_if' => 'The :attribute must be accepted when :other is :value.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute must only contain letters.', - 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'The :attribute must only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', - 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', - 'between' => [ - 'array' => 'The :attribute must have between :min and :max items.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'numeric' => 'The :attribute must be between :min and :max.', - 'string' => 'The :attribute must be between :min and :max characters.', - ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'current_password' => 'The password is incorrect.', - 'date' => 'The :attribute is not a valid date.', - 'date_equals' => 'The :attribute must be a date equal to :date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'declined' => 'The :attribute must be declined.', - 'declined_if' => 'The :attribute must be declined when :other is :value.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'doesnt_end_with' => 'The :attribute may not end with one of the following: :values.', - 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', - 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values.', - 'enum' => 'The selected :attribute is invalid.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'gt' => [ - 'array' => 'The :attribute must have more than :value items.', - 'file' => 'The :attribute must be greater than :value kilobytes.', - 'numeric' => 'The :attribute must be greater than :value.', - 'string' => 'The :attribute must be greater than :value characters.', - ], - 'gte' => [ - 'array' => 'The :attribute must have :value items or more.', - 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be greater than or equal to :value.', - 'string' => 'The :attribute must be greater than or equal to :value characters.', - ], - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'lt' => [ - 'array' => 'The :attribute must have less than :value items.', - 'file' => 'The :attribute must be less than :value kilobytes.', - 'numeric' => 'The :attribute must be less than :value.', - 'string' => 'The :attribute must be less than :value characters.', - ], - 'lte' => [ - 'array' => 'The :attribute must not have more than :value items.', - 'file' => 'The :attribute must be less than or equal to :value kilobytes.', - 'numeric' => 'The :attribute must be less than or equal to :value.', - 'string' => 'The :attribute must be less than or equal to :value characters.', - ], - 'mac_address' => 'The :attribute must be a valid MAC address.', - 'max' => [ - 'array' => 'The :attribute must not have more than :max items.', - 'file' => 'The :attribute must not be greater than :max kilobytes.', - 'numeric' => 'The :attribute must not be greater than :max.', - 'string' => 'The :attribute must not be greater than :max characters.', - ], - 'max_digits' => 'The :attribute must not have more than :max digits.', - 'mimes' => 'The :attribute must be a file of type: :values.', - 'mimetypes' => 'The :attribute must be a file of type: :values.', - 'min' => [ - 'array' => 'The :attribute must have at least :min items.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'numeric' => 'The :attribute must be at least :min.', - 'string' => 'The :attribute must be at least :min characters.', - ], - 'min_digits' => 'The :attribute must have at least :min digits.', - 'multiple_of' => 'The :attribute must be a multiple of :value.', - 'not_in' => 'The selected :attribute is invalid.', - 'not_regex' => 'The :attribute format is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'password' => [ - 'letters' => 'The :attribute must contain at least one letter.', - 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', - 'numbers' => 'The :attribute must contain at least one number.', - 'symbols' => 'The :attribute must contain at least one symbol.', - 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', - ], - 'present' => 'The :attribute field must be present.', - 'prohibited' => 'The :attribute field is prohibited.', - 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', - 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', - 'prohibits' => 'The :attribute field prohibits :other from being present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_array_keys' => 'The :attribute field must contain entries for: :values.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_if_accepted' => 'The :attribute field is required when :other is accepted.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values are present.', - 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ - 'array' => 'The :attribute must contain :size items.', - 'file' => 'The :attribute must be :size kilobytes.', - 'numeric' => 'The :attribute must be :size.', - 'string' => 'The :attribute must be :size characters.', - ], - 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid timezone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute must be a valid URL.', - 'uuid' => 'The :attribute must be a valid UUID.', - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute.rule" to name the lines. This makes it quick to - | specify a specific custom language line for a given attribute rule. - | - */ - - 'custom' => [ - 'attribute-name' => [ - 'rule-name' => 'custom-message', - ], - ], - - /* - |-------------------------------------------------------------------------- - | Custom Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap our attribute placeholder - | with something more reader friendly such as "E-Mail Address" instead - | of "email". This simply helps us make our message more expressive. - | - */ - - 'attributes' => [], - -]; diff --git a/package.json b/package.json index 45285b2161..45ce6b134b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@playwright/test": "^1.14.1", "@vue/test-utils": "^1.3.6", "@vue/vue2-jest": "^28.1.0", - "axios": "^0.28", + "axios": "^1.6.4", "babel-jest": "^28.1.0", "bootstrap": "^4.6.1", "browser-sync": "^2.27.11", diff --git a/phpunit.xml b/phpunit.xml index acd1214587..a1120c07b6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,7 +23,8 @@ - + + diff --git a/public/js/components/StatsShare.vue b/public/js/components/StatsShare.vue new file mode 100644 index 0000000000..b65ec18f23 --- /dev/null +++ b/public/js/components/StatsShare.vue @@ -0,0 +1,625 @@ + + + \ No newline at end of file diff --git a/public/js/translations.js b/public/js/translations.js new file mode 100644 index 0000000000..cd4da6b38c --- /dev/null +++ b/public/js/translations.js @@ -0,0 +1 @@ +module.exports = {"de.admin":{"brand":"Brand","brand-name":"Brand name","brand_modal_title":"Add new brand","categories":"Categories","category_cluster":"Category Cluster","category_name":"Category name","co2_footprint":"CO2<\/sub> Footprint (kg)","create-new-brand":"Create new brand","create-new-category":"Create new category","create-new-skill":"Create new skill","create-new-tag":"Create new tag","delete-skill":"Delete skill","delete-tag":"Delete tag","description":"Description","description_optional":"Description (optional)","edit-brand":"Edit brand","edit-brand-content":"","edit-category":"Edit category","edit-category-content":"","edit-skill":"Edit skill","edit-skill-content":"","group-tags":"Group tags","name":"Name","reliability":"Reliability","reliability-1":"Very poor","reliability-2":"Poor","reliability-3":"Fair","reliability-4":"Good","reliability-5":"Very good","reliability-6":"N\/A","save-brand":"Save brand","save-category":"Save category","save-skill":"Save skill","save-tag":"Save tag","skill_name":"Skill name","skills":"Skills","skills_modal_title":"Add new skill","tag-name":"Tag name","tags_modal_title":"Add new tag","weight":"Weight (kg)"},"de.auth":{"assigned_groups":"Assigned to groups","change_password":"Change password","change_password_text":"Keep your account safe and regularly change your password.","create_account":"Create an account","current_password":"Current password","delete_account":"Delete account","delete_account_text":"I understand that deleting my account will remove all of my personal data and\nthis is a permanent action.","email_address":"Email address","email_address_validation":"An account with this email address already exists. Have you tried logging in?","forgot_password":"Forgot password","forgotten_pw":"Forgotten your password?","forgotten_pw_text":"It happens to all of us. Simply enter your email to receive a password reset message.","login":"Login","new_password":"New password","new_repeat_password":"Repeat new password","password":"Password","profile_admin":"Admin only","profile_admin_text":"Here admins have the ability to change a user's role or their associated groups","repeat_password":"Repeat password","repeat_password_validation":"Passwords do not match or are fewer than six characters","reset":"Reset","reset_password":"Reset password","save_preferences":"Save preferences","save_user":"Save user","set_preferences":"Click here to set your email preferences for our discussion platform","sign_in":"I remembered. Let me sign in","throttle":"Too many login attempts. Please try again in :seconds seconds.","user_role":"User role"},"de.battcatora":{"about":"Mehr Informationen","branding":{"powered_by":"Unter Verwendung von Daten aus:"},"info":{"body-s1-header":"Was ist BattCat?","body-s1-p1":"Wir wollen verstehen, wie Batterien und Akkus dazu beitragen, dass Ger\u00e4te versagen. Damit m\u00f6chten wir der Politik sagen, wie zuk\u00fcnftige Modelle leichter reparierbar gemacht werden k\u00f6nnen. Reparatur vermeidet Abfall und schont die Ressourcen unseres Planeten.","body-s1-p2":"Mit BattCat k\u00f6nnen Sie sich an unserer Untersuchung beteiligen. Wir haben Informationen zu \u00fcber 1000 defekten Ger\u00e4ten gesammelt und brauchen Ihre Hilfe, um diese zu kategorisieren.","body-s2-header":"Was muss ich tun?","body-s2-p1":"Lesen Sie einfach die Informationen \u00fcber das defekte Ger\u00e4t und w\u00e4hlen Sie die Problembeschreibung oder Handlungsempfehlung aus der Liste darunter. Wenn Sie sich nicht sicher sind, w\u00e4hlen Sie unten einfach \"Ich wei\u00df nicht\". Sobald Sie eine Option ausgew\u00e4hlt haben, zeigen wir Ihnen ein anderes Ger\u00e4t. Je mehr Ger\u00e4tefehler Sie kategorisieren k\u00f6nnen, desto mehr lernen wir! BattCat zeigt jedes Ger\u00e4t drei Personen, die helfen, die richtige Kategorie zu best\u00e4tigen.","body-s3-header":"Woher bekommt BattCat Daten \u00fcber defekte Ger\u00e4te?","body-s3-p1":"BattCat verwendet Informationen von der Open Repair Alliance<\/a>, die Daten \u00fcber kaputte Ger\u00e4te sammelt, die echte Menschen auf der ganzen Welt bei Reparaturveranstaltungen wie Repair Caf\u00e9s und Restart Partys zu reparieren versucht haben.","body-s4-header":"Noch Fragen?","body-s4-p1":"Erfahren Sie mehr, stellen Sie Fragen und geben Sie uns Ihr Feedback, in der BattCat-Diskussion<\/a>.","title":"Danke, dass Sie BattCat ausprobiert haben"},"status":{"brand":"Marke","items_0_opinions":"mit 0 Meinungen","items_1_opinion":"mit 1 Meinung","items_2_opinions":"mit 2 Meinungen","items_3_opinions":"mit 3 Meinungen","items_majority_opinions":"Artikel mit Mehrheitsmeinungen","items_opinions":"Artikel \/ meinungen","items_split_opinions":"Artikel mit geteilten Meinungen","number_of_records":"Anzahl der Eintr\u00e4ge","opinions":"Meinungen","problem":"Problem","progress":"vollst\u00e4ndig","status":"Status","task_completed":"Du hast alle Eintr\u00e4ge gesehen, danke","total":"Gesamt","winning_opinion":"Gewinnende meinung"},"survey":{"a1":"Starke Ablehnung","a2":"Ablehnung","a3":"Neutral","a4":"Zustimmung","a5":"Starke Zustimmung","footer":"Wenn Sie eine der beiden Tasten dr\u00fccken, gelangen Sie zur\u00fcck zu BattCat","header1":"Vielen Dank!","header2":"Wir planen bereits weitere zuk\u00fcnftige Quests wie diese. Um die n\u00e4chsten noch besser zu machen, haben wir ein paar kurze Fragen f\u00fcr Sie.","invalid":"Bitte w\u00e4hlen Sie aus jeder der Fragen","q1":"BattCat hat mein Interesse am Reparieren gesteigert","q2":"BattCat hat mich dazu gebracht, mehr \u00fcber Elektroschrott nachzudenken","q3":"BattCat hat mein Denken \u00fcber den Kauf von Elektronik ver\u00e4ndert","q4":"BattCat hat meine Ansicht \u00fcber die Wichtigkeit von Reparaturen ver\u00e4ndert","send":"Senden","skip":"\u00fcberspringen"}},"de.dashboard":{"devices_logged":"devices logged","discussion_header":"Discussion Forum","getting_started_header":"Getting Started","join_group":"Join a group","visit_wiki":"Visit the wiki"},"de.device-audits":{"unavailable_audits":"No changes have been made to this device!","updated":{"metadata":"On :audit_created_at, :user_name updated record :audit_url<\/strong>","modified":{"age":"Age<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","brand":"Brand<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","category":"Category<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","category_creation":"Category Creation<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","do_it_yourself":"Do it yourself<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","estimate":"Estimate<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","event":"Event<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","model":"Model<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","more_time_needed":"More time needed<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","problem":"Problem<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","professional_help":"Professional Help<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","repair_status":"Repair Status<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","repaired_by":"Reparied by<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","spare_parts":"Spare Parts<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","wiki":"Wiki<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\""}}},"de.devices":{"age":"Age","age_approx":"years - approximate, if known","brand":"Brand","by_date":"By date","by_taxonomy":"By taxonomy","category":"Category","delete_device":"Delete device","devices":"Devices","devices_description":"Description of problem\/solution","event_info":"Event info","export_device_data":"Export device data","fixed":"Fixed","from_date":"From date","from_manufacturer":"From manufacturer","from_third_party":"From third party","graphic-camera":"Camera","graphic-comment":"Comment","group":"Group","model":"Model","repair":"Repair date","repair_details":"Next steps","repair_source":"Source of repair information","repair_status":"Repair status","repairable":"Repairable","required_impact":"kg - required for environmental impact calculation","to_date":"To date","useful_repair_urls":"URL of useful repair information used","useful_repair_urls_explanation":"Useful repair URL","useful_repair_urls_helper":"Enter URL here","weight":"Weight"},"de.dustupora":{"about":"Mehr Informationen","branding":{"powered_by":"Unter Verwendung von Daten aus:"},"info":{"body-s1-header":"Was ist DustUp?","body-s1-p1":"Wir wollen verstehen, wie Batterien und Akkus dazu beitragen, dass Ger\u00e4te versagen. Damit m\u00f6chten wir der Politik sagen, wie zuk\u00fcnftige Modelle leichter reparierbar gemacht werden k\u00f6nnen. Reparatur vermeidet Abfall und schont die Ressourcen unseres Planeten.","body-s1-p2":"Mit DustUp k\u00f6nnen Sie sich an unserer Untersuchung beteiligen. Wir haben Informationen zu \u00fcber 1000 defekten Ger\u00e4ten gesammelt und brauchen Ihre Hilfe, um diese zu kategorisieren.","body-s2-header":"Was muss ich tun?","body-s2-p1":"Lesen Sie einfach die Informationen \u00fcber das defekte Ger\u00e4t und w\u00e4hlen Sie die Problembeschreibung oder Handlungsempfehlung aus der Liste darunter. Wenn Sie sich nicht sicher sind, w\u00e4hlen Sie unten einfach \"Ich wei\u00df nicht\". Sobald Sie eine Option ausgew\u00e4hlt haben, zeigen wir Ihnen ein anderes Ger\u00e4t. Je mehr Ger\u00e4tefehler Sie kategorisieren k\u00f6nnen, desto mehr lernen wir! DustUp zeigt jedes Ger\u00e4t drei Personen, die helfen, die richtige Kategorie zu best\u00e4tigen.","body-s3-header":"Woher bekommt DustUp Daten \u00fcber defekte Ger\u00e4te?","body-s3-p1":"DustUp verwendet Informationen von der Open Repair Alliance<\/a>, die Daten \u00fcber kaputte Ger\u00e4te sammelt, die echte Menschen auf der ganzen Welt bei Reparaturveranstaltungen wie Repair Caf\u00e9s und Restart Partys zu reparieren versucht haben.","body-s4-header":"Noch Fragen?","body-s4-p1":"Erfahren Sie mehr, stellen Sie Fragen und geben Sie uns Ihr Feedback, in der DustUp-Diskussion<\/a>.","title":"Danke, dass Sie DustUp ausprobiert haben"},"status":{"brand":"Marke","items_0_opinions":"mit 0 Meinungen","items_1_opinion":"mit 1 Meinung","items_2_opinions":"mit 2 Meinungen","items_3_opinions":"mit 3 Meinungen","items_majority_opinions":"Artikel mit Mehrheitsmeinungen","items_opinions":"Artikel \/ meinungen","items_split_opinions":"Artikel mit geteilten Meinungen","number_of_records":"Anzahl der Eintr\u00e4ge","opinions":"Meinungen","problem":"Problem","progress":"vollst\u00e4ndig","status":"Status","task_completed":"Du hast alle Eintr\u00e4ge gesehen, danke","total":"Gesamt","winning_opinion":"Gewinnende meinung"},"survey":{"a1":"Starke Ablehnung","a2":"Ablehnung","a3":"Neutral","a4":"Zustimmung","a5":"Starke Zustimmung","footer":"Wenn Sie eine der beiden Tasten dr\u00fccken, gelangen Sie zur\u00fcck zu DustUp","header1":"Vielen Dank!","header2":"Wir planen bereits weitere zuk\u00fcnftige Quests wie diese. Um die n\u00e4chsten noch besser zu machen, haben wir ein paar kurze Fragen f\u00fcr Sie.","invalid":"Bitte w\u00e4hlen Sie aus jeder der Fragen","q1":"DustUp hat mein Interesse am Reparieren gesteigert","q2":"DustUp hat mich dazu gebracht, mehr \u00fcber Elektroschrott nachzudenken","q3":"DustUp hat mein Denken \u00fcber den Kauf von Elektronik ver\u00e4ndert","q4":"DustUp hat meine Ansicht \u00fcber die Wichtigkeit von Reparaturen ver\u00e4ndert","send":"Senden","skip":"\u00fcberspringen"},"task":{"brand":"Brand","did_you_know":"Wussten Sie schon?","fetch_another":"Ich wei\u00df es nicht, zeig eine andere Reparatur","go_with":"Geh mit","learn_more":"Mehr Informationen","problem":"Beschreibung des Problems","progress_subtitle":"Der Prozentsatz der Ger\u00e4te, die wir bisher klassifiziert haben","progress_title":"Unser Fortschritt","signpost_1":"Vacuum cleaners can be pretty pricey. If they break, they can be surprisingly hard to fix and end up as e-waste. If brands did more to make their vacuum cleaners easier to repair, we could save a lot of unnecessary waste.","signpost_2":"The European Union is planning to introduce new rules for vacuum cleaners that could require them to be easier to repair. Rules decided by the EU could also be used to influence laws in other places, including the UK.","signpost_3":"We want to tell policymakers why vacuum cleaners break and how they could be made easier to fix. Community repair groups around the world have been recording this information, and by trying DustUp, you are helping us analyse it. Thank you!","signpost_4":"Vielen Dank f\u00fcr Ihre Hilfe! Jeder Fehler, den Sie kategorisieren, macht diese Daten noch n\u00fctzlicher. Werden Sie doch auch Mitglied unserer Community<\/a>.","source":"Quelle","status":"Status","step1":"Lesen Sie die Informationen \u00fcber das defekte Ger\u00e4t.","step1-extra":"Ein Freiwilliger hat versucht, dieses Ger\u00e4t bei einer Reparaturveranstaltung zu reparieren und diese Beschreibung verfasst.","step2":"What caused this vacuum cleaner to fail?","step2-extra":"W\u00e4hlen Sie die Option, die am besten zu dem oben beschriebenen Problem passt.","strapline":"Lesen Sie einfach die Informationen \u00fcber das defekte Ger\u00e4t und w\u00e4hlen Sie die Art des beschriebenen Fehlers aus der Liste darunter aus.","subtitle":"Ein Freiwilliger hat versucht, dieses Ger\u00e4t bei einer Reparaturveranstaltung zu reparieren und diese Beschreibung verfasst.","suggestions":"Vorschl\u00e4ge","thankyou_guest":"Vielen Dank f\u00fcr Ihre Hilfe! Jeder Fehler, den Sie kategorisieren, macht diese Daten noch n\u00fctzlicher. Werden Sie doch auch Mitglied unserer Community<\/a>.","thankyou_user":"Vielen Dank an Sie! Bitte nehmen Sie an unserer Umfrage teil<\/a>","title":"DustUp: Akkuprobleme kategorisieren","translation":"\u00dcbersetzung"}},"de.event-audits":{"created":{"metadata":"On :audit_created_at, :user_name created record :audit_url<\/strong>","modified":{"end":"Event End Time<\/strong> set as \":new<\/strong>\"","event_date":"Event Date<\/strong> set as \":new<\/strong>\"","free_text":"Free Text<\/strong> set as \":new<\/strong>\"","group":"Event Group ID<\/strong> set as \":new<\/strong>\"","hours":"Event Hours<\/strong> set as \":new<\/strong>\"","idevents":"Event ID<\/strong> set as \":new<\/strong>\"","latitude":"Event Latitude<\/strong> set as \":new<\/strong>\"","location":"Event Location<\/strong> set as \":new<\/strong>\"","longitude":"Event Longitude<\/strong> set as \":new<\/strong>\"","pax":"pax<\/strong> set as \":new<\/strong>\"","start":"Event Start Time<\/strong> set as \":new<\/strong>\"","venue":"Event Name<\/strong> set as \":new<\/strong>\"","volunteers":"Quantity of Volunteers<\/strong> set as \":new<\/strong>\""}},"unavailable_audits":"No changes have been made to this event!","updated":{"metadata":"On :audit_created_at, :user_name updated record :audit_url<\/strong>","modified":{"end":"Event End Time<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","event_date":"Event Date<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","free_text":"Free Text<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","group":"Event Group ID<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","hours":"Event Hours<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","latitude":"Event Latitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","location":"Event Location<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","longitude":"Event Longitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","pax":"pax<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","start":"Event Start Time<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","venue":"Event Name<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","volunteers":"Quantity of Volunteers<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\""}}},"de.events":{"about_event_name_header":"About :event","add_event":"Add event","add_volunteer_modal_heading":"Add volunteer","all_invited_restarters_modal_description":"An overview of the Restarters invited to your event and their skills.","all_invited_restarters_modal_heading":"All invited Restarters","all_restarters_attended_modal_description":"An overview of who attended your event and their skills.","all_restarters_attended_modal_heading":"All Restarters attended","approve_event":"Approve Event","before_submit_text":"Once confirmed by our community lead, your event will be made public on The Restart Project homepage.","by_event":"By event","by_group":"By group","co2_equivalence_visualisation_dropdown":"CO2<\/sub> equivalence visualisation","create_event":"Create event","create_new_event":"Create new event","download-results":"Download Results (CSV)","edit_event":"Edit event","edit_event_content":"Go ahead and change or improve your event information.","embed_code_header":"Embed code","event":"Event","event_date":"Date","event_name":"Event","event_time":"Time","events":"Events","events_title_admin":"Events to moderate","field_add_image":"Add images","field_event_city":"City","field_event_country":"Country","field_event_county":"County\/State","field_event_date":"Date of event","field_event_desc":"Description","field_event_group":"Event group","field_event_images":"Add event images here","field_event_images_2":"Choose an image for your event","field_event_name":"Name of event","field_event_name_helper":"Please enter a neighbourhood or the name of the venue - please no 'Restart Party' or 'Repair Cafe'.","field_event_route":"Route","field_event_street_address":"Street address","field_event_time":"Start\/end time","field_event_venue":"Venue address","field_event_zip":"Post\/Zip code","field_venue_helper":"I.e. the place where the fixing happens!","full_name":"Full name","full_name_helper":"Leave field blank if anonymous","group_member":"Group member","headline_stats_dropdown":"Headline stats","headline_stats_message":"This widget shows the headline stats for your event e.g. the number of participants at your parties; the hours volunteered","infographic_message":"An infographic of an easy-to-understand equivalent of the CO2<\/sub> emissions that your group has prevented, such as equivalent number of cars manufactured","invite_restarters_modal_heading":"Invite volunteers to the event","manual_invite_box":"Send invites to","message_to_restarters":"Invitation message","message_volunteer_email_address":"This field will invite the volunteer to join the group","option_default":"-- Select --","option_not_registered":"Not registered on Fixometer","pending_rsvp_button":"I am attending","pending_rsvp_message":"You have an invite pending for this event","reporting":"Reporting","rsvp_button":"Sorry, I can no longer attend","rsvp_message":"Excellent! You are joining us at this event","sample_text_message_to_restarters":"","save_event":"Save Event","send_invite_button":"Send invites","send_invites_to_restarters_tickbox":"Add invites for group members. Members marked with a \u26a0 will be invited but won't be sent an email due to their notification settings.","share_stats_header":"Share your stats","share_stats_message":"Well done! On the :date at :event_name we were able to repair :number_devices devices<\/strong>. Help us spread the message by sharing your environmental impact on your website.","stat-0":"Participants","stat-2":"Restarters","stat-3":"Repairable devices","stat-4":"End-of-life devices","stat-5":"Fixed devices","stat-6":"CO2 emissions prevented","stat-7":"Waste prevented","table_restarter_column":"Restarter","table_skills_column":"Skills","type_email_addresses_message":"Note: you can also manually type in the email address of anyone else you would like to invite to this event. Press the tab, enter or comma key after each email address that you enter.","volunteer_attended_button":"Volunteer attended","volunteer_email_address":"Volunteer's email address (optional)","warning_volunteers_message":"Please note that the number of volunteers does not match the attendance record. Do you need to add or remove volunteers?"},"de.general":{"alert_uptodate":"Thanks! You are up to date","alert_uptodate_text":"You have nothing to action now. When you do, we'll let you know.","calendar_feed_help_url":"\/t\/fixometer-how-to-subscribe-to-a-calendar","email_alerts":"Emails & alerts","email_alerts_pref1":"I would like to receive The Restart Project monthly newsletter","email_alerts_pref2":"I would like to receive email notifications about events or groups near me","email_alerts_text":"Please choose what kind of email updates you would like to receive. You can change these at any time. Our Privacy Policy is available here<\/a>","faq_url":"https:\/\/therestartproject.org\/faq","filter-results":"Filter results","general":"General","help_feedback_url":"https:\/\/talk.restarters.net\/c\/help","introduction_message":"We are a global community of people who help others fix their electronics in community events. Join us!","login":"Login","logout":"Logout","menu_discourse":"Discussion","menu_faq":"FAQs","menu_help_feedback":"Help & Feedback","menu_other":"Other Links","menu_tools":"Community Tools","menu_wiki":"Wiki","new_group":"Create a new group","other_profile":"profile","party_reporting":"Event reporting","please_select":"Please select","profile":"Your profile","profile_content":"Please share some information about yourself, so you can connect with other organisers and fixers, and so we can understand the community better","repair_skills":"Skills","repair_skills_content":"This is optional but helps us improve your experience - which skills do you have and would like to share with others?","reporting":"Reporting","restartproject_url":"https:\/\/therestartproject.org","save_repair_skills":"Save skills","signmeup":"Sign me up!","therestartproject":"The Restart Project","time_reporting":"Volunteer hours","your_name":"Your name","your_name_validation":"Please enter your name","your_repair_skills":"Your skills"},"de.group-audits":{"unavailable_audits":"No changes have been made to this group!","updated":{"metadata":"On :audit_created_at, :user_name updated record :audit_url<\/strong>","modified":{"area":"Area<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","free_text":"Free Text<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","latitude":"Latitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","location":"Location<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","longitude":"Longitude<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","name":"Name<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\"","website":"Website<\/strong> was modified from \":old<\/strong>\" to \":new<\/strong>\""}}},"de.groups":{"about_group_name_header":"About :group","add_groups":"Add a group","add_groups_content":"Tell us more about your group, so we can create a page for you and help you publicise to potential volunteers and participants.","all_groups":"All groups","all_volunteers_group_name_header":"All volunteers of :group","all_volunteers_group_name_message":"Here's a list of all of the volunteers affiliated with your group and their skills.","approve_group":"Approve group","co2_equivalence_visualisation_dropdown":"CO2<\/sub> equivalence visualisation","create_group":"Create group","create_groups":"Create new group","edit_group":"Edit group","edit_group_save_changes":"Save changes","edit_group_text":"Go ahead and change or improve your group's profile.","email_addresses_field":"Email addresses","embed_code_header":"Embed code","group":"Group","group_admin_only":"Admin only","group_image":"Group image","group_tag":"Tag","group_tag2":"Group tag","group_tags":"Group tags","groups":"Groups","groups_about_group":"Tell us about your group","groups_approval_text":"Group submissions need to be approved by an administrator","groups_group_small":"A couple of examples include 'Restarters Torino' or 'Nottingham Fixers'","groups_location":"Location","groups_location_small":"I.e the place where the fixing happens!","groups_modal-button":"Yes, lets get started!","groups_modal_content":"We can help you get started, scheduling and announcing events, logging data and getting reports on their impact.","groups_modal_title":"Would you like to start a community repair group?","groups_name":"Name","groups_name_of":"Name of group","groups_title1":"Your groups","groups_title2":"Groups nearest to you","groups_website":"Your website","groups_website_small":"Don't have a website? Feel free to add a Facebook group or similar","headline_stats_dropdown":"Headline stats","headline_stats_message":"This widget shows the headline stats for your group e.g. the number of participants at your parties; the hours volunteered","infographic_message":"An infographic of an easy-to-understand equivalent of the CO2<\/sub> emissions that your group has prevented, such as equivalent number of cars manufactured.","join_group_button":"Join group","location":"Group location","message_example_text":"","message_header":"Invitation message","restarter_column_table":"Restarter","search_name":"Search name","send_invite_button":"Send invites","share_stats_header":"Share your stats","share_stats_message":":group have made a real impact fixing electronics and preventing waste. Help share this on your website and get other people involved:","skills_column_table":"Skills","tag-1":"Tag 1","tag-2":"Tag 2","tag-3":"Tag 3","tag-4":"Tag 4","tag-5":"Tag 5","tag-6":"Tag 6","tag-7":"Tag 7","tag-8":"Tag 8","type_email_addresses_message":"Type in the email addresses of the people you would like to invite to this group. Press the tab or comma key after each email address."},"de.login":{"login_title":"Sign in","more":"Find out more","stat_1":"Devices fixed","stat_2":"CO2<\/sub> emissions prevented","stat_3":"Waste prevented","stat_4":"Events held","whatis":"German Welcome to the Restarters community","whatis_content":"

This is a place to grow the community electronics repair movement. The world needs more fixing and more fixing skills to be shared.<\/p>

Join in if you would like to:<\/p>