forked from eatvio/eatvio-infra
meeting the requirements of a static analyzer
This commit is contained in:
@@ -12,23 +12,20 @@ use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
|
||||
class CalendarController extends Controller
|
||||
{
|
||||
public string|int|null $weekStartsAt;
|
||||
public int $weekStartsAt;
|
||||
|
||||
public string|int|null $weekEndsAt;
|
||||
public int $weekEndsAt;
|
||||
|
||||
public Carbon $startsAt;
|
||||
|
||||
public Carbon $endsAt;
|
||||
|
||||
public string|int|null $gridStartsAt;
|
||||
public Carbon $gridStartsAt;
|
||||
|
||||
public string|int|null $gridEndsAt;
|
||||
public Carbon $gridEndsAt;
|
||||
|
||||
public function __construct(
|
||||
string|int|null $initialYear = null,
|
||||
string|int|null $initialMonth = null,
|
||||
string|int|null $weekStartsAt = null
|
||||
) {
|
||||
public function __construct(?int $initialYear = null, ?int $initialMonth = null, ?int $weekStartsAt = null)
|
||||
{
|
||||
$this->weekStartsAt = $weekStartsAt ?? Carbon::MONDAY;
|
||||
$this->weekEndsAt = $this->weekStartsAt === Carbon::MONDAY
|
||||
? Carbon::SUNDAY
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Events\ChatMessageUpdated;
|
||||
use App\Messages\ChatMessage;
|
||||
use App\Models\Chat;
|
||||
use App\Models\User;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
@@ -45,18 +43,6 @@ class ChatController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* public function create(): void
|
||||
{
|
||||
ChatMessageUpdated::dispatch(
|
||||
new ChatMessage(
|
||||
time(),
|
||||
'some text '.md5(' '.time())
|
||||
)
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
public function show(int $lastChatUser): View|ViewFactory
|
||||
{
|
||||
$lastChatUser = User::find($lastChatUser);
|
||||
@@ -85,7 +71,7 @@ class ChatController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
private function makeChanName(int $from, int $to): string
|
||||
private function makeChanName(?int $from = null, ?int $to = null): string
|
||||
{
|
||||
return (int) $from < (int) $to
|
||||
? $from.'_'.$to
|
||||
|
||||
@@ -8,7 +8,6 @@ use Illuminate\Contracts\View\View;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
|
||||
public function show(User $user): View|ViewFactory
|
||||
{
|
||||
return view('user.show', ['user' => $user]);
|
||||
|
||||
Reference in New Issue
Block a user