diff --git a/.coveralls.yml b/.coveralls.yml index 0c2d3ece9c..06571ec196 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,3 +1,3 @@ src_dir: . coverage_clover: storage/coverage/clover.xml -json_path: storage/coverage/coveralls-upload.json \ No newline at end of file +json_path: storage/coverage/coveralls-upload.json diff --git a/.gitignore b/.gitignore index 42fa21bb5a..71dfa14632 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ composer.phar Thumbs.db .idea/ -.DS_Store tests/_output/* _ide_helper.php /build/logs/clover.xml @@ -27,4 +26,5 @@ db.sqlite-journal tests/_output/* .env clover.xml -node_modules/ \ No newline at end of file +node_modules/ +addNewLines.php diff --git a/README.md b/README.md index 488176f9dd..033f8f3f0c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Firefly III (v3.3.4) +Firefly III (v3.3.5) =========== [![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=develop)](https://travis-ci.org/JC5/firefly-iii) diff --git a/app/Handlers/Events/JournalDeletedHandler.php b/app/Handlers/Events/JournalDeletedHandler.php index 16ad7b51e3..bcc3782511 100644 --- a/app/Handlers/Events/JournalDeletedHandler.php +++ b/app/Handlers/Events/JournalDeletedHandler.php @@ -1,16 +1,18 @@ targetdate)) { // count back until now. - // echo 'Count back!
'; $start = $piggyBank->targetdate; $end = $piggyBank->startdate; @@ -143,4 +142,4 @@ class ReminderHelper implements ReminderHelperInterface return 'Add ' . Amount::format($reminder->metadata->perReminder) . ' to fill this piggy bank on ' . $piggyBank->targetdate->format('jS F Y'); } -} \ No newline at end of file +} diff --git a/app/Helpers/Reminders/ReminderHelperInterface.php b/app/Helpers/Reminders/ReminderHelperInterface.php index cc381e1b04..833afe1a24 100644 --- a/app/Helpers/Reminders/ReminderHelperInterface.php +++ b/app/Helpers/Reminders/ReminderHelperInterface.php @@ -48,4 +48,4 @@ interface ReminderHelperInterface { * @return Reminder */ public function createReminder(PiggyBank $piggyBank, Carbon $start, Carbon $end); -} \ No newline at end of file +} diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index bb0ea1d3b8..cec2b058e3 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -168,4 +168,4 @@ class ReportHelper implements ReportHelperInterface return $report; } -} \ No newline at end of file +} diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index dedc6b38cb..2bbbefec75 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -55,4 +55,4 @@ interface ReportHelperInterface * @return array */ public function yearBalanceReport(Carbon $date, $showSharedReports = false); -} \ No newline at end of file +} diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 3dd13231e2..55d0b5ec73 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -143,7 +143,7 @@ class ReportQuery implements ReportQueryInterface ) ->orderBy('accounts.name', 'ASC') ->where( - function (Builder $query) use ($showSharedReports) { + function (Builder $query) { $query->where('account_meta.data', '!=', '"sharedAsset"'); $query->orWhereNull('account_meta.data'); @@ -272,15 +272,15 @@ class ReportQuery implements ReportQueryInterface // only get deposits not to a shared account // and transfers to a shared account. $query->where( - function ($query) { + function (Builder $query) { $query->where( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Deposit'); $q->where('acm_to.data', '!=', '"sharedAsset"'); } ); $query->orWhere( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Transfer'); $q->where('acm_from.data', '=', '"sharedAsset"'); } @@ -427,15 +427,15 @@ class ReportQuery implements ReportQueryInterface // get all withdrawals not from a shared accounts // and all transfers to a shared account $query->where( - function ($query) { + function (Builder $query) { $query->where( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Withdrawal'); $q->where('acm_from.data', '!=', '"sharedAsset"'); } ); $query->orWhere( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Transfer'); $q->where('acm_to.data', '=', '"sharedAsset"'); } @@ -495,15 +495,15 @@ class ReportQuery implements ReportQueryInterface // show queries where transfer type is deposit, and its not to a shared account // or where its a transfer and its from a shared account (both count as incomes) $query->where( - function ($query) { + function (Builder $query) { $query->where( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Deposit'); $q->where('acm_to.data', '!=', '"sharedAsset"'); } ); $query->orWhere( - function ($q) { + function (Builder $q) { $q->where('transaction_types.type', 'Transfer'); $q->where('acm_from.data', '=', '"sharedAsset"'); } @@ -604,4 +604,4 @@ class ReportQuery implements ReportQueryInterface ); } -} \ No newline at end of file +} diff --git a/app/Helpers/Report/ReportQueryInterface.php b/app/Helpers/Report/ReportQueryInterface.php index e67581a047..c92a46ad06 100644 --- a/app/Helpers/Report/ReportQueryInterface.php +++ b/app/Helpers/Report/ReportQueryInterface.php @@ -163,4 +163,4 @@ interface ReportQueryInterface * @return Collection */ public function sharedExpensesByCategory(Carbon $start, Carbon $end); -} \ No newline at end of file +} diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 26051e16d0..9cf2d0918e 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -7,6 +7,7 @@ use FireflyIII\Http\Requests; use FireflyIII\Http\Requests\AccountFormRequest; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Pagination\LengthAwarePaginator; use Input; use Redirect; @@ -124,7 +125,7 @@ class AccountController extends Controller // move to repository: $set = Auth::user()->accounts()->with( - ['accountmeta' => function ($query) { + ['accountmeta' => function (HasMany $query) { $query->where('name', 'accountRole'); }] )->accountTypeIn($types)->take($size)->offset($offset)->orderBy('accounts.name', 'ASC')->get(['accounts.*']); diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 0f3a19dde7..a4fd311bfd 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -5,6 +5,7 @@ use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Auth\Registrar; use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; use Illuminate\Http\Request; +use Illuminate\Mail\Message; use Mail; use Session; @@ -73,7 +74,7 @@ class AuthController extends Controller // send email. Mail::send( - 'emails.registered', [], function ($message) use ($email) { + 'emails.registered', [], function (Message $message) use ($email) { $message->to($email, $email)->subject('Welcome to Firefly III!'); } ); diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index f53bd43785..457b20bdb1 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -157,8 +157,6 @@ class BillController extends Controller public function store(BillFormRequest $request, BillRepositoryInterface $repository) { - var_dump($request->all()); - $billData = [ 'name' => $request->get('name'), 'match' => $request->get('match'), diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index e0147eb5ab..1cd2d46706 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -170,6 +170,10 @@ class BudgetController extends Controller Session::flash('success', 'New budget "' . $budget->name . '" stored!'); + if (intval(Input::get('create_another')) === 1) { + return Redirect::route('budgets.create')->withInput(); + } + return Redirect::route('budgets.index'); } diff --git a/app/Http/Controllers/GoogleChartController.php b/app/Http/Controllers/GoogleChartController.php index a2faed935c..c7095c0c84 100644 --- a/app/Http/Controllers/GoogleChartController.php +++ b/app/Http/Controllers/GoogleChartController.php @@ -6,7 +6,6 @@ use Carbon\Carbon; use DB; use Exception; use FireflyIII\Helpers\Report\ReportQueryInterface; -use FireflyIII\Http\Requests; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; use FireflyIII\Models\Budget; diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index fe3194ea61..5c03c30456 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -2,7 +2,6 @@ use Cache; use ErrorException; -use FireflyIII\Http\Requests; use League\CommonMark\CommonMarkConverter; use Response; use Route; @@ -33,7 +32,7 @@ class HelpController extends Controller return Response::json($content); } - if ($this->_inCache($route)) { + if ($this->inCache($route)) { $content = [ 'text' => Cache::get('help.' . $route . '.text'), 'title' => Cache::get('help.' . $route . '.title'), @@ -41,7 +40,7 @@ class HelpController extends Controller return Response::json($content); } - $content = $this->_getFromGithub($route); + $content = $this->getFromGithub($route); Cache::put('help.' . $route . '.text', $content['text'], 10080); // a week. @@ -56,7 +55,7 @@ class HelpController extends Controller * * @return bool */ - protected function _inCache($route) + protected function inCache($route) { return Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text'); } @@ -66,7 +65,7 @@ class HelpController extends Controller * * @return array */ - protected function _getFromGithub($route) + protected function getFromGithub($route) { $uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/' . e($route) . '.md'; $content = [ diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index b444c29251..48981f8143 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -3,15 +3,14 @@ use Amount; use Auth; use DB; -use FireflyIII\Http\Requests; use FireflyIII\Models\Bill; +use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use Input; use Preferences; use Response; use Session; -use Config; -use FireflyIII\Models\TransactionType; + /** * Class JsonController * @@ -91,7 +90,6 @@ class JsonController extends Controller $count = $bill->transactionjournals()->before($range['end'])->after($range['start'])->count(); if ($count != 0) { $journal = $bill->transactionjournals()->with('transactions')->before($range['end'])->after($range['start'])->first(); - $paid['items'][] = $journal->description; $currentAmount = 0; foreach ($journal->transactions as $t) { if (floatval($t->amount) > 0) { @@ -182,16 +180,17 @@ class JsonController extends Controller public function transactionJournals($what) { $descriptions = []; - $dbType = TransactionType::whereType($what)->first(); - $journals = Auth::user()->transactionjournals()->where('transaction_type_id', $dbType->id) - ->orderBy('id','DESC')->take(50) - ->get(); - foreach($journals as $j) { - $descriptions[] = $j->description; - } + $dbType = TransactionType::whereType($what)->first(); + $journals = Auth::user()->transactionjournals()->where('transaction_type_id', $dbType->id) + ->orderBy('id', 'DESC')->take(50) + ->get(); + foreach ($journals as $j) { + $descriptions[] = $j->description; + } $descriptions = array_unique($descriptions); sort($descriptions); + return Response::json($descriptions); diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index c80fa70c28..dd0a6979c0 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -7,7 +7,6 @@ use Config; use ExpandedForm; use FireflyIII\Http\Requests; use FireflyIII\Http\Requests\PiggyBankFormRequest; -use FireflyIII\Models\Account; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Repositories\Account\AccountRepositoryInterface; diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index b21e81c0bc..298b14d8f5 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -1,7 +1,6 @@ _validatePassword($request->get('current_password'), $request->get('new_password'), $request->get('new_password_confirmation')); + $result = $this->validatePassword($request->get('current_password'), $request->get('new_password'), $request->get('new_password_confirmation')); if (!($result === true)) { Session::flash('error', $result); @@ -70,7 +70,7 @@ class ProfileController extends Controller * * @return string|bool */ - protected function _validatePassword($old, $new1, $new2) + protected function validatePassword($old, $new1, $new2) { if (strlen($new1) == 0 || strlen($new2) == 0) { return 'Do fill in a password!'; diff --git a/app/Http/Controllers/RelatedController.php b/app/Http/Controllers/RelatedController.php index 6e5102bf52..5bdebaae3a 100644 --- a/app/Http/Controllers/RelatedController.php +++ b/app/Http/Controllers/RelatedController.php @@ -1,7 +1,6 @@ filter( - function (Reminder $reminder) use ($today) { + function (Reminder $reminder) { if ($reminder->active === false) { return $reminder; } @@ -92,7 +91,7 @@ class ReminderController extends Controller // dismissed reminders $dismissed = $reminders->filter( - function (Reminder $reminder) use ($today) { + function (Reminder $reminder) { if ($reminder->notnow === true) { return $reminder; } diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index ef345a6f96..1a6eef25ee 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -5,7 +5,6 @@ use Carbon\Carbon; use Exception; use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Helpers\Report\ReportQueryInterface; -use FireflyIII\Http\Requests; use FireflyIII\Models\Account; use FireflyIII\Models\TransactionJournal; use Illuminate\Database\Query\JoinClause; @@ -382,8 +381,6 @@ class ReportController extends Controller $groupedIncomes = $query->journalsByRevenueAccount($date, $end, $showSharedReports); $groupedExpenses = $query->journalsByExpenseAccount($date, $end, $showSharedReports); - //$groupedExpenses = $helper-> expensesGroupedByAccount($date, $end, 15); - return view( 'reports.year', compact('date', 'groupedIncomes', 'groupedExpenses', 'year', 'balances', 'title', 'subTitle', 'subTitleIcon', 'mainTitleIcon') ); diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 8c54a3170e..4a6016fadd 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -1,6 +1,5 @@ auth->guest()) { if ($request->ajax()) { diff --git a/app/Http/Middleware/PiggyBanks.php b/app/Http/Middleware/PiggyBanks.php index 1584f94175..92ac858ba4 100644 --- a/app/Http/Middleware/PiggyBanks.php +++ b/app/Http/Middleware/PiggyBanks.php @@ -7,9 +7,9 @@ use Carbon\Carbon; use Closure; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankRepetition; -use FireflyIII\Models\Reminder; use Illuminate\Contracts\Auth\Guard; use Illuminate\Database\Query\JoinClause; +use Illuminate\Http\Request; use Illuminate\Support\Collection; use Navigation; use Session; @@ -48,7 +48,7 @@ class PiggyBanks * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->auth->check() && !$request->isXmlHttpRequest()) { // get piggy banks without a repetition: @@ -91,7 +91,6 @@ class PiggyBanks $start = clone $piggyBank->startdate; $end = clone $piggyBank->targetdate; $max = clone $piggyBank->targetdate; - $index = 0; // first loop: start date to target date. // then, continue looping until end is > today @@ -127,7 +126,6 @@ class PiggyBanks $repetition->targetdate = is_null($piggyBank->targetdate) ? null : $piggyBank->targetdate; $repetition->currentamount = 0; // it might exist, catch: - //$repetition->save(); // then, loop from original target up to now. } @@ -138,4 +136,4 @@ class PiggyBanks return $next($request); } -} \ No newline at end of file +} diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index b37db6b6b4..7a5f212bc5 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -6,6 +6,7 @@ namespace FireflyIII\Http\Middleware; use Carbon\Carbon; use Closure; use Illuminate\Contracts\Auth\Guard; +use Illuminate\Http\Request; use Navigation; use Preferences; use Session; @@ -44,7 +45,7 @@ class Range * * @return mixed */ - public function handle($request, Closure $theNext) + public function handle(Request $request, Closure $theNext) { if ($this->auth->check()) { @@ -84,4 +85,4 @@ class Range } -} \ No newline at end of file +} diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 5033c35130..237bbe02ce 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -3,6 +3,7 @@ use Closure; use Illuminate\Contracts\Auth\Guard; use Illuminate\Http\RedirectResponse; +use Illuminate\Http\Request; /** * Class RedirectIfAuthenticated @@ -38,7 +39,7 @@ class RedirectIfAuthenticated * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->auth->check()) { return new RedirectResponse(url('/')); diff --git a/app/Http/Middleware/Reminders.php b/app/Http/Middleware/Reminders.php index 3bc152328f..55c555aec0 100644 --- a/app/Http/Middleware/Reminders.php +++ b/app/Http/Middleware/Reminders.php @@ -8,6 +8,7 @@ use Closure; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\Reminder; use Illuminate\Contracts\Auth\Guard; +use Illuminate\Http\Request; use View; /** @@ -43,7 +44,7 @@ class Reminders * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->auth->check() && !$request->isXmlHttpRequest()) { // do reminders stuff. @@ -87,4 +88,4 @@ class Reminders return $next($request); } -} \ No newline at end of file +} diff --git a/app/Http/Middleware/ReplaceTestVars.php b/app/Http/Middleware/ReplaceTestVars.php index 3af1d24641..ad35519a3e 100644 --- a/app/Http/Middleware/ReplaceTestVars.php +++ b/app/Http/Middleware/ReplaceTestVars.php @@ -4,15 +4,15 @@ namespace FireflyIII\Http\Middleware; use Closure; use Illuminate\Contracts\Foundation\Application; -use Illuminate\Contracts\Routing\Middleware; +use Illuminate\Http\Request; use Log; /** * Class ReplaceTestVars * - * @package App\Http\Middleware + * @package FireflyIII\Http\Middleware */ -class ReplaceTestVars implements Middleware +class ReplaceTestVars { /** * The application implementation. @@ -40,7 +40,7 @@ class ReplaceTestVars implements Middleware * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ('testing' === $this->app->environment() && $request->has('_token')) { $input = $request->all(); @@ -53,4 +53,4 @@ class ReplaceTestVars implements Middleware return $next($request); } -} \ No newline at end of file +} diff --git a/app/Http/Requests/BillFormRequest.php b/app/Http/Requests/BillFormRequest.php index 2c1cfdc45a..b3057bc885 100644 --- a/app/Http/Requests/BillFormRequest.php +++ b/app/Http/Requests/BillFormRequest.php @@ -46,4 +46,4 @@ class BillFormRequest extends Request return $rules; } -} \ No newline at end of file +} diff --git a/app/Http/Requests/BudgetFormRequest.php b/app/Http/Requests/BudgetFormRequest.php index 591926a969..19c3924417 100644 --- a/app/Http/Requests/BudgetFormRequest.php +++ b/app/Http/Requests/BudgetFormRequest.php @@ -37,4 +37,4 @@ class BudgetFormRequest extends Request 'name' => $nameRule, ]; } -} \ No newline at end of file +} diff --git a/app/Http/Requests/CategoryFormRequest.php b/app/Http/Requests/CategoryFormRequest.php index 30376b4cd8..7b9e577dc0 100644 --- a/app/Http/Requests/CategoryFormRequest.php +++ b/app/Http/Requests/CategoryFormRequest.php @@ -37,4 +37,4 @@ class CategoryFormRequest extends Request 'name' => $nameRule, ]; } -} \ No newline at end of file +} diff --git a/app/Http/Requests/CurrencyFormRequest.php b/app/Http/Requests/CurrencyFormRequest.php index 48fe2146d3..d45716d6d4 100644 --- a/app/Http/Requests/CurrencyFormRequest.php +++ b/app/Http/Requests/CurrencyFormRequest.php @@ -42,4 +42,4 @@ class CurrencyFormRequest extends Request return $rules; } -} \ No newline at end of file +} diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index 038542c0bc..82b8f8549e 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -3,9 +3,8 @@ namespace FireflyIII\Http\Requests; use Auth; -use FireflyIII\Models\Account; use Input; - +use Exception; /** * Class JournalFormRequest * @@ -24,6 +23,7 @@ class JournalFormRequest extends Request /** * @return array + * @throws Exception */ public function rules() { @@ -62,7 +62,7 @@ class JournalFormRequest extends Request $rules['category'] = 'between:1,255'; break; default: - die('Cannot handle ' . $what); + throw new Exception('Cannot handle ' . $what); break; } @@ -70,4 +70,4 @@ class JournalFormRequest extends Request } -} \ No newline at end of file +} diff --git a/app/Http/Requests/PiggyBankFormRequest.php b/app/Http/Requests/PiggyBankFormRequest.php index 768eda19a4..795246c1b8 100644 --- a/app/Http/Requests/PiggyBankFormRequest.php +++ b/app/Http/Requests/PiggyBankFormRequest.php @@ -4,7 +4,6 @@ namespace FireflyIII\Http\Requests; use Auth; use Carbon\Carbon; -use FireflyIII\Models\Account; use Input; use Navigation; @@ -66,4 +65,4 @@ class PiggyBankFormRequest extends Request return $rules; } -} \ No newline at end of file +} diff --git a/app/Http/Requests/ProfileFormRequest.php b/app/Http/Requests/ProfileFormRequest.php index 2b337a1037..0fc12e3377 100644 --- a/app/Http/Requests/ProfileFormRequest.php +++ b/app/Http/Requests/ProfileFormRequest.php @@ -3,7 +3,6 @@ namespace FireflyIII\Http\Requests; use Auth; -use FireflyIII\Models\Account; /** * Class ProfileFormRequest @@ -32,4 +31,4 @@ class ProfileFormRequest extends Request 'new_password_confirmation' => 'required', ]; } -} \ No newline at end of file +} diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 1ca7795fe1..ad1b4fd672 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -45,7 +45,6 @@ class PiggyBank extends Model return $rep; } else { Log::error('Tried to work with a piggy bank with a repeats=1 value! (id is '.$this->id.')'); - //App::abort(500); } diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index 4474c26e90..6c5c939b16 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -1,8 +1,9 @@ belongsTo('FireflyIII\Models\PiggyBank'); } - /** - * @param EloquentBuilder $query - * @param Carbon $date - * - * @return mixed - */ - public function scopeRelevantOnDate(EloquentBuilder $query, Carbon $date) - { - return $query->where( - function($q) use ($date) { - $q->where('startdate', '<=', $date->format('Y-m-d 00:00:00')); - $q->orWhereNull('startdate'); - }) - - ->where(function($q) use ($date) { - - $q->where('targetdate', '>=', $date->format('Y-m-d 00:00:00')); - $q->orWhereNull('targetdate'); - }); - } - /** * @param EloquentBuilder $query * @param Carbon $start @@ -57,7 +37,30 @@ class PiggyBankRepetition extends Model */ public function scopeOnDates(EloquentBuilder $query, Carbon $start, Carbon $target) { - return $query->where('startdate',$start->format('Y-m-d'))->where('targetdate',$target->format('Y-m-d')); + return $query->where('startdate', $start->format('Y-m-d'))->where('targetdate', $target->format('Y-m-d')); + } + + /** + * @param EloquentBuilder $query + * @param Carbon $date + * + * @return mixed + */ + public function scopeRelevantOnDate(EloquentBuilder $query, Carbon $date) + { + return $query->where( + function (EloquentBuilder $q) use ($date) { + $q->where('startdate', '<=', $date->format('Y-m-d 00:00:00')); + $q->orWhereNull('startdate'); + } + ) + ->where( + function (EloquentBuilder $q) use ($date) { + + $q->where('targetdate', '>=', $date->format('Y-m-d 00:00:00')); + $q->orWhereNull('targetdate'); + } + ); } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index e7c8505580..c92888c235 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -1,8 +1,6 @@ before( - function (Request $request) { - - // put IP in session if not already there. - - $reminders = []; - - if ($request->user()) { - //Filter::setSessionDateRange(); - //Reminders::updateReminders(); - //Steam::removeEmptyBudgetLimits(); - //$reminders = Reminders::getReminders(); - } - // View::share('reminders', $reminders); - } - ); } /** diff --git a/app/Providers/TestingServiceProvider.php b/app/Providers/TestingServiceProvider.php index ff26c311ca..707c0ddd3f 100644 --- a/app/Providers/TestingServiceProvider.php +++ b/app/Providers/TestingServiceProvider.php @@ -25,4 +25,4 @@ class TestingServiceProvider extends ServiceProvider } } -} \ No newline at end of file +} diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 859d06b09a..6ea2ec97a8 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -118,7 +118,6 @@ class AccountRepository implements AccountRepositoryInterface return $paginator; - //return Paginator::make($items, $count, 50); } @@ -202,8 +201,8 @@ class AccountRepository implements AccountRepositoryInterface */ public function store(array $data) { - $newAccount = $this->_store($data); - $this->_storeMetadata($newAccount, $data); + $newAccount = $this->storeAccount($data); + $this->storeMetadata($newAccount, $data); // continue with the opposing account: @@ -215,8 +214,8 @@ class AccountRepository implements AccountRepositoryInterface 'name' => $data['name'] . ' initial balance', 'active' => false, ]; - $opposing = $this->_store($opposingData); - $this->_storeInitialBalance($newAccount, $opposing, $data); + $opposing = $this->storeAccount($opposingData); + $this->storeInitialBalance($newAccount, $opposing, $data); } @@ -236,7 +235,7 @@ class AccountRepository implements AccountRepositoryInterface $account->save(); // update meta data: - $this->_updateMetadata($account, $data); + $this->updateMetadata($account, $data); $openingBalance = $this->openingBalanceTransaction($account); @@ -245,7 +244,7 @@ class AccountRepository implements AccountRepositoryInterface // if opening balance, do an update: if ($openingBalance) { // update existing opening balance. - $this->_updateInitialBalance($account, $openingBalance, $data); + $this->updateInitialBalance($account, $openingBalance, $data); } else { // create new opening balance. $type = $data['openingBalance'] < 0 ? 'expense' : 'revenue'; @@ -255,8 +254,8 @@ class AccountRepository implements AccountRepositoryInterface 'name' => $data['name'] . ' initial balance', 'active' => false, ]; - $opposing = $this->_store($opposingData); - $this->_storeInitialBalance($account, $opposing, $data); + $opposing = $this->storeAccount($opposingData); + $this->storeInitialBalance($account, $opposing, $data); } } else { @@ -275,7 +274,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return Account */ - protected function _store(array $data) + protected function storeAccount(array $data) { $type = Config::get('firefly.accountTypeByIdentifier.' . $data['accountType']); $accountType = AccountType::whereType($type)->first(); @@ -307,7 +306,7 @@ class AccountRepository implements AccountRepositoryInterface * @param Account $account * @param array $data */ - protected function _storeMetadata(Account $account, array $data) + protected function storeMetadata(Account $account, array $data) { $metaData = new AccountMeta( [ @@ -329,7 +328,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return TransactionJournal */ - protected function _storeInitialBalance(Account $account, Account $opposing, array $data) + protected function storeInitialBalance(Account $account, Account $opposing, array $data) { $type = $data['openingBalance'] < 0 ? 'Withdrawal' : 'Deposit'; $transactionType = TransactionType::whereType($type)->first(); @@ -398,7 +397,7 @@ class AccountRepository implements AccountRepositoryInterface * @param Account $account * @param array $data */ - protected function _updateMetadata(Account $account, array $data) + protected function updateMetadata(Account $account, array $data) { $metaEntries = $account->accountMeta()->get(); $updated = false; @@ -435,7 +434,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return TransactionJournal */ - protected function _updateInitialBalance(Account $account, TransactionJournal $journal, array $data) + protected function updateInitialBalance(Account $account, TransactionJournal $journal, array $data) { $journal->date = $data['openingBalanceDate']; @@ -453,4 +452,4 @@ class AccountRepository implements AccountRepositoryInterface return $journal; } -} \ No newline at end of file +} diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 41de454e63..e948ba01c8 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -85,4 +85,4 @@ interface AccountRepositoryInterface * @return Collection */ public function getSavingsAccounts(); -} \ No newline at end of file +} diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 5c12f99b0b..9f928cabb4 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -51,16 +51,11 @@ class BillRepository implements BillRepositoryInterface foreach ($billStarts as $dateEntry) { if ($dateEntry['end'] > $start && $dateEntry['start'] < $end) { // count transactions for bill in this range (not relevant yet!): - // $count = $bill->transactionjournals()->before($dateEntry['end'])->after($dateEntry['start'])->count(); - // if ($count == 0) { $validRanges[] = $dateEntry; - // } } } return $validRanges; - // echo $bill->name; - // var_dump($validRanges); } /** diff --git a/app/Repositories/Bill/BillRepositoryInterface.php b/app/Repositories/Bill/BillRepositoryInterface.php index 66ce00cf4a..44402cea23 100644 --- a/app/Repositories/Bill/BillRepositoryInterface.php +++ b/app/Repositories/Bill/BillRepositoryInterface.php @@ -56,4 +56,4 @@ interface BillRepositoryInterface { */ public function scan(Bill $bill, TransactionJournal $journal); -} \ No newline at end of file +} diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index f409b4c063..2c547d1618 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -142,4 +142,4 @@ class BudgetRepository implements BudgetRepositoryInterface } -} \ No newline at end of file +} diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index eabda354f3..dce5f21ae4 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -63,4 +63,4 @@ interface BudgetRepositoryInterface */ public function getJournals(Budget $budget, LimitRepetition $repetition = null, $take = 50); -} \ No newline at end of file +} diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index cc168bb0b9..437fb2da69 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -58,4 +58,4 @@ class CategoryRepository implements CategoryRepositoryInterface return $category; } -} \ No newline at end of file +} diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index 5b099eb6c7..7e4871a378 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -33,4 +33,4 @@ interface CategoryRepositoryInterface */ public function update(Category $category, array $data); -} \ No newline at end of file +} diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index be17996e38..a3bde0c535 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -11,7 +11,6 @@ use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use Illuminate\Support\Collection; -use Log; /** * Class JournalRepository @@ -275,7 +274,7 @@ class JournalRepository implements JournalRepositoryInterface $transaction->save(); } if (floatval($transaction->amount) > 0) { - $transaction->amount = $data['amount']; + $transaction->amount = $data['amount']; $transaction->account_id = $to->id; $transaction->save(); } @@ -287,4 +286,4 @@ class JournalRepository implements JournalRepositoryInterface return $journal; } -} \ No newline at end of file +} diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index f083fb9a3e..cf10d0e557 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -44,4 +44,4 @@ interface JournalRepositoryInterface * @return mixed */ public function update(TransactionJournal $journal, array $data); -} \ No newline at end of file +} diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index fa4ace8d68..3fedcf5871 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -6,7 +6,6 @@ use Auth; use DB; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankRepetition; -use FireflyIII\Models\Reminder; use Illuminate\Support\Collection; use Navigation; @@ -98,7 +97,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.id') ->where('accounts.user_id', Auth::user()->id) ->update(['order' => 0, 'piggy_banks.updated_at' => DB::Raw('NOW()')]); - //Auth::user()->piggyBanks()->update(['order' => 0]); } /** @@ -164,4 +162,4 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface return $piggyBank; } -} \ No newline at end of file +} diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index a763e5bfba..13afce327d 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -4,9 +4,7 @@ namespace FireflyIII\Repositories\PiggyBank; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankRepetition; -use FireflyIII\Models\Reminder; use Illuminate\Support\Collection; -use Carbon\Carbon; /** * Interface PiggyBankRepositoryInterface @@ -39,6 +37,7 @@ interface PiggyBankRepositoryInterface /** * Set all piggy banks to order 0. + * * @return void */ public function reset(); @@ -55,7 +54,6 @@ interface PiggyBankRepositoryInterface public function setOrder($id, $order); - /** * @param array $data * @@ -70,4 +68,4 @@ interface PiggyBankRepositoryInterface * @return PiggyBank */ public function update(PiggyBank $piggyBank, array $data); -} \ No newline at end of file +} diff --git a/app/Support/Amount.php b/app/Support/Amount.php index fc6868cf97..115392eb1f 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -166,4 +166,4 @@ class Amount return $currency; } -} \ No newline at end of file +} diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 2d82dacbf5..99c28470ed 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -314,4 +314,4 @@ class ExpandedForm return $html; } -} \ No newline at end of file +} diff --git a/app/Support/Facades/Amount.php b/app/Support/Facades/Amount.php index 90562d745e..3a8d059ea4 100644 --- a/app/Support/Facades/Amount.php +++ b/app/Support/Facades/Amount.php @@ -21,4 +21,4 @@ class Amount extends Facade return 'amount'; } -} \ No newline at end of file +} diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.php index ee365cc6b0..4757d8e779 100644 --- a/app/Support/Facades/ExpandedForm.php +++ b/app/Support/Facades/ExpandedForm.php @@ -21,4 +21,4 @@ class ExpandedForm extends Facade return 'expandedform'; } -} \ No newline at end of file +} diff --git a/app/Support/Facades/Navigation.php b/app/Support/Facades/Navigation.php index 2f0db5c215..86adb38a13 100644 --- a/app/Support/Facades/Navigation.php +++ b/app/Support/Facades/Navigation.php @@ -21,4 +21,4 @@ class Navigation extends Facade return 'navigation'; } -} \ No newline at end of file +} diff --git a/app/Support/Facades/Preferences.php b/app/Support/Facades/Preferences.php index a6b1818cef..d7c093c38e 100644 --- a/app/Support/Facades/Preferences.php +++ b/app/Support/Facades/Preferences.php @@ -21,4 +21,4 @@ class Preferences extends Facade return 'preferences'; } -} \ No newline at end of file +} diff --git a/app/Support/Facades/Steam.php b/app/Support/Facades/Steam.php index 5bcfe12e30..496975c3be 100644 --- a/app/Support/Facades/Steam.php +++ b/app/Support/Facades/Steam.php @@ -21,4 +21,4 @@ class Steam extends Facade return 'steam'; } -} \ No newline at end of file +} diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 7c734e3b9d..2ef5c9a4bd 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -457,4 +457,4 @@ class Navigation } -} \ No newline at end of file +} diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 185fea9512..b12a8fef6a 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -55,4 +55,4 @@ class Preferences return $pref; } -} \ No newline at end of file +} diff --git a/app/Support/Search/SearchInterface.php b/app/Support/Search/SearchInterface.php index 50d7c6ad08..4b58393065 100644 --- a/app/Support/Search/SearchInterface.php +++ b/app/Support/Search/SearchInterface.php @@ -45,4 +45,4 @@ interface SearchInterface { * @return Collection */ public function searchTransactions(array $words); -} \ No newline at end of file +} diff --git a/app/Support/Steam.php b/app/Support/Steam.php index ce3fbfb1a4..756c11b73d 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -198,4 +198,4 @@ class Steam return $array; } -} \ No newline at end of file +} diff --git a/bootstrap/app.php b/bootstrap/app.php index e3697dc4ad..e3ec5b5519 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -11,10 +11,8 @@ | */ -use FireflyIII\Validation\FireflyValidator; - $app = new Illuminate\Foundation\Application( - realpath(__DIR__.'/../') + realpath(__DIR__ . '/../') ); /* @@ -29,18 +27,18 @@ $app = new Illuminate\Foundation\Application( */ $app->singleton( - 'Illuminate\Contracts\Http\Kernel', - 'FireflyIII\Http\Kernel' + 'Illuminate\Contracts\Http\Kernel', + 'FireflyIII\Http\Kernel' ); $app->singleton( - 'Illuminate\Contracts\Console\Kernel', - 'FireflyIII\Console\Kernel' + 'Illuminate\Contracts\Console\Kernel', + 'FireflyIII\Console\Kernel' ); $app->singleton( - 'Illuminate\Contracts\Debug\ExceptionHandler', - 'FireflyIII\Exceptions\Handler' + 'Illuminate\Contracts\Debug\ExceptionHandler', + 'FireflyIII\Exceptions\Handler' ); /* diff --git a/composer.json b/composer.json index f214d73c10..d268b01254 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,8 @@ "require": { "laravel/framework": "5.0.*", "davejamesmiller/laravel-breadcrumbs": "~3.0", - "grumpydictator/gchart": "dev-master", - "watson/validating": "dev-master", + "grumpydictator/gchart": "~1", + "watson/validating": "~1.0", "doctrine/dbal": "~2.5", "illuminate/html": "~5.0", "league/commonmark": "0.7.*" diff --git a/composer.lock b/composer.lock index f3ef64268f..1a108b872b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "34e0c28c0f8f4c04b545b2cbb0f2f24b", + "hash": "b77b9f717b25e1e193bdc6edb18ad492", "packages": [ { "name": "classpreloader/classpreloader", @@ -682,7 +682,7 @@ }, { "name": "grumpydictator/gchart", - "version": "dev-master", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/JC5/gchart.git", @@ -950,16 +950,16 @@ }, { "name": "laravel/framework", - "version": "v5.0.22", + "version": "v5.0.23", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "388289de68ba912746bd1adb20a8b1cd0f846ea1" + "reference": "59219f7afb60be05d74ce01fcb5d2440f7a1b13d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/388289de68ba912746bd1adb20a8b1cd0f846ea1", - "reference": "388289de68ba912746bd1adb20a8b1cd0f846ea1", + "url": "https://api.github.com/repos/laravel/framework/zipball/59219f7afb60be05d74ce01fcb5d2440f7a1b13d", + "reference": "59219f7afb60be05d74ce01fcb5d2440f7a1b13d", "shasum": "" }, "require": { @@ -1072,7 +1072,7 @@ "framework", "laravel" ], - "time": "2015-03-27 14:49:51" + "time": "2015-03-28 16:56:59" }, { "name": "league/commonmark", @@ -2351,7 +2351,7 @@ }, { "name": "watson/validating", - "version": "dev-master", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/dwightwatson/validating.git", @@ -3962,8 +3962,6 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "grumpydictator/gchart": 20, - "watson/validating": 20, "barryvdh/laravel-debugbar": 0 }, "prefer-stable": false, diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php index 6ab7fad298..62ee9465bb 100644 --- a/database/seeds/TestDataSeeder.php +++ b/database/seeds/TestDataSeeder.php @@ -9,8 +9,6 @@ use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\Category; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankEvent; -use FireflyIII\Models\PiggyBankRepetition; -use FireflyIII\Models\Reminder; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionGroup; @@ -137,12 +135,9 @@ class TestDataSeeder extends Seeder $acc_c = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Delete me', 'active' => 1]); // create account meta: - $meta_a = AccountMeta::create(['account_id' => $acc_a->id, 'name' => 'accountRole', 'data' => 'defaultAsset']); - $meta_b = AccountMeta::create(['account_id' => $acc_b->id, 'name' => 'accountRole', 'data' => 'savingAsset']); - $meta_c = AccountMeta::create(['account_id' => $acc_c->id, 'name' => 'accountRole', 'data' => 'defaultAsset']); -// var_dump($meta_a->toArray()); -// var_dump($meta_b->toArray()); -// var_dump($meta_c->toArray()); + AccountMeta::create(['account_id' => $acc_a->id, 'name' => 'accountRole', 'data' => 'defaultAsset']); + AccountMeta::create(['account_id' => $acc_b->id, 'name' => 'accountRole', 'data' => 'savingAsset']); + AccountMeta::create(['account_id' => $acc_c->id, 'name' => 'accountRole', 'data' => 'defaultAsset']); $acc_d = Account::create(['user_id' => $user->id, 'account_type_id' => $ibType->id, 'name' => 'Checking account initial balance', 'active' => 0]); $acc_e = Account::create(['user_id' => $user->id, 'account_type_id' => $ibType->id, 'name' => 'Savings account initial balance', 'active' => 0]); @@ -211,20 +206,17 @@ class TestDataSeeder extends Seeder $bills = Budget::create(['user_id' => $user->id, 'name' => 'Bills']); $deleteMe = Budget::create(['user_id' => $user->id, 'name' => 'Delete me']); Budget::create(['user_id' => $user->id, 'name' => 'Budget without repetition']); - $groceriesLimit = BudgetLimit::create( + BudgetLimit::create( ['startdate' => $this->som, 'amount' => 201, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $groceries->id] ); - $billsLimit = BudgetLimit::create( + BudgetLimit::create( ['startdate' => $this->som, 'amount' => 202, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $bills->id] ); - $deleteMeLimit = BudgetLimit::create( + BudgetLimit::create( ['startdate' => $this->som, 'amount' => 203, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $deleteMe->id] ); // and because we have no filters, some repetitions: - // LimitRepetition::create(['budget_limit_id' => $groceriesLimit->id, 'startdate' => $this->som, 'enddate' => $this->eom, 'amount' => 201]); - // LimitRepetition::create(['budget_limit_id' => $billsLimit->id, 'startdate' => $this->som, 'enddate' => $this->eom, 'amount' => 202]); - // LimitRepetition::create(['budget_limit_id' => $deleteMeLimit->id, 'startdate' => $this->som, 'enddate' => $this->eom, 'amount' => 203]); } /** @@ -255,7 +247,6 @@ class TestDataSeeder extends Seeder $endDate->addMonths(4); $nextYear->addYear()->subDay(); - $next = $nextYear->format('Y-m-d'); $end = $endDate->format('Y-m-d'); // piggy bank @@ -351,8 +342,6 @@ class TestDataSeeder extends Seeder */ public function createReminders() { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - // for weekly piggy bank (clothes) } @@ -604,4 +593,4 @@ class TestDataSeeder extends Seeder } -} \ No newline at end of file +} diff --git a/phpspec.yml b/phpspec.yml index a028599425..1f6a86a520 100644 --- a/phpspec.yml +++ b/phpspec.yml @@ -2,4 +2,4 @@ suites: main: namespace: FireflyIII psr4_prefix: FireflyIII - src_path: app \ No newline at end of file + src_path: app diff --git a/phpunit.xml b/phpunit.xml index f21afb4ffc..0410acac89 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -31,4 +31,4 @@ - \ No newline at end of file + diff --git a/resources/views/emails/registered.blade.php b/resources/views/emails/registered.blade.php index 5a58f60f2d..4550f79f9d 100644 --- a/resources/views/emails/registered.blade.php +++ b/resources/views/emails/registered.blade.php @@ -2,4 +2,4 @@ Hey there! Welkome to Firefly III. Your registration has made it, and this email is here to confirm it. -Thanks for using Firefly! \ No newline at end of file +Thanks for using Firefly! diff --git a/resources/views/form/amount.blade.php b/resources/views/form/amount.blade.php index c5c10d6050..6f0beb7316 100644 --- a/resources/views/form/amount.blade.php +++ b/resources/views/form/amount.blade.php @@ -19,4 +19,4 @@ @include('form.feedback') {!! Form::input('hidden','amount_currency_id',$defaultCurrency->id) !!} - \ No newline at end of file + diff --git a/resources/views/form/balance.blade.php b/resources/views/form/balance.blade.php index 50a834ecb9..34294152a8 100644 --- a/resources/views/form/balance.blade.php +++ b/resources/views/form/balance.blade.php @@ -19,4 +19,4 @@ {!! Form::input('hidden','balance_currency_id',$defaultCurrency->id) !!} - \ No newline at end of file + diff --git a/resources/views/form/checkbox.blade.php b/resources/views/form/checkbox.blade.php index 038bac2dc5..cfe415d73d 100644 --- a/resources/views/form/checkbox.blade.php +++ b/resources/views/form/checkbox.blade.php @@ -8,4 +8,4 @@ @include('form.feedback') - \ No newline at end of file + diff --git a/resources/views/form/date.blade.php b/resources/views/form/date.blade.php index 71ab250e1a..58c3c1e5e3 100644 --- a/resources/views/form/date.blade.php +++ b/resources/views/form/date.blade.php @@ -4,4 +4,4 @@ {!! Form::input('date', $name, $value, $options) !!} @include('form.feedback') - \ No newline at end of file + diff --git a/resources/views/form/feedback.blade.php b/resources/views/form/feedback.blade.php index d3f62af36d..5b26fa2fb7 100644 --- a/resources/views/form/feedback.blade.php +++ b/resources/views/form/feedback.blade.php @@ -1,4 +1,4 @@ @if($errors->has($name))

{{{$errors->first($name)}}}

-@endif \ No newline at end of file +@endif diff --git a/resources/views/form/integer.blade.php b/resources/views/form/integer.blade.php index cfd93a09c2..9b84d9626f 100644 --- a/resources/views/form/integer.blade.php +++ b/resources/views/form/integer.blade.php @@ -6,4 +6,4 @@ @include('form.feedback') - \ No newline at end of file + diff --git a/resources/views/form/options.blade.php b/resources/views/form/options.blade.php index 1cbcae442e..eb17637f38 100644 --- a/resources/views/form/options.blade.php +++ b/resources/views/form/options.blade.php @@ -70,4 +70,4 @@ -@endif \ No newline at end of file +@endif diff --git a/resources/views/form/select.blade.php b/resources/views/form/select.blade.php index 6b5e8a2012..127ef8849f 100644 --- a/resources/views/form/select.blade.php +++ b/resources/views/form/select.blade.php @@ -5,4 +5,4 @@ @include('form.feedback') - \ No newline at end of file + diff --git a/resources/views/form/tags.blade.php b/resources/views/form/tags.blade.php index d9d0c31bd2..ba7b06c800 100644 --- a/resources/views/form/tags.blade.php +++ b/resources/views/form/tags.blade.php @@ -4,4 +4,4 @@ {!! Form::input('text', $name, $value, $options) !!} @include('form.feedback') - \ No newline at end of file + diff --git a/resources/views/form/text.blade.php b/resources/views/form/text.blade.php index d9d0c31bd2..ba7b06c800 100644 --- a/resources/views/form/text.blade.php +++ b/resources/views/form/text.blade.php @@ -4,4 +4,4 @@ {!! Form::input('text', $name, $value, $options) !!} @include('form.feedback') - \ No newline at end of file + diff --git a/resources/views/list/accounts.blade.php b/resources/views/list/accounts.blade.php index c4348e456a..11f60e0eea 100644 --- a/resources/views/list/accounts.blade.php +++ b/resources/views/list/accounts.blade.php @@ -56,4 +56,4 @@ @if(is_object($accounts) && method_exists($accounts, 'render')) {!! $accounts->render() !!} -@endif \ No newline at end of file +@endif diff --git a/resources/views/list/reminders.blade.php b/resources/views/list/reminders.blade.php index 23b3c5ea56..f8e1510aae 100644 --- a/resources/views/list/reminders.blade.php +++ b/resources/views/list/reminders.blade.php @@ -42,4 +42,4 @@

@endif - \ No newline at end of file + diff --git a/resources/views/partials/boxes.blade.php b/resources/views/partials/boxes.blade.php index 2197bf8a8d..4c6b947770 100644 --- a/resources/views/partials/boxes.blade.php +++ b/resources/views/partials/boxes.blade.php @@ -89,4 +89,4 @@ - \ No newline at end of file + diff --git a/resources/views/partials/date_nav.blade.php b/resources/views/partials/date_nav.blade.php index feeab074ea..28c2838b25 100644 --- a/resources/views/partials/date_nav.blade.php +++ b/resources/views/partials/date_nav.blade.php @@ -28,4 +28,4 @@ ---}} \ No newline at end of file +--}} diff --git a/resources/views/related/alreadyRelated.blade.php b/resources/views/related/alreadyRelated.blade.php index 6fdc642501..0940d7a770 100644 --- a/resources/views/related/alreadyRelated.blade.php +++ b/resources/views/related/alreadyRelated.blade.php @@ -60,4 +60,4 @@ @else

No related transactions

-@endif \ No newline at end of file +@endif diff --git a/resources/views/related/searchResult.blade.php b/resources/views/related/searchResult.blade.php index a3f9b54964..4d267a9e38 100644 --- a/resources/views/related/searchResult.blade.php +++ b/resources/views/related/searchResult.blade.php @@ -36,4 +36,4 @@ @else

No results

-@endif \ No newline at end of file +@endif diff --git a/resources/views/reminders/show.blade.php b/resources/views/reminders/show.blade.php index ec1811100d..8ab199dc59 100644 --- a/resources/views/reminders/show.blade.php +++ b/resources/views/reminders/show.blade.php @@ -35,4 +35,4 @@ -@stop \ No newline at end of file +@stop diff --git a/resources/views/reports/index.blade.php b/resources/views/reports/index.blade.php index b90f7289c6..4ef2851baa 100644 --- a/resources/views/reports/index.blade.php +++ b/resources/views/reports/index.blade.php @@ -70,4 +70,4 @@ @stop @section('scripts') -@stop \ No newline at end of file +@stop diff --git a/resources/views/transactions/index.blade.php b/resources/views/transactions/index.blade.php index 39b018c9dd..98bdb293c6 100644 --- a/resources/views/transactions/index.blade.php +++ b/resources/views/transactions/index.blade.php @@ -21,4 +21,4 @@ -@stop \ No newline at end of file +@stop diff --git a/server.php b/server.php index 8f37587762..c6499cf326 100644 --- a/server.php +++ b/server.php @@ -7,15 +7,14 @@ */ $uri = urldecode( - parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) + parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); // This file allows us to emulate Apache's "mod_rewrite" functionality from the // built-in PHP web server. This provides a convenient way to test a Laravel // application without having installed a "real" web server software here. -if ($uri !== '/' and file_exists(__DIR__.'/public'.$uri)) -{ - return false; +if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) { + return false; } -require_once __DIR__.'/public/index.php'; +require_once __DIR__ . '/public/index.php'; diff --git a/storage/.gitignore b/storage/.gitignore index 78eac7b62a..4ca7e82b3a 100644 --- a/storage/.gitignore +++ b/storage/.gitignore @@ -1 +1 @@ -laravel.log \ No newline at end of file +laravel.log diff --git a/storage/app/.gitignore b/storage/app/.gitignore index c96a04f008..d6b7ef32c8 100644 --- a/storage/app/.gitignore +++ b/storage/app/.gitignore @@ -1,2 +1,2 @@ * -!.gitignore \ No newline at end of file +!.gitignore diff --git a/storage/debugbar/.gitignore b/storage/debugbar/.gitignore index c96a04f008..d6b7ef32c8 100644 --- a/storage/debugbar/.gitignore +++ b/storage/debugbar/.gitignore @@ -1,2 +1,2 @@ * -!.gitignore \ No newline at end of file +!.gitignore diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore index c96a04f008..d6b7ef32c8 100644 --- a/storage/framework/cache/.gitignore +++ b/storage/framework/cache/.gitignore @@ -1,2 +1,2 @@ * -!.gitignore \ No newline at end of file +!.gitignore