thybag / PHP-SharePoint-Lists-API

A simple PHP API to make working with SharePoint lists easy.
MIT License
184 stars 95 forks source link

PHP 8.1: $this->_login and $this->_password not accessible #178

Closed cweiske closed 1 year ago

cweiske commented 2 years ago

When #177 is fixed, the next problem appears:

PHP Warning: Undefined property: Thybag\Auth\SharePointOnlineAuth::$_login in vendor/thybag/php-sharepoint-lists-api/src/Thybag/Auth/SharePointOnlineAuth.php on line 78 Warning: Undefined property: Thybag\Auth\SharePointOnlineAuth::$_password in vendor/thybag/php-sharepoint-lists-api/src/Thybag/Auth/SharePointOnlineAuth.php on line 79

This is because at least in PHP 8.1, _login and _password are private, and the child class cannot access this anymore.

A backwards-compatible workaround for this problem would be to catch the options in a custom constructor, and using them later.

thybag commented 1 year ago

I believe this was resolved as part of https://github.com/thybag/PHP-SharePoint-Lists-API/pull/180