honeybadger-io / honeybadger-php

PHP library for reporting errors to Honeybadger.io :elephant: :zap:
https://www.honeybadger.io/for/php/?utm_source=github&utm_medium=readme&utm_campaign=php&utm_content=website-url
MIT License
38 stars 21 forks source link

feat: checkin using name #176

Closed subzero10 closed 1 year ago

subzero10 commented 1 year ago

Status

READY

Description

The last piece of the next iteration of Checkins. This change will allow users to use checkin names instead of ids. Closes #175.

Related PRs

Todos

subzero10 commented 1 year ago

Hey @shalvah, I am working on the final part of this new checkins feature, which is to allow the user to checkin using the name instead of the id. For example, a checkin "A simple checkin" could be called with $honeybadger->checkin("A simple checkin"). This is the final change to allow users to configure checkin definitions entirely from the config file and not having to look for information in the dashboard.

I'm facing a small problem and I'm experimenting on what's the best way to tackle the following:

Do you have any thoughts on this? How would you go about it?

shalvah commented 1 year ago

Honestly...I don't know. I wouldn't say the proxy class is a bad practice, or even discouraged, especially as you're using it for an internal detail. Other alternatives would be inheritance or implementing an interface, but I think this is fine (and I think it's a form of composition), at least for the current use case. 👍 I would recommend naming it more specifically, though e.g. CheckInClientWithErrorHandling.

subzero10 commented 1 year ago

I'll go ahead and merge, considering @shalvah's feedback above. I applied the suggested change 👌.