PHP Class Eloquent\Phony\Call\CallData

Inheritance: implements Eloquent\Phony\Call\Call
Afficher le fichier Open project: eloquent/phony

Méthodes publiques

Méthode Description
__construct ( integer $index, CalledEvent $calledEvent ) Construct a new call data instance.
addIterableEvent ( Eloquent\Phony\Call\Event\IterableEvent $iterableEvent ) Add an iterable event.
allCalls ( ) : array Get all calls as an array.
allEvents ( ) : array Get all events as an array.
argument ( integer $index ) : mixed Get an argument by index.
arguments ( ) : Arguments Get the received arguments.
callAt ( integer $index ) : Eloquent\Phony\Call\Call Get a call by index.
callCount ( ) : integer Get the number of calls.
callback ( ) : callable Get the callback.
calledEvent ( ) : CalledEvent Get the 'called' event.
compareSequential ( Eloquent\Phony\Call\Call $a, Eloquent\Phony\Call\Call $b ) : integer A comparator for ordering calls by sequence number.
count ( ) : integer Get the event count.
endEvent ( ) : Eloquent\Phony\Call\Event\EndEvent | null Get the end event.
endTime ( ) : float | null Get the time at which the call completed.
eventAt ( integer $index ) : Eloquent\Phony\Event\Event Get an event by index.
eventCount ( ) : integer Get the number of events.
exception ( ) : Exceptio\Exception | Erro\Error Get the thrown exception.
firstCall ( ) : Eloquent\Phony\Call\Call Get the first call.
firstEvent ( ) : Eloquent\Phony\Event\Event Get the first event.
generatorException ( ) : Exceptio\Exception | Erro\Error Get the exception thrown from the generator.
generatorResponse ( ) : tuple\null Get the response from the generator.
generatorReturnValue ( ) : mixed Get the value returned from the generator.
getIterator ( ) : Iterator Get an iterator for this collection.
hasCalls ( ) : boolean Returns true if this collection contains any calls.
hasCompleted ( ) : boolean Returns true if this call has completed.
hasEvents ( ) : boolean Returns true if this collection contains any events.
hasResponded ( ) : boolean Returns true if this call has responded.
index ( ) : integer Get the call index.
isGenerator ( ) : boolean Returns true if this call has responded with a generator.
isIterable ( ) : boolean Returns true if this call has responded with an iterable.
iterableEvents ( ) : array Get the iterable events.
lastCall ( ) : Eloquent\Phony\Call\Call Get the last call.
lastEvent ( ) : Eloquent\Phony\Event\Event Get the last event.
response ( ) : tuple\null Get the response.
responseEvent ( ) : Eloquent\Phony\Call\Event\ResponseEvent | null Get the response event.
responseTime ( ) : float | null Get the time at which the call responded.
returnValue ( ) : mixed Get the returned value.
sequenceNumber ( ) : integer Get the sequence number.
setEndEvent ( Eloquent\Phony\Call\Event\EndEvent $endEvent ) Set the end event.
setResponseEvent ( Eloquent\Phony\Call\Event\ResponseEvent $responseEvent ) Set the response event.
time ( ) : float Get the time at which the event occurred.

Private Methods

Méthode Description
normalizeIndex ( $size, $index, &$normalized = null )

Method Details

__construct() public méthode

Construct a new call data instance.
public __construct ( integer $index, CalledEvent $calledEvent )
$index integer The index of this call.
$calledEvent Eloquent\Phony\Call\Event\CalledEvent The 'called' event.

addIterableEvent() public méthode

Add an iterable event.
public addIterableEvent ( Eloquent\Phony\Call\Event\IterableEvent $iterableEvent )
$iterableEvent Eloquent\Phony\Call\Event\IterableEvent The iterable event.

allCalls() public méthode

Get all calls as an array.
public allCalls ( ) : array
Résultat array

allEvents() public méthode

Get all events as an array.
public allEvents ( ) : array
Résultat array

argument() public méthode

Negative indices are offset from the end of the list. That is, -1 indicates the last element, and -2 indicates the second last element.
public argument ( integer $index ) : mixed
$index integer The index.
Résultat mixed The argument.

arguments() public méthode

Get the received arguments.
public arguments ( ) : Arguments
Résultat Arguments The received arguments.

callAt() public méthode

Negative indices are offset from the end of the list. That is, -1 indicates the last element, and -2 indicates the second last element.
public callAt ( integer $index ) : Eloquent\Phony\Call\Call
$index integer The index.
Résultat Eloquent\Phony\Call\Call The call.

callCount() public méthode

Get the number of calls.
public callCount ( ) : integer
Résultat integer The call count.

callback() public méthode

Get the callback.
public callback ( ) : callable
Résultat callable The callback.

calledEvent() public méthode

Get the 'called' event.
public calledEvent ( ) : CalledEvent
Résultat Eloquent\Phony\Call\Event\CalledEvent The 'called' event.

compareSequential() public static méthode

A comparator for ordering calls by sequence number.
public static compareSequential ( Eloquent\Phony\Call\Call $a, Eloquent\Phony\Call\Call $b ) : integer
$a Eloquent\Phony\Call\Call The first call.
$b Eloquent\Phony\Call\Call The second call.
Résultat integer The comparison value.

count() public méthode

Get the event count.
public count ( ) : integer
Résultat integer The event count.

endEvent() public méthode

Get the end event.
public endEvent ( ) : Eloquent\Phony\Call\Event\EndEvent | null
Résultat Eloquent\Phony\Call\Event\EndEvent | null The end event, or null if the call has not yet completed.

endTime() public méthode

When generator spies are in use, a call that returns a generator will not be considered complete until the generator has been completely consumed via iteration. Similarly, when iterable spies are in use, a call that returns an iterable will not be considered complete until the iterable has been completely consumed via iteration.
public endTime ( ) : float | null
Résultat float | null The time at which the call completed, in seconds since the Unix epoch, or null if the call has not yet completed.

eventAt() public méthode

Negative indices are offset from the end of the list. That is, -1 indicates the last element, and -2 indicates the second last element.
public eventAt ( integer $index ) : Eloquent\Phony\Event\Event
$index integer The index.
Résultat Eloquent\Phony\Event\Event The event.

eventCount() public méthode

Get the number of events.
public eventCount ( ) : integer
Résultat integer The event count.

exception() public méthode

Get the thrown exception.
public exception ( ) : Exceptio\Exception | Erro\Error
Résultat Exceptio\Exception | Erro\Error The thrown exception.

firstCall() public méthode

Get the first call.
public firstCall ( ) : Eloquent\Phony\Call\Call
Résultat Eloquent\Phony\Call\Call The call.

firstEvent() public méthode

Get the first event.
public firstEvent ( ) : Eloquent\Phony\Event\Event
Résultat Eloquent\Phony\Event\Event The event.

generatorException() public méthode

Get the exception thrown from the generator.
public generatorException ( ) : Exceptio\Exception | Erro\Error
Résultat Exceptio\Exception | Erro\Error The thrown exception.

generatorResponse() public méthode

Get the response from the generator.
public generatorResponse ( ) : tuple\null
Résultat tuple\null

generatorReturnValue() public méthode

Get the value returned from the generator.
public generatorReturnValue ( ) : mixed
Résultat mixed The returned value.

getIterator() public méthode

Get an iterator for this collection.
public getIterator ( ) : Iterator
Résultat Iterator The iterator.

hasCalls() public méthode

Returns true if this collection contains any calls.
public hasCalls ( ) : boolean
Résultat boolean True if this collection contains any calls.

hasCompleted() public méthode

When generator spies are in use, a call that returns a generator will not be considered complete until the generator has been completely consumed via iteration. Similarly, when iterable spies are in use, a call that returns an iterable will not be considered complete until the iterable has been completely consumed via iteration.
public hasCompleted ( ) : boolean
Résultat boolean True if this call has completed.

hasEvents() public méthode

Returns true if this collection contains any events.
public hasEvents ( ) : boolean
Résultat boolean True if this collection contains any events.

hasResponded() public méthode

A call that has responded has returned a value, or thrown an exception.
public hasResponded ( ) : boolean
Résultat boolean True if this call has responded.

index() public méthode

This number tracks the order of this call with respect to other calls made against the same spy.
public index ( ) : integer
Résultat integer The index.

isGenerator() public méthode

Returns true if this call has responded with a generator.
public isGenerator ( ) : boolean
Résultat boolean True if this call has responded with a generator.

isIterable() public méthode

Returns true if this call has responded with an iterable.
public isIterable ( ) : boolean
Résultat boolean True if this call has responded with an iterable.

iterableEvents() public méthode

Get the iterable events.
public iterableEvents ( ) : array
Résultat array

lastCall() public méthode

Get the last call.
public lastCall ( ) : Eloquent\Phony\Call\Call
Résultat Eloquent\Phony\Call\Call The call.

lastEvent() public méthode

Get the last event.
public lastEvent ( ) : Eloquent\Phony\Event\Event
Résultat Eloquent\Phony\Event\Event The event.

response() public méthode

Get the response.
public response ( ) : tuple\null
Résultat tuple\null

responseEvent() public méthode

Get the response event.
public responseEvent ( ) : Eloquent\Phony\Call\Event\ResponseEvent | null
Résultat Eloquent\Phony\Call\Event\ResponseEvent | null The response event, or null if the call has not yet responded.

responseTime() public méthode

A call that has responded has returned a value, or thrown an exception.
public responseTime ( ) : float | null
Résultat float | null The time at which the call responded, in seconds since the Unix epoch, or null if the call has not yet responded.

returnValue() public méthode

Get the returned value.
public returnValue ( ) : mixed
Résultat mixed The returned value.

sequenceNumber() public méthode

The sequence number is a unique number assigned to every event that Phony records. The numbers are assigned sequentially, meaning that sequence numbers can be used to determine event order.
public sequenceNumber ( ) : integer
Résultat integer The sequence number.

setEndEvent() public méthode

Set the end event.
public setEndEvent ( Eloquent\Phony\Call\Event\EndEvent $endEvent )
$endEvent Eloquent\Phony\Call\Event\EndEvent The end event.

setResponseEvent() public méthode

Set the response event.
public setResponseEvent ( Eloquent\Phony\Call\Event\ResponseEvent $responseEvent )
$responseEvent Eloquent\Phony\Call\Event\ResponseEvent The response event.

time() public méthode

Get the time at which the event occurred.
public time ( ) : float
Résultat float The time at which the event occurred, in seconds since the Unix epoch.