Elgg  Version 3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\DeprecationWrapper Class Reference

Wrap an object and display warnings whenever the object's variables are accessed or a method is used. More...

Inheritance diagram for Elgg\DeprecationWrapper:

Public Member Functions

 __construct ($object, $message, $version, $reporter= 'elgg_deprecated_notice')
 Create the wrapper. More...
 
 __get ($name)
 Get a property on the object. More...
 
 __set ($name, $value)
 Set a property on the object. More...
 
 __isset ($name)
 Is a property set? More...
 
 __call ($name, $arguments)
 Call a method on the object. More...
 
 __toString ()
 Get the object as string. More...
 
 offsetSet ($key, $value)
 Array access interface. More...
 
 offsetGet ($key)
 Array access interface. More...
 
 offsetUnset ($key)
 Array access interface. More...
 
 offsetExists ($offset)
 Array access interface. More...
 

Protected Member Functions

 displayWarning ()
 Display a warning. More...
 

Protected Attributes

 $object
 
 $string
 
 $message
 
 $version
 
 $reporter
 

Detailed Description

Wrap an object and display warnings whenever the object's variables are accessed or a method is used.

It can also be used to wrap a string.

Note that the wrapper will not share the type of the wrapped object and will fail type hints, instanceof, etc.

This was introduced for deprecating passing particular variables to views automatically in elgg_view(). It can be removed once that use is no longer required.

Wraps: url string in ViewsService config object in ViewsService user object in ViewsService session object in session lib config object in ElggPlugin::includeFile

Definition at line 27 of file DeprecationWrapper.php.

Constructor & Destructor Documentation

Elgg\DeprecationWrapper::__construct (   $object,
  $message,
  $version,
  $reporter = 'elgg_deprecated_notice' 
)

Create the wrapper.

Parameters
mixed$objectThe object or string to wrap
string$messageThe deprecation message to display when used
string$versionThe Elgg version this was deprecated
callable$reporterfunction called to report deprecation

Definition at line 51 of file DeprecationWrapper.php.

Member Function Documentation

Elgg\DeprecationWrapper::__call (   $name,
  $arguments 
)

Call a method on the object.

Parameters
string$nameMethod name
array$argumentsMethod arguments
Returns
mixed

Definition at line 103 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::__get (   $name)

Get a property on the object.

Parameters
string$nameProperty name
Returns
mixed

Definition at line 68 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::__isset (   $name)

Is a property set?

Parameters
string$nameProperty name
Returns
bool

Definition at line 91 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::__set (   $name,
  $value 
)

Set a property on the object.

Parameters
string$nameProperty name
mixed$valueProperty value
Returns
void

Definition at line 80 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::__toString ( )

Get the object as string.

Returns
string

Definition at line 113 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::displayWarning ( )
protected

Display a warning.

Returns
void

Definition at line 127 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::offsetExists (   $offset)

Array access interface.

See also
::offsetExists()
Parameters
mixed$offsetOffset
Returns
bool

Definition at line 204 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::offsetGet (   $key)

Array access interface.

See also
::offsetGet()
Parameters
mixed$keyName
Returns
mixed

Definition at line 168 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::offsetSet (   $key,
  $value 
)

Array access interface.

See also
::offsetSet()
Parameters
mixed$keyName
mixed$valueValue
Returns
void

Definition at line 145 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::offsetUnset (   $key)

Array access interface.

See also
::offsetUnset()
Parameters
mixed$keyName
Returns
void

Definition at line 186 of file DeprecationWrapper.php.

Member Data Documentation

Elgg\DeprecationWrapper::$message
protected

Definition at line 35 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::$object
protected

Definition at line 29 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::$reporter
protected

Definition at line 41 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::$string
protected

Definition at line 32 of file DeprecationWrapper.php.

Elgg\DeprecationWrapper::$version
protected

Definition at line 38 of file DeprecationWrapper.php.


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