Merge branch 'minor-next' into major-next

This commit is contained in:
Dylan K. Taylor
2025-01-08 15:25:12 +00:00
46 changed files with 978 additions and 435 deletions

View File

@ -44,6 +44,7 @@ final class DisallowForeachByReferenceRule implements Rule{
return [
RuleErrorBuilder::message("Foreach by-reference is not allowed, because it has surprising behaviour.")
->tip("If the value variable is used outside of the foreach construct (e.g. in a second foreach), the iterable's contents will be unexpectedly altered.")
->identifier('pocketmine.foreach.byRef')
->build()
];
}

View File

@ -101,7 +101,7 @@ final class UnsafeForeachArrayOfStringRule implements Rule{
RuleErrorBuilder::message(sprintf(
"Unsafe foreach on array with key type %s (they might be casted to int).",
$iterableType->getIterableKeyType()->describe(VerbosityLevel::value())
))->tip($tip)->build()
))->tip($tip)->identifier('pocketmine.foreach.stringKeys')->build()
];
}
return [];