Code clean up.

This commit is contained in:
James Cole
2017-11-15 12:25:49 +01:00
parent 57dcdfa0c4
commit ffca858b8d
476 changed files with 2055 additions and 4181 deletions

View File

@@ -18,7 +18,6 @@
* 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\Http\Controllers;
@@ -34,17 +33,14 @@ use Preferences;
use View;
/**
* Class CurrencyController
*
* @package FireflyIII\Http\Controllers
* Class CurrencyController.
*/
class CurrencyController extends Controller
{
/** @var CurrencyRepositoryInterface */
protected $repository;
/** @var UserRepositoryInterface */
/** @var UserRepositoryInterface */
protected $userRepository;
/**
@@ -54,7 +50,6 @@ class CurrencyController extends Controller
{
parent::__construct();
$this->middleware(
function ($request, $next) {
View::share('title', trans('firefly.currencies'));
@@ -84,7 +79,7 @@ class CurrencyController extends Controller
$subTitle = trans('firefly.create_currency');
// put previous url in session if not redirect from store (not "create another").
if (session('currencies.create.fromStore') !== true) {
if (true !== session('currencies.create.fromStore')) {
$this->rememberPreviousUri('currencies.create.uri');
}
$request->session()->forget('currencies.create.fromStore');
@@ -112,7 +107,6 @@ class CurrencyController extends Controller
return redirect(route('currencies.index'));
}
/**
* @param Request $request
* @param TransactionCurrency $currency
@@ -135,14 +129,12 @@ class CurrencyController extends Controller
return redirect(route('currencies.index'));
}
// put previous url in session
$this->rememberPreviousUri('currencies.delete.uri');
$request->session()->flash('gaEventCategory', 'currency');
$request->session()->flash('gaEventAction', 'delete');
$subTitle = trans('form.delete_currency', ['name' => $currency->name]);
return view('currencies.delete', compact('currency', 'subTitle'));
}
@@ -195,7 +187,7 @@ class CurrencyController extends Controller
$currency->symbol = htmlentities($currency->symbol);
// put previous url in session if not redirect from store (not "return_to_edit").
if (session('currencies.edit.fromUpdate') !== true) {
if (true !== session('currencies.edit.fromUpdate')) {
$this->rememberPreviousUri('currencies.edit.uri');
}
$request->session()->forget('currencies.edit.fromUpdate');
@@ -242,7 +234,7 @@ class CurrencyController extends Controller
$currency = $this->repository->store($data);
$request->session()->flash('success', trans('firefly.created_currency', ['name' => $currency->name]));
if (intval($request->get('create_another')) === 1) {
if (1 === intval($request->get('create_another'))) {
// @codeCoverageIgnoreStart
$request->session()->put('currencies.create.fromStore', true);
@@ -274,8 +266,7 @@ class CurrencyController extends Controller
$request->session()->flash('success', trans('firefly.updated_currency', ['name' => $currency->name]));
Preferences::mark();
if (intval($request->get('return_to_edit')) === 1) {
if (1 === intval($request->get('return_to_edit'))) {
// @codeCoverageIgnoreStart
$request->session()->put('currencies.edit.fromUpdate', true);