nadar / quill-delta-parser

A PHP library to parse and render Quill WYSIWYG Deltas into HTML - Flexibel and extendible for custom elements.
MIT License
121 stars 20 forks source link

php stan level 4 #69

Closed nadar closed 2 years ago

nadar commented 2 years ago

Potential code problem.

nadar commented 2 years ago

@lode https://github.com/nadar/quill-delta-parser/runs/7465227518?check_suite_focus=true a very interesting report i never considered:

 ------ --------------------------------- 
  Line   listener/Lists.php               
 ------ --------------------------------- 
  102    Left side of && is always true.  
  102    Left side of && is always true.  
 ------ --------------------------------- 
lode commented 2 years ago

Hmm, weird. I also don't understand how we can be sure that is the case. How $isLast gets to true is not as straightforward, doesn't read to me like that is guaranteed.

codeclimate[bot] commented 2 years ago

Code Climate has analyzed commit 0b02b408 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 98.5% (0.0% change).

View more on Code Climate.

nadar commented 2 years ago

the phpstan report is really amazing, i was not aware of that. but its logical. $isOpen is always true there:

image

lode commented 2 years ago

Ah sorry, I was looking at another version of that file.