All kinds of cleanup.

This commit is contained in:
James Cole
2014-12-06 21:48:23 +01:00
parent 07610ae8fb
commit 31a0be5bb4
26 changed files with 138 additions and 111 deletions

1
.gitignore vendored
View File

@@ -17,3 +17,4 @@ firefly-iii-import-*.json
tests/_output/* tests/_output/*
testing.sqlite testing.sqlite
c3.php

View File

@@ -2,14 +2,14 @@
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
return array( return [
'enabled' => Config::get('app.debug'), 'enabled' => Config::get('app.debug'),
'storage' => array( 'storage' => [
'enabled' => true, 'enabled' => true,
'path' => storage_path() . '/debugbar', 'path' => storage_path() . '/debugbar',
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -37,8 +37,8 @@ return array(
| |
*/ */
'capture_ajax' => true, 'capture_ajax' => true,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Capture Console Commands | Capture Console Commands
@@ -59,7 +59,7 @@ return array(
| |
*/ */
'collectors' => array( 'collectors' => [
'phpinfo' => true, // Php version 'phpinfo' => true, // Php version
'messages' => true, // Messages 'messages' => true, // Messages
'time' => true, // Time Datalogger 'time' => true, // Time Datalogger
@@ -78,7 +78,7 @@ return array(
'files' => false, // Show the included files 'files' => false, // Show the included files
'config' => false, // Display config settings 'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status 'auth' => false, // Display Laravel authentication status
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -89,27 +89,27 @@ return array(
| |
*/ */
'options' => array( 'options' => [
'auth' => array( 'auth' => [
'show_name' => false, // Also show the users name/email in the debugbar 'show_name' => false, // Also show the users name/email in the debugbar
), ],
'db' => array( 'db' => [
'with_params' => true, // Render SQL with the parameters substituted 'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline 'timeline' => false, // Add the queries to the timeline
), ],
'mail' => array( 'mail' => [
'full_log' => false 'full_log' => false
), ],
'views' => array( 'views' => [
'data' => false, //Note: Can slow down the application, because the data can be quite large.. 'data' => false, //Note: Can slow down the application, because the data can be quite large..
), ],
'route' => array( 'route' => [
'label' => true // show complete route on bar 'label' => true // show complete route on bar
), ],
'logs' => array( 'logs' => [
'file' => null 'file' => null
), ],
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -122,6 +122,6 @@ return array(
| |
*/ */
'inject' => true, 'inject' => true,
); ];

View File

@@ -1,6 +1,6 @@
<?php <?php
return array( return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -11,7 +11,7 @@ return array(
| |
*/ */
'filename' => '_ide_helper.php', 'filename' => '_ide_helper.php',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -25,9 +25,9 @@ return array(
'include_helpers' => false, 'include_helpers' => false,
'helper_files' => array( 'helper_files' => [
base_path().'/vendor/laravel/framework/src/Illuminate/Support/helpers.php', base_path() . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php',
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -39,9 +39,9 @@ return array(
| |
*/ */
'model_locations' => array( 'model_locations' => [
'app/models', 'app/models',
), ],
/* /*
@@ -53,14 +53,14 @@ return array(
| |
*/ */
'extra' => array( 'extra' => [
'Artisan' => array('Illuminate\Foundation\Artisan'), 'Artisan' => ['Illuminate\Foundation\Artisan'],
'Eloquent' => array('Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'), 'Eloquent' => ['Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'],
'Session' => array('Illuminate\Session\Store'), 'Session' => ['Illuminate\Session\Store'],
), ],
'magic' => array( 'magic' => [
'Log' => array( 'Log' => [
'debug' => 'Monolog\Logger::addDebug', 'debug' => 'Monolog\Logger::addDebug',
'info' => 'Monolog\Logger::addInfo', 'info' => 'Monolog\Logger::addInfo',
'notice' => 'Monolog\Logger::addNotice', 'notice' => 'Monolog\Logger::addNotice',
@@ -69,7 +69,8 @@ return array(
'critical' => 'Monolog\Logger::addCritical', 'critical' => 'Monolog\Logger::addCritical',
'alert' => 'Monolog\Logger::addAlert', 'alert' => 'Monolog\Logger::addAlert',
'emergency' => 'Monolog\Logger::addEmergency', 'emergency' => 'Monolog\Logger::addEmergency',
) ]
) ]
);
];

View File

@@ -1,5 +1,5 @@
<?php <?php
return array( return [
'view' => 'laravel-breadcrumbs::bootstrap3', 'view' => 'laravel-breadcrumbs::bootstrap3',
); ];

View File

@@ -1,6 +1,6 @@
<?php <?php
return array( return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -17,4 +17,4 @@ return array(
'driver' => 'array', 'driver' => 'array',
); ];

View File

@@ -1,6 +1,6 @@
<?php <?php
return array( return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -18,4 +18,4 @@ return array(
'driver' => 'array', 'driver' => 'array',
); ];

View File

@@ -1,6 +1,6 @@
<?php <?php
return [ return [
'paths' => array(__DIR__ . '/../views'), 'paths' => [__DIR__ . '/../views'],
'pagination' => 'pagination::slider-3', 'pagination' => 'pagination::slider-3',
]; ];

View File

@@ -92,6 +92,7 @@ class UserController extends BaseController
return View::make('user.registered'); return View::make('user.registered');
} }
return View::make('user.register'); return View::make('user.register');
} }

View File

@@ -68,6 +68,7 @@ Route::filter(
if (Auth::check()) { if (Auth::check()) {
return Redirect::to('/'); return Redirect::to('/');
} }
return null;
} }
); );

View File

@@ -1,6 +1,6 @@
<?php <?php
return array( return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -17,4 +17,4 @@ return array(
'next' => 'Next &raquo;', 'next' => 'Next &raquo;',
); ];

View File

@@ -1,24 +1,24 @@
<?php <?php
return array( return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Password Reminder Language Lines | Password Reminder Language Lines
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The following language lines are the default lines which match reasons | The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt | that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password. | has failed, such as for an invalid token or invalid new password.
| |
*/ */
"password" => "Passwords must be at least six characters and match the confirmation.", "password" => "Passwords must be at least six characters and match the confirmation.",
"user" => "We can't find a user with that e-mail address.", "user" => "We can't find a user with that e-mail address.",
"token" => "This password reset token is invalid.", "token" => "This password reset token is invalid.",
"sent" => "Password reminder sent!", "sent" => "Password reminder sent!",
); ];

View File

@@ -21,12 +21,12 @@ return [
"alpha_num" => "The :attribute may only contain letters and numbers.", "alpha_num" => "The :attribute may only contain letters and numbers.",
"array" => "The :attribute must be an array.", "array" => "The :attribute must be an array.",
"before" => "The :attribute must be a date before :date.", "before" => "The :attribute must be a date before :date.",
"between" => array( "between" => [
"numeric" => "The :attribute must be between :min and :max.", "numeric" => "The :attribute must be between :min and :max.",
"file" => "The :attribute must be between :min and :max kilobytes.", "file" => "The :attribute must be between :min and :max kilobytes.",
"string" => "The :attribute must be between :min and :max characters.", "string" => "The :attribute must be between :min and :max characters.",
"array" => "The :attribute must have between :min and :max items.", "array" => "The :attribute must have between :min and :max items.",
), ],
"confirmed" => "The :attribute confirmation does not match.", "confirmed" => "The :attribute confirmation does not match.",
"date" => "The :attribute is not a valid date.", "date" => "The :attribute is not a valid date.",
"date_format" => "The :attribute does not match the format :format.", "date_format" => "The :attribute does not match the format :format.",
@@ -39,19 +39,19 @@ return [
"in" => "The selected :attribute is invalid.", "in" => "The selected :attribute is invalid.",
"integer" => "The :attribute must be an integer.", "integer" => "The :attribute must be an integer.",
"ip" => "The :attribute must be a valid IP address.", "ip" => "The :attribute must be a valid IP address.",
"max" => array( "max" => [
"numeric" => "The :attribute may not be greater than :max.", "numeric" => "The :attribute may not be greater than :max.",
"file" => "The :attribute may not be greater than :max kilobytes.", "file" => "The :attribute may not be greater than :max kilobytes.",
"string" => "The :attribute may not be greater than :max characters.", "string" => "The :attribute may not be greater than :max characters.",
"array" => "The :attribute may not have more than :max items.", "array" => "The :attribute may not have more than :max items.",
), ],
"mimes" => "The :attribute must be a file of type: :values.", "mimes" => "The :attribute must be a file of type: :values.",
"min" => array( "min" => [
"numeric" => "The :attribute must be at least :min.", "numeric" => "The :attribute must be at least :min.",
"file" => "The :attribute must be at least :min kilobytes.", "file" => "The :attribute must be at least :min kilobytes.",
"string" => "The :attribute must be at least :min characters.", "string" => "The :attribute must be at least :min characters.",
"array" => "The :attribute must have at least :min items.", "array" => "The :attribute must have at least :min items.",
), ],
"not_in" => "The selected :attribute is invalid.", "not_in" => "The selected :attribute is invalid.",
"numeric" => "The :attribute must be a number.", "numeric" => "The :attribute must be a number.",
"regex" => "The :attribute format is invalid.", "regex" => "The :attribute format is invalid.",
@@ -62,12 +62,12 @@ return [
"required_without" => "The :attribute field is required when :values is not present.", "required_without" => "The :attribute field is required when :values is not present.",
"required_without_all" => "The :attribute field is required when none of :values are present.", "required_without_all" => "The :attribute field is required when none of :values are present.",
"same" => "The :attribute and :other must match.", "same" => "The :attribute and :other must match.",
"size" => array( "size" => [
"numeric" => "The :attribute must be :size.", "numeric" => "The :attribute must be :size.",
"file" => "The :attribute must be :size kilobytes.", "file" => "The :attribute must be :size kilobytes.",
"string" => "The :attribute must be :size characters.", "string" => "The :attribute must be :size characters.",
"array" => "The :attribute must contain :size items.", "array" => "The :attribute must contain :size items.",
), ],
"unique" => "The :attribute has already been taken.", "unique" => "The :attribute has already been taken.",
"url" => "The :attribute format is invalid.", "url" => "The :attribute format is invalid.",
@@ -82,11 +82,11 @@ return [
| |
*/ */
'custom' => array( 'custom' => [
'attribute-name' => array( 'attribute-name' => [
'rule-name' => 'custom-message', 'rule-name' => 'custom-message',
), ],
), ],
'alphabasic' => 'The :attribute field must consist of basic alphanumeric characters.', 'alphabasic' => 'The :attribute field must consist of basic alphanumeric characters.',
/* /*
@@ -100,6 +100,6 @@ return [
| |
*/ */
'attributes' => array(), 'attributes' => [],
]; ];

View File

@@ -109,8 +109,6 @@ class AccountType implements CUD, CommonDatabaseCalls
break; break;
} }
return null;
} }
/** /**

View File

@@ -67,6 +67,7 @@ class Report implements ReportInterface
} }
} }
} }
return null;
} }
); );
} else { } else {
@@ -86,6 +87,7 @@ class Report implements ReportInterface
} }
} }
} }
return null;
} }
); );
} }
@@ -148,6 +150,7 @@ class Report implements ReportInterface
} }
} }
} }
return null;
} }
); );
} else { } else {
@@ -157,6 +160,7 @@ class Report implements ReportInterface
if ($journal->transactionType->type == 'Deposit') { if ($journal->transactionType->type == 'Deposit') {
return $journal; return $journal;
} }
return null;
} }
); );
} }

View File

@@ -108,8 +108,6 @@ class TransactionType implements CUD, CommonDatabaseCalls
} }
return null;
} }
/** /**

View File

@@ -1,6 +1,12 @@
<?php <?php
namespace FireflyIII; namespace FireflyIII;
use FireflyIII\Shared\Toolkit\Date;
use FireflyIII\Shared\Toolkit\Filter;
use FireflyIII\Shared\Toolkit\Form;
use FireflyIII\Shared\Toolkit\Navigation;
use FireflyIII\Shared\Toolkit\Reminders;
use FireflyIII\Shared\Toolkit\Steam;
use FireflyIII\Shared\Validation\FireflyValidator; use FireflyIII\Shared\Validation\FireflyValidator;
use Illuminate\Foundation\AliasLoader; use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
@@ -42,27 +48,27 @@ class FF3ServiceProvider extends ServiceProvider
$this->app->bind( $this->app->bind(
'reminders', function () { 'reminders', function () {
return new \FireflyIII\Shared\Toolkit\Reminders; return new Reminders;
} }
); );
$this->app->bind( $this->app->bind(
'filter', function () { 'filter', function () {
return new \FireflyIII\Shared\Toolkit\Filter; return new Filter;
} }
); );
$this->app->bind( $this->app->bind(
'datekit', function () { 'datekit', function () {
return new \FireflyIII\Shared\Toolkit\Date; return new Date;
} }
); );
$this->app->bind( $this->app->bind(
'navigation', function () { 'navigation', function () {
return new \FireflyIII\Shared\Toolkit\Navigation; return new Navigation;
} }
); );
$this->app->bind( $this->app->bind(
'ffform', function () { 'ffform', function () {
return new \FireflyIII\Shared\Toolkit\Form; return new Form;
} }
); );
@@ -70,8 +76,8 @@ class FF3ServiceProvider extends ServiceProvider
* For models, various stuff: * For models, various stuff:
*/ */
$this->app->bind( $this->app->bind(
'steam', function() { 'steam', function () {
return new \FireflyIII\Shared\Toolkit\Steam; return new Steam;
} }
); );

View File

@@ -276,6 +276,9 @@ class Form
* *
* @param $type * @param $type
* @param $name * @param $name
*
* @return string
* @throws FireflyException
*/ */
public static function ffOptionsList($type, $name) public static function ffOptionsList($type, $name)
{ {

View File

@@ -83,6 +83,7 @@ class Reminders
if (!is_null($piggybank->reminder)) { if (!is_null($piggybank->reminder)) {
return $piggybank; return $piggybank;
} }
return null;
} }
); );
$today = Carbon::now(); $today = Carbon::now();

View File

@@ -2,7 +2,8 @@
// models: // models:
Route::bind( Route::bind(
'account', function ($value, $route) { 'account',
function ($value, $route) {
if (Auth::check()) { if (Auth::check()) {
$account = Account:: $account = Account::
leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')->where('account_types.editable', 1)->where('accounts.id', $value) leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')->where('account_types.editable', 1)->where('accounts.id', $value)

View File

@@ -21,9 +21,9 @@
<div class="row"> <div class="row">
<div class="col-lg-12 col-md-12 col-sm-12"> <div class="col-lg-12 col-md-12 col-sm-12">
<div class="progress progress-striped"> <div class="progress progress-striped">
<div class="progress-bar progress-bar-info" id="progress-bar-default" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div> <div class="progress-bar progress-bar-info" id="progress-bar-default" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
<div class="progress-bar progress-bar-danger" id="progress-bar-danger" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div> <div class="progress-bar progress-bar-danger" id="progress-bar-danger" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
<div class="progress-bar progress-bar-warning" id="progress-bar-warning" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div> <div class="progress-bar progress-bar-warning" id="progress-bar-warning" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -19,13 +19,11 @@ modules:
populate: false populate: false
coverage: coverage:
enabled: true enabled: true
whitelist: remote: true
include: whitelist:
- app/*
exclude:
- app/storage/*
blacklist:
include: include:
- app/controllers/* - app/controllers/*
- app/models/*
- app/lib/FireflyIII/*
exclude: exclude:
- app/controllers/BaseController.php - app/controllers/BaseController.php

View File

@@ -34,7 +34,8 @@
"satooshi/php-coveralls": "dev-master", "satooshi/php-coveralls": "dev-master",
"mockery/mockery": "@stable", "mockery/mockery": "@stable",
"league/factory-muffin": "~2.0", "league/factory-muffin": "~2.0",
"codeception/codeception": "*" "codeception/codeception": "*",
"codeception/c3": "2.*"
}, },
"autoload": { "autoload": {
@@ -53,11 +54,13 @@
"scripts": { "scripts": {
"post-install-cmd": [ "post-install-cmd": [
"php artisan clear-compiled", "php artisan clear-compiled",
"php artisan optimize" "php artisan optimize",
"Codeception\\c3\\Installer::copyC3ToRoot"
], ],
"post-update-cmd": [ "post-update-cmd": [
"php artisan clear-compiled", "php artisan clear-compiled",
"php artisan optimize" "php artisan optimize",
"Codeception\\c3\\Installer::copyC3ToRoot"
], ],
"post-create-project-cmd": [ "post-create-project-cmd": [
"php artisan key:generate" "php artisan key:generate"

View File

@@ -6,6 +6,15 @@
* @author Taylor Otwell <taylorotwell@gmail.com> * @author Taylor Otwell <taylorotwell@gmail.com>
*/ */
/**
* Adding c3.php for code coverage during codeception tests
* ref: https://github.com/Codeception/c3
*/
if (file_exists(__DIR__ . '/../c3.php')) {
require __DIR__ . '/../c3.php';
}
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Register The Auto Loader | Register The Auto Loader
@@ -18,8 +27,7 @@
| |
*/ */
require __DIR__.'/../bootstrap/autoload.php'; require __DIR__ . '/../bootstrap/autoload.php';
/* /*
@@ -34,7 +42,7 @@ require __DIR__.'/../bootstrap/autoload.php';
| |
*/ */
$app = require_once __DIR__.'/../bootstrap/start.php'; $app = require_once __DIR__ . '/../bootstrap/start.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@@ -8,5 +8,8 @@ class_name: FunctionalTester
modules: modules:
enabled: [Db, Filesystem, FunctionalHelper, Laravel4] enabled: [Db, Filesystem, FunctionalHelper, Laravel4]
config: config:
Db:
populate: false
cleanup: false
Laravel4: Laravel4:
environment: 'testing' environment: 'testing'

View File

@@ -1,4 +1,4 @@
<?php //[STAMP] 53e78415f2bf7c271c646ffe2b3f72b5 <?php //[STAMP] 783e39b9effa232e3a9a3fc0349ec983
// This class was automatically generated by build task // This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build // You should not change it manually as it will be overwritten on next build

View File

@@ -4,4 +4,4 @@ $I->wantTo('register a new account');
$I->amOnPage('/register'); $I->amOnPage('/register');
$I->submitForm('#register', ['email' => 'noreply@gmail.com']); $I->submitForm('#register', ['email' => 'noreply@gmail.com']);
$I->see('Password sent!'); $I->see('Password sent!');
$I->seeInDatabase('users', ['email' => 'noreply@gmail.com']); $I->seeRecord('users', ['email' => 'noreply@gmail.com']);