Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Fix method signature to allow mocking #194

Open
SvenRtbg opened this issue Jan 29, 2014 · 0 comments
Open

Fix method signature to allow mocking #194

SvenRtbg opened this issue Jan 29, 2014 · 0 comments

Comments

@SvenRtbg
Copy link

The magic method __call in EpiTwitter deviates from the PHP default:

public function __call($name, $params = null/*, $username, $password*/)

or in short:

public function __call($name, $params = null)

That default value "null" is never been used in PHP. If you call a method without parameters, the $params value is an empty array.

But because of this signature it is impossible to mock that class with e.g. Mockery in strict mode.

It should not change anything if this function is reverted to the standard that PHP sets:

public function __call($name, $params)

For more details on one such problem, see http://stackoverflow.com/questions/21358268/mockery-call-has-a-different-signature

SvenRtbg added a commit to SvenRtbg/twitter-async that referenced this issue Jan 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant