Code cleanup.

This commit is contained in:
James Cole
2015-07-06 16:52:18 +02:00
parent 6bdb6db330
commit 3fb14b4708
31 changed files with 59 additions and 49 deletions

View File

@@ -15,6 +15,17 @@ interface ConverterInterface
*/
public function convert();
/**
* @param array $data
*/
public function setData(array $data);
/**
* @param string $field
*
*/
public function setField($field);
/**
* @param int $index
*/
@@ -35,15 +46,4 @@ interface ConverterInterface
*/
public function setValue($value);
/**
* @param array $data
*/
public function setData(array $data);
/**
* @param string $field
*
*/
public function setField($field);
}

View File

@@ -1,6 +1,7 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\TransactionCurrency;
/**

View File

@@ -1,6 +1,7 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\TransactionCurrency;
/**

View File

@@ -20,7 +20,7 @@ class AnyAccount implements MapperInterface
{
$result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
$list = [];
$list = [];
/** @var Account $account */
foreach ($result as $account) {
$list[$account->id] = $account->name . ' (' . $account->accountType->type . ')';

View File

@@ -1,8 +1,9 @@
<?php
namespace FireflyIII\Helpers\Csv\PostProcessing;
use Preferences;
use FireflyIII\Models\TransactionCurrency;
use Preferences;
/**
* Class Currency
@@ -23,8 +24,8 @@ class Currency implements PostProcessorInterface
// fix currency
if (is_null($this->data['currency'])) {
$currencyPreference = Preferences::get('currencyPreference', 'EUR');
$this->data['currency'] = TransactionCurrency::whereCode($currencyPreference->data)->first();
$currencyPreference = Preferences::get('currencyPreference', 'EUR');
$this->data['currency'] = TransactionCurrency::whereCode($currencyPreference->data)->first();
}
return $this->data;

View File

@@ -14,15 +14,16 @@ namespace FireflyIII\Helpers\Csv\PostProcessing;
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
interface PostProcessorInterface {
/**
* @param array $data
*/
public function setData(array $data);
interface PostProcessorInterface
{
/**
* @return array
*/
public function process();
/**
* @param array $data
*/
public function setData(array $data);
}

View File

@@ -129,7 +129,7 @@ class Wizard implements WizardInterface
*/
public function showOptions(array $map)
{
$options = [];
$options = [];
foreach ($map as $index => $columnRole) {
$mapper = Config::get('csv.roles.' . $columnRole . '.mapper');

View File

@@ -1,6 +1,7 @@
<?php
namespace FireflyIII\Helpers\Csv;
use League\Csv\Reader;
/**