mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 04:34:00 +00:00
Fix tests.
This commit is contained in:
@@ -467,10 +467,14 @@ class AccountController extends Controller
|
|||||||
|
|
||||||
/** @var CurrencyRepositoryInterface $repository */
|
/** @var CurrencyRepositoryInterface $repository */
|
||||||
$repository = app(CurrencyRepositoryInterface::class);
|
$repository = app(CurrencyRepositoryInterface::class);
|
||||||
$default = app('amount')->getDefaultCurrency();
|
/** @var AccountRepositoryInterface $accountRepos */
|
||||||
$chartData = [];
|
$accountRepos = app(AccountRepositoryInterface::class);
|
||||||
|
|
||||||
|
$default = app('amount')->getDefaultCurrency();
|
||||||
|
$chartData = [];
|
||||||
|
/** @var Account $account */
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$currency = $repository->findNull((int)$account->getMeta('currency_id'));
|
$currency = $repository->findNull((int)$accountRepos->getMetaValue($account, 'currency_id'));
|
||||||
if (null === $currency) {
|
if (null === $currency) {
|
||||||
$currency = $default;
|
$currency = $default;
|
||||||
}
|
}
|
||||||
|
@@ -139,10 +139,10 @@ class Bill extends Model
|
|||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||||
*/
|
*/
|
||||||
public function getNameAttribute($value): string
|
public function getNameAttribute($value): ?string
|
||||||
{
|
{
|
||||||
if (1 === (int)$this->name_encrypted) {
|
if (1 === (int)$this->name_encrypted) {
|
||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
|
@@ -96,10 +96,10 @@ class Budget extends Model
|
|||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||||
*/
|
*/
|
||||||
public function getNameAttribute($value): string
|
public function getNameAttribute($value): ?string
|
||||||
{
|
{
|
||||||
if ($this->encrypted) {
|
if ($this->encrypted) {
|
||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
|
@@ -85,10 +85,10 @@ class Category extends Model
|
|||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||||
*/
|
*/
|
||||||
public function getNameAttribute($value): string
|
public function getNameAttribute($value): ?string
|
||||||
{
|
{
|
||||||
if ($this->encrypted) {
|
if ($this->encrypted) {
|
||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
|
@@ -107,10 +107,10 @@ class PiggyBank extends Model
|
|||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||||
*/
|
*/
|
||||||
public function getNameAttribute($value): string
|
public function getNameAttribute($value): ?string
|
||||||
{
|
{
|
||||||
if ($this->encrypted) {
|
if ($this->encrypted) {
|
||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
|
@@ -85,10 +85,10 @@ class Tag extends Model
|
|||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||||
*/
|
*/
|
||||||
public function getDescriptionAttribute($value): string
|
public function getDescriptionAttribute($value): ?string
|
||||||
{
|
{
|
||||||
if (null === $value) {
|
if (null === $value) {
|
||||||
return $value;
|
return $value;
|
||||||
|
@@ -153,10 +153,10 @@ class TransactionJournal extends Model
|
|||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||||
*/
|
*/
|
||||||
public function getDescriptionAttribute($value): string
|
public function getDescriptionAttribute($value): ?string
|
||||||
{
|
{
|
||||||
if ($this->encrypted) {
|
if ($this->encrypted) {
|
||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FireflyIII\Rules;
|
namespace FireflyIII\TransactionRules\Triggers;
|
||||||
|
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
|
Reference in New Issue
Block a user