fix minor bugs

This commit is contained in:
Dennis Eichhorn 2023-11-02 23:55:19 +00:00
parent dd0a71421a
commit 1675a82410
2 changed files with 4 additions and 4 deletions

View File

@ -316,7 +316,7 @@ class Matrix implements \ArrayAccess, \Iterator
$isSymmetric = true;
for ($j = 0; ($j < $this->m) & $isSymmetric; ++$j) {
for ($i = 0; ($i < $this->n) & $isSymmetric; ++$i) {
$isSymmetric = ($this->matrix[$i][$j] === $this->matrix[$j][$i]);
$isSymmetric = \abs($this->matrix[$i][$j] - $this->matrix[$j][$i]) < self::EPSILON;
}
}

View File

@ -2088,7 +2088,7 @@ class Markdown
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
$Block['element']['handler']['argument'] = \substr($Block['element']['handler']['argument'], 0, $matches[0][1]);
$Block['element']['handler']['argument'] = \substr($Block['element']['handler']['argument'], 0, (int) $matches[0][1]);
}
return $Block;
@ -2207,7 +2207,7 @@ class Markdown
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
$Block['element']['handler']['argument'] = \substr($Block['element']['handler']['argument'], 0, $matches[0][1]);
$Block['element']['handler']['argument'] = \substr($Block['element']['handler']['argument'], 0, (int) $matches[0][1]);
}
return $Block;
@ -4022,7 +4022,7 @@ class Markdown
while (\preg_match($regexp, $text, $matches, \PREG_OFFSET_CAPTURE))
{
$offset = $matches[0][1];
$offset = (int) $matches[0][1];
$before = \substr($text, 0, $offset);
$after = \substr($text, $offset + \strlen($matches[0][0]));