0
Php-Diでperformaceに関して何が良いか教えてもらえますか? annotations
またはplain constructor params
を使用していますか? 注釈=書き込む文字数は少なくなりますが、それは良い方法ですか?Php-Di annotationsの性能
class A {
/**
* @Inject
* @var B
**/
private $b;
use() {
$this->b->method();
}
}
対:
class A {
/** @var B **/
private $b;
public function __constructor(B $b) {
$this->b=$b;
}
use() {
$this->b->method();
}
}
ほとんどすべての時間はあなたの好みに応じて変わります。 私は個人的に2番目のアプローチが好きです –