-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global variable conflict: Rename 'version' to 'version-brevo' #31
Comments
As of PHP 8.1.0, write access to the entire I think there should be another solution to set the |
Thank you @jasperpoppe for raising this important issue. I fully agree with your concerns regarding the use of $GLOBALS, especially given the changes in PHP 8.1.0. I've updated the Pull Request to address this issue comprehensively. The new solution completely eliminates the use of $GLOBALS, resolving both the compatibility issue with PHP 8.1+ and the warning you've been experiencing. Here's what the updated PR does:
Here's a snippet of the change: class Configuration
{
/**
* Version of the package
*/
const VERSION = "2.0.0";
// ...
public function __construct()
{
$this->tempFolderPath = sys_get_temp_dir();
$this->userAgent = 'brevo_clientAPI/v' . self::VERSION . '/php';
}
} This change should resolve:
You can find the updated PR here: #32 I believe this solution effectively addresses the concerns you raised in issue #43. It gets rid of the $GLOBALS['version'] variable as you suggested, while maintaining the functionality. Please review these changes when you have a chance and let me know if you think any further modifications are needed. Your feedback on this solution would be greatly appreciated. |
Hello,
I've encountered an issue with the global variable named "version" in the Brevo PHP package. This global variable is causing conflicts in my project.
To resolve this, I propose changing the variable name to something more specific to the Brevo package. This would help avoid potential conflicts with other packages or user-defined variables.
Here's a proposed patch to address this issue:
This change makes the variable name more specific to the Brevo package, reducing the likelihood of conflicts with other code.
Please review this pull request and let me know if you need any further information or if you'd like me to make any adjustments to this proposed change.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered: