mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 04:19:12 +00:00
Fix code quality with rector [skip ci]
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user