Thanks to all for feedback!

Let's try to integrate new feature to old class.
We have constructor in CURLFile with one required parameter: $filename .
To avoid BC break we cannot replace this parameter. So  I suggest to do it
optional and add setBuffer() method.

So we can create CURLFile with empty parameters in constructor and fill it
with setters.
Have two more questions:
1) If we not fill all options or fille not compatible options, when we must
throw error? ? And what level of this error? (Sorry, I'm just php coder and
know about C language and php source so little)
For file from disk(or other source) required $filename. For file from
buffer required $buffer and $postname.
2) Curently CURLFile cannot be unserialized, because it contains $filename
(see source code). How it compatible with our dicussion?


Jakub, I think about static factory methods, but not sure if it will be
great.
 I think using empty constructor more clear.

Reply via email to