Refactoring of code for #1159

This commit is contained in:
James Cole
2018-10-05 17:54:51 +02:00
parent 7ac439fd0e
commit 6f70791239
11 changed files with 543 additions and 336 deletions

View File

@@ -0,0 +1,35 @@
<?php
/**
* FinTSConfigurationSteps.php
* Copyright (c) 2018 https://github.com/bnw
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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\Import\JobConfiguration;
/**
*
* Class FinTSConfigurationSteps
*/
abstract class FinTSConfigurationSteps
{
public const NEW = 'new';
public const CHOOSE_ACCOUNT = 'choose_account';
public const GO_FOR_IMPORT = 'go-for-import';
}

View File

@@ -1,7 +1,7 @@
<?php
/**
* FinTSJobConfiguration.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* Copyright (c) 2018 https://github.com/bnw
*
* This file is part of Firefly III.
*
@@ -29,13 +29,10 @@ use FireflyIII\Support\Import\JobConfiguration\FinTS\FinTSConfigurationInterface
use FireflyIII\Support\Import\JobConfiguration\FinTS\NewFinTSJobHandler;
use Illuminate\Support\MessageBag;
abstract class FinTSConfigurationSteps
{
const NEW = 'new';
const CHOOSE_ACCOUNT = 'choose_account';
const GO_FOR_IMPORT = 'go-for-import';
}
/**
*
* Class FinTSJobConfiguration
*/
class FinTSJobConfiguration implements JobConfigurationInterface
{
/** @var ImportJob */
@@ -48,7 +45,7 @@ class FinTSJobConfiguration implements JobConfigurationInterface
*/
public function configurationComplete(): bool
{
return $this->importJob->stage == FinTSConfigurationSteps::GO_FOR_IMPORT;
return $this->importJob->stage === FinTSConfigurationSteps::GO_FOR_IMPORT;
}
/**