mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Expand tests, do code cleanup.
This commit is contained in:
@@ -27,6 +27,9 @@ namespace FireflyIII\Support;
|
||||
*/
|
||||
class ChartColour
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public static $colours
|
||||
= [
|
||||
[53, 124, 165],
|
||||
|
@@ -78,6 +78,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function checkbox(string $name, $value = 1, $checked = null, $options = []): string
|
||||
{
|
||||
@@ -100,6 +101,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function date(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -118,6 +120,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function file(string $name, array $options = []): string
|
||||
{
|
||||
@@ -135,6 +138,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function integer(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -154,6 +158,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function location(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -226,6 +231,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function multiCheckbox(string $name, array $list = [], $selected = null, array $options = []): string
|
||||
{
|
||||
@@ -247,6 +253,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function multiRadio(string $name, array $list = [], $selected = null, array $options = []): string
|
||||
{
|
||||
@@ -267,6 +274,8 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
* @throws Facades\FireflyException
|
||||
*/
|
||||
public function nonSelectableAmount(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -295,6 +304,8 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
* @throws Facades\FireflyException
|
||||
*/
|
||||
public function nonSelectableBalance(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -324,6 +335,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function number(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -344,6 +356,7 @@ class ExpandedForm
|
||||
* @param $name
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function optionsList(string $type, string $name): string
|
||||
{
|
||||
@@ -366,6 +379,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function password(string $name, array $options = []): string
|
||||
{
|
||||
@@ -384,6 +398,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function select(string $name, array $list = [], $selected = null, array $options = []): string
|
||||
{
|
||||
@@ -404,6 +419,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function staticText(string $name, $value, array $options = []): string
|
||||
{
|
||||
@@ -421,6 +437,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function tags(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -440,6 +457,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function text(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -458,6 +476,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function textarea(string $name, $value = null, array $options = []): string
|
||||
{
|
||||
@@ -557,6 +576,8 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
* @throws Facades\FireflyException
|
||||
*/
|
||||
private function currencyField(string $name, string $view, $value = null, array $options = []): string
|
||||
{
|
||||
|
@@ -34,6 +34,9 @@ use Log;
|
||||
*/
|
||||
class Initial implements ConfigurationInterface
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private $job;
|
||||
|
||||
/**
|
||||
|
@@ -51,6 +51,7 @@ class Map implements ConfigurationInterface
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws \League\Csv\Exception
|
||||
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
|
||||
*/
|
||||
public function getData(): array
|
||||
{
|
||||
@@ -187,6 +188,7 @@ class Map implements ConfigurationInterface
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function getMappableColumns(): bool
|
||||
{
|
||||
|
@@ -34,6 +34,9 @@ use Log;
|
||||
*/
|
||||
class Roles implements ConfigurationInterface
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $data = [];
|
||||
/** @var ImportJob */
|
||||
private $job;
|
||||
@@ -46,6 +49,7 @@ class Roles implements ConfigurationInterface
|
||||
*
|
||||
* @return array
|
||||
* @throws \League\Csv\Exception
|
||||
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
|
||||
*/
|
||||
public function getData(): array
|
||||
{
|
||||
|
@@ -22,6 +22,7 @@ class InputMandatory implements ConfigurationInterface
|
||||
* Get the data necessary to show the configuration screen.
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getData(): array
|
||||
{
|
||||
@@ -56,7 +57,7 @@ class InputMandatory implements ConfigurationInterface
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return ConfigurationInterface
|
||||
* @return void
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
@@ -69,6 +70,7 @@ class InputMandatory implements ConfigurationInterface
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function storeConfiguration(array $data): bool
|
||||
{
|
||||
|
@@ -13,6 +13,9 @@ use FireflyIII\Support\Import\Configuration\ConfigurationInterface;
|
||||
*/
|
||||
class SelectCountry implements ConfigurationInterface
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public static $allCountries
|
||||
= [
|
||||
'AF' => 'Afghanistan',
|
||||
@@ -302,7 +305,7 @@ class SelectCountry implements ConfigurationInterface
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return ConfigurationInterface
|
||||
* @return void
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
|
@@ -50,7 +50,7 @@ class SelectProvider implements ConfigurationInterface
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return ConfigurationInterface
|
||||
* @return void
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
|
@@ -61,6 +61,7 @@ class BunqInformation implements InformationInterface
|
||||
* color: any associated color.
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getAccounts(): array
|
||||
{
|
||||
@@ -113,6 +114,8 @@ class BunqInformation implements InformationInterface
|
||||
|
||||
/**
|
||||
* @param SessionToken $sessionToken
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function closeSession(SessionToken $sessionToken): void
|
||||
{
|
||||
@@ -135,6 +138,7 @@ class BunqInformation implements InformationInterface
|
||||
* @param int $userId
|
||||
*
|
||||
* @return Collection
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function getMonetaryAccounts(SessionToken $sessionToken, int $userId): Collection
|
||||
{
|
||||
@@ -159,6 +163,7 @@ class BunqInformation implements InformationInterface
|
||||
* @return int
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function getUserInformation(SessionToken $sessionToken): int
|
||||
{
|
||||
@@ -185,6 +190,7 @@ class BunqInformation implements InformationInterface
|
||||
|
||||
/**
|
||||
* @return SessionToken
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function startSession(): SessionToken
|
||||
{
|
||||
|
@@ -61,6 +61,7 @@ class SpectreInformation implements InformationInterface
|
||||
* color: any associated color.
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getAccounts(): array
|
||||
{
|
||||
@@ -113,6 +114,8 @@ class SpectreInformation implements InformationInterface
|
||||
|
||||
/**
|
||||
* @param SessionToken $sessionToken
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function closeSession(SessionToken $sessionToken): void
|
||||
{
|
||||
@@ -135,6 +138,7 @@ class SpectreInformation implements InformationInterface
|
||||
* @param int $userId
|
||||
*
|
||||
* @return Collection
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function getMonetaryAccounts(SessionToken $sessionToken, int $userId): Collection
|
||||
{
|
||||
@@ -159,6 +163,7 @@ class SpectreInformation implements InformationInterface
|
||||
* @return int
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function getUserInformation(SessionToken $sessionToken): int
|
||||
{
|
||||
@@ -185,6 +190,7 @@ class SpectreInformation implements InformationInterface
|
||||
|
||||
/**
|
||||
* @return SessionToken
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function startSession(): SessionToken
|
||||
{
|
||||
|
@@ -46,7 +46,6 @@ trait TransactionJournalTrait
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function amount(): string
|
||||
{
|
||||
|
@@ -29,6 +29,9 @@ use FireflyIII\Models\Transaction;
|
||||
use Log;
|
||||
use Steam;
|
||||
|
||||
/**
|
||||
* Class Modifier
|
||||
*/
|
||||
class Modifier
|
||||
{
|
||||
/**
|
||||
@@ -52,11 +55,11 @@ class Modifier
|
||||
/**
|
||||
* @param array $modifier
|
||||
* @param Transaction $transaction
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*
|
||||
*/
|
||||
public static function apply(array $modifier, Transaction $transaction): bool
|
||||
{
|
||||
|
@@ -185,6 +185,11 @@ class Search implements SearchInterface
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param JournalCollectorInterface $collector
|
||||
*
|
||||
* @return JournalCollectorInterface
|
||||
*/
|
||||
private function applyModifiers(JournalCollectorInterface $collector): JournalCollectorInterface
|
||||
{
|
||||
foreach ($this->modifiers as $modifier) {
|
||||
|
@@ -28,6 +28,9 @@ use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Support\SingleCacheProperties;
|
||||
use Twig_Extension;
|
||||
|
||||
/**
|
||||
* Class TransactionJournal
|
||||
*/
|
||||
class TransactionJournal extends Twig_Extension
|
||||
{
|
||||
/**
|
||||
|
Reference in New Issue
Block a user