i got this unexpected error after site builder set up. Since I'm not familiar with CSS or PHP scripts, I'm not able to see the error which should be on line 8 and line 19 (according to the 500 error code).
There was no closing line (?>) at the end of the script, which is now added by me. Can you plese help me to fix other errors? thank you in advance for your help
<?php
/**
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/
declare(strict_types=1); // Error highlighted issue with this line.
namespace Zend\Diactoros;
/**
* 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 // Error highlighted issue with this line.
{
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'],
$spec['size'],
$spec['error'],
isset($spec['name']) ? $spec['name'] : null,
isset($spec['type']) ? $spec['type'] : null
);
}
?>