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
351 stars 21 forks source link

Add phpstan-phpunit and phpstan-strict-rules #105

Closed phil-davis closed 1 year ago

phil-davis commented 1 year ago

1) added phpstan-phpunit and phpstan-strict-rules to composer.json and fixed up things reported about test code. 2) Add phpstan messages to ignoreErrors instead of ignoring 3) fixup things reported in real code

codecov[bot] commented 1 year ago

Codecov Report

Merging #105 (496e883) into master (2626b72) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##             master     #105   +/-   ##
=========================================
  Coverage     99.73%   99.73%           
  Complexity      109      109           
=========================================
  Files             7        7           
  Lines           376      376           
=========================================
  Hits            375      375           
  Misses            1        1           
Impacted Files Coverage Δ
lib/EmitterTrait.php 100.00% <ø> (ø)
lib/Loop/Loop.php 100.00% <100.00%> (ø)
lib/Loop/functions.php 100.00% <100.00%> (ø)
lib/Promise.php 100.00% <100.00%> (ø)
lib/Promise/functions.php 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

phil-davis commented 1 year ago

@staabm please review again and merge if you think it looks OK.

IMO the code changes I made are just being more explicit in "if" statements - phpstan now wants all "if" conditions to be real booleans. No more just saying if($var) when $var is not actually boolean type.

phil-davis commented 1 year ago

I am getting back to a backlog of sabre-io issues and PRs - there should be some action from now and over the coming weekend.