1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix redundant cast

This commit is contained in:
Matthew Brown 2021-06-07 13:19:00 -04:00
parent 80e8d40013
commit 7301e3a35f

View File

@ -757,7 +757,7 @@ class Config
$attributes = $dom_document->getElementsByTagName('psalm')->item(0)->attributes;
foreach ($attributes as $attribute) {
if (in_array($attribute->name, $deprecated_attributes, true)) {
$line = (int) $attribute->getLineNo();
$line = $attribute->getLineNo();
assert($line > 0); // getLineNo() always returns non-zero for nodes loaded from file
$offset = self::lineNumberToByteOffset($file_contents, $line);
$attribute_start = strrpos($file_contents, $attribute->name, $offset - strlen($file_contents)) ?: 0;