-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added symlink functionality via X-Object-Manifest header management #565
Conversation
Thanks for the PR, @markchalloner! We'll review it shortly and provide any feedback. |
@@ -293,6 +300,26 @@ public function getEtag() | |||
{ | |||
return $this->etag ? : $this->content->getContentMd5(); | |||
} | |||
|
|||
/** | |||
* @param $manifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a description for this parameter? We are starting to auto-generate API documentation so the description would be useful to readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…Manifest protected. Updated PHPDoc and tests.
You are correct about setting up a mock response before your unit test calls |
|
||
/** | ||
* @param string $destination Path (`container/object') of other object to symlink this object to | ||
* @return null|\Guzzle\Http\Message\Response The response or null if $this is not empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of returning null
for an error case, lets throw an exception instead. This has the following benefits:
- it will keep error-handling consistent within this method. Just as you throw
Exceptions\NoNameError
when the object has no name, you can throw another exception if the object has content in it. - by using an exception instead of returning
null
, we can provide more information to the caller about what went wrong.
Feel free to re-use an exception class from https://github.com/markchalloner/php-opencloud/tree/working/lib/OpenCloud/Common/Exceptions or add your own if you can't find one that's appropriate.
This same comment applies to the createSymlinkFrom
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @markchalloner, could you please remove the null
from the @return type and description? Also, could you please add the necessary @throws documentation for the exceptions thrown by this method?
Hey @markchalloner, this is looking quite good. I have made a couple of minor suggestions about using exceptions instead of returning nulls, and I've provided a pointer to setting up mock responses. Once those changes are in, I'll be happy to merge this PR. Thanks! |
|
||
/** | ||
* @param string $source Path (`container/object') of other object to symlink this object from | ||
* @return null|DataObject The symlinked object or null if object already exists and is not empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @markchalloner, could you please remove the null
from the @return type and description? Also, could you please add the necessary @throws documentation for the exceptions thrown by this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops missed that. Updated now. Cheers
@markchalloner Thanks for the unit test using I've made two minor comments re: docblocks. Once those are addressed, I'll merge this PR. Very nice work on this with the implementation, tests and documentation! |
Added symlink functionality via X-Object-Manifest header management
Once again, awesome job @markchalloner. Thank you for this contribution! |
Implementation of #561