Skip to content

PHP notice in SequenceMatcher.php #112

Description

@brainfork

My company was utilizing chrisboulton/php-diff in our code and have had to replace it as part of an ongoing upgrade to PHP 8. We've replaced that repo with this one and ran PHPStan scans on it which returned this notice:

  Line   \lib\Diff\SequenceMatcher.php
 ------ -------------------------------------------------------------
  372    Call to function unset() contains undefined variable $line.
 ------ -------------------------------------------------------------

I believe a fix for this would be to simply define $line = '' above the if statement here:

if ($this->options['ignoreLines'] == 2) {

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions