Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.76k stars 774 forks source link

Ip rule: Fix check whether start and end address have been set #1375

Closed fabacino closed 2 years ago

fabacino commented 2 years ago

Fixes the following phpstan error (output abbreviated for clearity):

Run vendor/bin/phpstan analyze
Note: Using configuration file /home/runner/work/Validation/Validation/phpstan.neon.dist.

 ------ ---------------------------------- 
  Line   library/Rules/Ip.php              
 ------ ---------------------------------- 
  108    Right side of && is always true.  
 ------ ---------------------------------- 

I did not add a new test because due to the way the two variables are initialized, there is actually no possibility for startAddress to be null and endAddress to be set simultaneously.

nickl- commented 2 years ago

Well spotted Thanx!!