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\Transaction;
@@ -36,14 +35,10 @@ use URL;
use View;
/**
* Class LinkController
*
* @package FireflyIII\Http\Controllers\Transaction
* Class LinkController.
*/
class LinkController extends Controller
{
/**
*
*/
@@ -61,7 +56,6 @@ class LinkController extends Controller
);
}
/**
* @param TransactionJournalLink $link
*
@@ -107,7 +101,7 @@ class LinkController extends Controller
TransactionJournal $journal
) {
$linkInfo = $request->getLinkInfo();
if ($linkInfo['transaction_journal_id'] === 0) {
if (0 === $linkInfo['transaction_journal_id']) {
Session::flash('error', trans('firefly.invalid_link_selection'));
return redirect(route('transactions.show', [$journal->id]));
@@ -124,13 +118,13 @@ class LinkController extends Controller
$journalLink = new TransactionJournalLink;
$journalLink->linkType()->associate($linkType);
if ($linkInfo['direction'] === 'inward') {
if ('inward' === $linkInfo['direction']) {
Log::debug(sprintf('Link type is inwards ("%s"), so %d is source and %d is destination.', $linkType->inward, $other->id, $journal->id));
$journalLink->source()->associate($other);
$journalLink->destination()->associate($journal);
}
if ($linkInfo['direction'] === 'outward') {
if ('outward' === $linkInfo['direction']) {
Log::debug(sprintf('Link type is inwards ("%s"), so %d is source and %d is destination.', $linkType->outward, $journal->id, $other->id));
$journalLink->source()->associate($journal);
$journalLink->destination()->associate($other);