Hey Alexander!
2015-04-22 10:26 GMT+02:00 Alexander Moskalev <[email protected]>:
> Jakub, I think about static factory methods, but not sure if it will be
> great.
> I think using empty constructor more clear.
>
So we can add a setter, which, however, will return $this, to allow
chaining and prevent one redundant line of code:
<?php
$fileBuffer = (new CURLFile)->setBuffer('some file contents');
// ($fileBuffer instanceof CURLFile) === true
But this looks a bit weird and for some people also confusing. Thus it
would be even better to have a static factory method, I think.
Best regards,
Kubo2