PHP Class Eloquent\Phony\Stub\StubFactory

Exibir arquivo Open project: eloquent/phony Class Usage Examples

Public Methods

Method Description
__construct ( Sequencer $labelSequencer, MatcherFactory $matcherFactory, MatcherVerifier $matcherVerifier, Invoker $invoker, InvocableInspector $invocableInspector, EmptyValueFactory $emptyValueFactory, GeneratorAnswerBuilderFactory $generatorAnswerBuilderFactory ) Construct a new stub factory.
create ( callable | null $callback = null, mixed $self = null, callable $defaultAnswerCallback = 'Eloquent\Phony\Stub\StubData::returnsEmptyAnswerCallback' ) : Eloquent\Phony\Stub\Stub Create a new stub.
instance ( ) : StubFactory Get the static instance of this factory.

Method Details

__construct() public method

Construct a new stub factory.
public __construct ( Sequencer $labelSequencer, MatcherFactory $matcherFactory, MatcherVerifier $matcherVerifier, Invoker $invoker, InvocableInspector $invocableInspector, EmptyValueFactory $emptyValueFactory, GeneratorAnswerBuilderFactory $generatorAnswerBuilderFactory )
$labelSequencer Eloquent\Phony\Sequencer\Sequencer The label sequencer to use.
$matcherFactory Eloquent\Phony\Matcher\MatcherFactory The matcher factory to use.
$matcherVerifier Eloquent\Phony\Matcher\MatcherVerifier The matcher verifier to use.
$invoker Eloquent\Phony\Invocation\Invoker The invoker to use.
$invocableInspector Eloquent\Phony\Invocation\InvocableInspector The invocable inspector to use.
$emptyValueFactory EmptyValueFactory The empty value factory to use.
$generatorAnswerBuilderFactory Eloquent\Phony\Stub\Answer\Builder\GeneratorAnswerBuilderFactory The generator answer builder factory to use.

create() public method

Create a new stub.
public create ( callable | null $callback = null, mixed $self = null, callable $defaultAnswerCallback = 'Eloquent\Phony\Stub\StubData::returnsEmptyAnswerCallback' ) : Eloquent\Phony\Stub\Stub
$callback callable | null The callback, or null to create an anonymous stub.
$self mixed The self value.
$defaultAnswerCallback callable The callback to use when creating a default answer.
return Eloquent\Phony\Stub\Stub The newly created stub.

instance() public static method

Get the static instance of this factory.
public static instance ( ) : StubFactory
return StubFactory The static factory.