File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed
Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -428,14 +428,26 @@ public function getContainersToWrite(){
428428 return $ containers ;
429429 }
430430
431- protected function isContainer ($ field ){
432- return
433- is_a ($ field , File::class) ||
434- is_a ($ field , UploadedFile::class) ||
435- (
436- is_array ($ field ) &&
437- sizeof ($ field ) === 2
438- );
431+ protected function isContainer ($ field )
432+ {
433+
434+ // if this is a file then we know it's a container
435+ if ($ this ->isFile ($ field )) {
436+ return true ;
437+ }
438+
439+ // if it's an array, it could be a file => filename key-value pair.
440+ // it's a conainer if the first object in the array is a file
441+ if (is_array ($ field ) && sizeof ($ field ) === 2 && $ this ->isFile ($ field [0 ]) ){
442+ return true ;
443+ }
444+
445+ return false ;
446+ }
447+
448+ protected function isFile ($ object ){
449+ return (is_a ($ object , File::class) ||
450+ is_a ($ object , UploadedFile::class));
439451 }
440452
441453 /**
You can’t perform that action at this time.
0 commit comments