File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,18 @@ trait SizeTrait
15
15
*/
16
16
protected function getValueSize ($ value )
17
17
{
18
- if (is_int ($ value ) || is_numeric ($ value )) {
18
+ if ( $ this ->getAttribute () && ( $ this ->getAttribute ()->hasRule ( 'numeric ' ) || $ this ->getAttribute ()->hasRule ( 'integer ' ) ) && is_numeric ( $ value ) ) {
19
+ $ value = (float ) $ value ;
20
+ }
21
+
22
+ if ( is_int ( $ value ) || is_float ( $ value ) ) {
19
23
return (float ) $ value ;
20
- } elseif (is_string ($ value) ) {
21
- return (float ) mb_strlen ($ value , 'UTF-8 ' );
22
- } elseif ($ this ->isUploadedFileValue ($ value) ) {
24
+ } elseif ( is_string ( $ value ) ) {
25
+ return (float ) mb_strlen ( $ value , 'UTF-8 ' );
26
+ } elseif ( $ this ->isUploadedFileValue ( $ value ) ) {
23
27
return (float ) $ value ['size ' ];
24
- } elseif (is_array ($ value) ) {
25
- return (float ) count ($ value );
28
+ } elseif ( is_array ( $ value ) ) {
29
+ return (float ) count ( $ value );
26
30
} else {
27
31
return false ;
28
32
}
You can’t perform that action at this time.
0 commit comments