mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-26 08:51:12 -06:00
Code cleanup.
This commit is contained in:
parent
6bdb6db330
commit
3fb14b4708
@ -20,6 +20,7 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @param Collection $accounts
|
* @param Collection $accounts
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
|
@ -37,6 +37,7 @@ class GoogleBudgetChartGenerator implements BudgetChartGenerator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @param Collection $entries
|
* @param Collection $entries
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -17,7 +17,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $entries
|
* @param Collection $entries
|
||||||
* @param string $dateFormat
|
* @param string $dateFormat
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -76,6 +76,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @param Collection $entries
|
* @param Collection $entries
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -99,6 +99,7 @@ class GoogleCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
$chart->addRowArray($entry);
|
$chart->addRowArray($entry);
|
||||||
}
|
}
|
||||||
$chart->generate();
|
$chart->generate();
|
||||||
|
|
||||||
return $chart->getData();
|
return $chart->getData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
namespace FireflyIII\Generator\Chart\Report;
|
namespace FireflyIII\Generator\Chart\Report;
|
||||||
|
|
||||||
use Config;
|
use Config;
|
||||||
use Grumpydictator\Gchart\GChart;
|
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
|
|
||||||
@ -78,6 +77,7 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
|
|||||||
$data['datasets'][1]['data'][] = round($expense, 2);
|
$data['datasets'][1]['data'][] = round($expense, 2);
|
||||||
$data['datasets'][0]['data'][] = round(($income / $count), 2);
|
$data['datasets'][0]['data'][] = round(($income / $count), 2);
|
||||||
$data['datasets'][1]['data'][] = round(($expense / $count), 2);
|
$data['datasets'][1]['data'][] = round(($expense / $count), 2);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,17 @@ interface ConverterInterface
|
|||||||
*/
|
*/
|
||||||
public function convert();
|
public function convert();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
public function setData(array $data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $field
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function setField($field);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $index
|
* @param int $index
|
||||||
*/
|
*/
|
||||||
@ -35,15 +46,4 @@ interface ConverterInterface
|
|||||||
*/
|
*/
|
||||||
public function setValue($value);
|
public function setValue($value);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $data
|
|
||||||
*/
|
|
||||||
public function setData(array $data);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $field
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function setField($field);
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FireflyIII\Helpers\Csv\Converter;
|
namespace FireflyIII\Helpers\Csv\Converter;
|
||||||
|
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FireflyIII\Helpers\Csv\Converter;
|
namespace FireflyIII\Helpers\Csv\Converter;
|
||||||
|
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +20,7 @@ class AnyAccount implements MapperInterface
|
|||||||
{
|
{
|
||||||
$result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
|
$result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
|
||||||
|
|
||||||
$list = [];
|
$list = [];
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
foreach ($result as $account) {
|
foreach ($result as $account) {
|
||||||
$list[$account->id] = $account->name . ' (' . $account->accountType->type . ')';
|
$list[$account->id] = $account->name . ' (' . $account->accountType->type . ')';
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FireflyIII\Helpers\Csv\PostProcessing;
|
namespace FireflyIII\Helpers\Csv\PostProcessing;
|
||||||
use Preferences;
|
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
|
use Preferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Currency
|
* Class Currency
|
||||||
@ -23,8 +24,8 @@ class Currency implements PostProcessorInterface
|
|||||||
|
|
||||||
// fix currency
|
// fix currency
|
||||||
if (is_null($this->data['currency'])) {
|
if (is_null($this->data['currency'])) {
|
||||||
$currencyPreference = Preferences::get('currencyPreference', 'EUR');
|
$currencyPreference = Preferences::get('currencyPreference', 'EUR');
|
||||||
$this->data['currency'] = TransactionCurrency::whereCode($currencyPreference->data)->first();
|
$this->data['currency'] = TransactionCurrency::whereCode($currencyPreference->data)->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->data;
|
return $this->data;
|
||||||
|
@ -14,15 +14,16 @@ namespace FireflyIII\Helpers\Csv\PostProcessing;
|
|||||||
*
|
*
|
||||||
* @package FireflyIII\Helpers\Csv\PostProcessing
|
* @package FireflyIII\Helpers\Csv\PostProcessing
|
||||||
*/
|
*/
|
||||||
interface PostProcessorInterface {
|
interface PostProcessorInterface
|
||||||
|
{
|
||||||
/**
|
|
||||||
* @param array $data
|
|
||||||
*/
|
|
||||||
public function setData(array $data);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function process();
|
public function process();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
public function setData(array $data);
|
||||||
}
|
}
|
@ -129,7 +129,7 @@ class Wizard implements WizardInterface
|
|||||||
*/
|
*/
|
||||||
public function showOptions(array $map)
|
public function showOptions(array $map)
|
||||||
{
|
{
|
||||||
$options = [];
|
$options = [];
|
||||||
foreach ($map as $index => $columnRole) {
|
foreach ($map as $index => $columnRole) {
|
||||||
|
|
||||||
$mapper = Config::get('csv.roles.' . $columnRole . '.mapper');
|
$mapper = Config::get('csv.roles.' . $columnRole . '.mapper');
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FireflyIII\Helpers\Csv;
|
namespace FireflyIII\Helpers\Csv;
|
||||||
|
|
||||||
use League\Csv\Reader;
|
use League\Csv\Reader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,7 +6,7 @@ use Watson\Validating\ValidatingTrait;
|
|||||||
/**
|
/**
|
||||||
* Class AccountMeta
|
* Class AccountMeta
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class AccountType
|
* Class AccountType
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* FireflyIII\Models\Bill
|
* FireflyIII\Models\Bill
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore Class Bill
|
* @codeCoverageIgnore Class Bill
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
* @property \Carbon\Carbon $updated_at
|
* @property \Carbon\Carbon $updated_at
|
||||||
|
@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class Budget
|
* Class Budget
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
@ -40,6 +40,7 @@ class Budget extends Model
|
|||||||
/**
|
/**
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||||
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
* @return Budget
|
* @return Budget
|
||||||
|
@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class BudgetLimit
|
* Class BudgetLimit
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class Component
|
* Class Component
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class LimitRepetition
|
* Class LimitRepetition
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBank
|
* Class PiggyBank
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
@ -37,9 +37,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereOrder($value)
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereOrder($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereEncrypted($value)
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereEncrypted($value)
|
||||||
* @property PiggyBankRepetition currentRep
|
* @property PiggyBankRepetition currentRep
|
||||||
* @property string $reminder
|
* @property string $reminder
|
||||||
* @property integer $reminder_skip
|
* @property integer $reminder_skip
|
||||||
* @property boolean $remind_me
|
* @property boolean $remind_me
|
||||||
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminder($value)
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminder($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminderSkip($value)
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminderSkip($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereRemindMe($value)
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereRemindMe($value)
|
||||||
|
@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBankEvent
|
* Class PiggyBankEvent
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBankRepetition
|
* Class PiggyBankRepetition
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class Preference
|
* Class Preference
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -9,7 +9,7 @@ use Watson\Validating\ValidatingTrait;
|
|||||||
/**
|
/**
|
||||||
* Class Transaction
|
* Class Transaction
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class TransactionCurrency
|
* Class TransactionCurrency
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class TransactionGroup
|
* Class TransactionGroup
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class TransactionRelation
|
* Class TransactionRelation
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class TransactionRelation extends Model
|
class TransactionRelation extends Model
|
||||||
|
@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class TransactionType
|
* Class TransactionType
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
@ -83,7 +83,7 @@ class Navigation
|
|||||||
$subDay = ['week', 'weekly', '1W', 'month', 'monthly', '1M', '3M', 'quarter', 'quarterly', '6M', 'half-year', 'year', 'yearly'];
|
$subDay = ['week', 'weekly', '1W', 'month', 'monthly', '1M', '3M', 'quarter', 'quarterly', '6M', 'half-year', 'year', 'yearly'];
|
||||||
|
|
||||||
if (!isset($functionMap[$repeatFreq])) {
|
if (!isset($functionMap[$repeatFreq])) {
|
||||||
throw new FireflyException('Cannot do endOfPeriod for $repeat_freq "' . $repeatFreq.'"');
|
throw new FireflyException('Cannot do endOfPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||||
}
|
}
|
||||||
$function = $functionMap[$repeatFreq];
|
$function = $functionMap[$repeatFreq];
|
||||||
if (isset($modifierMap[$repeatFreq])) {
|
if (isset($modifierMap[$repeatFreq])) {
|
||||||
@ -204,7 +204,7 @@ class Navigation
|
|||||||
|
|
||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
throw new FireflyException('Cannot do startOfPeriod for $repeat_freq "' . $repeatFreq.'"');
|
throw new FireflyException('Cannot do startOfPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -246,7 +246,7 @@ class Navigation
|
|||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq.'"');
|
throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -282,7 +282,7 @@ class Navigation
|
|||||||
|
|
||||||
return $end;
|
return $end;
|
||||||
}
|
}
|
||||||
throw new FireflyException('updateEndDate cannot handle $range "' . $range.'"');
|
throw new FireflyException('updateEndDate cannot handle $range "' . $range . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -316,7 +316,7 @@ class Navigation
|
|||||||
|
|
||||||
return $start;
|
return $start;
|
||||||
}
|
}
|
||||||
throw new FireflyException('updateStartDate cannot handle $range "' . $range.'"');
|
throw new FireflyException('updateStartDate cannot handle $range "' . $range . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ use Zizaco\Entrust\Traits\EntrustUserTrait;
|
|||||||
/**
|
/**
|
||||||
* Class User
|
* Class User
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII
|
* @package FireflyIII
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
|
Loading…
Reference in New Issue
Block a user