Skip to content

Conversation

@haphan
Copy link
Collaborator

@haphan haphan commented Aug 29, 2018

Some minor updates I cherry-picked from a project I've been working on.

You have time to do a quick code review @laszlof?

@coveralls
Copy link

coveralls commented Aug 29, 2018

Pull Request Test Coverage Report for Build 620

  • 11 of 11 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 96.134%

Totals Coverage Status
Change from base Build 610: 0.02%
Covered Lines: 1691
Relevant Lines: 1759

💛 - Coveralls

@laszlof
Copy link
Contributor

laszlof commented Aug 29, 2018 via email

@haphan
Copy link
Collaborator Author

haphan commented Aug 29, 2018

No worries @laszlof. Whenever you have time.

*
* @param bool $bootable
*/
public function setBootable(bool $bootable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should have a default value (true). The name of the method insinuates that it makes the volume bootable, rather than necessarily setting a flag.

*/
public function setBootable(bool $bootable)
{
$bootable = boolval($bootable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casting here would be more performant. Just splitting hairs here though.

*
* @param array $options
*
* $options['status'] = (string) The volume status.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the = here is supposed to line up with the next 2 lines.

*/
public function resetStatus(array $options)
{
$options += ['id' => $this->id];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might prefer array_merge here. If they pass in an id this isnt going to overwrite it (Maybe you want that?).

public $contentType;

/** @var int */
/** @var \DateTimeImmutable */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This typehint cant be right. This is a Content-Length header, it should probably be a string (according to API spec)

https://developer.openstack.org/api-ref/object-store/#get-object-content-and-metadata

@laszlof
Copy link
Contributor

laszlof commented Aug 29, 2018

Looks good pending travis

@haphan haphan merged commit eec8fb4 into master Aug 30, 2018
@haphan
Copy link
Collaborator Author

haphan commented Aug 30, 2018

Thank you @laszlof

@haphan haphan deleted the updates branch August 30, 2018 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants