解析错误:解析错误,期望`'{''Laravel [英] Parse error: parse error, expecting `'{'' Laravel

查看:166
本文介绍了解析错误:解析错误,期望`'{''Laravel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在laravel项目的eclipse文件夹中运行了php artisan route:list,并收到此错误.我已经检查了文件,并且那里有{.

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

警告:不支持在其中声明'strict_types' /用户/frankukachukwu/eclipse-workspace/essenceglobalmart.net/ap p/供应商/zendframework/zend-diactoros/src/functions/create_uploaded_file.php 在第8行

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

解析错误:解析错误,期望输入'{" /用户/frankukachukwu/eclipse-workspace/essenceglobalmart.net/app/ 供应商/zendframework/zend-diactoros/src/functions/create_uploaded_file.php 在第19行

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

推荐答案

似乎您使用的软件包与您的PHP版本不兼容

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

您需要兼容的PHP版本,即7.0.0 - 7.0.5 || ^7.0.7.

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

要解决此问题,您可以更新您的PHP版本或降级软件包

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

这篇关于解析错误:解析错误,期望`'{''Laravel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆