maknz / slack

A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.
BSD 2-Clause "Simplified" License
1.17k stars 204 forks source link

Support message building #70

Open krzysztof-ciszewski opened 8 years ago

krzysztof-ciszewski commented 8 years ago

I do not personally understand why the Message class is tightly coupled with the Client class. It doesn't make sense to me that it can send itself. I think that if you want to have an explicit message you should explicitly send it. It also makes it hard to separate the message creation logic from the sending logic since you would have to pass a useless client that you won't use everywhere. I propose adding HeadlessMessage or a similar class that doesn't require the client in it's constructor.