Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split public api #25

Merged
merged 11 commits into from
Oct 9, 2015
Merged

Split public api #25

merged 11 commits into from
Oct 9, 2015

Conversation

young-steveo
Copy link
Contributor

This contains breaking changes that will lead to Swivel v2.0.0 after it is merged.

This PR simplifies the ambiguity surrounding Builder::addBehavior and Manager::invoke when automatically wrapping non-callables.

Breaking Changes

Builder::addBehavior, Builder::defaultBehavior, and Manager::invoke no longer accept non-callable $strategy parameter. These methods will throw a \LogicException when a non-callable is passed.

New API

Three new methods have been introduced to handle the functionality that was removed in the breaking changes:

  • Builder::addValue
  • Builder::defaultValue
  • Manager::returnValue

These methods are used to configure _Swivel_ to return a value that is not expected to be callable. In the case of passing a callable to these methods, the unexecuted callable will be returned.

jonyo added a commit that referenced this pull request Oct 9, 2015
@jonyo jonyo merged commit 554c78c into master Oct 9, 2015
@jonyo jonyo deleted the split-public-api branch October 9, 2015 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants