Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Convenience method for generates()->returns() #140

Description

@jmalloc

I'm not sure if we already discussed this or not - but a really common pattern under Recoil / PHP 7 is to use generates()->returns() where you simply want a stubbed coroutine to return a specific value.

Perhaps we could add a second parameter to generates(), which is the return value for PHP 7 generators:

generates($values = array(), $returnValue = null)

So usage is imply:

$stub->generates([], new Thing());

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions