Fix code quality with rector [skip ci]

This commit is contained in:
James Cole
2025-11-09 09:08:03 +01:00
parent d2610be790
commit 68183a0a0e
209 changed files with 1021 additions and 1248 deletions

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Binder;
use Illuminate\Support\Facades\Log;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Routing\Route;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -33,10 +34,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class CLIToken implements BinderInterface
{
/**
* @return mixed
*/
public static function routeBinder(string $value, Route $route)
public static function routeBinder(string $value, Route $route): string
{
/** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class);
@@ -50,12 +48,12 @@ class CLIToken implements BinderInterface
foreach ($users as $user) {
$accessToken = app('preferences')->getForUser($user, 'access_token');
if (null !== $accessToken && $accessToken->data === $value) {
app('log')->info(sprintf('Recognized user #%d (%s) from his access token.', $user->id, $user->email));
Log::info(sprintf('Recognized user #%d (%s) from his access token.', $user->id, $user->email));
return $value;
}
}
app('log')->error(sprintf('Recognized no users by access token "%s"', $value));
Log::error(sprintf('Recognized no users by access token "%s"', $value));
throw new NotFoundHttpException();
}