Optimize some code.

This commit is contained in:
James Cole 2020-08-20 17:59:44 +02:00
parent d78d2f25eb
commit 9f80d729a2
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
5 changed files with 3 additions and 39 deletions

View File

@ -329,8 +329,8 @@ class TransactionUpdateRequest extends FormRequest
foreach ($this->dateFields as $fieldName) { foreach ($this->dateFields as $fieldName) {
Log::debug(sprintf('Now at date field %s', $fieldName)); Log::debug(sprintf('Now at date field %s', $fieldName));
if (array_key_exists($fieldName, $transaction)) { if (array_key_exists($fieldName, $transaction)) {
$current[$fieldName] = $this->dateFromValue((string) $transaction[$fieldName]);
Log::debug(sprintf('New value: "%s"', (string) $transaction[$fieldName])); Log::debug(sprintf('New value: "%s"', (string) $transaction[$fieldName]));
$current[$fieldName] = $this->dateFromValue((string) $transaction[$fieldName]);
} }
} }

View File

@ -48,19 +48,7 @@ use Storage;
*/ */
class AccountRepository implements AccountRepositoryInterface class AccountRepository implements AccountRepositoryInterface
{ {
private User $user;
/** @var User */
private $user;
/**
* Constructor.
*/
public function __construct()
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
}
}
/** /**
* @param array $types * @param array $types

View File

@ -53,16 +53,6 @@ class BillRepository implements BillRepositoryInterface
private User $user; private User $user;
/**
* Constructor.
*/
public function __construct()
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
}
}
/** /**
* @param Bill $bill * @param Bill $bill
* *

View File

@ -43,18 +43,7 @@ use Storage;
*/ */
class TagRepository implements TagRepositoryInterface class TagRepository implements TagRepositoryInterface
{ {
/** @var User */ private User $user;
private $user;
/**
* Constructor.
*/
public function __construct()
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
}
}
/** /**
* @return int * @return int

View File

@ -185,9 +185,6 @@ class BetterQuerySearch implements SearchInterface
Log::error(sprintf('Cannot handle node %s', $class)); Log::error(sprintf('Cannot handle node %s', $class));
throw new FireflyException(sprintf('Firefly III search cant handle "%s"-nodes', $class)); throw new FireflyException(sprintf('Firefly III search cant handle "%s"-nodes', $class));
case Word::class: case Word::class:
Log::debug(sprintf('Now handle %s', $class));
$this->words[] = $searchNode->getValue();
break;
case Phrase::class: case Phrase::class:
Log::debug(sprintf('Now handle %s', $class)); Log::debug(sprintf('Now handle %s', $class));
$this->words[] = $searchNode->getValue(); $this->words[] = $searchNode->getValue();