mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Use PSR-12 code style
This commit is contained in:
@@ -50,8 +50,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
*/
|
||||
public function getAllJournals(array $types): Collection
|
||||
{
|
||||
return TransactionJournal
|
||||
::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
return TransactionJournal::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->whereIn('transaction_types.type', $types)
|
||||
->with(['user', 'transactionType', 'transactionCurrency', 'transactions', 'transactions.account'])
|
||||
->get(['transaction_journals.*']);
|
||||
@@ -119,7 +118,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
*/
|
||||
public function getMetaDate(TransactionJournal $journal, string $field): ?Carbon
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty('journal-meta-updated');
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty($field);
|
||||
@@ -162,7 +161,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
*/
|
||||
public function getMetaField(TransactionJournal $journal, string $field): ?string
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty('journal-meta-updated');
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty($field);
|
||||
@@ -221,8 +220,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
*/
|
||||
public function getSplitJournals(): Collection
|
||||
{
|
||||
$query = TransactionJournal
|
||||
::leftJoin('transactions', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
$query = TransactionJournal::leftJoin('transactions', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->groupBy('transaction_journals.id');
|
||||
$result = $query->get(['transaction_journals.id as id', DB::raw('count(transactions.id) as transaction_count')]);
|
||||
$journalIds = [];
|
||||
@@ -234,8 +232,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
}
|
||||
$journalIds = array_unique($journalIds);
|
||||
|
||||
return TransactionJournal
|
||||
::with(['transactions'])
|
||||
return TransactionJournal::with(['transactions'])
|
||||
->whereIn('id', $journalIds)->get();
|
||||
}
|
||||
|
||||
|
@@ -117,5 +117,4 @@ interface JournalCLIRepositoryInterface
|
||||
* @param User $user
|
||||
*/
|
||||
public function setUser(User $user);
|
||||
|
||||
}
|
||||
|
@@ -133,7 +133,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
*/
|
||||
public function getJournalTotal(TransactionJournal $journal): string
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('amount-positive');
|
||||
if ($cache->has()) {
|
||||
@@ -189,7 +189,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
*/
|
||||
public function getMetaDateById(int $journalId, string $field): ?Carbon
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty('journal-meta-updated');
|
||||
$cache->addProperty($journalId);
|
||||
$cache->addProperty($field);
|
||||
|
Reference in New Issue
Block a user