1
0
mirror of https://github.com/elyby/accounts.git synced 2025-03-12 11:19:22 +05:30

17 lines
358 B
PHP

<?php
namespace common\tests\_support;
use ReflectionClass;
trait ProtectedCaller {
protected function callProtected($object, string $function, ...$args) {
$class = new ReflectionClass($object);
$method = $class->getMethod($function);
$method->setAccessible(true);
return $method->invokeArgs($object, $args);
}
}