Skip to content

Commit

Permalink
run lint(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Oct 30, 2023
1 parent 5687ce4 commit 26f4e3e
Show file tree
Hide file tree
Showing 415 changed files with 41,448 additions and 21,954 deletions.
6 changes: 6 additions & 0 deletions .bladeformatterrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"indentSize": 4,
"wrapLineLength": 250,
"endWithNewLine": true,
"useTabs": false
}
1 change: 1 addition & 0 deletions .bladeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/*
64 changes: 29 additions & 35 deletions app/Console/Commands/AddSiteSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;

use DB;
use Illuminate\Console\Command;

class AddSiteSettings extends Command
{
class AddSiteSettings extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -24,45 +22,17 @@ class AddSiteSettings extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

/**
* Add a site setting.
*
* Example usage:
* $this->addSiteSetting("site_setting_key", 1, "0: does nothing. 1: does something.");
*
* @param string $key
* @param int $value
* @param string $description
*/
private function addSiteSetting($key, $value, $description) {
if(!DB::table('site_settings')->where('key', $key)->exists()) {
DB::table('site_settings')->insert([
[
'key' => $key,
'value' => $value,
'description' => $description,
],
]);
$this->info( "Added: ".$key." / Default: ".$value);
}
else $this->line("Skipped: ".$key);
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
public function handle() {
$this->info('*********************');
$this->info('* ADD SITE SETTINGS *');
$this->info('*********************'."\n");
Expand Down Expand Up @@ -96,12 +66,36 @@ public function handle()
$this->addSiteSetting('admin_user', 1, 'ID of the site\'s admin user.');

$this->addSiteSetting('gallery_submissions_open', 1, '0: Gallery submissions closed, 1: Gallery submissions open.');

$this->addSiteSetting('gallery_rewards_divided', 1, '0: Gallery criteria rewards will be rewarded to each collaborator, 1: Gallery criteria rewards will be divided between collaborators.');

$this->addSiteSetting('gallery_submissions_require_approval', 1, '0: Gallery submissions do not require approval, 1: Gallery submissions require approval.');

$this->line("\nSite settings up to date!");
}

/**
* Add a site setting.
*
* Example usage:
* $this->addSiteSetting("site_setting_key", 1, "0: does nothing. 1: does something.");
*
* @param string $key
* @param int $value
* @param string $description
*/
private function addSiteSetting($key, $value, $description) {
if (!DB::table('site_settings')->where('key', $key)->exists()) {
DB::table('site_settings')->insert([
[
'key' => $key,
'value' => $value,
'description' => $description,
],
]);
$this->info('Added: '.$key.' / Default: '.$value);
} else {
$this->line('Skipped: '.$key);
}
}
}
37 changes: 16 additions & 21 deletions app/Console/Commands/AddTextPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Carbon\Carbon;
use Config;
use DB;
use Carbon\Carbon;
use Illuminate\Console\Command;

class AddTextPages extends Command
{
class AddTextPages extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -25,11 +24,8 @@ class AddTextPages extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -38,34 +34,33 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
$pages = Config::get('lorekeeper.text_pages');


$this->info('******************');
$this->info('* ADD SITE PAGES *');
$this->info('******************'."\n");

$this->line("Adding site pages...existing entries will be skipped.\n");

foreach($pages as $key => $page) {
if(!DB::table('site_pages')->where('key', $key)->exists()) {
foreach ($pages as $key => $page) {
if (!DB::table('site_pages')->where('key', $key)->exists()) {
DB::table('site_pages')->insert([
[
'key' => $key,
'title' => $page['title'],
'text' => $page['text'],
'key' => $key,
'title' => $page['title'],
'text' => $page['text'],
'parsed_text' => $page['text'],
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],

]);
$this->info("Added: ".$page['title']);
$this->info('Added: '.$page['title']);
} else {
$this->line('Skipped: '.$page['title']);
}
else $this->line("Skipped: ".$page['title']);
}
}
}
13 changes: 4 additions & 9 deletions app/Console/Commands/CheckNews.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Services\NewsService;
use Illuminate\Console\Command;

class CheckNews extends Command
{
class CheckNews extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -23,11 +22,8 @@ class CheckNews extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -36,8 +32,7 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
(new NewsService)->updateQueue();
}
Expand Down
13 changes: 4 additions & 9 deletions app/Console/Commands/CheckSales.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Services\SalesService;
use Illuminate\Console\Command;

class CheckSales extends Command
{
class CheckSales extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -23,11 +22,8 @@ class CheckSales extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -36,8 +32,7 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
(new SalesService)->updateQueue();
}
Expand Down
17 changes: 5 additions & 12 deletions app/Console/Commands/ClearDeletedCharacterAttachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;

use DB;

use App\Models\Character\Character;
use App\Models\Character\CharacterCurrency;
use App\Models\Character\CharacterFeature;
use App\Models\Character\CharacterImage;
use DB;
use Illuminate\Console\Command;

class ClearDeletedCharacterAttachments extends Command
{
class ClearDeletedCharacterAttachments extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -29,11 +26,8 @@ class ClearDeletedCharacterAttachments extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -42,8 +36,7 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
// Get deleted character IDs
$deletedCharacterIds = DB::table('characters')->whereNotNull('deleted_at')->pluck('id');

Expand Down
22 changes: 8 additions & 14 deletions app/Console/Commands/CopyDefaultImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
use Config;
use Illuminate\Console\Command;

class CopyDefaultImages extends Command
{
class CopyDefaultImages extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -23,11 +22,8 @@ class CopyDefaultImages extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -36,22 +32,20 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
$this->info('***********************');
$this->info('* COPY DEFAULT IMAGES *');
$this->info('***********************'."\n");

$images = Config::get('lorekeeper.image_files');

$sourceDir = base_path() . '/data/images/';
$destDir = public_path() . '/images/';
$sourceDir = base_path().'/data/images/';
$destDir = public_path().'/images/';

foreach($images as $image)
{
$this->line("Copying image: ".$image['filename'] . "\n");
copy($sourceDir . $image['filename'], $destDir . $image['filename']);
foreach ($images as $image) {
$this->line('Copying image: '.$image['filename']."\n");
copy($sourceDir.$image['filename'], $destDir.$image['filename']);
}
$this->line('Done!');
}
Expand Down
13 changes: 4 additions & 9 deletions app/Console/Commands/FixCharItemNotifs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Services\ExtensionService;
use Illuminate\Console\Command;

class FixCharItemNotifs extends Command
{
class FixCharItemNotifs extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -23,11 +22,8 @@ class FixCharItemNotifs extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -36,8 +32,7 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
(new ExtensionService)->updateNotifications(39, 501);
(new ExtensionService)->updateNotifications(40, 502);
Expand Down
Loading

0 comments on commit 26f4e3e

Please sign in to comment.