mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Various code cleanup.
This commit is contained in:
@@ -78,6 +78,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function checkbox(string $name, $value = 1, $checked = null, $options = []): string
|
||||
@@ -101,6 +102,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function date(string $name, $value = null, array $options = []): string
|
||||
@@ -120,6 +122,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function file(string $name, array $options = []): string
|
||||
@@ -138,6 +141,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function integer(string $name, $value = null, array $options = []): string
|
||||
@@ -158,6 +162,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function location(string $name, $value = null, array $options = []): string
|
||||
@@ -231,6 +236,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function multiCheckbox(string $name, array $list = [], $selected = null, array $options = []): string
|
||||
@@ -253,6 +259,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function multiRadio(string $name, array $list = [], $selected = null, array $options = []): string
|
||||
@@ -274,6 +281,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
* @throws Facades\FireflyException
|
||||
*/
|
||||
@@ -304,6 +312,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
* @throws Facades\FireflyException
|
||||
*/
|
||||
@@ -335,6 +344,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function number(string $name, $value = null, array $options = []): string
|
||||
@@ -356,6 +366,7 @@ class ExpandedForm
|
||||
* @param $name
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function optionsList(string $type, string $name): string
|
||||
@@ -379,6 +390,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function password(string $name, array $options = []): string
|
||||
@@ -398,6 +410,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function select(string $name, array $list = [], $selected = null, array $options = []): string
|
||||
@@ -419,6 +432,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function staticText(string $name, $value, array $options = []): string
|
||||
@@ -437,6 +451,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function tags(string $name, $value = null, array $options = []): string
|
||||
@@ -457,6 +472,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function text(string $name, $value = null, array $options = []): string
|
||||
@@ -476,6 +492,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function textarea(string $name, $value = null, array $options = []): string
|
||||
@@ -576,6 +593,7 @@ class ExpandedForm
|
||||
* @param array $options
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
* @throws Facades\FireflyException
|
||||
*/
|
||||
|
||||
@@ -75,7 +75,6 @@ class Initial implements ConfigurationInterface
|
||||
'specifix' => [],
|
||||
'delimiters' => $delimiters,
|
||||
'specifics' => $specifics,
|
||||
|
||||
];
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -188,6 +188,7 @@ class Map implements ConfigurationInterface
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function getMappableColumns(): bool
|
||||
|
||||
@@ -48,15 +48,16 @@ class Roles implements ConfigurationInterface
|
||||
* Get the data necessary to show the configuration screen.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws \League\Csv\Exception
|
||||
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
|
||||
*/
|
||||
public function getData(): array
|
||||
{
|
||||
$config = $this->job->configuration;
|
||||
$content = $this->job->uploadFileContents();
|
||||
$headers = [];
|
||||
$offset = 0;
|
||||
$config = $this->job->configuration;
|
||||
$content = $this->job->uploadFileContents();
|
||||
$headers = [];
|
||||
$offset = 0;
|
||||
// create CSV reader.
|
||||
$reader = Reader::createFromString($content);
|
||||
$reader->setDelimiter($config['delimiter']);
|
||||
|
||||
@@ -107,11 +107,10 @@ class Upload implements ConfigurationInterface
|
||||
$config['has-file-upload'] = $uploaded;
|
||||
$repository->setConfiguration($this->job, $config);
|
||||
|
||||
if ($uploaded === false) {
|
||||
if (false === $uploaded) {
|
||||
$this->warning = 'No valid upload.';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,12 +18,10 @@
|
||||
* 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\Support\Import\Configuration\Spectre;
|
||||
|
||||
|
||||
use Crypt;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
@@ -42,6 +40,7 @@ class InputMandatory implements ConfigurationInterface
|
||||
* Get the data necessary to show the configuration screen.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getData(): array
|
||||
@@ -76,8 +75,6 @@ class InputMandatory implements ConfigurationInterface
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
@@ -90,6 +87,7 @@ class InputMandatory implements ConfigurationInterface
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function storeConfiguration(array $data): bool
|
||||
@@ -120,4 +118,4 @@ class InputMandatory implements ConfigurationInterface
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,10 @@
|
||||
* 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\Support\Import\Configuration\Spectre;
|
||||
|
||||
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Models\SpectreProvider;
|
||||
use FireflyIII\Support\Import\Configuration\ConfigurationInterface;
|
||||
@@ -324,8 +322,6 @@ class SelectCountry implements ConfigurationInterface
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
@@ -341,12 +337,12 @@ class SelectCountry implements ConfigurationInterface
|
||||
*/
|
||||
public function storeConfiguration(array $data): bool
|
||||
{
|
||||
$config = $this->job->configuration;
|
||||
$config['country'] = $data['country_code'] ?? 'XF'; // default to fake country.
|
||||
$config = $this->job->configuration;
|
||||
$config['country'] = $data['country_code'] ?? 'XF'; // default to fake country.
|
||||
$config['selected-country'] = true;
|
||||
$this->job->configuration = $config;
|
||||
$this->job->configuration = $config;
|
||||
$this->job->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,10 @@
|
||||
* 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\Support\Import\Configuration\Spectre;
|
||||
|
||||
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Models\SpectreProvider;
|
||||
use FireflyIII\Support\Import\Configuration\ConfigurationInterface;
|
||||
@@ -69,8 +67,6 @@ class SelectProvider implements ConfigurationInterface
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setJob(ImportJob $job)
|
||||
{
|
||||
@@ -86,12 +82,12 @@ class SelectProvider implements ConfigurationInterface
|
||||
*/
|
||||
public function storeConfiguration(array $data): bool
|
||||
{
|
||||
$config = $this->job->configuration;
|
||||
$config['provider'] = intval($data['provider_code']) ?? 0; // default to fake country.
|
||||
$config['selected-provider'] = true;
|
||||
$this->job->configuration = $config;
|
||||
$config = $this->job->configuration;
|
||||
$config['provider'] = intval($data['provider_code']) ?? 0; // default to fake country.
|
||||
$config['selected-provider'] = true;
|
||||
$this->job->configuration = $config;
|
||||
$this->job->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ class BunqInformation implements InformationInterface
|
||||
* color: any associated color.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getAccounts(): array
|
||||
@@ -138,6 +139,7 @@ class BunqInformation implements InformationInterface
|
||||
* @param int $userId
|
||||
*
|
||||
* @return Collection
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function getMonetaryAccounts(SessionToken $sessionToken, int $userId): Collection
|
||||
@@ -190,6 +192,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
|
||||
@@ -138,6 +139,7 @@ class SpectreInformation implements InformationInterface
|
||||
* @param int $userId
|
||||
*
|
||||
* @return Collection
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function getMonetaryAccounts(SessionToken $sessionToken, int $userId): Collection
|
||||
@@ -190,6 +192,7 @@ class SpectreInformation implements InformationInterface
|
||||
|
||||
/**
|
||||
* @return SessionToken
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function startSession(): SessionToken
|
||||
|
||||
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Support\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournalMeta;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
@@ -45,7 +44,6 @@ trait TransactionJournalTrait
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public function amount(): string
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace FireflyIII\Support\Search;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use Log;
|
||||
use Steam;
|
||||
@@ -59,7 +58,6 @@ class Modifier
|
||||
* @return bool
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*
|
||||
*/
|
||||
public static function apply(array $modifier, Transaction $transaction): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user