CodeIgniter v4.5 API

ReflectionHelper

Testing helper.

Table of Contents

Methods

getPrivateMethodInvoker()  : Closure
Find a private method invoker.
getPrivateProperty()  : mixed
Retrieve a private property.
setPrivateProperty()  : void
Set a private property.
getAccessibleRefProperty()  : ReflectionProperty
Find an accessible property.

Methods

getPrivateMethodInvoker()

Find a private method invoker.

public static getPrivateMethodInvoker(object|string $obj, string $method) : Closure
Parameters
$obj : object|string

object or class name

$method : string

method name

Tags
phpstan-return

Closure(mixed ...$args): mixed

throws
ReflectionException
Return values
Closure

getPrivateProperty()

Retrieve a private property.

public static getPrivateProperty(object|string $obj, string $property) : mixed
Parameters
$obj : object|string

object or class name

$property : string

property name

Tags
throws
ReflectionException

setPrivateProperty()

Set a private property.

public static setPrivateProperty(object|string $obj, string $property, mixed $value) : void
Parameters
$obj : object|string

object or class name

$property : string

property name

$value : mixed

value

Tags
throws
ReflectionException

getAccessibleRefProperty()

Find an accessible property.

private static getAccessibleRefProperty(object|string $obj, string $property) : ReflectionProperty
Parameters
$obj : object|string
$property : string
Tags
throws
ReflectionException
Return values
ReflectionProperty

        
On this page

Search results