Various code cleanup.

This commit is contained in:
James Cole
2017-09-14 17:40:02 +02:00
parent 761e9effae
commit 5e900736f8
59 changed files with 315 additions and 1912 deletions

View File

@@ -1,4 +1,15 @@
<?php
declare(strict_types=1);
/**
* EncryptCookies.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
namespace FireflyIII\Http\Middleware;
@@ -11,7 +22,8 @@ class EncryptCookies extends Middleware
*
* @var array
*/
protected $except = [
//
];
protected $except
= [
//
];
}

View File

@@ -101,12 +101,11 @@ class Range
$moneyResult = setlocale(LC_MONETARY, $locale);
// send error to view if could not set money format
if($moneyResult === false) {
if ($moneyResult === false) {
View::share('invalidMonetaryLocale', true);
}
// save some formats:
$monthAndDayFormat = (string)trans('config.month_and_day');
$dateTimeFormat = (string)trans('config.date_time');

View File

@@ -1,4 +1,15 @@
<?php
declare(strict_types=1);
/**
* RedirectIfAuthenticated.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
namespace FireflyIII\Http\Middleware;
@@ -10,9 +21,10 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
*
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)

View File

@@ -1,4 +1,15 @@
<?php
declare(strict_types=1);
/**
* TrimStrings.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
namespace FireflyIII\Http\Middleware;
@@ -11,8 +22,9 @@ class TrimStrings extends Middleware
*
* @var array
*/
protected $except = [
'password',
'password_confirmation',
];
protected $except
= [
'password',
'password_confirmation',
];
}

View File

@@ -1,29 +1,40 @@
<?php
declare(strict_types=1);
/**
* TrustProxies.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
namespace FireflyIII\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The current proxy header mappings.
*
* @var array
*/
protected $headers
= [
Request::HEADER_FORWARDED => 'FORWARDED',
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
];
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;
/**
* The current proxy header mappings.
*
* @var array
*/
protected $headers = [
Request::HEADER_FORWARDED => 'FORWARDED',
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
];
}

View File

@@ -1,4 +1,15 @@
<?php
declare(strict_types=1);
/**
* VerifyCsrfToken.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
namespace FireflyIII\Http\Middleware;
@@ -11,7 +22,8 @@ class VerifyCsrfToken extends Middleware
*
* @var array
*/
protected $except = [
//
];
protected $except
= [
//
];
}