Overview
  • Namespace
  • Class

Namespaces

  • CupOfTea
    • Chain
      • Contracts
      • Exceptions

Classes

  • Chain
  • Results

Class Chain

CupOfTea\Chain\Chain implements CupOfTea\Chain\Contracts\ResultAccess uses CupOfTea\Package\Package (not available)
Namespace: CupOfTea\Chain
Located at Chain.php

Methods summary

public
# __construct( Object $container = null )

Create a new Chain Instance

Create a new Chain Instance

Parameters

$container
Container instance used to build the class. Must contain make method to build the class. Suggested container: Illuminate\Container.

Throws

CupOfTea\Chain\Exceptions\InvalidContainerException
if the provided container does not contain a make method.
public CupOfTea\Chain\Chain
# requires( string $class )

Require the Class to be an instance of $class.

Require the Class to be an instance of $class.

Parameters

$class

Returns

CupOfTea\Chain\Chain
The Chain object.
public CupOfTea\Chain\Chain
# on( string|object $class )

Specify Class or Class Instance to chain methods on.

Specify Class or Class Instance to chain methods on.

Parameters

$class
Class or Class Instance to chain methods on.

Returns

CupOfTea\Chain\Chain
The Chain object.
public CupOfTea\Chain\Chain
# call( mixed $methods )

Specify the methods to be chained on the Class.

Specify the methods to be chained on the Class.

Parameters

$methods
String or array of strings, listing the methods to be chained on the Class.

Returns

CupOfTea\Chain\Chain
The Chain object.
public CupOfTea\Chain\Chain
# forgiving( )

Enable forgiving mode. Chain will no longer throw an InvalidMethodException if a method does not exist on the Class.

Enable forgiving mode. Chain will no longer throw an InvalidMethodException if a method does not exist on the Class.

Returns

CupOfTea\Chain\Chain
The Chain object.
public CupOfTea\Chain\Chain
# with( mixed $parameters )

Specify parameters for the Chained methods.

Specify parameters for the Chained methods.

Parameters

$parameters
String or array of strings, listing the parameters to be used with the chained methods.

Returns

CupOfTea\Chain\Chain
The Chain object.
public CupOfTea\Chain\Results
# run( )

Run the Chain of methods on the Class.

Run the Chain of methods on the Class.

Returns

CupOfTea\Chain\Results
Object containing the results from each method.
public mixed
# then( callable $destination )

Run the Chain with a final destination Callback.

Run the Chain with a final destination Callback.

Parameters

$destination
Final destination Callback. Will receive the Results object as a parameter.

Returns

mixed
The result of the final destination Callback.
public mixed
# getResult( string $result )

Run the Chain and immediately return the result of the specified method.

Run the Chain and immediately return the result of the specified method.

Parameters

$result
Method name to return the result of.

Returns

mixed
Result of the specified method.

Implementation of

CupOfTea\Chain\Contracts\ResultAccess::getResult()
public Array
# getResults( )

Run the Chain and return the results as an Array.

Run the Chain and return the results as an Array.

Returns

Array
Results of the Chained methods.

Implementation of

CupOfTea\Chain\Contracts\ResultAccess::getResults()
public
# toArray( )

Alias for getResults.

Alias for getResults.

See

CupOfTea\Chain\Chain::getResults()

Implementation of

CupOfTea\Chain\Contracts\ResultAccess::toArray()

Constants summary

string PACKAGE

Package Name

Package Name

Const

string
# 'CupOfTea/Chain'
string VERSION

Package Version

Package Version

Const

string
# '1.2.1'

Properties summary

protected $container

Container Instance

Container Instance

Protected

Object
#
protected $requires

Required Class

Required Class

Protected

string
#
protected $instance

Instance of the Class

Instance of the Class

Protected

Object
#
protected boolean $forgiving

Forgiving mode

Forgiving mode

Protected

bool
# false
protected array $parameters

Method parameters

Method parameters

Protected

Array
# []
API documentation generated by ApiGen