Skip to content

Fix test suite forward compatibility with upcoming EventLoop releases - #88

Merged
WyriHaximus merged 1 commit into
reactphp:masterfrom
clue-labs:loop
Dec 23, 2017
Merged

Fix test suite forward compatibility with upcoming EventLoop releases#88
WyriHaximus merged 1 commit into
reactphp:masterfrom
clue-labs:loop

Conversation

@clue

@clueclue commented Dec 23, 2017

Copy link
Copy Markdown
Member

@clueclue added this to the v0.4.12 milestone Dec 23, 2017
Comment threadtests/Query/ExecutorTest.php Outdated
private function createTimerMock()
{
return $this->getMockBuilder(
'React\EventLoop' . (interface_exists('React\EventLoop\TimerInterface') ? '' : '\Timer') . '\TimerInterface'

@kelunikkelunikDec 23, 2017

Copy link
Copy Markdown

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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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
Copy Markdown

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 ;-)

@WyriHaximusWyriHaximus left a comment

Copy link
Copy Markdown
Member

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:masterDec 23, 2017
@clue
clue deleted the loop branch December 23, 2017 15:36
Sign up for freeto 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

@clue@jsor@WyriHaximus@kelunik