note 128242 added to language.oop5.traits
| From: | JustAddingSomeAdditionalUseCase at main dot php dot net | Date: | Wed, 22 Feb 2023 11:14:02 +0000 |
| Subject: | note 128242 added to language.oop5.traits | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220199@lists.php.net to get a copy of this message | ||
I have not seen this specific use case:
"Wanting to preserve action of parent class method, the trait one calling ::parent & also
the child class mehod action".
// Child class.
use SuperTrait {
initialize as initializeOr;
}
public function initialize(array &$element) {
...
$this->initializeOr($element);
}
// Trait.
public function initialize(array &$element) {
...
parent::initialize($element);
}
// Parent class.
public function initialize(array &$element) {
...
}
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 5.225.170.11)
----
Manual Page -- https://php.net/manual/en/language.oop5.traits.php
Edit -- https://main.php.net/note/edit/128242
Del: integrated -- https://main.php.net/note/delete/128242/integrated
Del: useless -- https://main.php.net/note/delete/128242/useless
Del: bad code -- https://main.php.net/note/delete/128242/bad+code
Del: spam -- https://main.php.net/note/delete/128242/spam
Del: non-english -- https://main.php.net/note/delete/128242/non-english
Del: in docs -- https://main.php.net/note/delete/128242/in+docs
Del: other reasons-- https://main.php.net/note/delete/128242
Reject -- https://main.php.net/note/reject/128242
Search -- https://main.php.net/manage/user-notes.php