mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Clean up code.
This commit is contained in:
@@ -40,21 +40,7 @@ class BillFactory
|
||||
{
|
||||
use BillServiceTrait, CreatesObjectGroups;
|
||||
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
@@ -153,11 +139,7 @@ class BillFactory
|
||||
*/
|
||||
public function findByName(string $name): ?Bill
|
||||
{
|
||||
$query = sprintf('%%%s%%', $name);
|
||||
/** @var Bill $first */
|
||||
$first = $this->user->bills()->where('name', 'LIKE', $query)->first();
|
||||
|
||||
return $first;
|
||||
return $this->user->bills()->where('name', 'LIKE', sprintf('%%%s%%', $name))->first();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user