mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 03:08:11 +00:00
Code clean up.
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers;
|
||||
@@ -35,9 +34,7 @@ use Navigation;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class JavascriptController
|
||||
*
|
||||
* @package FireflyIII\Http\Controllers
|
||||
* Class JavascriptController.
|
||||
*/
|
||||
class JavascriptController extends Controller
|
||||
{
|
||||
@@ -53,19 +50,17 @@ class JavascriptController extends Controller
|
||||
$preference = Preferences::get('currencyPreference', config('firefly.default_currency', 'EUR'));
|
||||
$default = $currencyRepository->findByCode($preference->data);
|
||||
|
||||
$data = ['accounts' => [],];
|
||||
|
||||
$data = ['accounts' => []];
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
$accountId = $account->id;
|
||||
$currency = intval($account->getMeta('currency_id'));
|
||||
$currency = $currency === 0 ? $default->id : $currency;
|
||||
$currency = 0 === $currency ? $default->id : $currency;
|
||||
$entry = ['preferredCurrency' => $currency, 'name' => $account->name];
|
||||
$data['accounts'][$accountId] = $entry;
|
||||
}
|
||||
|
||||
|
||||
return response()
|
||||
->view('javascript.accounts', $data, 200)
|
||||
->header('Content-Type', 'text/javascript');
|
||||
@@ -79,7 +74,7 @@ class JavascriptController extends Controller
|
||||
public function currencies(CurrencyRepositoryInterface $repository)
|
||||
{
|
||||
$currencies = $repository->get();
|
||||
$data = ['currencies' => [],];
|
||||
$data = ['currencies' => []];
|
||||
/** @var TransactionCurrency $currency */
|
||||
foreach ($currencies as $currency) {
|
||||
$currencyId = $currency->id;
|
||||
@@ -180,7 +175,6 @@ class JavascriptController extends Controller
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user