liuggio / statsd-php-client

Statsd (Object Oriented) client library for PHP
MIT License
115 stars 32 forks source link

setSampleRate hidden by interface #44

Closed tgr closed 9 years ago

tgr commented 9 years ago

StatsdDataInterface includes getters but not setters. For most of them is is not really problematic as the factory offers a way to set the field on instantiation, but that is not the case for sample rate. So the only way to set sampling rate per stats record is something like

$statsdDataFactory->increment('foo')->setSampleRate(0.01);

which will be flagged by static analyzers as the interface documented as the return type of increment does not have that method.

liuggio commented 9 years ago

Interface on the model doesn't make any sense to me, I think for now we can remove it from the annotation

liuggio commented 9 years ago

@tgr thanks for reporting a PR will now follow.

liuggio commented 9 years ago

https://github.com/liuggio/statsd-php-client/pull/49 :) @tgr