Apply fixes from StyleCI

This commit is contained in:
Manish Verma
2016-12-13 13:14:54 +00:00
committed by StyleCI Bot
parent 857d3004eb
commit 88f3df2180
161 changed files with 4729 additions and 3879 deletions

View File

@@ -4,9 +4,10 @@ namespace App\Http\Controllers\Common;
use App\Http\Controllers\Controller;
class FileuploadController extends Controller {
public function __construct() {
class FileuploadController extends Controller
{
public function __construct()
{
// checking authentication
$this->middleware('auth');
// checking if role is agent
@@ -15,7 +16,8 @@ class FileuploadController extends Controller {
// Returns a file size limit in bytes based on the PHP upload_max_filesize
// and post_max_size
function file_upload_max_size() {
public function file_upload_max_size()
{
static $max_size = -1;
if ($max_size < 0) {
@@ -31,11 +33,13 @@ class FileuploadController extends Controller {
$max_size_in_actual = ini_get('upload_max_filesize');
}
}
return ['0' => $max_size_in_bytes, '1' => $max_size_in_actual];
// return $max_size_in_bytes;
}
function parse_size($size) {
public function parse_size($size)
{
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
$size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
if ($unit) {
@@ -45,5 +49,4 @@ class FileuploadController extends Controller {
return round($size);
}
}
}