diff --git a/app/Console/Commands/CardExport.php b/app/Console/Commands/CardExport.php index 5310f68..643e7e9 100644 --- a/app/Console/Commands/CardExport.php +++ b/app/Console/Commands/CardExport.php @@ -34,7 +34,7 @@ class CardExport extends Command public function handle() { $data = collect(); - foreach(Card::with(['character', 'raid'])->get() as $card) { + foreach (Card::with(['character', 'raid'])->get() as $card) { $row = collect([ 'message' => $card->body, diff --git a/app/Console/Commands/CardImport.php b/app/Console/Commands/CardImport.php index 4ccd277..b8d59f9 100644 --- a/app/Console/Commands/CardImport.php +++ b/app/Console/Commands/CardImport.php @@ -39,12 +39,12 @@ class CardImport extends Command try { $json = json_decode($data, false, 8, JSON_THROW_ON_ERROR); - } catch(\JsonException $ex) { + } catch (\JsonException $ex) { $this->error("Json: " . $ex->getMessage()); return; } - foreach($json as $item) { + foreach ($json as $item) { $data = [ 'body' => $item->message, diff --git a/app/Console/Commands/InstallLogo.php b/app/Console/Commands/InstallLogo.php index 92c0bd6..a09e133 100644 --- a/app/Console/Commands/InstallLogo.php +++ b/app/Console/Commands/InstallLogo.php @@ -34,4 +34,4 @@ class InstallLogo extends Command Storage::disk('resources')->copy('logos/' . $filename, 'images/logo.png'); } -} \ No newline at end of file +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 51b3721..d0c68e7 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -28,7 +28,7 @@ class Kernel extends ConsoleKernel protected function schedule(Schedule $schedule) { // Prune old game settings. - $schedule->command('model:prune', [ '--model' => [ \App\Models\Setting::class ] ]) + $schedule->command('model:prune', ['--model' => [\App\Models\Setting::class]]) ->description("Prune expired settings") ->twiceDaily(2, 8); } @@ -40,7 +40,7 @@ class Kernel extends ConsoleKernel */ protected function commands() { - $this->load(__DIR__.'/Commands'); + $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } diff --git a/app/Game/GameBoard.php b/app/Game/GameBoard.php index 57abdad..4ae58f1 100644 --- a/app/Game/GameBoard.php +++ b/app/Game/GameBoard.php @@ -39,7 +39,7 @@ class GameBoard /** * Return the state */ - public function getState() : GameBoardState + public function getState(): GameBoardState { return $this->state; } @@ -47,7 +47,7 @@ class GameBoard /** * Get the size of the board. */ - public function getSize() : int + public function getSize(): int { return $this->state->getSize(); } @@ -55,7 +55,7 @@ class GameBoard /** * Clear the game board. */ - public function clear() : void + public function clear(): void { $this->state->clear(); } @@ -64,7 +64,7 @@ class GameBoard * Check if the board is in an ended state. * E.g: all cards is in a winning state. */ - public function hasGameEnded() : bool + public function hasGameEnded(): bool { return $this->state->isFull(GameBoardState::STATE_WIN); } @@ -74,7 +74,7 @@ class GameBoard * * @throw NotEnoughCardsException */ - public function regenerate(GameSettings $settings) : self + public function regenerate(GameSettings $settings): self { $num_cards = $this->getSize(); $cards = Card::getBySettings($settings, $num_cards); diff --git a/app/Game/GameBoardState.php b/app/Game/GameBoardState.php index 8ea69af..427cc57 100644 --- a/app/Game/GameBoardState.php +++ b/app/Game/GameBoardState.php @@ -42,7 +42,7 @@ class GameBoardState /** * Set the state of a cell. */ - public function set(int $pos, bool $pressed = true) : self + public function set(int $pos, bool $pressed = true): self { if ($this->hasGameEnded()) { return $this; @@ -62,7 +62,7 @@ class GameBoardState /** * Toggle pressed state of a cell. */ - public function toggle(int $pos) : self + public function toggle(int $pos): self { return $this->set($pos, !$this->isPressed($pos)); } @@ -70,7 +70,7 @@ class GameBoardState /** * Check if a cell is pressed or not. */ - public function isPressed(int $pos) : bool + public function isPressed(int $pos): bool { return isset($this->state[$pos]); } @@ -78,7 +78,7 @@ class GameBoardState /** * Check if a cell is part of a winning row/column. */ - public function isWin(int $pos) : bool + public function isWin(int $pos): bool { return isset($this->state[$pos]) && $this->state[$pos] == self::STATE_WIN; } @@ -86,7 +86,7 @@ class GameBoardState /** * Get the sate of the cells. */ - public function getState() : array + public function getState(): array { return $this->state; } @@ -94,7 +94,7 @@ class GameBoardState /** * Get the size of the board. */ - public function getSize() : int + public function getSize(): int { return $this->width * $this->height; } @@ -102,7 +102,7 @@ class GameBoardState /** * Clear the board. */ - public function clear() : self + public function clear(): self { $this->state = []; $this->winning = 0; @@ -110,7 +110,7 @@ class GameBoardState } // TODO: Rename - public function getNumWinRows() : int + public function getNumWinRows(): int { return $this->winning; } @@ -118,13 +118,13 @@ class GameBoardState /** * Check if the board only has winning cards */ - public function hasGameEnded() : bool + public function hasGameEnded(): bool { if (count($this->state) < $this->width * $this->height) { return false; } - foreach($this->state as $pos) { + foreach ($this->state as $pos) { if ($pos !== self::STATE_WIN) { return false; } @@ -135,14 +135,14 @@ class GameBoardState /** * Check if the board is full and all positions is in a given state. */ - public function isFull($state) : bool + public function isFull($state): bool { // Board not filled, impossible to have all positions set. if (count($this->state) < $this->width * $this->height) { return false; } - foreach($this->state as $pos) { + foreach ($this->state as $pos) { if ($pos !== $state) { return false; } @@ -153,15 +153,15 @@ class GameBoardState /** * */ - protected function update() : void + protected function update(): void { - foreach($this->state as $pos => $_) { + foreach ($this->state as $pos => $_) { $this->state[$pos] = self::STATE_PRESSED; } $patterns = $this->checkWinningState(); - foreach($patterns as $cards) { - foreach($cards as $pos) { + foreach ($patterns as $cards) { + foreach ($cards as $pos) { $this->state[$pos] = self::STATE_WIN; } } @@ -171,12 +171,12 @@ class GameBoardState /** * Check if the board is in a winning state. */ - protected function checkWinningState() : array + protected function checkWinningState(): array { $win = []; // Rows - for($y=0; $y < $this->height; $y++) { + for ($y = 0; $y < $this->height; $y++) { $c = $this->checkRow($y); if (count($c)) { $win[] = $c; @@ -184,7 +184,7 @@ class GameBoardState } // Columns - for($x=0; $x < $this->width; $x++) { + for ($x = 0; $x < $this->width; $x++) { $c = $this->checkCol($x); if (count($c)) { $win[] = $c; @@ -197,12 +197,12 @@ class GameBoardState /** * Check if a row is in a winning state (all cells pressed) */ - protected function checkRow($y) : array + protected function checkRow($y): array { $cards = []; $y = $y * $this->width; - for($x = 0; $x < $this->width; $x++) { + for ($x = 0; $x < $this->width; $x++) { $pos = $x + $y; if (!$this->isPressed($pos)) { return []; @@ -216,11 +216,11 @@ class GameBoardState /** * Check if a column is in a winning state (all cells pressed) */ - protected function checkCol($x) : array + protected function checkCol($x): array { $cards = []; - for($y = 0; $y < $this->height; $y++) { + for ($y = 0; $y < $this->height; $y++) { $pos = $x + ($y * $this->width); if (!$this->isPressed($pos)) { return []; diff --git a/app/Game/GameService.php b/app/Game/GameService.php index 06f3a53..9b4682d 100644 --- a/app/Game/GameService.php +++ b/app/Game/GameService.php @@ -20,7 +20,7 @@ class GameService /** * Get the current session */ - public function session() : GameSession + public function session(): GameSession { return $this->session; } @@ -28,7 +28,7 @@ class GameService /** * Generate a new Game session */ - public function newSession(?GameSettings $settings = null) : self + public function newSession(?GameSettings $settings = null): self { if (!$settings) { $settings = $this->session()->getSettings(); diff --git a/app/Game/GameSession.php b/app/Game/GameSession.php index 33d2683..675a999 100644 --- a/app/Game/GameSession.php +++ b/app/Game/GameSession.php @@ -28,7 +28,7 @@ class GameSession /** * Get the board */ - public function getBoard() : GameBoard + public function getBoard(): GameBoard { return $this->board; } @@ -36,7 +36,7 @@ class GameSession /** * Get the board state */ - public function getBoardState() : GameBoardState + public function getBoardState(): GameBoardState { return $this->getBoard()->getState(); } @@ -44,7 +44,7 @@ class GameSession /** * Get Cards */ - public function getCards() : Collection + public function getCards(): Collection { return $this->getBoard()->getCards(); } @@ -52,7 +52,7 @@ class GameSession /** * Get Settings */ - public function getSettings() : GameSettings + public function getSettings(): GameSettings { return $this->settings; } @@ -60,7 +60,7 @@ class GameSession /** * Set new settings */ - public function setSettings(GameSettings $settings) : self + public function setSettings(GameSettings $settings): self { $this->settings = $settings; return $this; diff --git a/app/Game/GameSettings.php b/app/Game/GameSettings.php index deb9577..8d12ad4 100644 --- a/app/Game/GameSettings.php +++ b/app/Game/GameSettings.php @@ -44,7 +44,7 @@ class GameSettings } } - public function toArray() : array + public function toArray(): array { return [ 'classes' => $this->classes->toArray(), @@ -54,7 +54,7 @@ class GameSettings ]; } - public function all() : Collection + public function all(): Collection { return collect([ 'classes' => $this->classes->all()->toArray(), diff --git a/app/Http/Controllers/Admin/CardController.php b/app/Http/Controllers/Admin/CardController.php index 05a08c5..110d3f9 100644 --- a/app/Http/Controllers/Admin/CardController.php +++ b/app/Http/Controllers/Admin/CardController.php @@ -7,7 +7,7 @@ use App\Http\Livewire\Form\CardForm; class CardController extends BaseController { - protected $_datatable = [ + protected $_datatable = [ 'model' => Card::class, 'default_sort' => 'id', 'route_create' => 'admin.card.create', @@ -16,21 +16,21 @@ class CardController extends BaseController 'restore_enabled' => true, 'columns' => [ 'id' => '#', - 'body' => 'Body', - 'subject' => 'Subject', - 'subject_type' => 'Subject Type', + 'body' => 'Body', + 'subject' => 'Subject', + 'subject_type' => 'Subject Type', 'raid.name' => 'Raid', ], 'sort_columns' => [ 'id' => 'id', - 'body' => 'body', + 'body' => 'body', 'subject' => ['character.name', 'class', 'role'], 'raid.name' => 'raid.name', ] ]; - static public function getForm() : string - { - return CardForm::class; - } + static public function getForm(): string + { + return CardForm::class; + } } diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 2b0ae3f..0bc5374 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -9,13 +9,13 @@ use App\Http\Controllers\Controller; class AuthController extends Controller { - /** + /** * Show login page */ - public function create() - { - return view('auth.login'); - } + public function create() + { + return view('auth.login'); + } /** * Destroy an authenticated session. diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index b702cbb..8f3e0c5 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -31,18 +31,18 @@ class Kernel extends HttpKernel protected $middlewareGroups = [ 'web' => [ \Illuminate\Routing\Middleware\SubstituteBindings::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, ] ]; - /** - * The application's route middleware. - * - * These middleware may be assigned to groups or used individually. - * - * @var array - */ - protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class - ]; + /** + * The application's route middleware. + * + * These middleware may be assigned to groups or used individually. + * + * @var array + */ + protected $routeMiddleware = [ + 'auth' => \App\Http\Middleware\Authenticate::class + ]; } diff --git a/app/Http/Livewire/AlertContainer.php b/app/Http/Livewire/AlertContainer.php index 310aeb2..ee472f5 100644 --- a/app/Http/Livewire/AlertContainer.php +++ b/app/Http/Livewire/AlertContainer.php @@ -7,45 +7,45 @@ use Livewire\Component; class AlertContainer extends Component { - /** - * List of alert types. - */ - protected array $_types = [ - 'info', - 'success', - 'warning', - 'danger' - ]; + /** + * List of alert types. + */ + protected array $_types = [ + 'info', + 'success', + 'warning', + 'danger' + ]; - /** - * Event listeners - */ - protected $listeners = [ - // Add message when "alert" event is fired. - 'alert' => 'addMessage' - ]; + /** + * Event listeners + */ + protected $listeners = [ + // Add message when "alert" event is fired. + 'alert' => 'addMessage' + ]; - /** - * Alert messages. - */ - public array $messages = []; + /** + * Alert messages. + */ + public array $messages = []; public function mount() { - // Load messages from session - foreach($this->_types as $type) { - if (Session::has($type)) { - $this->addMessage($type, Session::get($type)); - } - } + // Load messages from session + foreach ($this->_types as $type) { + if (Session::has($type)) { + $this->addMessage($type, Session::get($type)); + } + } } - /** - * Add a message to the container. - */ - public function addMessage(string $type, string $message) + /** + * Add a message to the container. + */ + public function addMessage(string $type, string $message) { - $this->messages[] = [ $type, $message ]; + $this->messages[] = [$type, $message]; } /** diff --git a/app/Http/Livewire/Datatable.php b/app/Http/Livewire/Datatable.php index 8ad8851..df2fd3b 100644 --- a/app/Http/Livewire/Datatable.php +++ b/app/Http/Livewire/Datatable.php @@ -5,197 +5,202 @@ namespace App\Http\Livewire; use Livewire\Component; use Livewire\WithPagination; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Str; class Datatable extends Component { - use WithPagination, Traits\WithSort, Traits\Alert; + use WithPagination, Traits\WithSort, Traits\Alert; - /** - * Query string settings. - */ - protected $queryString = [ - 'sort' => ['except' => 'id'], - 'dir' => ['except' => 'asc'], - 'page' => ['except' => 1], - 'trashed' => ['except' => false] - ]; + /** + * Query string settings. + */ + protected $queryString = [ + 'sort' => ['except' => 'id'], + 'dir' => ['except' => 'asc'], + 'page' => ['except' => 1], + 'trashed' => ['except' => false] + ]; - /** - * Model to get data from. - */ - public $model; + /** + * Model to get data from. + */ + public $model; - /** - * Array of columns to show - */ - public array $columns; + /** + * Array of columns to show + */ + public array $columns; - /** - * What colums are sortable - */ - public array $sort_columns; + /** + * What colums are sortable + */ + public array $sort_columns; - /** - * Default sorting column - */ - public string $default_sort; + /** + * Default sorting column + */ + public string $default_sort; - /** - * If only trashed records should be shown. - */ - public bool $trashed = false; + /** + * If only trashed records should be shown. + */ + public bool $trashed = false; - /** - * Route for creating a record (if null, link is omitted) - */ - public $route_create; + /** + * Route for creating a record (if null, link is omitted) + */ + public $route_create; - /** - * Route for editing a record (if null, link is omitted) - */ - public $route_edit; + /** + * Route for editing a record (if null, link is omitted) + */ + public $route_edit; - /** - * True if delete functionality is enabled. - */ - public $delete_enabled; + /** + * True if delete functionality is enabled. + */ + public $delete_enabled; - /** - * True if restore functionality is enabled. - */ - public $restore_enabled; + /** + * True if restore functionality is enabled. + */ + public $restore_enabled; - /** - * How many records should be displayed on one page. - */ - public int $itemsPerPage = 30; + /** + * How many records should be displayed on one page. + */ + public int $itemsPerPage = 30; - public function mount(string $model, array $columns, - array $sort_columns = [], $default_sort = '', - $route_create = null, $route_edit = null, $delete_enabled = false, $restore_enabled = false) - { - $this->model = app()->make($model); - $this->default_sort = $default_sort; - $this->sort = $this->default_sort; - $this->sort_columns = $sort_columns; - $this->route_create = $route_create; - $this->route_edit = $route_edit; - $this->delete_enabled = (bool) $delete_enabled; - $this->restore_enabled = (bool) $restore_enabled; + public function mount( + string $model, + array $columns, + array $sort_columns = [], + $default_sort = '', + $route_create = null, + $route_edit = null, + $delete_enabled = false, + $restore_enabled = false + ) { + $this->model = app()->make($model); + $this->default_sort = $default_sort; + $this->columns = $columns; + $this->sort = $this->default_sort; + $this->sort_columns = $sort_columns; + $this->route_create = $route_create; + $this->route_edit = $route_edit; + $this->delete_enabled = (bool) $delete_enabled; + $this->restore_enabled = (bool) $restore_enabled; - $this->setTrashed(false); + $this->setTrashed(false); } - /** - * Get the model name. - */ - public function getModelName() : string - { - return class_basename($this->model); - } + /** + * Get the model name. + */ + public function getModelName(): string + { + return class_basename($this->model); + } - /** - * Set trashed flag. - */ - public function setTrashed($value) - { - $this->trashed = (bool) $value; + /** + * Set trashed flag. + */ + public function setTrashed($value) + { + $this->trashed = (bool) $value; - if ($this->trashed) { - // Add deleted_at columns. - $this->columns['deleted_at'] = 'Deleted at'; - $this->sort_columns['deleted_at'] = 'deleted_at'; - } else { - // Unset deleted_at columns. - unset($this->columns['deleted_at']); - unset($this->sort_columns['deleted_at']); + if ($this->trashed) { + // Add deleted_at columns. + $this->columns['deleted_at'] = 'Deleted at'; + $this->sort_columns['deleted_at'] = 'deleted_at'; + } else { + // Unset deleted_at columns. + unset($this->columns['deleted_at']); + unset($this->sort_columns['deleted_at']); - // if delete_at was the sorting column - // revert back to default sorting. - if ($this->sort == 'deleted_at') { - $this->sort = $this->default_sort; - } - } - } + // if delete_at was the sorting column + // revert back to default sorting. + if ($this->sort == 'deleted_at') { + $this->sort = $this->default_sort; + } + } + } - /** - * Toggle trashed flag - */ - public function toggleTrashed() - { - $this->setTrashed(!$this->trashed); - } + /** + * Toggle trashed flag + */ + public function toggleTrashed() + { + $this->setTrashed(!$this->trashed); + } - /** - * Delete an record - */ - public function delete($id) - { - if (!$this->delete_enabled) { - return; - } + /** + * Delete an record + */ + public function delete($id) + { + if (!$this->delete_enabled) { + return; + } - $record = $this->model->find($id); + $record = $this->model->find($id); - if (!$record) { - $this->danger('Record not found'); - return; - } + if (!$record) { + $this->danger('Record not found'); + return; + } - $record->delete(); + $record->delete(); - $this->info(__($this->getModelName() . " #:id was deleted.", [ 'id' => $record->id ])); - } + $this->info(__($this->getModelName() . " #:id was deleted.", ['id' => $record->id])); + } - /** - * Restore a delted record - */ - public function restore($id) - { - if (!$this->restore_enabled) { - return; - } + /** + * Restore a delted record + */ + public function restore($id) + { + if (!$this->restore_enabled) { + return; + } - $record = $this->model->withTrashed()->find($id); + $record = $this->model->withTrashed()->find($id); - if (!$record) { - $this->danger('Record not found'); - return; - } + if (!$record) { + $this->danger('Record not found'); + return; + } - $record->restore(); + $record->restore(); - $this->info(__($this->getModelName() . " #:id was restored.", [ 'id' => $record->id ])); - } + $this->info(__($this->getModelName() . " #:id was restored.", ['id' => $record->id])); + } /** * Render the datatable */ public function render() { - $query = $this->model->query(); + $query = $this->model->query(); - // Only include trashed if asked to. - if ($this->trashed) { - $query->onlyTrashed(); - } + // Only include trashed if asked to. + if ($this->trashed) { + $query->onlyTrashed(); + } - // Check colums for "dot-notated" strings. - // as we want to eager load those relationships - foreach ($this->columns as $col => $_) { - $p = strrpos($col, '.'); - if ($p !== false) { - $rel = substr($col, 0, $p); - $query->with($rel); - } - } + // Check colums for "dot-notated" strings. + // as we want to eager load those relationships + foreach ($this->columns as $col => $_) { + $p = strrpos($col, '.'); + if ($p !== false) { + $rel = substr($col, 0, $p); + $query->with($rel); + } + } - // Apply sorting. - $this->sortApply($query); + // Apply sorting. + $this->sortApply($query); - $items = $query->paginate($this->itemsPerPage); + $items = $query->paginate($this->itemsPerPage); return view('livewire.datatable', ['items' => $items]); } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 704089a..de3dbd4 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -14,7 +14,7 @@ class Authenticate extends Middleware */ protected function redirectTo($request) { - if (! $request->expectsJson()) { + if (!$request->expectsJson()) { return route('login'); } } diff --git a/app/Models/Card.php b/app/Models/Card.php index b76f706..5b3028d 100644 --- a/app/Models/Card.php +++ b/app/Models/Card.php @@ -59,7 +59,7 @@ class Card extends Model return "Somebody"; } - /** + /** * Who, Where or What this card belongs to. */ public function getSubjectTypeAttribute() @@ -91,7 +91,7 @@ class Card extends Model ->inRandomOrder(); // Run through all settings and apply filter. - foreach($settings->all() as $type => $values) { + foreach ($settings->all() as $type => $values) { $column = $type_map[$type]; diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 66f528c..fed0ae0 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -29,14 +29,14 @@ class Setting extends Model ]; /** - * Get the prunable model query. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function prunable() - { - return static::where('created_at', '<', now()->subDay(1)); - } + * Get the prunable model query. + * + * @return \Illuminate\Database\Eloquent\Builder + */ + public function prunable() + { + return static::where('created_at', '<', now()->subDay(1)); + } public function getHashAttribute() { diff --git a/app/Models/Wow.php b/app/Models/Wow.php index e06ca15..8c37766 100644 --- a/app/Models/Wow.php +++ b/app/Models/Wow.php @@ -4,19 +4,19 @@ namespace App\Models; class Wow { - /** - * Enum for classes. - */ - static public $classes = [ - 'warrior' => 'Warrior', - 'rogue' => 'Rogue', - 'paladin' => 'Paladin', - 'hunter' => 'Hunter', - 'mage' => 'Mage', - 'warlock' => 'Warlock', - 'shaman' => 'Shaman', - 'druid' => 'Druid', - 'priest' => 'Priest', - 'dk' => 'Death Knight' - ]; + /** + * Enum for classes. + */ + static public $classes = [ + 'warrior' => 'Warrior', + 'rogue' => 'Rogue', + 'paladin' => 'Paladin', + 'hunter' => 'Hunter', + 'mage' => 'Mage', + 'warlock' => 'Warlock', + 'shaman' => 'Shaman', + 'druid' => 'Druid', + 'priest' => 'Priest', + 'dk' => 'Death Knight' + ]; } diff --git a/app/Providers/GameServiceProvider.php b/app/Providers/GameServiceProvider.php index ece6e5b..ba6e6c4 100644 --- a/app/Providers/GameServiceProvider.php +++ b/app/Providers/GameServiceProvider.php @@ -2,7 +2,6 @@ namespace App\Providers; -use App\Game\GameBuilder; use App\Game\GameBoardState; use App\Game\GameService; use App\Game\GameSession; @@ -20,7 +19,7 @@ class GameServiceProvider extends ServiceProvider implements DeferrableProvider */ public function register() { - $this->app->bind(GameBoardState::class, function($app) { + $this->app->bind(GameBoardState::class, function ($app) { $width = (int) config('app.game.board.width', 4); $height = (int) config('app.game.board.height', 4); return new GameBoardState($width, $height); @@ -50,6 +49,6 @@ class GameServiceProvider extends ServiceProvider implements DeferrableProvider */ public function provides() { - return [ 'game', GameService::class, GameBoardState::class ]; + return ['game', GameService::class, GameBoardState::class]; } } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 3743712..81365fb 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -4,10 +4,7 @@ namespace App\Providers; use App\Models\Setting; -use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; -use Illuminate\Http\Request; -use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider diff --git a/app/Support/Set.php b/app/Support/Set.php index f1f1351..63be8ec 100644 --- a/app/Support/Set.php +++ b/app/Support/Set.php @@ -13,12 +13,12 @@ class Set implements \Countable public function __construct($items = []) { - foreach($items as $k => $v) { + foreach ($items as $k => $v) { $this->set($k, $v); } } - public function set($key, bool $value = true) : self + public function set($key, bool $value = true): self { if ($value) { $this->items[$key] = true; @@ -29,40 +29,40 @@ class Set implements \Countable return $this; } - public function fill($array) : self + public function fill($array): self { $this->clear(); - foreach($array as $k => $v) { + foreach ($array as $k => $v) { $this->set($k, $v); } return $this; } - public function has($key) : bool + public function has($key): bool { return isset($this->items[$key]); } - public function toggle($key) : self + public function toggle($key): self { $this->set($key, !$this->has($key)); return $this; } - public function clear() : self + public function clear(): self { $this->items = []; return $this; } - public function all() : Collection + public function all(): Collection { return collect($this->items)->keys(); } - public function count() : int + public function count(): int { return count($this->items); } diff --git a/app/View/Components/CardText.php b/app/View/Components/CardText.php index 7c28d52..fbc1e78 100644 --- a/app/View/Components/CardText.php +++ b/app/View/Components/CardText.php @@ -10,7 +10,7 @@ class CardText extends Component { protected Card $card; - protected string $subject; + protected string $subject; /** * Create a new component instance. @@ -20,7 +20,7 @@ class CardText extends Component public function __construct(Card $card, $subject = '') { $this->card = $card; - $this->subject = strlen($subject) ? $subject : $card->subject; + $this->subject = strlen($subject) ? $subject : $card->subject; } /** @@ -34,9 +34,10 @@ class CardText extends Component // Replace non escaped '?' with subject and also Unescape escaped '?' $text = preg_replace( - ['/(?$subject", '?'], - $this->card->body); + $this->card->body + ); return $text; } diff --git a/artisan b/artisan index 67a3329..0a11434 100644 --- a/artisan +++ b/artisan @@ -15,9 +15,9 @@ define('LARAVEL_START', microtime(true)); | */ -require __DIR__.'/vendor/autoload.php'; +require __DIR__ . '/vendor/autoload.php'; -$app = require_once __DIR__.'/bootstrap/app.php'; +$app = require_once __DIR__ . '/bootstrap/app.php'; /* |-------------------------------------------------------------------------- diff --git a/config/cache.php b/config/cache.php index 8108dcf..5f9d0c0 100644 --- a/config/cache.php +++ b/config/cache.php @@ -105,6 +105,6 @@ return [ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'Bingo'), '_').'_cache'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'Bingo'), '_') . '_cache'), ]; diff --git a/config/database.php b/config/database.php index b42d9b3..3bfc47a 100644 --- a/config/database.php +++ b/config/database.php @@ -123,7 +123,7 @@ return [ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), ], 'default' => [ diff --git a/config/filesystems.php b/config/filesystems.php index 5e2af68..820621d 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -43,7 +43,7 @@ return [ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', ], diff --git a/config/ignite.php b/config/ignite.php index eda9bd2..aab1f23 100644 --- a/config/ignite.php +++ b/config/ignite.php @@ -2,8 +2,8 @@ return [ - 'select' => [ - 'icon' => 'heroicon-s-chevron-down', - ] + 'select' => [ + 'icon' => 'heroicon-s-chevron-down', + ] ]; diff --git a/config/sanctum.php b/config/sanctum.php index 442726a..3c92b7a 100644 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -16,7 +16,7 @@ return [ 'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( '%s%s', 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', - env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : '' + env('APP_URL') ? ',' . parse_url(env('APP_URL'), PHP_URL_HOST) : '' ))), /* diff --git a/config/session.php b/config/session.php index 621f133..6116bbc 100644 --- a/config/session.php +++ b/config/session.php @@ -128,7 +128,7 @@ return [ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'bingo'), '_').'_session' + Str::slug(env('APP_NAME', 'bingo'), '_') . '_session' ), /* diff --git a/config/trustedproxy.php b/config/trustedproxy.php index b788f14..accf93c 100644 --- a/config/trustedproxy.php +++ b/config/trustedproxy.php @@ -2,4 +2,4 @@ return [ 'proxies' => env('HTTP_TRUSTED_PROXIES', []), -]; \ No newline at end of file +]; diff --git a/database/seeders/TBCRaidSeeder.php b/database/seeders/TBCRaidSeeder.php index 924e5d6..e4be7c8 100644 --- a/database/seeders/TBCRaidSeeder.php +++ b/database/seeders/TBCRaidSeeder.php @@ -14,10 +14,10 @@ class TBCRaidSeeder extends Seeder */ public function run() { - $raids = [ 'Karazhan', 'Grul\'s Lair', 'Magtheridon', 'SSC', 'TK' ]; + $raids = ['Karazhan', 'Grul\'s Lair', 'Magtheridon', 'SSC', 'TK']; - foreach($raids as $name) { - Raid::insert(['name' => $name ]); + foreach ($raids as $name) { + Raid::insert(['name' => $name]); } } } diff --git a/database/seeders/WrathRaidSeeder.php b/database/seeders/WrathRaidSeeder.php index dc16f17..66a5184 100644 --- a/database/seeders/WrathRaidSeeder.php +++ b/database/seeders/WrathRaidSeeder.php @@ -14,10 +14,10 @@ class WrathRaidSeeder extends Seeder */ public function run() { - $raids = [ 'Naxramas', 'Obsidian Sanctum', 'Malygos', 'Ulduar', 'Icecrown Citadel' ]; + $raids = ['Naxramas', 'Obsidian Sanctum', 'Malygos', 'Ulduar', 'Icecrown Citadel']; - foreach($raids as $name) { - Raid::insert(['name' => $name ]); + foreach ($raids as $name) { + Raid::insert(['name' => $name]); } } } diff --git a/resources/views/form/account.blade.php b/resources/views/form/account.blade.php index e775689..75fe503 100644 --- a/resources/views/form/account.blade.php +++ b/resources/views/form/account.blade.php @@ -4,25 +4,25 @@