Testing File Downloads with Guzzle

I have a class that does two things: downloads a call recording as an MP3 from Twilio and then re-uploads it to Amazon S3 for permanent storage. This scenario happens frequently, and I wanted to be able to test it without actually making a real HTTP request from Twilio or to Amazon S3. In this … Continue reading Testing File Downloads with Guzzle

Customizing the precision in percent formatting in Sonata IntlBundle

By default, the number_format_percent macro in the Sonata IntlBundle formats numbers without a decimal fraction. For example, if the value passed to it is .1240, the resulting formatted string will be "12%". If you want to add additional levels of precision, you can customize it with the fraction_digits argument like this: {{ .1240|number_format_percent({'fraction_digits': 2}) }} … Continue reading Customizing the precision in percent formatting in Sonata IntlBundle