refactoring container for speed.
This commit is contained in:
@@ -4,6 +4,7 @@ use Closure;
|
||||
use Laravel\IoC;
|
||||
use Laravel\Str;
|
||||
use Laravel\Lang;
|
||||
use Laravel\Input;
|
||||
use Laravel\Database\Manager as DB;
|
||||
|
||||
class Validator {
|
||||
@@ -304,9 +305,7 @@ class Validator {
|
||||
|
||||
$value = $this->attributes[$attribute];
|
||||
|
||||
$files = IoC::container()->resolve('laravel.input')->file();
|
||||
|
||||
return (array_key_exists($attribute, $files)) ? $value['size'] / 1024 : Str::length(trim($value));
|
||||
return (array_key_exists($attribute, Input::file())) ? $value['size'] / 1024 : Str::length(trim($value));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -478,7 +477,7 @@ class Validator {
|
||||
// the default error message for the appropriate units.
|
||||
if (in_array($rule, $this->size_rules) and ! $this->has_rule($attribute, $this->numeric_rules))
|
||||
{
|
||||
return (array_key_exists($attribute, IoC::container()->resolve('laravel.input')->file()))
|
||||
return (array_key_exists($attribute, Input::file()))
|
||||
? rtrim($message, '.').' '.Lang::line('validation.kilobytes')->get($this->language).'.'
|
||||
: rtrim($message, '.').' '.Lang::line('validation.characters')->get($this->language).'.';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user