Documentation

Sudo
in package

Helpers for bypassing visibility restrictions, mostly used in code generated by the `sudo` command.

Table of Contents

assignProperty()  : mixed
Assign the value of a property of an object, bypassing visibility restrictions.
assignStaticProperty()  : mixed
Assign the value of a static property of a class, bypassing visibility restrictions.
callMethod()  : mixed
Call a method on an object, bypassing visibility restrictions.
callStatic()  : mixed
Call a static method on a class, bypassing visibility restrictions.
fetchClassConst()  : mixed
Fetch a class constant, bypassing visibility restrictions.
fetchProperty()  : mixed
Fetch a property of an object, bypassing visibility restrictions.
fetchStaticProperty()  : mixed
Fetch a property of a class, bypassing visibility restrictions.

Methods

assignProperty()

Assign the value of a property of an object, bypassing visibility restrictions.

public static assignProperty(object $object, string $property, mixed $value) : mixed
Parameters
$object : object
$property : string

property name

$value : mixed
Return values
mixed

Value of $object->property

assignStaticProperty()

Assign the value of a static property of a class, bypassing visibility restrictions.

public static assignStaticProperty(string|object $class, string $property, mixed $value) : mixed
Parameters
$class : string|object

class name or instance

$property : string

property name

$value : mixed
Return values
mixed

Value of $class::$property

callMethod()

Call a method on an object, bypassing visibility restrictions.

public static callMethod(object $object, string $method[, mixed $args = null ]) : mixed
Parameters
$object : object
$method : string

method name

$args : mixed = null
Return values
mixed

callStatic()

Call a static method on a class, bypassing visibility restrictions.

public static callStatic(string|object $class, string $method[, mixed $args = null ]) : mixed
Parameters
$class : string|object

class name or instance

$method : string

method name

$args : mixed = null
Return values
mixed

fetchClassConst()

Fetch a class constant, bypassing visibility restrictions.

public static fetchClassConst(string|object $class, string $const) : mixed
Parameters
$class : string|object

class name or instance

$const : string

constant name

Return values
mixed

fetchProperty()

Fetch a property of an object, bypassing visibility restrictions.

public static fetchProperty(object $object, string $property) : mixed
Parameters
$object : object
$property : string

property name

Return values
mixed

Value of $object->property

fetchStaticProperty()

Fetch a property of a class, bypassing visibility restrictions.

public static fetchStaticProperty(string|object $class, string $property) : mixed
Parameters
$class : string|object

class name or instance

$property : string

property name

Return values
mixed

Value of $class::$property

Search results