First part of a large code cleanup commit.

This commit is contained in:
James Cole
2019-02-12 21:49:28 +01:00
parent b273af341c
commit e0d87aa11e
70 changed files with 336 additions and 354 deletions

View File

@@ -51,7 +51,7 @@ class CLIToken implements BinderInterface
foreach ($users as $user) {
$accessToken = app('preferences')->getForUser($user, 'access_token', null);
if(null !== $accessToken && $accessToken->data === $value) {
if (null !== $accessToken && $accessToken->data === $value) {
Log::info(sprintf('Recognized user #%d (%s) from his acccess token.', $user->id, $user->email));
return $value;

View File

@@ -57,10 +57,10 @@ class TagList implements BinderInterface
$collection = $allTags->filter(
function (Tag $tag) use ($list) {
if(\in_array(strtolower($tag->tag), $list, true)) {
if (\in_array(strtolower($tag->tag), $list, true)) {
return true;
}
if(\in_array((string)$tag->id, $list, true)) {
if (\in_array((string)$tag->id, $list, true)) {
return true;
}

View File

@@ -25,7 +25,6 @@ namespace FireflyIII\Support\Binder;
use FireflyIII\Models\Tag;
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Routing\Route;
use Illuminate\Support\Collection;
use Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -38,8 +37,7 @@ class TagOrId implements BinderInterface
* @param string $value
* @param Route $route
*
* @return Collection
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @return Tag
*/
public static function routeBinder(string $value, Route $route): Tag
{