Fix various phpstan issues.

This commit is contained in:
James Cole
2025-01-03 14:56:06 +01:00
parent a8ae496fda
commit 394d0eabef
42 changed files with 133 additions and 181 deletions

View File

@@ -88,7 +88,7 @@ class LinkController extends Controller
*/
public function delete(Request $request, LinkType $linkType)
{
if (!$linkType->editable) {
if (false === $linkType->editable) {
$request->session()->flash('error', (string) trans('firefly.cannot_edit_link_type', ['name' => e($linkType->name)]));
return redirect(route('admin.links.index'));
@@ -139,7 +139,7 @@ class LinkController extends Controller
*/
public function edit(Request $request, LinkType $linkType)
{
if (!$linkType->editable) {
if (false === $linkType->editable) {
$request->session()->flash('error', (string) trans('firefly.cannot_edit_link_type', ['name' => e($linkType->name)]));
return redirect(route('admin.links.index'));
@@ -231,7 +231,7 @@ class LinkController extends Controller
*/
public function update(LinkTypeFormRequest $request, LinkType $linkType)
{
if (!$linkType->editable) {
if (false === $linkType->editable) {
$request->session()->flash('error', (string) trans('firefly.cannot_edit_link_type', ['name' => e($linkType->name)]));
return redirect(route('admin.links.index'));

View File

@@ -57,7 +57,7 @@ class NotificationController extends Controller
// admin notification settings:
$notifications = [];
foreach (config('notifications.notifications.owner') as $key => $info) {
if ($info['enabled']) {
if (true === $info['enabled']) {
$notifications[$key] = app('fireflyconfig')->get(sprintf('notification_%s', $key), true)->data;
}
}

View File

@@ -85,7 +85,7 @@ class UserController extends Controller
public function deleteInvite(InvitedUser $invitedUser): JsonResponse
{
app('log')->debug('Will now delete invitation');
if ($invitedUser->redeemed) {
if (true === $invitedUser->redeemed) {
app('log')->debug('Is already redeemed.');
session()->flash('error', trans('firefly.invite_is_already_redeemed', ['address' => $invitedUser->email]));