Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core\deprecation Class Reference

Static Public Member Functions

static emit_deprecation_if_present (array|string|object $reference)
 Emit a deprecation notice if the reference is deprecated.
 
static from (array|string|object $reference)
 Get the attribute from a reference.
 
static get_deprecation_string (deprecated $attribute,)
 Get a string describing the deprecation.
 
static is_deprecated (array|string|object $reference)
 Check if a reference is deprecated.
 

Static Protected Member Functions

static emit_deprecation_notice (deprecated $attribute,)
 Emit the relevant deprecation notice.
 
static from_reflected_object (ReflectionClass $rc, ?string $name,)
 Fetch a referenced deprecation attribute from a reflected object.
 
static get_attribute (Reflector $ref, string $owner,)
 Get a deprecation attribute from a reflector.
 

Member Function Documentation

◆ emit_deprecation_if_present()

static core\deprecation::emit_deprecation_if_present ( array|string|object $reference)
static

Emit a deprecation notice if the reference is deprecated.

Parameters
array | string | object$reference

◆ emit_deprecation_notice()

static core\deprecation::emit_deprecation_notice ( deprecated $attribute)
staticprotected

Emit the relevant deprecation notice.

Parameters
deprecated$attribute

◆ from()

static core\deprecation::from ( array|string|object $reference)
static

Get the attribute from a reference.

The reference can be:

  • a string, in which case it will be checked for a function, class, method, property, constant, or enum.
  • an array
  • an instantiated object, in which case the object will be checked for a class, method, property, or constant.
Parameters
array | string | object$referenceA reference to a potentially deprecated thing.
Return values
null|deprecated

◆ from_reflected_object()

static core\deprecation::from_reflected_object ( ReflectionClass $rc,
?string $name )
staticprotected

Fetch a referenced deprecation attribute from a reflected object.

Parameters
ReflectionClass$rcThe reflected object
null | string$nameThe name of the thing to check for deprecation
Return values
null|deprecated_with_reference

◆ get_attribute()

static core\deprecation::get_attribute ( Reflector $ref,
string $owner )
staticprotected

Get a deprecation attribute from a reflector.

Parameters
Reflector$refThe reflector
string$ownerA descriptor of the owner of the thing that is deprecated
Return values
null|deprecated_with_reference

◆ get_deprecation_string()

static core\deprecation::get_deprecation_string ( deprecated $attribute)
static

Get a string describing the deprecation.

Parameters
deprecated$attribute
string$owner
Return values
string

◆ is_deprecated()

static core\deprecation::is_deprecated ( array|string|object $reference)
static

Check if a reference is deprecated.

Parameters
array | string | object$reference
Return values
bool

The documentation for this class was generated from the following file: