sabre-io / event

:bell: The sabre/event library provides utilities for lightweight event-based programming
http://sabre.io/event/
BSD 3-Clause "New" or "Revised" License
350 stars 21 forks source link

Pass null to $microseconds for null $seconds #88

Closed TysonAndre closed 2 years ago

TysonAndre commented 3 years ago

Passing null seconds and non-null microseconds will become deprecated in php 8.1. See https://github.com/php/php-src/pull/6879/files#r615680892 of https://github.com/php/php-src/pull/6879

codecov[bot] commented 3 years ago

Codecov Report

Merging #88 (563a116) into master (0c99442) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #88   +/-   ##
=========================================
  Coverage     99.74%   99.74%           
+ Complexity      111      110    -1     
=========================================
  Files             7        7           
  Lines           397      397           
=========================================
  Hits            396      396           
  Misses            1        1           
Impacted Files Coverage Δ
lib/Loop/Loop.php 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0c99442...563a116. Read the comment docs.

TysonAndre commented 3 years ago

This is ready for another look - it requires two calls (or a variable length argument list) because php 7 doesn't allow passing in null to microseconds, but php 8 deprecates passing anything other than null to the optional parameter microseconds (tv_usec) when seconds (tv_sec) is null

https://php.net/stream_select

TysonAndre commented 3 years ago

php 8.1.0alpha2 is out

@staabm this could use another look

phil-davis commented 2 years ago

Rebased to run the current GitHub workflows CI, which runs unit tests in all versions of PHP. Everything is passing.