xero-laravel
xero-laravel copied to clipboard
syntax error, unexpected '?', expecting variable (T_VARIABLE)
while I am want to call the function below, getting the error syntax error, unexpected '?', expecting variable (T_VARIABLE)
, using PHP version PHP 7.4.27
public function redirectUserToXero() { return $this->getOAuth2()->getAuthorizationRedirect(); }
I am also seeing this on a codebase which has been using this library for a while. Just introduced.
I think related to this commit... https://github.com/langleyfoxall/xero-laravel/commit/b6fed0cf0deeca5cc48a196152f0e97af9349961
Thanks, @richmartell for your response, please let me know if you get any solution on this in future
@richmartell you are right its came with this line,
public function refreshAccessToken(AccessTokenInterface $accessToken, string? $grantType = null)
new released has been deployed 8 days ago, since the error came.,
i remove latest version and using "langleyfoxall/xero-laravel": "v3.1.1", its working fine till now, i am still doing other setup, lets see how its goes
https://github.com/langleyfoxall/xero-laravel/pull/54 check this
Same issue here!
the same issue here :( with last version :(
For php 7.4 remove "string?" from line 133 on OAuth2.php in refreshAccessToken() method, that should fix this error.
Go to src>OAuth2.php and remove "string?" from refreshAccessToken() Previous: public function refreshAccessToken(AccessTokenInterface $accessToken, string? $grantType = null) Now: public function refreshAccessToken(AccessTokenInterface $accessToken, $grantType = null)
This is also an issue for PHP8 in 3.1.2
Also getting this, that fix (#58) seems to have solved it, and has been merged into master. Can a new release be created to deploy this fix?
go to : vendor\langleyfoxall\xero-laravel\src\OAuth2.php
public function refreshAccessToken(AccessTokenInterface $accessToken, string ? $grantType = null)
->remove "?" from above line