mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix various phpstan issues.
This commit is contained in:
@@ -41,8 +41,7 @@ use Illuminate\View\View;
|
||||
*/
|
||||
class AttachmentController extends Controller
|
||||
{
|
||||
/** @var AttachmentRepositoryInterface Attachment repository */
|
||||
private $repository;
|
||||
private AttachmentRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
* AttachmentController constructor.
|
||||
@@ -128,7 +127,7 @@ class AttachmentController extends Controller
|
||||
->header('Expires', '0')
|
||||
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
|
||||
->header('Pragma', 'public')
|
||||
->header('Content-Length', strlen($content));
|
||||
->header('Content-Length', (string) strlen($content));
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use Illuminate\Foundation\Auth\ThrottlesLogins;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -81,10 +82,10 @@ class LoginController extends Controller
|
||||
/**
|
||||
* Handle a login request to the application.
|
||||
*
|
||||
*
|
||||
* @return JsonResponse|RedirectResponse
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public function login(Request $request)
|
||||
public function login(Request $request): JsonResponse | RedirectResponse
|
||||
{
|
||||
Log::channel('audit')->info(sprintf('User is trying to login using "%s"', $request->get($this->username())));
|
||||
app('log')->info('User is trying to login.');
|
||||
|
@@ -30,6 +30,9 @@ use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\ObjectGroup\OrganisesObjectGroups;
|
||||
use FireflyIII\Transformers\BillTransformer;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
@@ -68,7 +71,7 @@ class IndexController extends Controller
|
||||
/**
|
||||
* Show all bills.
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View | Application | Factory | \Illuminate\Contracts\Foundation\Application
|
||||
{
|
||||
$this->cleanupObjectGroups();
|
||||
$this->repository->correctOrder();
|
||||
|
@@ -270,7 +270,7 @@ class DebugController extends Controller
|
||||
$userAgent = request()->header('user-agent');
|
||||
|
||||
// set languages, see what happens:
|
||||
$original = setlocale(LC_ALL, 0);
|
||||
$original = setlocale(LC_ALL, '0');
|
||||
$localeAttempts = [];
|
||||
$parts = app('steam')->getLocaleArray(app('steam')->getLocale());
|
||||
foreach ($parts as $code) {
|
||||
|
@@ -102,7 +102,7 @@ class IndexController extends Controller
|
||||
->header('Expires', '0')
|
||||
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
|
||||
->header('Pragma', 'public')
|
||||
->header('Content-Length', strlen($result['transactions']));
|
||||
->header('Content-Length', (string) strlen($result['transactions']));
|
||||
|
||||
// return CSV file made from 'transactions' array.
|
||||
return $response;
|
||||
|
@@ -73,7 +73,7 @@ class BoxController extends Controller
|
||||
$cache->addProperty($today);
|
||||
$cache->addProperty('box-available');
|
||||
if ($cache->has()) {
|
||||
//return response()->json($cache->get());
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
$leftPerDayAmount = '0';
|
||||
$leftToSpendAmount = '0';
|
||||
@@ -83,7 +83,7 @@ class BoxController extends Controller
|
||||
$availableBudgets = $abRepository->getAvailableBudgetsByExactDate($start, $end);
|
||||
app('log')->debug(sprintf('Found %d available budget(s)', $availableBudgets->count()));
|
||||
$availableBudgets = $availableBudgets->filter(
|
||||
static function (AvailableBudget $availableBudget) use ($currency) {
|
||||
static function (AvailableBudget $availableBudget) use ($currency) { // @phpstan-ignore-line
|
||||
if ($availableBudget->transaction_currency_id === $currency->id) {
|
||||
app('log')->debug(sprintf(
|
||||
'Will include AB #%d: from %s-%s amount %s',
|
||||
|
@@ -180,9 +180,11 @@ class TagController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function massDestroy(Request $request)
|
||||
public function massDestroy(Request $request): RedirectResponse
|
||||
{
|
||||
$tags = $request->get('tags');
|
||||
if (null === $tags || !is_array($tags)) {
|
||||
|
Reference in New Issue
Block a user