我正在按照入门指南在使用wordpress(https://developer.vimeo.com/api/guides/start)错误的网站上实现Vimeo API我在非常基本的代码上遇到了问题:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$pathToAutoload = get_template_directory().'/vendor/autoload.php';
require $pathToAutoload;
use Vimeo\Vimeo;
$client = new Vimeo(
"myClientId",
"myClientSecret",
"myAccessToken"
);
$response = $client->request('/tutorial', array(), 'GET');
print_r($response);
?>
我收到此错误:
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /Users/Robin/Documents/Works/mySite/v4/wordpress/wp-content/themes/my-theme/vendor/vimeo/vimeo-api/src/Vimeo/Vimeo.php on line 88
看起来错误来自库本身。此行的代码出现错误:
public function request($url, $params = array(), $method = 'GET', $json_body = true, array $headers = array()): array
知道怎么调试吗?
(我正在使用MAMP Pro和PHP 5.6.37)
要使用Vimeo库,您必须具有PHP> = 7.1.0,请检查以下URL的要求
https://packagist.org/packages/vimeo/vimeo-api
或尝试与PHP> = 5.3.0兼容的旧版本(如果它仍在工作),