mirror of
https://github.com/elyby/accounts.git
synced 2024-12-03 12:10:57 +05:30
17 lines
370 B
PHP
17 lines
370 B
PHP
|
<?php
|
||
|
namespace tests\codeception\common\_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);
|
||
|
}
|
||
|
|
||
|
}
|