99designs / phumbor

A minimal PHP helper for Thumbor
MIT License
123 stars 43 forks source link

Fix UrlBuilder to work better with PHP clone operator #26

Closed dhotson closed 7 years ago

dhotson commented 7 years ago

Being able to clone the url builder instance can be useful in certain situations. e.g.

$builder = Thumbor\Url\Builder::construct($server, $secret, 'http://a.com/b.jpg');

$a = clone $builder;
$a->addFilter('fill', 'green');

$b = clone $builder;
$b->addFilter('fill', 'red');

This PR makes this possible by ensuring the $commands instance variable is also cloned correctly.