-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Declared session in BaseController to avoid Creation of dynamic property in php 8.2 #6996
Conversation
I prefer to just write comment instead, as session may or may not be used, session init is also commented under init method. |
app/Controllers/BaseController.php
Outdated
@@ -37,6 +37,13 @@ abstract class BaseController extends Controller | |||
*/ | |||
protected $helpers = []; | |||
|
|||
/** | |||
* To declare the session propety to allow for global |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* To declare the session propety to allow for global | |
* To declare the session property to allow for global |
app/Controllers/BaseController.php
Outdated
* initialization in the initController() method | ||
* See the Creation of dynamic property depreciation i php 8.2 | ||
*/ | ||
// public $session; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected modifier is fine since the code is commented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be protected
, because we don't need to set it public.
I appreciate the thoroughness but I'm fine expecting developers to handle this themselves. A compromise might be expanding the comment below under initController to say something like "be sure to declare properties for anything you assign." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned up the comment regarding the depreciation of dynamic properties and set the session method to be protected in the BaseController
Co-authored-by: kenjis <[email protected]>
@thenerdyshark We do not use |
Co-authored-by: Abdul Malik Ikhsan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Declared session property in the BaseController to avoid the depreciation of dynamic properties in PHP 8.2