Skip to content
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 missing functions #6

Merged
merged 5 commits into from
Oct 10, 2017
Merged

Added missing functions #6

merged 5 commits into from
Oct 10, 2017

Conversation

kyl0b1te
Copy link
Contributor

@kyl0b1te kyl0b1te commented Oct 6, 2017

  • changed the way of yams parsing (added new dependency)
  • added missing beanstalk functions


switch ($type) {
case "PAUSED":
return true;
Copy link
Member

Choose a reason for hiding this comment

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

I guess it can just return null if the return value doesn't have any other meaning, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For me, true here mean that operation was executed and finished successfully. Null is not really informative here, IMO

Copy link
Member

Choose a reason for hiding this comment

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

true isn't either, as the successful resolution of the promise already indicates success. It's just like a void function in blocking PHP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... maybe you're right. But I'm still not sure :)

Copy link
Member

Choose a reason for hiding this comment

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

Any opinion change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So you will not merge without this true to null conversion ?

Copy link
Member

Choose a reason for hiding this comment

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

I can also change it afterwards. ;-) Could you provide a code sample that examines the return value and acts based on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any function call with remote communication that should change server state. Is not really helpful use extensions for such cases every time.

Image that:
function setServerAvailablity(int $code) { ... }
will return null. Is it informative ?

Compare it with true

foreach ($source as $stat) {
if ($stat == '---' || empty($stat)) {
continue;
public function getTubesList(): Promise {
Copy link
Member

Choose a reason for hiding this comment

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

We could name it listTubes().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not completely sure about it. For me, its more predictable to have a getTubesList() and getWatchedTubesList() methods. What do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

I think listWatchedTubes() reads slightly better, but I don't have a strong preference for either.

@markkimsal Thoughts?

@kelunik
Copy link
Member

kelunik commented Oct 6, 2017

Could you please rebase your changes onto the current master instead of merging it? It might be easier to just create a new branch and cherry-pick the few commits. 👍

@kyl0b1te
Copy link
Contributor Author

kyl0b1te commented Oct 9, 2017

Is there any updates ? :)

});
}

public function getUsingTube(): Promise {
Copy link
Member

Choose a reason for hiding this comment

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

Could you rename that one to getUsedTube()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Really? What name you want to see here ?

Copy link
Member

Choose a reason for hiding this comment

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

getUsedTube(), as mentioned. 😄

Other than that it looks perfectly fine now. 👍

@kelunik
Copy link
Member

kelunik commented Oct 10, 2017

Seems like you rebased one commit too early (c952a54), do you want to fix that or should I just go ahead and merge it?

@kyl0b1te
Copy link
Contributor Author

@kelunik I think better you to do it

@kelunik kelunik merged commit af27d06 into amphp:master Oct 10, 2017
@kelunik
Copy link
Member

kelunik commented Oct 10, 2017

I'll just create a merge commit, too lazy to fix it up now. The history isn't too unclean.

Thanks for your contribution!

@kelunik kelunik mentioned this pull request Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants