Expand tests, do code cleanup.

This commit is contained in:
James Cole
2017-12-17 14:30:53 +01:00
parent b08af77c98
commit 78335e5814
141 changed files with 773 additions and 54 deletions

View File

@@ -27,6 +27,9 @@ namespace FireflyIII\Support;
*/
class ChartColour
{
/**
* @var array
*/
public static $colours
= [
[53, 124, 165],

View File

@@ -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
{

View File

@@ -34,6 +34,9 @@ use Log;
*/
class Initial implements ConfigurationInterface
{
/**
* @var
*/
private $job;
/**

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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)
{

View File

@@ -50,7 +50,7 @@ class SelectProvider implements ConfigurationInterface
/**
* @param ImportJob $job
*
* @return ConfigurationInterface
* @return void
*/
public function setJob(ImportJob $job)
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -46,7 +46,6 @@ trait TransactionJournalTrait
/**
* @return string
*
* @throws FireflyException
*/
public function amount(): string
{

View File

@@ -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
{

View File

@@ -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) {

View File

@@ -28,6 +28,9 @@ use FireflyIII\Models\TransactionType;
use FireflyIII\Support\SingleCacheProperties;
use Twig_Extension;
/**
* Class TransactionJournal
*/
class TransactionJournal extends Twig_Extension
{
/**