Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

_get/_set for headers (etc) & ArrayAccess #56

Closed
BigBlueHat opened this Issue · 1 comment

2 participants

@BigBlueHat
Collaborator

It would be super rad to not have to care about underlying changes to header case (as in 0.8.0) using "magic methods" like _get & _set:
http://www.php.net/manual/en/language.oop5.overloading.php#object.get

It would be doubly super rad to not have to care about JSON decoding "style" (array or object)--especially since it's "Sag-wide" atm:

$sag->decode(false);

(this last one is something I wish PHP "just did" but in the meantime, if Sag does it automatically, it'd be very helpful).

Mostly just trying to lower the "usability" bar. :)

@sbisbee
Owner

To your points...

  • Yeah, header case was silly. I wouldn't have done it if Cloudant didn't send different cases. Luckily we don't have to build anything else for this because we just lower case the strings, meaning it will Never Change Again.

  • If we were building around this issue, I'd rather not create a SagResponse class. It's one of my pet peeves about other libs.

  • The decoding stuff just tells Sag whether to run json_decode() on response bodies. There are no implementation details in Sag, just in PHP. I'd rather not break how json_decode() "works".

Plus all the things I just said in IRC. :)

Cheers.

@sbisbee sbisbee closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.