xplo.re Medusa Core Framework 3.2
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
      • Driver
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Fault
      • Formatter
        • Driver
      • Incident
        • Exception
      • Reporter
        • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • Type
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • AutoLoader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Configuration
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • Version

Class Closure

Interface to PHP native Closure instances. Embeds a Closure instance (aka lambda function) and provides an extended user interface including code and parameter retrieval and serialisation.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Closure
Namespace: Core
Package: Core
Since: 3.1
Requires: PHP 5.3
Version: 1.0
Located at Closure.inc.php

Methods summary

public
# __construct( $closure, array $args = null )

Initialises the Core\Closure instance with a PHP-native closure.

Initialises the Core\Closure instance with a PHP-native closure.

Parameters

$closure
closure represented by this instance.
$args
Optional array of arguments to bind closure to.

Throws

Core\Exception\InvalidArgument
Provided argument is not a lambda function.
Core\Exception\Loader

Since

3.1
public mixed
# __invoke( )

Invokes the embedded Closure with the given arguments.

Invokes the embedded Closure with the given arguments.

Returns

mixed
Return value of the embedded closure.

Since

3.1
public string[]
# __sleep( )

Serialises this instance.

Serialises this instance.

Returns

string[]
Array of properties to store during serialisation.

Since

3.1
public
# __wakeUp( )

De-serialises contents of a fresh instance.

De-serialises contents of a fresh instance.

Throws

Core\Exception\Inconsistency
Serialised closure data is defective.
Core\Exception\Loader

Since

3.1
public ReflectionParameter[]
# parameters( )

Returns an array of parameters expected by the embedded closure.

Returns an array of parameters expected by the embedded closure.

Returns

ReflectionParameter[]

Array of ReflectionParameter instances storing parameter names of the embedded closure.

Since

3.1
public string|false
# sourceCode( )

Returns the PHP source code of the embedded closure.

Returns the PHP source code of the embedded closure.

Returns

string|false

PHP source code string of the embedded closure or false if the query to fetch the source code failed.

Since

3.1
public string[]|false
# usedVariables( )

Returns an array of variables used by the embedded closure.

Returns an array of variables used by the embedded closure.

Returns

string[]|false

Array of variable names used by of the embedded closure. If no variables are used, an empty array is returned. If the list of used variables cannot be retrieves (e.g. error fetching the source code), false is returned instead.

Since

3.1

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected array $_v_arguments

Array of bound arguments.

Array of bound arguments.

Since

3.1
#
protected Closure $_v_closure

The embedded closure.

The embedded closure.

Since

3.1
#
protected ReflectionFunction $_rf

The reflection function instance of the embedded closure.

The reflection function instance of the embedded closure.

Since

3.1
#
protected string $_sourceCode

Source code buffer.

Source code buffer.

Since

3.1
#
protected array $_usedVariables

Used variables buffer.

Used variables buffer.

Since

3.1
#

Magic properties

public read-only array $arguments

Array of bound arguments.

public read-only Closure $closure

The embedded closure.

public read-only string|false $sourceCode

PHP source code of the embedded closure.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.2 API documentation generated by ApiGen