Reputation: 38
I'm following the starter guide to implement the Vimeo API on a website using wordpress (https://developer.vimeo.com/api/guides/start) bug I have an issue on very basic code :
<?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);
?>
I get this error :
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
It looks like the error comes from the library itself. There is the code at this line where the error appear :
public function request($url, $params = array(), $method = 'GET', $json_body = true, array $headers = array()): array
Any idea how to debug it ?
(I'm using MAMP Pro and PHP 5.6.37)
Upvotes: 0
Views: 597
Reputation: 1313
To use Vimeo library you must have PHP >= 7.1.0, please check requirements on url below
https://packagist.org/packages/vimeo/vimeo-api
or try older version (if it's still working) which is compatible with PHP >= 5.3.0),
https://packagist.org/packages/vimeo/vimeo-api#2.0.5
Upvotes: 3