Git Product home page Git Product logo

Comments (6)

tanuck avatar tanuck commented on May 29, 2024

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.

leggetter avatar leggetter commented on May 29, 2024

@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.

tanuck avatar tanuck commented on May 29, 2024

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.

leggetter avatar leggetter commented on May 29, 2024

👍 Yep - good call on keeping the internal class.

Agree RE #68 too.

from pusher-http-php.

tanuck avatar tanuck commented on May 29, 2024

Okay 👍

from pusher-http-php.

leggetter avatar leggetter commented on May 29, 2024

Fixed in #69.

from pusher-http-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.