Skip to content

Commit

Permalink
Right side of && is always true.
Browse files Browse the repository at this point in the history
As found by PHPStan:

Line 869 in   src/Twig/TwigExtension.php
Right side of && is always true.

Which makes sense as var_dump(strtok("  ", " ")) -> bool(false) so we
either get a false or would get the string on: var_dump(strtok("  1", " ") -> str("1")
  • Loading branch information
vmcj committed Jan 15, 2024
1 parent 304949f commit e823d7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ protected function parseSourceDiff(string $difftext): string
{
$line = strtok($difftext, "\n"); // first line
$return = '';
while ($line !== false && strlen($line) != 0) {
while ($line !== false) {
// Strip any additional DOS/MAC newline characters:
$line = str_replace("\r", "", $line);
$formdiffline = match (substr($line, 0, 1)) {
Expand Down

0 comments on commit e823d7d

Please sign in to comment.