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;
@@ -38,9 +37,7 @@ use Session;
use View;
/**
* Class RuleGroupController
*
* @package FireflyIII\Http\Controllers
* Class RuleGroupController.
*/
class RuleGroupController extends Controller
{
@@ -51,7 +48,6 @@ class RuleGroupController extends Controller
{
parent::__construct();
$this->middleware(
function ($request, $next) {
View::share('title', trans('firefly.rules'));
@@ -71,7 +67,7 @@ class RuleGroupController extends Controller
$subTitle = trans('firefly.make_new_rule_group');
// put previous url in session if not redirect from store (not "create another").
if (session('rule-groups.create.fromStore') !== true) {
if (true !== session('rule-groups.create.fromStore')) {
$this->rememberPreviousUri('rule-groups.create.uri');
}
Session::forget('rule-groups.create.fromStore');
@@ -116,7 +112,6 @@ class RuleGroupController extends Controller
$repository->destroy($ruleGroup, $moveTo);
Session::flash('success', strval(trans('firefly.deleted_rule_group', ['title' => $title])));
Preferences::mark();
@@ -146,7 +141,7 @@ class RuleGroupController extends Controller
$subTitle = trans('firefly.edit_rule_group', ['title' => $ruleGroup->title]);
// put previous url in session if not redirect from store (not "return_to_edit").
if (session('rule-groups.edit.fromUpdate') !== true) {
if (true !== session('rule-groups.edit.fromUpdate')) {
$this->rememberPreviousUri('rule-groups.edit.uri');
}
Session::forget('rule-groups.edit.fromUpdate');
@@ -157,7 +152,7 @@ class RuleGroupController extends Controller
}
/**
* Execute the given rulegroup on a set of existing transactions
* Execute the given rulegroup on a set of existing transactions.
*
* @param SelectTransactionsRequest $request
* @param AccountRepositoryInterface $repository
@@ -223,7 +218,7 @@ class RuleGroupController extends Controller
Session::flash('success', strval(trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title])));
Preferences::mark();
if (intval($request->get('create_another')) === 1) {
if (1 === intval($request->get('create_another'))) {
// @codeCoverageIgnoreStart
Session::put('rule-groups.create.fromStore', true);
@@ -259,7 +254,7 @@ class RuleGroupController extends Controller
$data = [
'title' => $request->input('title'),
'description' => $request->input('description'),
'active' => intval($request->input('active')) === 1,
'active' => 1 === intval($request->input('active')),
];
$repository->update($ruleGroup, $data);
@@ -267,7 +262,7 @@ class RuleGroupController extends Controller
Session::flash('success', strval(trans('firefly.updated_rule_group', ['title' => $ruleGroup->title])));
Preferences::mark();
if (intval($request->get('return_to_edit')) === 1) {
if (1 === intval($request->get('return_to_edit'))) {
// @codeCoverageIgnoreStart
Session::put('rule-groups.edit.fromUpdate', true);