ellipsesynergie / api-response

Simple package to handle response properly in your API.
MIT License
377 stars 53 forks source link

Error code references as "self" prevent extensibility #25

Closed saverio closed 8 years ago

saverio commented 8 years ago

The error codes are defined as constants, which is great since they can be overridden by creating a class that extends Response; however, due to the fact that the constants are referenced via self::CODE_NOT_FOUND instead of static::CODE_NOT_FOUND, the constants being referenced are always the ones defined in the original class despite the class that was initiated.

maximebeaudoin commented 8 years ago

I'm agree with that. I'll take a look at it later this week. If you want, you can create a new PR for this.