8000 Fix test suite forward compatibility with upcoming EventLoop releases by clue · Pull Request #88 · reactphp/dns · GitHub
[go: up one dir, main page]

Skip to content

Fix test suite forward compatibility with upcoming EventLoop releases #88

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

Merged
merged 1 commit into from
Dec 23, 2017

Conversation

clue
Copy link
Member
@clue clue commented Dec 23, 2017

@clue clue added this to the v0.4.12 milestone Dec 23, 2017
private function createTimerMock()
{
return $this->getMockBuilder(
'React\EventLoop' . (interface_exists('React\EventLoop\TimerInterface') ? '' : '\Timer') . '\TimerInterface'
Copy link
@kelunik kelunik Dec 23, 2017

Choose a reason for hiding this comment

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

interface_exists('React\EventLoop\TimerInterface') ? 'React\EventLoop\TimerInterface' : 'React\EventLoop\Timer\TimerInterface' would be more readable IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Which is what I used before committing this, but it results in a rather long line :) Any suggestions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Anyway, updated to also match reactphp/promise-timer#31 👍

Copy link

Choose a reason for hiding this comment

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

I wouldn't care about a longer line if it's more readable and I don't have to think. Just format it with multiple lines if you care about that:

interface_exists('React\EventLoop\TimerInterface')
    ? 'React\EventLoop\TimerInterface'
    : 'React\EventLoop\Timer\TimerInterface'

Apart from that, just drop older PHP versions and use ::class ;-)

Copy link
Member
@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

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

👍

@WyriHaximus WyriHaximus merged commit 8c63b16 into reactphp:master Dec 23, 2017
@clue clue deleted the loop branch December 23, 2017 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0