Skip to content

Firefly III: a personal finances manager

Code cleanup.

James Cole7785ec022232
diff --git a/app/Commands/Command.php b/app/Commands/Command.php
index 6e5ff04d10..095393f3fa 100644
--- a/app/Commands/Command.php
+++ b/app/Commands/Command.php
@@ -1,7 +1,11 @@
<?php namespace FireflyIII\Commands;
+/**
+ * Class Command
+ *
+ * @package FireflyIII\Commands
+ */
+abstract class Command
+{
-abstract class Command {
-
- //
}
diff --git a/app/Console/Commands/Inspire.php b/app/Console/Commands/Inspire.php
index 79a2722de2..ddd55093b5 100644
--- a/app/Console/Commands/Inspire.php
+++ b/app/Console/Commands/Inspire.php
@@ -2,33 +2,36 @@
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Input\InputArgument;
-class Inspire extends Command {
+/**
+ * Class Inspire
+ *
+ * @package FireflyIII\Console\Commands
+ */
+class Inspire extends Command
+{
- /**
- * The console command name.
- *
- * @var string
- */
- protected $name = 'inspire';
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Display an inspiring quote';
+ /**
+ * The console command name.
+ *
+ * @var string
+ */
+ protected $name = 'inspire';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'Display an inspiring quote';
-
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
- }
+ /**
+ * Execute the console command.
+ *
+ * @return mixed
+ */
+ public function handle()
+ {
+ $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
+ }
}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 81e5194f67..f740d7abbc 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -3,27 +3,35 @@
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
-class Kernel extends ConsoleKernel {
+/**
+ * Class Kernel
+ *
+ * @package FireflyIII\Console
+ */
+class Kernel extends ConsoleKernel
+{
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- 'FireflyIII\Console\Commands\Inspire',
- ];
+ /**
+ * The Artisan commands provided by your application.
+ *
+ * @var array
+ */
+ protected $commands
+ = [
+ 'FireflyIII\Console\Commands\Inspire',
+ ];
- /**
- * Define the application's command schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- protected function schedule(Schedule $schedule)
- {
- $schedule->command('inspire')
- ->hourly();
- }
+ /**
+ * Define the application's command schedule.
+ *
+ * @param \Illuminate\Console\Scheduling\Schedule $schedule
+ *
+ * @return void
+ */
+ protected function schedule(Schedule $schedule)
+ {
+ $schedule->command('inspire')
+ ->hourly();
+ }
}
diff --git a/app/Events/Event.php b/app/Events/Event.php
index 2a3fbc3fe8..3d82e4d1dd 100644
--- a/app/Events/Event.php
+++ b/app/Events/Event.php
@@ -1,7 +1,13 @@
<?php namespace FireflyIII\Events;
-abstract class Event {
+/**
+ * Class Event
+ *
+ * @package FireflyIII\Events
+ */
+abstract class Event
+{
- //
+ //
}
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 8c61cf51d1..87333e1669 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -3,47 +3,54 @@
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
-class Handler extends ExceptionHandler {
+/**
+ * Class Handler
+ *
+ * @package FireflyIII\Exceptions
+ */
+class Handler extends ExceptionHandler
+{
- /**
- * A list of the exception types that should not be reported.
- *
- * @var array
- */
- protected $dontReport = [
- 'Symfony\Component\HttpKernel\Exception\HttpException'
- ];
+ /**
+ * A list of the exception types that should not be reported.
+ *
+ * @var array
+ */
+ protected $dontReport
+ = [
+ 'Symfony\Component\HttpKernel\Exception\HttpException'
+ ];
- /**
- * Report or log an exception.
- *
- * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
- *
- * @param \Exception $e
- * @return void
- */
- public function report(Exception $e)
- {
- return parent::report($e);
- }
+ /**
+ * Render an exception into an HTTP response.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Exception $e
+ *
+ * @return \Illuminate\Http\Response
+ */
+ public function render($request, Exception $e)
+ {
+ if ($this->isHttpException($e)) {
+ return $this->renderHttpException($e);
+ } else {
+ return parent::render($request, $e);
+ }
+ }
- /**
- * Render an exception into an HTTP response.
- *
- * @param \Illuminate\Http\Request $request
- * @param \Exception $e
- * @return \Illuminate\Http\Response
- */
- public function render($request, Exception $e)
- {
- if ($this->isHttpException($e))
- {
- return $this->renderHttpException($e);
- }
- else
- {
- return parent::render($request, $e);
- }
- }
+ /**
+ * Report or log an exception.
+ *
+ * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
+ *
+ * @param \Exception $e
+ *
+ * @return void
+ */
+ public function report(Exception $e)
+ {
+ /** @noinspection PhpInconsistentReturnPointsInspection */
+ return parent::report($e);
+ }
}
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index b77f9739b4..71faf8895a 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -17,6 +17,9 @@ use View;
*/
class AccountController extends Controller
{
+ /**
+ *
+ */
public function __construct()
{
View::share('mainTitleIcon', 'fa-credit-card');
@@ -39,6 +42,11 @@ class AccountController extends Controller
}
+ /**
+ * @param string $what
+ *
+ * @return View
+ */
public function index($what = 'default')
{
$subTitle = Config::get('firefly.subTitlesByIdentifier.' . $what);
@@ -49,10 +57,16 @@ class AccountController extends Controller
return view('accounts.index', compact('what', 'subTitleIcon', 'subTitle', 'accounts'));
}
+ /**
+ * @param AccountFormRequest $request
+ * @param AccountRepositoryInterface $repository
+ *
+ * @return \Illuminate\Http\RedirectResponse
+ */
public function store(AccountFormRequest $request, AccountRepositoryInterface $repository)
{
$accountData = [
- 'name' => $request->input('name') . rand(1,1000),
+ 'name' => $request->input('name'),
'accountType' => $request->input('what'),
'active' => true,
'user' => Auth::user()->id,
diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php
index e175b6a819..d79cc2c56e 100644
--- a/app/Http/Controllers/Auth/AuthController.php
+++ b/app/Http/Controllers/Auth/AuthController.php
@@ -5,6 +5,11 @@ use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
+/**
+ * Class AuthController
+ *
+ * @package FireflyIII\Http\Controllers\Auth
+ */
class AuthController extends Controller
{
@@ -29,7 +34,6 @@ class AuthController extends Controller
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\Registrar $registrar
*
- * @return void
*/
public function __construct(Guard $auth, Registrar $registrar)
{
diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php
index 9d3327a9c5..0d6f68e290 100644
--- a/app/Http/Controllers/Auth/PasswordController.php
+++ b/app/Http/Controllers/Auth/PasswordController.php
@@ -5,34 +5,40 @@ use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Foundation\Auth\ResetsPasswords;
-class PasswordController extends Controller {
+/**
+ * Class PasswordController
+ *
+ * @package FireflyIII\Http\Controllers\Auth
+ */
+class PasswordController extends Controller
+{
- /*
- |--------------------------------------------------------------------------
- | Password Reset Controller
- |--------------------------------------------------------------------------
- |
- | This controller is responsible for handling password reset requests
- | and uses a simple trait to include this behavior. You're free to
- | explore this trait and override any methods you wish to tweak.
- |
- */
+ /*
+ |--------------------------------------------------------------------------
+ | Password Reset Controller
+ |--------------------------------------------------------------------------
+ |
+ | This controller is responsible for handling password reset requests
+ | and uses a simple trait to include this behavior. You're free to
+ | explore this trait and override any methods you wish to tweak.
+ |
+ */
- use ResetsPasswords;
+ use ResetsPasswords;
- /**
- * Create a new password controller instance.
- *
- * @param \Illuminate\Contracts\Auth\Guard $auth
- * @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
- * @return void
- */
- public function __construct(Guard $auth, PasswordBroker $passwords)
- {
- $this->auth = $auth;
- $this->passwords = $passwords;
+ /**
+ * Create a new password controller instance.
+ *
+ * @param \Illuminate\Contracts\Auth\Guard $auth
+ * @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
+ *
+ */
+ public function __construct(Guard $auth, PasswordBroker $passwords)
+ {
+ $this->auth = $auth;
+ $this->passwords = $passwords;
- $this->middleware('guest');
- }
+ $this->middleware('guest');
+ }
}
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 847a5e9741..fb7b363590 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -1,11 +1,17 @@
<?php namespace FireflyIII\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesCommands;
-use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
+use Illuminate\Routing\Controller as BaseController;
-abstract class Controller extends BaseController {
+/**
+ * Class Controller
+ *
+ * @package FireflyIII\Http\Controllers
+ */
+abstract class Controller extends BaseController
+{
- use DispatchesCommands, ValidatesRequests;
+ use DispatchesCommands, ValidatesRequests;
}
diff --git a/app/Http/Controllers/GoogleChartController.php b/app/Http/Controllers/GoogleChartController.php
index ec59d392ba..c5fa91bdab 100644
--- a/app/Http/Controllers/GoogleChartController.php
+++ b/app/Http/Controllers/GoogleChartController.php
@@ -2,6 +2,7 @@
use Auth;
use Carbon\Carbon;
+use Crypt;
use FireflyIII\Http\Requests;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill;
@@ -11,12 +12,10 @@ use FireflyIII\Models\TransactionJournal;
use Grumpydictator\Gchart\GChart;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\JoinClause;
-use Illuminate\Http\Request;
use Preferences;
use Response;
use Session;
use Steam;
-use Crypt;
/**
* Class GoogleChartController
@@ -137,6 +136,11 @@ class GoogleChartController extends Controller
return Response::json($chart->getData());
}
+ /**
+ * @param GChart $chart
+ *
+ * @return \Symfony\Component\HttpFoundation\Response
+ */
public function allCategoriesHomeChart(GChart $chart)
{
$chart->addColumn('Category', 'string');
@@ -174,6 +178,11 @@ class GoogleChartController extends Controller
}
+ /**
+ * @param GChart $chart
+ *
+ * @return \Symfony\Component\HttpFoundation\Response
+ */
public function billsOverview(GChart $chart)
{
$paid = ['items' => [], 'amount' => 0];
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index fc8fe07e52..67ce5757e4 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -2,6 +2,11 @@
use Illuminate\Foundation\Http\Kernel as HttpKernel;
+/**
+ * Class Kernel
+ *
+ * @package FireflyIII\Http
+ */
class Kernel extends HttpKernel
{
diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php
index 80c81b876a..f014b3c53a 100644
--- a/app/Http/Middleware/Authenticate.php
+++ b/app/Http/Middleware/Authenticate.php
@@ -3,48 +3,51 @@
use Closure;
use Illuminate\Contracts\Auth\Guard;
-class Authenticate {
+/**
+ * Class Authenticate
+ *
+ * @package FireflyIII\Http\Middleware
+ */
+class Authenticate
+{
- /**
- * The Guard implementation.
- *
- * @var Guard
- */
- protected $auth;
+ /**
+ * The Guard implementation.
+ *
+ * @var Guard
+ */
+ protected $auth;
- /**
- * Create a new filter instance.
- *
- * @param Guard $auth
- * @return void
- */
- public function __construct(Guard $auth)
- {
- $this->auth = $auth;
- }
+ /**
+ * Create a new filter instance.
+ *
+ * @param Guard $auth
+ *
+ */
+ public function __construct(Guard $auth)
+ {
+ $this->auth = $auth;
+ }
- /**
- * Handle an incoming request.
- *
- * @param \Illuminate\Http\Request $request
- * @param \Closure $next
- * @return mixed
- */
- public function handle($request, Closure $next)
- {
- if ($this->auth->guest())
- {
- if ($request->ajax())
- {
- return response('Unauthorized.', 401);
- }
- else
- {
- return redirect()->guest('auth/login');
- }
- }
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ *
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ if ($this->auth->guest()) {
+ if ($request->ajax()) {
+ return response('Unauthorized.', 401);
+ } else {
+ return redirect()->guest('auth/login');
+ }
+ }
- return $next($request);
- }
+ return $next($request);
+ }
}
diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php
index fa392b7184..609720eebf 100644
--- a/app/Http/Middleware/Range.php
+++ b/app/Http/Middleware/Range.php
@@ -7,7 +7,6 @@ use Carbon\Carbon;
use Closure;
use FireflyIII\Exception\FireflyException;
use Illuminate\Contracts\Auth\Guard;
-use Illuminate\Http\RedirectResponse;
use Navigation;
use Preferences;
use Session;
@@ -31,7 +30,6 @@ class Range
*
* @param Guard $auth
*
- * @return void
*/
public function __construct(Guard $auth)
{
diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php
index b60bd5268f..082fcf987a 100644
--- a/app/Http/Middleware/RedirectIfAuthenticated.php
+++ b/app/Http/Middleware/RedirectIfAuthenticated.php
@@ -4,41 +4,47 @@ use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\RedirectResponse;
-class RedirectIfAuthenticated {
+/**
+ * Class RedirectIfAuthenticated
+ *
+ * @package FireflyIII\Http\Middleware
+ */
+class RedirectIfAuthenticated
+{
- /**
- * The Guard implementation.
- *
- * @var Guard
- */
- protected $auth;
+ /**
+ * The Guard implementation.
+ *
+ * @var Guard
+ */
+ protected $auth;
- /**
- * Create a new filter instance.
- *
- * @param Guard $auth
- * @return void
- */
- public function __construct(Guard $auth)
- {
- $this->auth = $auth;
- }
+ /**
+ * Create a new filter instance.
+ *
+ * @param Guard $auth
+ *
+ */
+ public function __construct(Guard $auth)
+ {
+ $this->auth = $auth;
+ }
- /**
- * Handle an incoming request.
- *
- * @param \Illuminate\Http\Request $request
- * @param \Closure $next
- * @return mixed
- */
- public function handle($request, Closure $next)
- {
- if ($this->auth->check())
- {
- return new RedirectResponse(url('/home'));
- }
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ *
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ if ($this->auth->check()) {
+ return new RedirectResponse(url('/home'));
+ }
- return $next($request);
- }
+ return $next($request);
+ }
}
diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php
index 76107c584d..0cb1548af8 100644
--- a/app/Http/Middleware/VerifyCsrfToken.php
+++ b/app/Http/Middleware/VerifyCsrfToken.php
@@ -3,18 +3,25 @@
use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
-class VerifyCsrfToken extends BaseVerifier {
+/**
+ * Class VerifyCsrfToken
+ *
+ * @package FireflyIII\Http\Middleware
+ */
+class VerifyCsrfToken extends BaseVerifier
+{
- /**
- * Handle an incoming request.
- *
- * @param \Illuminate\Http\Request $request
- * @param \Closure $next
- * @return mixed
- */
- public function handle($request, Closure $next)
- {
- return parent::handle($request, $next);
- }
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ *
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ return parent::handle($request, $next);
+ }
}
diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php
index a64a8ddbb2..7bedd3d057 100644
--- a/app/Http/Requests/AccountFormRequest.php
+++ b/app/Http/Requests/AccountFormRequest.php
@@ -12,12 +12,18 @@ use Config;
*/
class AccountFormRequest extends Request
{
+ /**
+ * @return bool
+ */
public function authorize()
{
// Only allow logged in users
return Auth::check();
}
+ /**
+ * @return array
+ */
public function rules()
{
$accountRoles = join(',', array_keys(Config::get('firefly.accountRoles')));
@@ -29,7 +35,7 @@ class AccountFormRequest extends Request
'openingBalanceDate' => 'date',
'accountRole' => 'in:' . $accountRoles,
'active' => 'boolean',
- 'balance_currency_id' => 'required|exists:transaction_currencies,id',
+ 'balance_currency_id' => 'exists:transaction_currencies,id',
'what' => 'in:' . $types
];
}
diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php
index 772d06464f..a5c9945e32 100644
--- a/app/Http/Requests/Request.php
+++ b/app/Http/Requests/Request.php
@@ -2,8 +2,14 @@
use Illuminate\Foundation\Http\FormRequest;
-abstract class Request extends FormRequest {
-
- //
+/**
+ * Class Request
+ *
+ * @package FireflyIII\Http\Requests
+ */
+abstract class Request extends FormRequest
+{
+
+ //
}
diff --git a/app/Http/routes.php b/app/Http/routes.php
index 46d6a44e39..c320aacbc5 100644
--- a/app/Http/routes.php
+++ b/app/Http/routes.php
@@ -4,7 +4,7 @@
* Home Controller
*/
Route::group(
- ['middleware' => ['auth','range']], function () {
+ ['middleware' => ['auth', 'range']], function () {
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
Route::get('/prev', ['uses' => 'HomeController@sessionPrev', 'as' => 'sessionPrev']);
Route::get('/next', ['uses' => 'HomeController@sessionNext', 'as' => 'sessionNext']);
@@ -19,8 +19,8 @@ Route::group(
Route::get('/accounts/delete/{account}', ['uses' => 'AccountController@delete', 'as' => 'accounts.delete']);
Route::get('/accounts/show/{account}/{view?}', ['uses' => 'AccountController@show', 'as' => 'accounts.show']);
Route::post('/accounts/store', ['uses' => 'AccountController@store', 'as' => 'accounts.store']);
-// Route::post('/accounts/update/{account}', ['uses' => 'AccountController@update', 'as' => 'accounts.update']);
-// Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
+ // Route::post('/accounts/update/{account}', ['uses' => 'AccountController@update', 'as' => 'accounts.update']);
+ // Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
/**
* Bills Controller
diff --git a/app/Models/Account.php b/app/Models/Account.php
index f3dac68a2b..4ea183adca 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -22,23 +22,36 @@ class Account extends Model
'active' => 'required|boolean'
];
- protected $fillable = ['user_id','account_type_id','name','active'];
+ protected $fillable = ['user_id', 'account_type_id', 'name', 'active'];
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function accountMeta()
{
return $this->hasMany('FireflyIII\Models\AccountMeta');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function accountType()
{
return $this->belongsTo('FireflyIII\Models\AccountType');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
+ /**
+ * @param EloquentBuilder $query
+ * @param array $types
+ */
public function scopeAccountTypeIn(EloquentBuilder $query, array $types)
{
if (is_null($this->joinedAccountTypes)) {
@@ -48,11 +61,17 @@ class Account extends Model
$query->whereIn('account_types.type', $types);
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function transactions()
{
return $this->hasMany('FireflyIII\Models\Transaction');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php
index 582d9d3ec7..c6dbce3080 100644
--- a/app/Models/AccountMeta.php
+++ b/app/Models/AccountMeta.php
@@ -2,25 +2,44 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class AccountMeta
+ *
+ * @package FireflyIII\Models
+ */
class AccountMeta extends Model
{
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function account()
{
return $this->belongsTo('FireflyIII\Models\Account');
}
+ /**
+ * @param $value
+ *
+ * @return mixed
+ */
public function getDataAttribute($value)
{
return json_decode($value);
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at'];
}
+ /**
+ * @param $value
+ */
public function setDataAttribute($value)
{
$this->attributes['data'] = json_encode($value);
diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php
index f3967bafa2..aee84c7c1e 100644
--- a/app/Models/AccountType.php
+++ b/app/Models/AccountType.php
@@ -2,15 +2,26 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class AccountType
+ *
+ * @package FireflyIII\Models
+ */
class AccountType extends Model
{
//
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function accounts()
{
return $this->hasMany('FireflyIII\Models\Account');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at'];
diff --git a/app/Models/Bill.php b/app/Models/Bill.php
index da3c71d537..63c0381554 100644
--- a/app/Models/Bill.php
+++ b/app/Models/Bill.php
@@ -2,19 +2,33 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class Bill
+ *
+ * @package FireflyIII\Models
+ */
class Bill extends Model
{
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'date'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function transactionjournals()
{
return $this->hasMany('FireflyIII\Models\TransactionJournal');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/Budget.php b/app/Models/Budget.php
index ca32aeec57..c5eca8b87b 100644
--- a/app/Models/Budget.php
+++ b/app/Models/Budget.php
@@ -3,31 +3,51 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+/**
+ * Class Budget
+ *
+ * @package FireflyIII\Models
+ */
class Budget extends Model
{
use SoftDeletes;
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function budgetlimits()
{
return $this->hasMany('FireflyIII\Models\BudgetLimit');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
+ */
public function limitrepetitions()
{
return $this->hasManyThrough('FireflyIII\Models\LimitRepetition', 'BudgetLimit', 'budget_id');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ */
public function transactionjournals()
{
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'budget_transaction_journal', 'budget_id');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php
index 0899b9dc97..5189d91664 100644
--- a/app/Models/BudgetLimit.php
+++ b/app/Models/BudgetLimit.php
@@ -2,19 +2,33 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class BudgetLimit
+ *
+ * @package FireflyIII\Models
+ */
class BudgetLimit extends Model
{
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function budget()
{
return $this->belongsTo('FireflyIII\Models\Budget');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'startdate'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function limitrepetitions()
{
return $this->hasMany('FireflyIII\Models\LimitRepetition');
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 21e5009739..1d9ceb0678 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -3,20 +3,34 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+/**
+ * Class Category
+ *
+ * @package FireflyIII\Models
+ */
class Category extends Model
{
use SoftDeletes;
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ */
public function transactionjournals()
{
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/Component.php b/app/Models/Component.php
index c79422d80e..0c8e57a45f 100644
--- a/app/Models/Component.php
+++ b/app/Models/Component.php
@@ -3,10 +3,18 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+/**
+ * Class Component
+ *
+ * @package FireflyIII\Models
+ */
class Component extends Model
{
use SoftDeletes;
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
diff --git a/app/Models/LimitRepetition.php b/app/Models/LimitRepetition.php
index 9501c63b41..fe837e9d14 100644
--- a/app/Models/LimitRepetition.php
+++ b/app/Models/LimitRepetition.php
@@ -2,14 +2,25 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class LimitRepetition
+ *
+ * @package FireflyIII\Models
+ */
class LimitRepetition extends Model
{
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function budgetLimit()
{
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'startdate', 'enddate'];
diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php
index 2f332cfce8..f31dbcc142 100644
--- a/app/Models/PiggyBank.php
+++ b/app/Models/PiggyBank.php
@@ -3,30 +3,50 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+/**
+ * Class PiggyBank
+ *
+ * @package FireflyIII\Models
+ */
class PiggyBank extends Model
{
use SoftDeletes;
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function account()
{
return $this->belongsTo('FireflyIII\Models\Account');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function piggyBankEvents()
{
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function piggyBankRepetitions()
{
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\MorphMany
+ */
public function reminders()
{
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php
index bf1cc37f49..f9a94a0286 100644
--- a/app/Models/PiggyBankEvent.php
+++ b/app/Models/PiggyBankEvent.php
@@ -2,19 +2,33 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class PiggyBankEvent
+ *
+ * @package FireflyIII\Models
+ */
class PiggyBankEvent extends Model
{
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'date'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function piggyBank()
{
return $this->belongsTo('FireflyIII\Models\PiggyBank');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function transactionJournal()
{
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php
index f0d20643b7..fe4d72a6f2 100644
--- a/app/Models/PiggyBankRepetition.php
+++ b/app/Models/PiggyBankRepetition.php
@@ -2,14 +2,25 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class PiggyBankRepetition
+ *
+ * @package FireflyIII\Models
+ */
class PiggyBankRepetition extends Model
{
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'startdate', 'targetdate'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function piggyBank()
{
return $this->belongsTo('FireflyIII\Models\PiggyBank');
diff --git a/app/Models/Preference.php b/app/Models/Preference.php
index cc10f47add..b0c1cb7d03 100644
--- a/app/Models/Preference.php
+++ b/app/Models/Preference.php
@@ -2,26 +2,45 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class Preference
+ *
+ * @package FireflyIII\Models
+ */
class Preference extends Model
{
protected $fillable = ['user_id', 'data', 'name'];
+ /**
+ * @param $value
+ *
+ * @return mixed
+ */
public function getDataAttribute($value)
{
return json_decode($value);
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at'];
}
+ /**
+ * @param $value
+ */
public function setDataAttribute($value)
{
$this->attributes['data'] = json_encode($value);
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/Reminder.php b/app/Models/Reminder.php
index 12e33d009a..98e75a0a4c 100644
--- a/app/Models/Reminder.php
+++ b/app/Models/Reminder.php
@@ -2,19 +2,33 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class Reminder
+ *
+ * @package FireflyIII\Models
+ */
class Reminder extends Model
{
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'startdate', 'enddate'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\MorphTo
+ */
public function remindersable()
{
return $this->morphTo();
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php
index e44f279519..fde880b91e 100644
--- a/app/Models/Transaction.php
+++ b/app/Models/Transaction.php
@@ -4,6 +4,11 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
+/**
+ * Class Transaction
+ *
+ * @package FireflyIII\Models
+ */
class Transaction extends Model
{
protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount'];
@@ -16,16 +21,25 @@ class Transaction extends Model
];
use SoftDeletes, ValidatingTrait;
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function account()
{
return $this->belongsTo('FireflyIII\Models\Account');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function transactionJournal()
{
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php
index 731026e55f..884e355d96 100644
--- a/app/Models/TransactionCurrency.php
+++ b/app/Models/TransactionCurrency.php
@@ -3,15 +3,26 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+/**
+ * Class TransactionCurrency
+ *
+ * @package FireflyIII\Models
+ */
class TransactionCurrency extends Model
{
use SoftDeletes;
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function transactionJournals()
{
return $this->hasMany('FireflyIII\Models\TransactionJournal');
diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php
index dad9d4d42b..3afbdba0f4 100644
--- a/app/Models/TransactionGroup.php
+++ b/app/Models/TransactionGroup.php
@@ -3,20 +3,34 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+/**
+ * Class TransactionGroup
+ *
+ * @package FireflyIII\Models
+ */
class TransactionGroup extends Model
{
use SoftDeletes;
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ */
public function transactionjournals()
{
return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php
index 031dd92389..4c1a4cef0e 100644
--- a/app/Models/TransactionJournal.php
+++ b/app/Models/TransactionJournal.php
@@ -30,26 +30,43 @@ class TransactionJournal extends Model
'encrypted' => 'required|boolean'
];
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function bill()
{
return $this->belongsTo('FireflyIII\Models\Bill');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ */
public function budgets()
{
return $this->belongsToMany('FireflyIII\Models\Budget');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ */
public function categories()
{
return $this->belongsToMany('FireflyIII\Models\Category');
}
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'date', 'deleted_at'];
}
+ /**
+ * @param $value
+ *
+ * @return string
+ */
public function getDescriptionAttribute($value)
{
if ($this->encrypted) {
@@ -61,6 +78,9 @@ class TransactionJournal extends Model
// @codeCoverageIgnoreEnd
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function piggyBankEvents()
{
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
@@ -119,32 +139,50 @@ class TransactionJournal extends Model
$query->whereIn('transaction_types.type', $types);
}
+ /**
+ * @param $value
+ */
public function setDescriptionAttribute($value)
{
$this->attributes['description'] = \Crypt::encrypt($value);
$this->attributes['encrypted'] = true;
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function transactionCurrency()
{
return $this->belongsTo('FireflyIII\Models\TransactionCurrency');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function transactionType()
{
return $this->belongsTo('FireflyIII\Models\TransactionType');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ */
public function transactiongroups()
{
return $this->belongsToMany('FireflyIII\Models\TransactionGroup');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function transactions()
{
return $this->hasMany('FireflyIII\Models\Transaction');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ */
public function user()
{
return $this->belongsTo('FireflyIII\User');
diff --git a/app/Models/TransactionRelation.php b/app/Models/TransactionRelation.php
index f2eba009e4..058f395537 100644
--- a/app/Models/TransactionRelation.php
+++ b/app/Models/TransactionRelation.php
@@ -2,9 +2,17 @@
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class TransactionRelation
+ *
+ * @package FireflyIII\Models
+ */
class TransactionRelation extends Model
{
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at'];
diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php
index 1010173cd3..dbabd104f8 100644
--- a/app/Models/TransactionType.php
+++ b/app/Models/TransactionType.php
@@ -3,15 +3,26 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+/**
+ * Class TransactionType
+ *
+ * @package FireflyIII\Models
+ */
class TransactionType extends Model
{
use SoftDeletes;
+ /**
+ * @return array
+ */
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function transactionJournals()
{
return $this->hasMany('FireflyIII\Models\TransactionJournal');
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 1b0dd3e094..bfff79a9f2 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -2,33 +2,39 @@
use Illuminate\Support\ServiceProvider;
-class AppServiceProvider extends ServiceProvider {
+/**
+ * Class AppServiceProvider
+ *
+ * @package FireflyIII\Providers
+ */
+class AppServiceProvider extends ServiceProvider
+{
- /**
- * Bootstrap any application services.
- *
- * @return void
- */
- public function boot()
- {
- //
- }
+ /**
+ * Bootstrap any application services.
+ *
+ * @return void
+ */
+ public function boot()
+ {
+ //
+ }
- /**
- * Register any application services.
- *
- * This service provider is a great spot to register your various container
- * bindings with the application. As you can see, we are registering our
- * "Registrar" implementation here. You can add your own bindings too!
- *
- * @return void
- */
- public function register()
- {
- $this->app->bind(
- 'Illuminate\Contracts\Auth\Registrar',
- 'FireflyIII\Services\Registrar'
- );
- }
+ /**
+ * Register any application services.
+ *
+ * This service provider is a great spot to register your various container
+ * bindings with the application. As you can see, we are registering our
+ * "Registrar" implementation here. You can add your own bindings too!
+ *
+ * @return void
+ */
+ public function register()
+ {
+ $this->app->bind(
+ 'Illuminate\Contracts\Auth\Registrar',
+ 'FireflyIII\Services\Registrar'
+ );
+ }
}
diff --git a/app/Providers/BusServiceProvider.php b/app/Providers/BusServiceProvider.php
index 0978b5e862..0edb595695 100644
--- a/app/Providers/BusServiceProvider.php
+++ b/app/Providers/BusServiceProvider.php
@@ -3,32 +3,40 @@
use Illuminate\Bus\Dispatcher;
use Illuminate\Support\ServiceProvider;
-class BusServiceProvider extends ServiceProvider {
+/**
+ * Class BusServiceProvider
+ *
+ * @package FireflyIII\Providers
+ */
+class BusServiceProvider extends ServiceProvider
+{
- /**
- * Bootstrap any application services.
- *
- * @param \Illuminate\Bus\Dispatcher $dispatcher
- * @return void
- */
- public function boot(Dispatcher $dispatcher)
- {
- $dispatcher->mapUsing(function($command)
- {
- return Dispatcher::simpleMapping(
- $command, 'FireflyIII\Commands', 'FireflyIII\Handlers\Commands'
- );
- });
- }
+ /**
+ * Bootstrap any application services.
+ *
+ * @param \Illuminate\Bus\Dispatcher $dispatcher
+ *
+ * @return void
+ */
+ public function boot(Dispatcher $dispatcher)
+ {
+ $dispatcher->mapUsing(
+ function ($command) {
+ return Dispatcher::simpleMapping(
+ $command, 'FireflyIII\Commands', 'FireflyIII\Handlers\Commands'
+ );
+ }
+ );
+ }
- /**
- * Register any application services.
- *
- * @return void
- */
- public function register()
- {
- //
- }
+ /**
+ * Register any application services.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ //
+ }
}
diff --git a/app/Providers/ConfigServiceProvider.php b/app/Providers/ConfigServiceProvider.php
index 577b2520ea..94d9ee03fd 100644
--- a/app/Providers/ConfigServiceProvider.php
+++ b/app/Providers/ConfigServiceProvider.php
@@ -2,22 +2,30 @@
use Illuminate\Support\ServiceProvider;
-class ConfigServiceProvider extends ServiceProvider {
+/**
+ * Class ConfigServiceProvider
+ *
+ * @package FireflyIII\Providers
+ */
+class ConfigServiceProvider extends ServiceProvider
+{
- /**
- * Overwrite any vendor / package configuration.
- *
- * This service provider is intended to provide a convenient location for you
- * to overwrite any "vendor" or package configuration that you may want to
- * modify before the application handles the incoming request / command.
- *
- * @return void
- */
- public function register()
- {
- config([
- //
- ]);
- }
+ /**
+ * Overwrite any vendor / package configuration.
+ *
+ * This service provider is intended to provide a convenient location for you
+ * to overwrite any "vendor" or package configuration that you may want to
+ * modify before the application handles the incoming request / command.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ config(
+ [
+ //
+ ]
+ );
+ }
}
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 2f1f21df67..5d16b0d436 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -3,30 +3,38 @@
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
-class EventServiceProvider extends ServiceProvider {
+/**
+ * Class EventServiceProvider
+ *
+ * @package FireflyIII\Providers
+ */
+class EventServiceProvider extends ServiceProvider
+{
- /**
- * The event handler mappings for the application.
- *
- * @var array
- */
- protected $listen = [
- 'event.name' => [
- 'EventListener',
- ],
- ];
+ /**
+ * The event handler mappings for the application.
+ *
+ * @var array
+ */
+ protected $listen
+ = [
+ 'event.name' => [
+ 'EventListener',
+ ],
+ ];
- /**
- * Register any other events for your application.
- *
- * @param \Illuminate\Contracts\Events\Dispatcher $events
- * @return void
- */
- public function boot(DispatcherContract $events)
- {
- parent::boot($events);
+ /**
+ * Register any other events for your application.
+ *
+ * @param \Illuminate\Contracts\Events\Dispatcher $events
+ *
+ * @return void
+ */
+ public function boot(DispatcherContract $events)
+ {
+ parent::boot($events);
- //
- }
+ //
+ }
}
diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php
index a0656f4530..ce53c188a1 100644
--- a/app/Providers/FireflyServiceProvider.php
+++ b/app/Providers/FireflyServiceProvider.php
@@ -2,9 +2,14 @@
namespace FireflyIII\Providers;
+use FireflyIII\Support\Amount;
+use FireflyIII\Support\ExpandedForm;
+use FireflyIII\Support\Navigation;
+use FireflyIII\Support\Preferences;
+use FireflyIII\Support\Steam;
+use FireflyIII\Validation\FireflyValidator;
use Illuminate\Support\ServiceProvider;
use Validator;
-use FireflyIII\Validation\FireflyValidator;
/**
* Class FireflyServiceProvider
@@ -13,38 +18,41 @@ use FireflyIII\Validation\FireflyValidator;
*/
class FireflyServiceProvider extends ServiceProvider
{
- public function boot() {
- Validator::resolver(function($translator, $data, $rules, $messages)
- {
- return new FireflyValidator($translator, $data, $rules, $messages);
- });
+ public function boot()
+ {
+ Validator::resolver(
+ function ($translator, $data, $rules, $messages) {
+ return new FireflyValidator($translator, $data, $rules, $messages);
+ }
+ );
}
+
public function register()
{
$this->app->bind(
'preferences', function () {
- return new \FireflyIII\Support\Preferences;
+ return new Preferences;
}
);
$this->app->bind(
'navigation', function () {
- return new \FireflyIII\Support\Navigation;
+ return new Navigation;
}
);
$this->app->bind(
'amount', function () {
- return new \FireflyIII\Support\Amount;
+ return new Amount;
}
);
$this->app->bind(
'steam', function () {
- return new \FireflyIII\Support\Steam;
+ return new Steam;
}
);
$this->app->bind(
'expandedform', function () {
- return new \FireflyIII\Support\ExpandedForm;
+ return new ExpandedForm;
}
);
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 9de0455111..cd51b4b800 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -4,6 +4,11 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi
use Illuminate\Http\Request;
use Illuminate\Routing\Router;
+/**
+ * Class RouteServiceProvider
+ *
+ * @package FireflyIII\Providers
+ */
class RouteServiceProvider extends ServiceProvider
{
@@ -40,7 +45,7 @@ class RouteServiceProvider extends ServiceProvider
//Steam::removeEmptyBudgetLimits();
//$reminders = Reminders::getReminders();
}
-// View::share('reminders', $reminders);
+ // View::share('reminders', $reminders);
}
);
}
@@ -56,6 +61,7 @@ class RouteServiceProvider extends ServiceProvider
{
$router->group(
['namespace' => $this->namespace], function ($router) {
+ /** @noinspection PhpIncludeInspection */
require app_path('Http/routes.php');
}
);
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index f80cf2b09a..5821035575 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -75,6 +75,8 @@ class AccountRepository implements AccountRepositoryInterface
* @param Account $account
* @param Account $opposing
* @param array $data
+ *
+ * @return TransactionJournal
*/
protected function _storeInitialBalance(Account $account, Account $opposing, array $data)
{
diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php
index 524d4a0545..e3c0e41ff6 100644
--- a/app/Repositories/Account/AccountRepositoryInterface.php
+++ b/app/Repositories/Account/AccountRepositoryInterface.php
@@ -3,7 +3,17 @@
namespace FireflyIII\Repositories\Account;
+/**
+ * Interface AccountRepositoryInterface
+ *
+ * @package FireflyIII\Repositories\Account
+ */
interface AccountRepositoryInterface
{
+ /**
+ * @param array $data
+ *
+ * @return mixed
+ */
public function store(array $data);
}
\ No newline at end of file
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php
index fe14e453eb..4be2636774 100644
--- a/app/Repositories/Journal/JournalRepository.php
+++ b/app/Repositories/Journal/JournalRepository.php
@@ -2,7 +2,12 @@
namespace FireflyIII\Repositories\Journal;
-
-class JournalRepository implements JournalRepositoryInterface {
+/**
+ * Class JournalRepository
+ *
+ * @package FireflyIII\Repositories\Journal
+ */
+class JournalRepository implements JournalRepositoryInterface
+{
}
\ No newline at end of file
diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php
index 6da37e2a41..ae19f6f052 100644
--- a/app/Repositories/Journal/JournalRepositoryInterface.php
+++ b/app/Repositories/Journal/JournalRepositoryInterface.php
@@ -9,6 +9,12 @@
namespace FireflyIII\Repositories\Journal;
-interface JournalRepositoryInterface {
+/**
+ * Interface JournalRepositoryInterface
+ *
+ * @package FireflyIII\Repositories\Journal
+ */
+interface JournalRepositoryInterface
+{
}
\ No newline at end of file
diff --git a/app/Services/Registrar.php b/app/Services/Registrar.php
index 771bf26134..5183c21308 100644
--- a/app/Services/Registrar.php
+++ b/app/Services/Registrar.php
@@ -4,6 +4,11 @@ use FireflyIII\User;
use Illuminate\Contracts\Auth\Registrar as RegistrarContract;
use Validator;
+/**
+ * Class Registrar
+ *
+ * @package FireflyIII\Services
+ */
class Registrar implements RegistrarContract
{
@@ -35,9 +40,9 @@ class Registrar implements RegistrarContract
{
return Validator::make(
$data, [
- 'email' => 'required|email|max:255|unique:users',
- 'password' => 'required|confirmed|min:6',
- ]
+ 'email' => 'required|email|max:255|unique:users',
+ 'password' => 'required|confirmed|min:6',
+ ]
);
}
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index a9a1d12a32..97a07e7055 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -30,8 +30,8 @@ class Amount
}
/**
- * @param \Transaction $transaction
- * @param bool $coloured
+ * @param Transaction|\Transaction $transaction
+ * @param bool $coloured
*
* @return string
*/
diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php
index a6ecdd0a88..3494c9fc2c 100644
--- a/app/Support/ExpandedForm.php
+++ b/app/Support/ExpandedForm.php
@@ -181,6 +181,14 @@ class ExpandedForm
return $html;
}
+ /**
+ * @param $name
+ * @param array $list
+ * @param null $selected
+ * @param array $options
+ *
+ * @return string
+ */
public function select($name, array $list = [], $selected = null, array $options = [])
{
$label = $this->label($name, $options);
diff --git a/app/Support/Facades/Amount.php b/app/Support/Facades/Amount.php
index 38320a72cc..90562d745e 100644
--- a/app/Support/Facades/Amount.php
+++ b/app/Support/Facades/Amount.php
@@ -3,6 +3,7 @@
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Facades\Facade;
+
/**
* Class Amount
*
diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.php
index 008e85d7a7..ee365cc6b0 100644
--- a/app/Support/Facades/ExpandedForm.php
+++ b/app/Support/Facades/ExpandedForm.php
@@ -3,6 +3,7 @@
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Facades\Facade;
+
/**
* Class Amount
*
diff --git a/app/Support/Facades/Navigation.php b/app/Support/Facades/Navigation.php
index fab4183f15..2f0db5c215 100644
--- a/app/Support/Facades/Navigation.php
+++ b/app/Support/Facades/Navigation.php
@@ -3,6 +3,7 @@
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Facades\Facade;
+
/**
* Class Navigation
*
diff --git a/app/Support/Facades/Preferences.php b/app/Support/Facades/Preferences.php
index 70ef74965b..a6b1818cef 100644
--- a/app/Support/Facades/Preferences.php
+++ b/app/Support/Facades/Preferences.php
@@ -3,6 +3,7 @@
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Facades\Facade;
+
/**
* Class Preferences
*
diff --git a/app/Support/Facades/Steam.php b/app/Support/Facades/Steam.php
index dc8e3fd3eb..5bcfe12e30 100644
--- a/app/Support/Facades/Steam.php
+++ b/app/Support/Facades/Steam.php
@@ -3,6 +3,7 @@
namespace FireflyIII\Support\Facades;
use Illuminate\Support\Facades\Facade;
+
/**
* Class Steam
*
diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php
index 26e01a88ce..139ec248e2 100644
--- a/app/Support/Navigation.php
+++ b/app/Support/Navigation.php
@@ -14,6 +14,13 @@ class Navigation
{
+ /**
+ * @param $range
+ * @param Carbon $date
+ *
+ * @return Carbon
+ * @throws FireflyException
+ */
public function jumpToNext($range, Carbon $date)
{
switch ($range) {
@@ -47,6 +54,13 @@ class Navigation
return $date;
}
+ /**
+ * @param $range
+ * @param Carbon $date
+ *
+ * @return Carbon
+ * @throws FireflyException
+ */
public function jumpToPrevious($range, Carbon $date)
{
$functionMap = [
@@ -80,6 +94,13 @@ class Navigation
throw new FireflyException('Cannot do _previous() on ' . $range);
}
+ /**
+ * @param $range
+ * @param Carbon $date
+ *
+ * @return string
+ * @throws FireflyException
+ */
public function periodName($range, Carbon $date)
{
$formatMap = [
@@ -106,6 +127,13 @@ class Navigation
throw new FireflyException('No _periodName() for range "' . $range . '"');
}
+ /**
+ * @param $range
+ * @param Carbon $start
+ *
+ * @return Carbon
+ * @throws FireflyException
+ */
public function updateEndDate($range, Carbon $start)
{
$functionMap = [
@@ -135,6 +163,13 @@ class Navigation
throw new FireflyException('updateEndDate cannot handle $range ' . $range);
}
+ /**
+ * @param $range
+ * @param Carbon $start
+ *
+ * @return Carbon
+ * @throws FireflyException
+ */
public function updateStartDate($range, Carbon $start)
{
$functionMap = [
diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php
index 32d47ad1ec..98cab769c9 100644
--- a/app/Support/Preferences.php
+++ b/app/Support/Preferences.php
@@ -2,8 +2,8 @@
namespace FireflyIII\Support;
-use \FireflyIII\Models\Preference;
use Auth;
+use FireflyIII\Models\Preference;
/**
* Class Preferences
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index fe408640bb..2f0acb6b61 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -15,7 +15,7 @@ class Steam
/**
*
* @param Account $account
- * @param Carbon $date
+ * @param Carbon $date
*
* @return float
*/
diff --git a/app/User.php b/app/User.php
index ba823abfcb..62447196e0 100644
--- a/app/User.php
+++ b/app/User.php
@@ -6,6 +6,11 @@ use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Model;
+/**
+ * Class User
+ *
+ * @package FireflyIII
+ */
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
@@ -30,46 +35,73 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*/
protected $table = 'users';
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function accounts()
{
return $this->hasMany('FireflyIII\Models\Account');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function bills()
{
return $this->hasMany('FireflyIII\Models\Bill');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function budgets()
{
return $this->hasMany('FireflyIII\Models\Budget');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function categories()
{
return $this->hasMany('FireflyIII\Models\Category');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
+ */
public function piggyBanks()
{
return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'Account');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function preferences()
{
return $this->hasMany('FireflyIII\Models\Preference');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function reminders()
{
return $this->hasMany('FireflyIII\Models\Reminder');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
public function transactionjournals()
{
return $this->hasMany('FireflyIII\Models\TransactionJournal');
}
+ /**
+ * @param $value
+ */
public function setPasswordAttribute($value)
{
$this->attributes['password'] = \Hash::make($value);
diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php
index f934e870b9..9a2dac44e5 100644
--- a/app/Validation/FireflyValidator.php
+++ b/app/Validation/FireflyValidator.php
@@ -2,18 +2,31 @@
namespace FireflyIII\Validation;
-use Illuminate\Validation\Validator;
use DB;
+use Illuminate\Validation\Validator;
+/**
+ * Class FireflyValidator
+ *
+ * @package FireflyIII\Validation
+ */
class FireflyValidator extends Validator
{
+ /**
+ * @param $attribute
+ * @param $value
+ * @param $parameters
+ *
+ * @return bool
+ */
public function validateUniqueForUser($attribute, $value, $parameters)
{
- $count = DB::table($parameters[0])->where($parameters[1],$value)->count();
- if($count == 0) {
+ $count = DB::table($parameters[0])->where($parameters[1], $value)->count();
+ if ($count == 0) {
return true;
}
+
return false;
}
diff --git a/database/migrations/2014_06_27_163032_create_users_table.php b/database/migrations/2014_06_27_163032_create_users_table.php
index 66bca1aae2..1bd8824f42 100644
--- a/database/migrations/2014_06_27_163032_create_users_table.php
+++ b/database/migrations/2014_06_27_163032_create_users_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateUsersTable
*/
class CreateUsersTable extends Migration
@@ -30,13 +30,13 @@ class CreateUsersTable extends Migration
{
Schema::create(
'users', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->string('email', 100)->unique();
- $table->string('password', 60);
- $table->rememberToken();
- $table->string('reset', 32)->nullable();
- }
+ $table->increments('id');
+ $table->timestamps();
+ $table->string('email', 100)->unique();
+ $table->string('password', 60);
+ $table->rememberToken();
+ $table->string('reset', 32)->nullable();
+ }
);
}
diff --git a/database/migrations/2014_06_27_163145_create_account_types_table.php b/database/migrations/2014_06_27_163145_create_account_types_table.php
index 783ec4d15d..f55c0f09b6 100644
--- a/database/migrations/2014_06_27_163145_create_account_types_table.php
+++ b/database/migrations/2014_06_27_163145_create_account_types_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateAccountTypesTable
*
*/
@@ -31,13 +31,13 @@ class CreateAccountTypesTable extends Migration
{
Schema::create(
'account_types', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->string('type', 30);
- $table->boolean('editable');
+ $table->increments('id');
+ $table->timestamps();
+ $table->string('type', 30);
+ $table->boolean('editable');
- $table->unique('type');
- }
+ $table->unique('type');
+ }
);
}
diff --git a/database/migrations/2014_06_27_163259_create_accounts_table.php b/database/migrations/2014_06_27_163259_create_accounts_table.php
index 3fb5541655..59c3cd4682 100644
--- a/database/migrations/2014_06_27_163259_create_accounts_table.php
+++ b/database/migrations/2014_06_27_163259_create_accounts_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateAccountsTable
*
*/
@@ -31,23 +31,23 @@ class CreateAccountsTable extends Migration
{
Schema::create(
'accounts', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->softDeletes();
- $table->integer('user_id')->unsigned();
- $table->integer('account_type_id')->unsigned();
- $table->string('name', 100);
- $table->boolean('active');
-
- // connect accounts to users
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
-
- // connect accounts to account_types
- $table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
-
- // for a user, the account name must be unique.
- $table->unique(['user_id', 'account_type_id', 'name']);
- }
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->integer('user_id')->unsigned();
+ $table->integer('account_type_id')->unsigned();
+ $table->string('name', 100);
+ $table->boolean('active');
+
+ // connect accounts to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+
+ // connect accounts to account_types
+ $table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
+
+ // for a user, the account name must be unique.
+ $table->unique(['user_id', 'account_type_id', 'name']);
+ }
);
}
diff --git a/database/migrations/2014_06_27_163817_create_components_table.php b/database/migrations/2014_06_27_163817_create_components_table.php
index 465b1ecaff..a96ab4d388 100644
--- a/database/migrations/2014_06_27_163817_create_components_table.php
+++ b/database/migrations/2014_06_27_163817_create_components_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateComponentsTable
*
*/
@@ -31,19 +31,19 @@ class CreateComponentsTable extends Migration
{
Schema::create(
'components', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->softDeletes();
- $table->string('name', 50);
- $table->integer('user_id')->unsigned();
- $table->string('class', 20);
-
- // connect components to users
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
-
- // for a user, the component type & name must be unique.
- $table->unique(['user_id', 'class', 'name']);
- }
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->string('name', 50);
+ $table->integer('user_id')->unsigned();
+ $table->string('class', 20);
+
+ // connect components to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+
+ // for a user, the component type & name must be unique.
+ $table->unique(['user_id', 'class', 'name']);
+ }
);
}
diff --git a/database/migrations/2014_06_27_163818_create_piggybanks_table.php b/database/migrations/2014_06_27_163818_create_piggybanks_table.php
index 67d527a66d..827c5f4c48 100644
--- a/database/migrations/2014_06_27_163818_create_piggybanks_table.php
+++ b/database/migrations/2014_06_27_163818_create_piggybanks_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreatePiggybanksTable
*
*/
@@ -31,29 +31,29 @@ class CreatePiggybanksTable extends Migration
{
Schema::create(
'piggybanks', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('account_id')->unsigned();
- $table->string('name', 100);
- $table->decimal('targetamount', 10, 2);
- $table->date('startdate')->nullable();
- $table->date('targetdate')->nullable();
- $table->boolean('repeats');
- $table->enum('rep_length', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
- $table->smallInteger('rep_every')->unsigned();
- $table->smallInteger('rep_times')->unsigned()->nullable();
- $table->enum('reminder', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
- $table->smallInteger('reminder_skip')->unsigned();
- $table->boolean('remind_me');
- $table->integer('order')->unsigned();
-
- // connect account to piggy bank.
- $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
-
- // for an account, the name must be unique.
- $table->unique(['account_id', 'name']);
-
- }
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('account_id')->unsigned();
+ $table->string('name', 100);
+ $table->decimal('targetamount', 10, 2);
+ $table->date('startdate')->nullable();
+ $table->date('targetdate')->nullable();
+ $table->boolean('repeats');
+ $table->enum('rep_length', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
+ $table->smallInteger('rep_every')->unsigned();
+ $table->smallInteger('rep_times')->unsigned()->nullable();
+ $table->enum('reminder', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
+ $table->smallInteger('reminder_skip')->unsigned();
+ $table->boolean('remind_me');
+ $table->integer('order')->unsigned();
+
+ // connect account to piggy bank.
+ $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
+
+ // for an account, the name must be unique.
+ $table->unique(['account_id', 'name']);
+
+ }
);
}
diff --git a/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php b/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php
index 809a837bc9..d32e52f07b 100644
--- a/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php
+++ b/database/migrations/2014_06_27_164042_create_transaction_currencies_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateTransactionCurrenciesTable
*
*/
@@ -31,14 +31,14 @@ class CreateTransactionCurrenciesTable extends Migration
{
Schema::create(
'transaction_currencies', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->softDeletes();
- $table->string('code', 3);
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->string('code', 3);
- // code must be unique.
- $table->unique(['code']);
- }
+ // code must be unique.
+ $table->unique(['code']);
+ }
);
}
diff --git a/database/migrations/2014_06_27_164512_create_transaction_types_table.php b/database/migrations/2014_06_27_164512_create_transaction_types_table.php
index 746f037a84..4aa42eb9bd 100644
--- a/database/migrations/2014_06_27_164512_create_transaction_types_table.php
+++ b/database/migrations/2014_06_27_164512_create_transaction_types_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateTransactionTypesTable
*
*/
@@ -31,14 +31,14 @@ class CreateTransactionTypesTable extends Migration
{
Schema::create(
'transaction_types', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->softDeletes();
- $table->string('type', 50);
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->string('type', 50);
- // type must be unique.
- $table->unique(['type']);
- }
+ // type must be unique.
+ $table->unique(['type']);
+ }
);
}
diff --git a/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php b/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php
index 724059c859..6c9ae0f668 100644
--- a/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php
+++ b/database/migrations/2014_06_27_164619_create_recurring_transactions_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateRecurringTransactionsTable
*
*/
@@ -31,28 +31,28 @@ class CreateRecurringTransactionsTable extends Migration
{
Schema::create(
'recurring_transactions', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('user_id')->unsigned();
- $table->string('name', 50);
- $table->string('match', 255);
- $table->decimal('amount_min', 10, 2);
- $table->decimal('amount_max', 10, 2);
- $table->date('date');
- $table->boolean('active');
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('user_id')->unsigned();
+ $table->string('name', 50);
+ $table->string('match', 255);
+ $table->decimal('amount_min', 10, 2);
+ $table->decimal('amount_max', 10, 2);
+ $table->date('date');
+ $table->boolean('active');
- $table->boolean('automatch');
- $table->enum('repeat_freq', ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly']);
- $table->smallInteger('skip')->unsigned();
+ $table->boolean('automatch');
+ $table->enum('repeat_freq', ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly']);
+ $table->smallInteger('skip')->unsigned();
- // connect user id to users
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ // connect user id to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
- // for a user, the name must be unique
- $table->unique(['user_id', 'name']);
+ // for a user, the name must be unique
+ $table->unique(['user_id', 'name']);
- }
+ }
);
}
diff --git a/database/migrations/2014_06_27_164620_create_transaction_journals_table.php b/database/migrations/2014_06_27_164620_create_transaction_journals_table.php
index 44ede35eb0..b41b1ff493 100644
--- a/database/migrations/2014_06_27_164620_create_transaction_journals_table.php
+++ b/database/migrations/2014_06_27_164620_create_transaction_journals_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateTransactionJournalsTable
*
*/
@@ -31,31 +31,31 @@ class CreateTransactionJournalsTable extends Migration
{
Schema::create(
'transaction_journals', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->softDeletes();
- $table->integer('user_id')->unsigned();
- $table->integer('transaction_type_id')->unsigned();
- $table->integer('recurring_transaction_id')->unsigned()->nullable();
- $table->integer('transaction_currency_id')->unsigned();
- $table->string('description', 255)->nullable();
- $table->boolean('completed');
- $table->date('date');
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->integer('user_id')->unsigned();
+ $table->integer('transaction_type_id')->unsigned();
+ $table->integer('recurring_transaction_id')->unsigned()->nullable();
+ $table->integer('transaction_currency_id')->unsigned();
+ $table->string('description', 255)->nullable();
+ $table->boolean('completed');
+ $table->date('date');
- // connect users
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ // connect users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
- // connect transaction journals to transaction types
- $table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
+ // connect transaction journals to transaction types
+ $table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
- // connect transaction journals to recurring transactions
- $table->foreign('recurring_transaction_id')->references('id')->on('recurring_transactions')->onDelete('set null');
+ // connect transaction journals to recurring transactions
+ $table->foreign('recurring_transaction_id')->references('id')->on('recurring_transactions')->onDelete('set null');
- // connect transaction journals to transaction currencies
- $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
+ // connect transaction journals to transaction currencies
+ $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
- }
+ }
);
}
diff --git a/database/migrations/2014_06_27_164836_create_transactions_table.php b/database/migrations/2014_06_27_164836_create_transactions_table.php
index 66b2772534..8e1c847db5 100644
--- a/database/migrations/2014_06_27_164836_create_transactions_table.php
+++ b/database/migrations/2014_06_27_164836_create_transactions_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateTransactionsTable
*
*/
@@ -31,29 +31,26 @@ class CreateTransactionsTable extends Migration
{
Schema::create(
'transactions', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->softDeletes();
- $table->integer('account_id')->unsigned();
- $table->integer('piggybank_id')->nullable()->unsigned();
- $table->integer('transaction_journal_id')->unsigned();
- $table->string('description', 255)->nullable();
- $table->decimal('amount', 10, 2);
-
- // connect account id:
- $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
-
- // connect piggy banks
- $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('set null');
-
- // connect transactions to transaction journals
- $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->integer('account_id')->unsigned();
+ $table->integer('piggybank_id')->nullable()->unsigned();
+ $table->integer('transaction_journal_id')->unsigned();
+ $table->string('description', 255)->nullable();
+ $table->decimal('amount', 10, 2);
+ // connect account id:
+ $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
+ // connect piggy banks
+ $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('set null');
+ // connect transactions to transaction journals
+ $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
- }
+ }
);
}
diff --git a/database/migrations/2014_06_27_165344_create_component_transaction_table.php b/database/migrations/2014_06_27_165344_create_component_transaction_table.php
index 6eee751926..03020da537 100644
--- a/database/migrations/2014_06_27_165344_create_component_transaction_table.php
+++ b/database/migrations/2014_06_27_165344_create_component_transaction_table.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- *
+ *
* Class CreateComponentTransactionTable
*
*/
@@ -31,19 +31,19 @@ class CreateComponentTransactionTable extends Migration
{
Schema::create(
'component_transaction', function (Blueprint $table) {
- $table->increments('id');
- $table->integer('component_id')->unsigned();
- $table->integer('transaction_id')->unsigned();
+ $table->increments('id');
+ $table->integer('component_id')->unsigned();
+ $table->integer('transaction_id')->unsigned();
- // connect to components
- $table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
+ // connect to components
+ $table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
- // connect to transactions
- $table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
+ // connect to transactions
+ $table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
- // combo must be unique:
- $table->unique(['component_id', 'transaction_id']);
- }
+ // combo must be unique:
+ $table->unique(['component_id', 'transaction_id']);
+ }
);
}
diff --git a/database/migrations/2014_07_06_123842_create_preferences_table.php b/database/migrations/2014_07_06_123842_create_preferences_table.php
index 7cd7069c8e..ef510274c9 100644
--- a/database/migrations/2014_07_06_123842_create_preferences_table.php
+++ b/database/migrations/2014_07_06_123842_create_preferences_table.php
@@ -31,18 +31,18 @@ class CreatePreferencesTable extends Migration
{
Schema::create(
'preferences', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('user_id')->unsigned();
- $table->string('name');
- $table->text('data');
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('user_id')->unsigned();
+ $table->string('name');
+ $table->text('data');
- // connect preferences to users
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ // connect preferences to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
- // only one preference per name per user
- $table->unique(['user_id', 'name']);
- }
+ // only one preference per name per user
+ $table->unique(['user_id', 'name']);
+ }
);
}
diff --git a/database/migrations/2014_07_19_055011_create_limit_repeat_table.php b/database/migrations/2014_07_19_055011_create_limit_repeat_table.php
index 46edc87ac9..5174585c72 100644
--- a/database/migrations/2014_07_19_055011_create_limit_repeat_table.php
+++ b/database/migrations/2014_07_19_055011_create_limit_repeat_table.php
@@ -31,18 +31,18 @@ class CreateLimitRepeatTable extends Migration
{
Schema::create(
'limit_repetitions', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('limit_id')->unsigned();
- $table->date('startdate');
- $table->date('enddate');
- $table->decimal('amount', 10, 2);
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('limit_id')->unsigned();
+ $table->date('startdate');
+ $table->date('enddate');
+ $table->decimal('amount', 10, 2);
- $table->unique(['limit_id', 'startdate', 'enddate']);
+ $table->unique(['limit_id', 'startdate', 'enddate']);
- // connect limit
- $table->foreign('limit_id')->references('id')->on('limits')->onDelete('cascade');
- }
+ // connect limit
+ $table->foreign('limit_id')->references('id')->on('limits')->onDelete('cascade');
+ }
);
}
diff --git a/database/migrations/2014_08_12_173919_create_piggybank_repetitions_table.php b/database/migrations/2014_08_12_173919_create_piggybank_repetitions_table.php
index 341d36a9d8..223c4262ed 100644
--- a/database/migrations/2014_08_12_173919_create_piggybank_repetitions_table.php
+++ b/database/migrations/2014_08_12_173919_create_piggybank_repetitions_table.php
@@ -31,18 +31,18 @@ class CreatePiggybankRepetitionsTable extends Migration
{
Schema::create(
'piggybank_repetitions', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('piggybank_id')->unsigned();
- $table->date('startdate')->nullable();
- $table->date('targetdate')->nullable();
- $table->decimal('currentamount', 10, 2);
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('piggybank_id')->unsigned();
+ $table->date('startdate')->nullable();
+ $table->date('targetdate')->nullable();
+ $table->decimal('currentamount', 10, 2);
- $table->unique(['piggybank_id', 'startdate', 'targetdate']);
+ $table->unique(['piggybank_id', 'startdate', 'targetdate']);
- // connect instance to piggybank.
- $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
- }
+ // connect instance to piggybank.
+ $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
+ }
);
}
diff --git a/database/migrations/2014_08_18_100330_create_piggybank_events_table.php b/database/migrations/2014_08_18_100330_create_piggybank_events_table.php
index 8eebf01388..5c68410837 100644
--- a/database/migrations/2014_08_18_100330_create_piggybank_events_table.php
+++ b/database/migrations/2014_08_18_100330_create_piggybank_events_table.php
@@ -31,20 +31,20 @@ class CreatePiggybankEventsTable extends Migration
{
Schema::create(
'piggybank_events', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('piggybank_id')->unsigned();
- $table->integer('transaction_journal_id')->unsigned()->nullable();
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('piggybank_id')->unsigned();
+ $table->integer('transaction_journal_id')->unsigned()->nullable();
- $table->date('date');
- $table->decimal('amount', 10, 2);
+ $table->date('date');
+ $table->decimal('amount', 10, 2);
- // connect instance to piggybank.
- $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
+ // connect instance to piggybank.
+ $table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
- // connect to journal:
- $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
- }
+ // connect to journal:
+ $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
+ }
);
}
diff --git a/database/migrations/2014_08_23_113221_create_reminders_table.php b/database/migrations/2014_08_23_113221_create_reminders_table.php
index 1aaa49fb0a..aaecf27eb6 100644
--- a/database/migrations/2014_08_23_113221_create_reminders_table.php
+++ b/database/migrations/2014_08_23_113221_create_reminders_table.php
@@ -31,19 +31,19 @@ class CreateRemindersTable extends Migration
{
Schema::create(
'reminders', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('user_id')->unsigned();
- $table->date('startdate');
- $table->date('enddate')->nullable();
- $table->boolean('active');
- $table->boolean('notnow')->default(0);
- $table->integer('remindersable_id')->unsigned()->nullable();
- $table->string('remindersable_type')->nullable();
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('user_id')->unsigned();
+ $table->date('startdate');
+ $table->date('enddate')->nullable();
+ $table->boolean('active');
+ $table->boolean('notnow')->default(0);
+ $table->integer('remindersable_id')->unsigned()->nullable();
+ $table->string('remindersable_type')->nullable();
- // connect reminders to users
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
- }
+ // connect reminders to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ }
);
}
diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php
index 679df38f88..788ebc23e6 100644
--- a/database/migrations/2014_10_12_100000_create_password_resets_table.php
+++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php
@@ -1,33 +1,38 @@
<?php
-use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
-class CreatePasswordResetsTable extends Migration {
+/**
+ * Class CreatePasswordResetsTable
+ */
+class CreatePasswordResetsTable extends Migration
+{
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('password_resets', function(Blueprint $table)
- {
- $table->string('email')->index();
- $table->string('token')->index();
- $table->timestamp('created_at');
- });
- }
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('password_resets');
+ }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('password_resets');
- }
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create(
+ 'password_resets', function (Blueprint $table) {
+ $table->string('email')->index();
+ $table->string('token')->index();
+ $table->timestamp('created_at');
+ }
+ );
+ }
}
diff --git a/database/migrations/2014_11_10_172053_create_account_meta_table.php b/database/migrations/2014_11_10_172053_create_account_meta_table.php
index 1febb05a1b..24f92af144 100644
--- a/database/migrations/2014_11_10_172053_create_account_meta_table.php
+++ b/database/migrations/2014_11_10_172053_create_account_meta_table.php
@@ -33,16 +33,16 @@ class CreateAccountMetaTable extends Migration
//
Schema::create(
'account_meta', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->integer('account_id')->unsigned();
- $table->string('name');
- $table->text('data');
+ $table->increments('id');
+ $table->timestamps();
+ $table->integer('account_id')->unsigned();
+ $table->string('name');
+ $table->text('data');
- $table->unique(['account_id', 'name']);
+ $table->unique(['account_id', 'name']);
- }
+ }
);
}
diff --git a/database/migrations/2014_11_29_135749_create_transaction_groups_table.php b/database/migrations/2014_11_29_135749_create_transaction_groups_table.php
index c3d2e3af49..db68b79146 100644
--- a/database/migrations/2014_11_29_135749_create_transaction_groups_table.php
+++ b/database/migrations/2014_11_29_135749_create_transaction_groups_table.php
@@ -31,15 +31,15 @@ class CreateTransactionGroupsTable extends Migration
{
Schema::create(
'transaction_groups', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->softDeletes();
- $table->integer('user_id')->unsigned();
- $table->enum('relation', ['balance']);
-
- // connect reminders to users
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
- }
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->integer('user_id')->unsigned();
+ $table->enum('relation', ['balance']);
+
+ // connect reminders to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ }
);
diff --git a/database/migrations/2014_11_29_140217_create_transaction_group_transaction_journal_table.php b/database/migrations/2014_11_29_140217_create_transaction_group_transaction_journal_table.php
index 7a275b68d6..444e64b7c1 100644
--- a/database/migrations/2014_11_29_140217_create_transaction_group_transaction_journal_table.php
+++ b/database/migrations/2014_11_29_140217_create_transaction_group_transaction_journal_table.php
@@ -32,17 +32,17 @@ class CreateTransactionGroupTransactionJournalTable extends Migration
Schema::create(
'transaction_group_transaction_journal', function (Blueprint $table) {
- $table->increments('id');
- $table->integer('transaction_group_id')->unsigned();
- $table->integer('transaction_journal_id')->unsigned();
+ $table->increments('id');
+ $table->integer('transaction_group_id')->unsigned();
+ $table->integer('transaction_journal_id')->unsigned();
- // link to foreign tables.
- $table->foreign('transaction_group_id', 'tr_grp_id')->references('id')->on('transaction_groups')->onDelete('cascade');
- $table->foreign('transaction_journal_id', 'tr_trj_id')->references('id')->on('transaction_journals')->onDelete('cascade');
+ // link to foreign tables.
+ $table->foreign('transaction_group_id', 'tr_grp_id')->references('id')->on('transaction_groups')->onDelete('cascade');
+ $table->foreign('transaction_journal_id', 'tr_trj_id')->references('id')->on('transaction_journals')->onDelete('cascade');
- // add unique.
- $table->unique(['transaction_group_id', 'transaction_journal_id'], 'tt_joined');
- }
+ // add unique.
+ $table->unique(['transaction_group_id', 'transaction_journal_id'], 'tt_joined');
+ }
);
}
diff --git a/database/migrations/2014_12_13_190730_changes_for_v321.php b/database/migrations/2014_12_13_190730_changes_for_v321.php
index b2db7f7736..3d184e8e6f 100644
--- a/database/migrations/2014_12_13_190730_changes_for_v321.php
+++ b/database/migrations/2014_12_13_190730_changes_for_v321.php
@@ -1,10 +1,10 @@
<?php
+use FireflyIII\Models\BudgetLimit;
+use FireflyIII\Models\Component;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-use FireflyIII\Models\Component;
-use FireflyIII\Models\BudgetLimit;
/**
* @SuppressWarnings(PHPMD.ShortMethodName) // method names are mandated by laravel.
diff --git a/database/migrations/2014_12_24_191544_changes_for_v322.php b/database/migrations/2014_12_24_191544_changes_for_v322.php
index 5b5e7abff2..f1ec4036b3 100644
--- a/database/migrations/2014_12_24_191544_changes_for_v322.php
+++ b/database/migrations/2014_12_24_191544_changes_for_v322.php
@@ -6,7 +6,6 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings("MethodLength") // I don't mind this in case of migrations.
-
*
* Class ChangesForV322
*/
diff --git a/database/migrations/2015_01_18_082406_changes_for_v325.php b/database/migrations/2015_01_18_082406_changes_for_v325.php
index 32a4d2e769..d24b6d1c87 100644
--- a/database/migrations/2015_01_18_082406_changes_for_v325.php
+++ b/database/migrations/2015_01_18_082406_changes_for_v325.php
@@ -1,7 +1,6 @@
<?php
use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
diff --git a/database/seeds/AccountTypeSeeder.php b/database/seeds/AccountTypeSeeder.php
index 16fb415b56..7b2b56e021 100644
--- a/database/seeds/AccountTypeSeeder.php
+++ b/database/seeds/AccountTypeSeeder.php
@@ -1,6 +1,6 @@
<?php
-use Illuminate\Database\Seeder;
use FireflyIII\Models\AccountType;
+use Illuminate\Database\Seeder;
/**
* Class AccountTypeSeeder
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php
index 275f0b8500..4c2e245530 100644
--- a/database/seeds/DatabaseSeeder.php
+++ b/database/seeds/DatabaseSeeder.php
@@ -1,7 +1,12 @@
<?php
-use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
-class DatabaseSeeder extends Seeder {
+use Illuminate\Database\Seeder;
+
+/**
+ * Class DatabaseSeeder
+ */
+class DatabaseSeeder extends Seeder
+{
/**
* Run the database seeds.
diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php
index 3d24119910..8e5bb51ddc 100644
--- a/database/seeds/TestDataSeeder.php
+++ b/database/seeds/TestDataSeeder.php
@@ -1,23 +1,23 @@
<?php
use Carbon\Carbon;
-use Illuminate\Database\Seeder;
-use FireflyIII\User;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
-use FireflyIII\Models\Budget;
use FireflyIII\Models\Bill;
+use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\Category;
use FireflyIII\Models\LimitRepetition;
-use FireflyIII\Models\Reminder;
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;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
-use FireflyIII\Models\TransactionGroup;
+use FireflyIII\User;
+use Illuminate\Database\Seeder;
/**
* @SuppressWarnings("CamelCase") // I'm fine with this.
@@ -610,8 +610,8 @@ class TestDataSeeder extends Seeder
$house = Category::whereName('House')->orderBy('id', 'DESC')->first();
$piggyBank = PiggyBank::whereName('New camera')->orderBy('id', 'DESC')->first();
$intoPiggy = $this->createJournal(
- ['from' => $checking, 'to' => $savings, 'amount' => 100, 'transactionType' => $transfer, 'description' => 'Money for piggy',
- 'date' => $this->yaeom, 'transactionCurrency' => $euro, 'category' => $house, 'budget' => $groceries]
+ ['from' => $checking, 'to' => $savings, 'amount' => 100, 'transactionType' => $transfer, 'description' => 'Money for piggy',
+ 'date' => $this->yaeom, 'transactionCurrency' => $euro, 'category' => $house, 'budget' => $groceries]
);
PiggyBankEvent::create(
[
diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.php
index 922d37b31c..a53bb414b6 100644
--- a/database/seeds/TransactionCurrencySeeder.php
+++ b/database/seeds/TransactionCurrencySeeder.php
@@ -1,7 +1,8 @@
<?php
-use Illuminate\Database\Seeder;
use FireflyIII\Models\TransactionCurrency;
+use Illuminate\Database\Seeder;
+
/**
* Class TransactionCurrencySeeder
*/
@@ -11,9 +12,9 @@ class TransactionCurrencySeeder extends Seeder
{
DB::table('transaction_currencies')->delete();
- TransactionCurrency::create(['code' => 'EUR','name' => 'Euro','symbol' => '&#8364;']);
- TransactionCurrency::create(['code' => 'USD','name' => 'US Dollar','symbol' => '$']);
- TransactionCurrency::create(['code' => 'HUF','name' => 'Hungarian forint','symbol' => 'Ft']);
+ TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '&#8364;']);
+ TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$']);
+ TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft']);
}
}
diff --git a/database/seeds/TransactionTypeSeeder.php b/database/seeds/TransactionTypeSeeder.php
index 66559c6e25..ecdff20b05 100644
--- a/database/seeds/TransactionTypeSeeder.php
+++ b/database/seeds/TransactionTypeSeeder.php
@@ -1,6 +1,7 @@
<?php
-use Illuminate\Database\Seeder;
use FireflyIII\Models\TransactionType;
+use Illuminate\Database\Seeder;
+
/**
* Class TransactionTypeSeeder
*/
diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php
index 1ea4acd260..bba8e18db0 100644
--- a/tests/ExampleTest.php
+++ b/tests/ExampleTest.php
@@ -1,17 +1,21 @@
<?php
-class ExampleTest extends TestCase {
+/**
+ * Class ExampleTest
+ */
+class ExampleTest extends TestCase
+{
- /**
- * A basic functional test example.
- *
- * @return void
- */
- public function testBasicExample()
- {
- $response = $this->call('GET', '/');
+ /**
+ * A basic functional test example.
+ *
+ * @return void
+ */
+ public function testBasicExample()
+ {
+ $response = $this->call('GET', '/');
- $this->assertEquals(200, $response->getStatusCode());
- }
+ $this->assertEquals(200, $response->getStatusCode());
+ }
}
diff --git a/tests/TestCase.php b/tests/TestCase.php
index 69726c3b3d..971e451ea7 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -1,19 +1,23 @@
<?php
-class TestCase extends Illuminate\Foundation\Testing\TestCase {
+/**
+ * Class TestCase
+ */
+class TestCase extends Illuminate\Foundation\Testing\TestCase
+{
- /**
- * Creates the application.
- *
- * @return \Illuminate\Foundation\Application
- */
- public function createApplication()
- {
- $app = require __DIR__.'/../bootstrap/app.php';
+ /**
+ * Creates the application.
+ *
+ * @return \Illuminate\Foundation\Application
+ */
+ public function createApplication()
+ {
+ $app = require __DIR__ . '/../bootstrap/app.php';
- $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
+ $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
- return $app;
- }
+ return $app;
+ }
}
diff --git a/tests/functional/AccountControllerCest.php b/tests/functional/AccountControllerCest.php
index 8848523ed6..c81d8d8339 100644
--- a/tests/functional/AccountControllerCest.php
+++ b/tests/functional/AccountControllerCest.php
@@ -155,20 +155,6 @@ class AccountControllerCest
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
}
- /**
- * @param FunctionalTester $I
- */
- public function storeValidateOnly(FunctionalTester $I)
- {
- $I->amOnPage('/accounts/create/asset');
- $I->wantTo('validate a new asset account');
- $I->see('Create a new asset account');
- $I->submitForm(
- '#store', ['name' => 'New through tests.', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
- );
- $I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
- }
-
/**
* @param FunctionalTester $I
*/
@@ -197,19 +183,4 @@ class AccountControllerCest
}
- /**
- * @param FunctionalTester $I
- */
- public function validateUpdateOnly(FunctionalTester $I)
- {
- $I->wantTo('update an asset account and validate only');
- $I->amOnPage('/accounts/edit/2');
- $I->see('Edit asset account "Savings account"');
- $I->submitForm(
- '#update', ['name' => 'Savings accountXX', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
- );
- $I->dontSeeRecord('accounts', ['name' => 'Savings accountXX']);
-
- }
-
}
diff --git a/tests/functional/RelatedControllerCest.php b/tests/functional/RelatedControllerCest.php
index 1914bf7633..7e7ae49ae7 100644
--- a/tests/functional/RelatedControllerCest.php
+++ b/tests/functional/RelatedControllerCest.php
@@ -1,7 +1,8 @@
<?php
-use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionGroup;
+use FireflyIII\Models\TransactionJournal;
+
/**
* @SuppressWarnings("CamelCase")
* @SuppressWarnings("short")
@@ -27,6 +28,9 @@ class RelatedControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function alreadyRelated(FunctionalTester $I)
{
$group = TransactionGroup::first();
@@ -38,6 +42,9 @@ class RelatedControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function alreadyRelatedNoRelations(FunctionalTester $I)
{
$journal = TransactionJournal::first();
@@ -48,6 +55,9 @@ class RelatedControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function relate(FunctionalTester $I)
{
$journal = TransactionJournal::leftJoin(
@@ -67,6 +77,9 @@ class RelatedControllerCest
$I->see('true');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function related(FunctionalTester $I)
{
$group = TransactionGroup::first();
@@ -77,6 +90,9 @@ class RelatedControllerCest
$I->see('Big expense in ');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function removeRelation(FunctionalTester $I)
{
$group = TransactionGroup::first();
@@ -88,6 +104,9 @@ class RelatedControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function search(FunctionalTester $I)
{
$one = TransactionJournal::first();//$group = TransactionGroup::first();
diff --git a/tests/functional/ReminderControllerCest.php b/tests/functional/ReminderControllerCest.php
index 65e094815a..8a28f5657f 100644
--- a/tests/functional/ReminderControllerCest.php
+++ b/tests/functional/ReminderControllerCest.php
@@ -1,5 +1,6 @@
<?php
use FireflyIII\Models\Reminder;
+
/**
* Class ReminderControllerCest
*
@@ -29,7 +30,7 @@ class ReminderControllerCest
*/
public function act(FunctionalTester $I)
{
- $reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder','!=','')->first(
+ $reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder', '!=', '')->first(
['reminders.*']
);
@@ -73,12 +74,12 @@ class ReminderControllerCest
*/
public function show(FunctionalTester $I)
{
- $reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder','!=','')->first(
+ $reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder', '!=', '')->first(
['reminders.*']
);
$I->wantTo('see a reminder');
- $I->amOnPage('/reminders/'.$reminder->id);
+ $I->amOnPage('/reminders/' . $reminder->id);
$I->see('A reminder about');
$I->see('your piggy bank labelled "Nieuwe spullen"');
}
diff --git a/tests/functional/ReportControllerCest.php b/tests/functional/ReportControllerCest.php
index cd1a546a19..cf47b3ba6a 100644
--- a/tests/functional/ReportControllerCest.php
+++ b/tests/functional/ReportControllerCest.php
@@ -24,6 +24,9 @@ class ReportControllerCest
$I->amLoggedAs(['email' => '[email protected]', 'password' => 'james']);
}
+ /**
+ * @param FunctionalTester $I
+ */
public function budget(FunctionalTester $I)
{
$I->wantTo('see a budget report');
@@ -31,6 +34,9 @@ class ReportControllerCest
$I->see('Budget report for September 2014');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function budgetInvalidDate(FunctionalTester $I)
{
$I->wantTo('see a budget report for an invalid date');
@@ -38,6 +44,9 @@ class ReportControllerCest
$I->see('Invalid date');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function index(FunctionalTester $I)
{
$I->wantTo('see all possible reports');
@@ -47,6 +56,9 @@ class ReportControllerCest
$I->see('Budget reports');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function month(FunctionalTester $I)
{
$I->wantTo('see a monthly report');
@@ -54,6 +66,9 @@ class ReportControllerCest
$I->see('Report for September 2014');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function monthInvalidDate(FunctionalTester $I)
{
$I->wantTo('see a monthly report for an invalid month');
@@ -61,6 +76,9 @@ class ReportControllerCest
$I->see('Invalid date');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function year(FunctionalTester $I)
{
$I->wantTo('see a yearly report');
@@ -69,6 +87,9 @@ class ReportControllerCest
$I->see('Account balance');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function yearInvalidDate(FunctionalTester $I)
{
$I->wantTo('see a yearly report for an invalid year');
diff --git a/tests/functional/SearchControllerCest.php b/tests/functional/SearchControllerCest.php
index 8b8341f59b..038d5bcd05 100644
--- a/tests/functional/SearchControllerCest.php
+++ b/tests/functional/SearchControllerCest.php
@@ -20,6 +20,9 @@ class SearchControllerCest
$I->amLoggedAs(['email' => '[email protected]', 'password' => 'james']);
}
+ /**
+ * @param FunctionalTester $I
+ */
public function index(FunctionalTester $I)
{
$I->wantTo('search for "salary"');
@@ -29,6 +32,9 @@ class SearchControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function indexNoQuery(FunctionalTester $I)
{
$I->wantTo('Search for empty string');
diff --git a/tests/functional/TransactionControllerCest.php b/tests/functional/TransactionControllerCest.php
index 3a7ce23d82..0839032a12 100644
--- a/tests/functional/TransactionControllerCest.php
+++ b/tests/functional/TransactionControllerCest.php
@@ -23,6 +23,9 @@ class TransactionControllerCest
$I->amLoggedAs(['email' => '[email protected]', 'password' => 'james']);
}
+ /**
+ * @param FunctionalTester $I
+ */
public function create(FunctionalTester $I)
{
$I->wantTo('create a transaction');
@@ -30,6 +33,9 @@ class TransactionControllerCest
$I->see('Add a new withdrawal');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function deleteWithdrawal(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -42,6 +48,9 @@ class TransactionControllerCest
$I->see('Delete withdrawal "' . $journal->description . '"');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function destroyDeposit(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -56,6 +65,9 @@ class TransactionControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function destroyTransfer(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -72,6 +84,9 @@ class TransactionControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function destroyTransferWithEvent(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -87,6 +102,9 @@ class TransactionControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function destroyWithdrawal(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -102,6 +120,9 @@ class TransactionControllerCest
}
+ /**
+ * @param FunctionalTester $I
+ */
public function edit(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -115,6 +136,9 @@ class TransactionControllerCest
$I->see('Edit transfer &quot;' . $journal->description . '&quot;');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function index(FunctionalTester $I)
{
$I->wantTo('see all withdrawals');
@@ -122,6 +146,9 @@ class TransactionControllerCest
$I->see('Expenses');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function indexExpenses(FunctionalTester $I)
{
$I->wantTo('see all expenses');
@@ -129,6 +156,9 @@ class TransactionControllerCest
$I->see('Revenue, income and deposits');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function indexTransfers(FunctionalTester $I)
{
$I->wantTo('see all transfers');
@@ -136,6 +166,9 @@ class TransactionControllerCest
$I->see('Transfers');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function show(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -168,6 +201,9 @@ class TransactionControllerCest
$I->see($journal->description);
}
+ /**
+ * @param FunctionalTester $I
+ */
public function store(FunctionalTester $I)
{
$I->wantTo('store a transaction');
@@ -188,6 +224,9 @@ class TransactionControllerCest
$I->see('Transaction &quot;Test&quot; stored.');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function storeAndFail(FunctionalTester $I)
{
$I->wantTo('store a transaction and fail');
@@ -208,6 +247,9 @@ class TransactionControllerCest
$I->see('Could not store transaction: The description field is required.');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function storeAndReturn(FunctionalTester $I)
{
$I->wantTo('store a transaction');
@@ -228,6 +270,9 @@ class TransactionControllerCest
$I->see('Transaction &quot;Test&quot; stored.');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function storeValidate(FunctionalTester $I)
{
$I->wantTo('validate a transaction');
@@ -250,6 +295,9 @@ class TransactionControllerCest
$I->dontSeeRecord('transaction_journals', ['description' => 'TestValidateMe']);
}
+ /**
+ * @param FunctionalTester $I
+ */
public function update(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -276,6 +324,9 @@ class TransactionControllerCest
$I->see($journal->description . '!');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function updateAndFail(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -302,6 +353,9 @@ class TransactionControllerCest
$I->see('Could not update transaction: The description field is required.');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function updateAndReturn(FunctionalTester $I)
{
// get withdrawal transaction type id:
@@ -327,6 +381,9 @@ class TransactionControllerCest
$I->see($journal->description . '!');
}
+ /**
+ * @param FunctionalTester $I
+ */
public function updateValidate(FunctionalTester $I)
{
// get withdrawal transaction type id: