<?php
trait Aggregation {
protected function callAggregation($method, $arguments, $triggger = FALSE) {
var_dump($method, $arguments, $trigger);
}
protected function foo() {
}
}
class AggregateWithUse {
use Aggregation {
Aggregation::callAggregation as public __call;
}
}
class AggregateManually {
use Aggregation;
public function __call($method, $arguments) {
$this->callAggregation($method, $arguments);
}
}
(new AggregateWithUse())->test(42);
(new AggregateManually())->test(42);