![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/laminas/laminas-diactoros/src/functions/ |
<?php declare(strict_types=1); namespace Laminas\Diactoros; use function sprintf; /** * Create an uploaded file instance from an array of values. * * @param array $spec A single $_FILES entry. * @throws Exception\InvalidArgumentException If one or more of the tmp_name, * size, or error keys are missing from $spec. */ function createUploadedFile(array $spec): UploadedFile { if ( ! isset($spec['tmp_name']) || ! isset($spec['size']) || ! isset($spec['error']) ) { throw new Exception\InvalidArgumentException(sprintf( '$spec provided to %s MUST contain each of the keys "tmp_name",' . ' "size", and "error"; one or more were missing', __FUNCTION__ )); } return new UploadedFile( $spec['tmp_name'], (int) $spec['size'], $spec['error'], $spec['name'] ?? null, $spec['type'] ?? null ); }