php - 解析错误:解析错误,期待 `'{'' Laravel
问题描述
我php artisan route:list
在一个 laravel 项目的 eclipse 文件夹中运行并得到了这个错误。我检查了文件,那里{
有。
$ php artisan route:list
警告:第 8 行 /Users/frankukachukwu/eclipse-workspace/essenceglobalmart.net/app/vendor/zendframework/zend-dictoros/src/functions/create_uploaded_file.php 中不支持声明“strict_types”
解析错误:解析错误,在第 19 行的 /Users/frankukachukwu/eclipse-workspace/essenceglobalmart.net/app/vendor/zendframework/zend-dictoros/src/functions/create_uploaded_file.php 中期待 `'{''
<?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
版本不兼容
您需要一个兼容的PHP
版本,即7.0.0 - 7.0.5 || ^7.0.7.
要解决此问题,您可以更新PHP
版本或降级包
推荐阅读
- ruby-on-rails - 通过 Ruby Web 应用程序编写 VBS 脚本——多线程问题
- linux-device-driver - 可变大小的 i2c 读取 Raspberry
- c# - 一行或一列中没有 3 个相同的随机 2D 数组
- c# - 如何将条件等于两个字符串
- python - 随机 url 生成器,但确保结果是唯一的
- python - 熊猫将(不等长度)列表的列拆分为多列
- python - Youtube V3 API 不对视频进行排序
- azure-devops - 将管道变量从 Designer 传递到 YAML 作业模板
- node.js - 有没有办法使用多个优先路径来保存 pug 文件?
- db2-400 - 在 QSYS2 中使用函数 TIMESTAMP_FORMAT 无效。成员数据映射错误