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/*
testing.sqlite
c3.php

View File

@ -2,14 +2,14 @@
use Illuminate\Support\Facades\Config;
return array(
return [
'enabled' => Config::get('app.debug'),
'enabled' => Config::get('app.debug'),
'storage' => array(
'storage' => [
'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
@ -59,7 +59,7 @@ return array(
|
*/
'collectors' => array(
'collectors' => [
'phpinfo' => true, // Php version
'messages' => true, // Messages
'time' => true, // Time Datalogger
@ -78,7 +78,7 @@ return array(
'files' => false, // Show the included files
'config' => false, // Display config settings
'auth' => false, // Display Laravel authentication status
),
],
/*
|--------------------------------------------------------------------------
@ -89,27 +89,27 @@ return array(
|
*/
'options' => array(
'auth' => array(
'options' => [
'auth' => [
'show_name' => false, // Also show the users name/email in the debugbar
),
'db' => array(
'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline
),
'mail' => array(
],
'db' => [
'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline
],
'mail' => [
'full_log' => false
),
'views' => array(
],
'views' => [
'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
),
'logs' => array(
],
'logs' => [
'file' => null
),
),
],
],
/*
|--------------------------------------------------------------------------
@ -122,6 +122,6 @@ return array(
|
*/
'inject' => true,
'inject' => true,
);
];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,24 +1,24 @@
<?php
return array(
return [
/*
|--------------------------------------------------------------------------
| Password Reminder Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/
/*
|--------------------------------------------------------------------------
| Password Reminder Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| 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.",
"array" => "The :attribute must be an array.",
"before" => "The :attribute must be a date before :date.",
"between" => array(
"between" => [
"numeric" => "The :attribute must be between :min and :max.",
"file" => "The :attribute must be between :min and :max kilobytes.",
"string" => "The :attribute must be between :min and :max characters.",
"array" => "The :attribute must have between :min and :max items.",
),
],
"confirmed" => "The :attribute confirmation does not match.",
"date" => "The :attribute is not a valid date.",
"date_format" => "The :attribute does not match the format :format.",
@ -39,19 +39,19 @@ return [
"in" => "The selected :attribute is invalid.",
"integer" => "The :attribute must be an integer.",
"ip" => "The :attribute must be a valid IP address.",
"max" => array(
"max" => [
"numeric" => "The :attribute may not be greater than :max.",
"file" => "The :attribute may not be greater than :max kilobytes.",
"string" => "The :attribute may not be greater than :max characters.",
"array" => "The :attribute may not have more than :max items.",
),
],
"mimes" => "The :attribute must be a file of type: :values.",
"min" => array(
"min" => [
"numeric" => "The :attribute must be at least :min.",
"file" => "The :attribute must be at least :min kilobytes.",
"string" => "The :attribute must be at least :min characters.",
"array" => "The :attribute must have at least :min items.",
),
],
"not_in" => "The selected :attribute is invalid.",
"numeric" => "The :attribute must be a number.",
"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_all" => "The :attribute field is required when none of :values are present.",
"same" => "The :attribute and :other must match.",
"size" => array(
"size" => [
"numeric" => "The :attribute must be :size.",
"file" => "The :attribute must be :size kilobytes.",
"string" => "The :attribute must be :size characters.",
"array" => "The :attribute must contain :size items.",
),
],
"unique" => "The :attribute has already been taken.",
"url" => "The :attribute format is invalid.",
@ -82,11 +82,11 @@ return [
|
*/
'custom' => array(
'attribute-name' => array(
'custom' => [
'attribute-name' => [
'rule-name' => 'custom-message',
),
),
],
],
'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;
}
return null;
}
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,8 @@
// models:
Route::bind(
'account', function ($value, $route) {
'account',
function ($value, $route) {
if (Auth::check()) {
$account = Account::
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="col-lg-12 col-md-12 col-sm-12">
<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-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-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-warning" id="progress-bar-warning" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
</div>
</div>
</div>

View File

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

View File

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

View File

@ -6,6 +6,15 @@
* @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
@ -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:
enabled: [Db, Filesystem, FunctionalHelper, Laravel4]
config:
Db:
populate: false
cleanup: false
Laravel4:
environment: 'testing'

View File

@ -1,4 +1,4 @@
<?php //[STAMP] 53e78415f2bf7c271c646ffe2b3f72b5
<?php //[STAMP] 783e39b9effa232e3a9a3fc0349ec983
// This class was automatically generated by build task
// 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->submitForm('#register', ['email' => 'noreply@gmail.com']);
$I->see('Password sent!');
$I->seeInDatabase('users', ['email' => 'noreply@gmail.com']);
$I->seeRecord('users', ['email' => 'noreply@gmail.com']);