-
Notifications
You must be signed in to change notification settings - Fork 308
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
Add Pusher::forUrl static factory function #65
Comments
Although in this comment we made a decision to support:
I don't think it's the right decision. I don't see the need to expose a We could update the constructor to support:
But then where do options parameters get added since the 2nd and 3rd are usually the Thus, I would opt to keep the 1st parameter as the application ID only when using
This also aligns with the Node library: Any objections or additional thoughts? |
Well there will be a Config class that's exposed, so whether we have the And obviously we've already regressed the |
I've had a dig into this and it's a bit of a rabbit hole. The
My personal preference right now would be to move this issue to a 3.1 milestone and create a fix issue (or re-open #66) for 3.0 in order to remove support for the first parameter of the 3.1 will then include:
Putting all this together should allow a cleaner solution to this issue than the rabbit hole I mentioned. This is just an off the top of my head and there may be a more elegant solution: class Pusher {
public static function fromUrl($url, $options) {
$config = Config::fromUrl($url);
$pusher = new Pusher($config->appId, $config->appKey, $config->appSecret, $options);
return $pusher;
}
} Does anybody object to removing support for |
I had a look at this but am unsure in what file to put that function. If we're following PSR-4 the only way to have a |
Nevermind, I'll follow what Guzzle does: https://github.com/guzzle/guzzle/blob/master/composer.json#L26 |
This replaces the current new-lib functionality that allows a string to be passed to the
Pusher
constructor.The text was updated successfully, but these errors were encountered: