Comments (6)
I would go with the first option. As long as any boolean type parameters are kept in the 4th argument array. I always feel passing boolean parameters in that way is much better for readability. I do think the Pusher\Config
class should be kept though!
from pusher-http-php.
@tanuck To clarify: would you'd prefer:
use Pusher\Pusher;
use Pusher\Config;
$pusher = new Pusher(new Config('my-app-id', 'my-app-key', 'my-app-secret', array('encrypted' => true)));
For me:
- the two
use
statements is one too many and an unnecessary additional step - it results in a bunch of extra parenthesis that people can make mistakes with results in one more annoyance on the way to getting things working
But happy to add this as a +1 for the Config
based constructor.
from pusher-http-php.
No. That option is a bit too cluttered for me. And I agree about the 2 use statements. I was happy with your first example from option 1:
$pusher = new Pusher('my-app-id', 'my-app-key', 'my-app-secret', array('encrypted' => true));
But keep the Config class for internal use. Instead of cluttered the Pusher class with additional config related properties.
It would be good to decide on this and merge the implementation before looking at #68
from pusher-http-php.
👍 Yep - good call on keeping the internal class.
Agree RE #68 too.
from pusher-http-php.
Okay 👍
from pusher-http-php.
Fixed in #69.
from pusher-http-php.
Related Issues (20)
- No callbacks on private channel. pusher:subscription_error HOT 4
- Unable to subscribe to private channel - gives 403 | Forbidden HOT 3
- Compatibility issues with ugprade 7.0.2 -> 7.2.0 HOT 11
- authenticateUser() gives invalid response HOT 6
- Echo.listen not working in pusher-php-server 7.2.1 HOT 2
- Upgrading from 7.0.2 to 7.2.0 breaks broadcasting events in laravel HOT 5
- Pusher error: cURL error 28: Failed to connect to api-eu.pusher.com port 443: Connection timed out HOT 7
- Invalid user id from pusher server. HOT 2
- The CI setup is not friendly to community contributors HOT 1
- Add the ability to set Guzzle config from $options HOT 3
- v7.2.1 is not compatible with pusher SDK HOT 5
- Batch message sending does not add socket_id from event HOT 6
- Internal Server Error 500 HOT 2
- Pusher Beams Enquiry HOT 23
- Reporting a vulnerability HOT 1
- Pusher being run at Laravel package:discover resulting in Argument Error HOT 7
- Pusher Presence Channel Data HOT 1
- First parameter must either be an object or the name of an existing class {"exception":"[object] (ErrorException(code: 0) HOT 2
- Question about deprecation for all of the versions above v13 HOT 1
- [bug] cannot set a custom timeout as a option in pusher
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pusher-http-php.