brianlmoon / net_gearman

A PHP interface for Gearman
84 stars 46 forks source link

Fix array to string conversion notice in Net_Gearman_Connection::blockingRead(). #42

Closed bdeshong closed 5 years ago

bdeshong commented 6 years ago

When socket_select() fails we throw a Net_Gearman_Exception, but its message is assuming that $timeout is scalar, when it's actually an array of number of seconds and microseconds. This causes a notice. Fix the notice, and include both values in the exception message.

Sample PHP notice before change:

PHP Notice:  Array to string conversion in /foo/bar/vendor/brianlmoon/net_gearman/Net/Gearman/Connection.php on line 391

Sample exception message after change:

Socket timeout (5.0000s, 5000.3134μs): (Connection timed out)
rokclimb15 commented 5 years ago

@brianlmoon could you merge this pretty please?

rokclimb15 commented 5 years ago

Thanks @brianlmoon!