In PHP, how do I reduce traits with SPL?

PHP, SPL, traits, reusable methods, software design
This example demonstrates how to effectively use traits in PHP with the Standard PHP Library (SPL) for reusable methods.
<?php trait Logger { public function log($message) { echo "[LOG]: " . $message . "<br>"; } } trait FileLogger { use Logger; public function logToFile($message) { file_put_contents('log.txt', $message.PHP_EOL, FILE_APPEND); } } class Application { use FileLogger; public function run() { $this->log("Application is running."); $this->logToFile("Logged to file: Application is running."); } } $app = new Application(); $app->run(); ?>

PHP SPL traits reusable methods software design