PHP Class Elgg\DeprecationWrapper

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 variabled to views automatically in elgg_view(). It also used to wrap the deprecated global $SESSION. 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
Inheritance: implements ArrayAccess
Show file Open project: elgg/elgg

Protected Properties

Property Type Description
$message string
$object object
$reporter callable
$string string
$version string

Public Methods

Method Description
__call ( string $name, array $arguments ) : mixed Call a method on the object
__construct ( mixed $object, string $message, string $version, callable $reporter = 'elgg_deprecated_notice' ) Create the wrapper
__get ( string $name ) : mixed Get a property on the object
__set ( string $name, mixed $value ) : void Set a property on the object
__toString ( ) : string Get the object as string
offsetExists ( mixed $offset ) : boolean Array access interface
offsetGet ( mixed $key ) : mixed Array access interface
offsetSet ( mixed $key, mixed $value ) : void Array access interface
offsetUnset ( mixed $key ) : void Array access interface

Protected Methods

Method Description
displayWarning ( ) : void Display a warning

Method Details

__call() public method

Call a method on the object
public __call ( string $name, array $arguments ) : mixed
$name string Method name
$arguments array Method arguments
return mixed

__construct() public method

Create the wrapper
public __construct ( mixed $object, string $message, string $version, callable $reporter = 'elgg_deprecated_notice' )
$object mixed The object or string to wrap
$message string The deprecation message to display when used
$version string The Elgg version this was deprecated
$reporter callable function called to report deprecation

__get() public method

Get a property on the object
public __get ( string $name ) : mixed
$name string Property name
return mixed

__set() public method

Set a property on the object
public __set ( string $name, mixed $value ) : void
$name string Property name
$value mixed Property value
return void

__toString() public method

Get the object as string
public __toString ( ) : string
return string

displayWarning() protected method

Display a warning
protected displayWarning ( ) : void
return void

offsetExists() public method

Array access interface
See also: ArrayAccess::offsetExists()
public offsetExists ( mixed $offset ) : boolean
$offset mixed Offset
return boolean

offsetGet() public method

Array access interface
See also: ArrayAccess::offsetGet()
public offsetGet ( mixed $key ) : mixed
$key mixed Name
return mixed

offsetSet() public method

Array access interface
See also: ArrayAccess::offsetSet()
public offsetSet ( mixed $key, mixed $value ) : void
$key mixed Name
$value mixed Value
return void

offsetUnset() public method

Array access interface
See also: ArrayAccess::offsetUnset()
public offsetUnset ( mixed $key ) : void
$key mixed Name
return void

Property Details

$message protected property

protected string $message
return string

$object protected property

protected object $object
return object

$reporter protected property

protected callable $reporter
return callable

$string protected property

protected string $string
return string

$version protected property

protected string $version
return string