kphp
kphp copied to clipboard
Allow use `use` in traits
<?php
namespace Traits;
trait AuthorTrait {
use A\B\C;
protected static function foo(int $id): D {
$user = get_user($id);
return $user->check() ?
E::bar() // from A\B\C
: E::baz(); // form A\B\C
}
}
Compile Error: https://github.com/VKCOM/kphp/blob/e02602ea4180ac3da5dc0edfbb055fbc11be26f4/compiler/gentree.cpp#L2231-L2233
relates to KPHP-1332