0

I ran php artisan route:list in eclipse folder of a laravel project and got this error. I have checked the file and there is { there.

$  php artisan route:list

Warning: Unsupported declare 'strict_types' in /Users/frankukachukwu/eclipse-workspace/essenceglobalmart.net/ap p/vendor/zendframework/zend-diactoros/src/functions/create_uploaded_file.php on line 8

Parse error: parse error, expecting `'{'' in /Users/frankukachukwu/eclipse-workspace/essenceglobalmart.net/app/ vendor/zendframework/zend-diactoros/src/functions/create_uploaded_file.php on line 19

<?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);

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 {

    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
    );
}
5
  • please share the create_uploaded_file.php Commented Mar 1, 2020 at 8:06
  • Please share what is written on create_uploaded_file.php on line 19 Commented Mar 1, 2020 at 8:06
  • The error is very clear. And very easy to solve. Commented Mar 1, 2020 at 8:10
  • Added it @Sehdev Commented Mar 1, 2020 at 8:55
  • @tksilicon what is your php version? Commented Mar 1, 2020 at 9:01

1 Answer 1

3

It seems the package that you are using is not compatible with your PHP version

You need a compatible PHP version, which is 7.0.0 - 7.0.5 || ^7.0.7.

To solve this issue you can either update your PHP version or downgrade package

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.