mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Ban foreach(arrayWithStringKeys as k => v)
this is not as good as phpstan/phpstan-src#769 (e.g. array_key_first()/array_key_last() aren't covered by this, nor is array_rand()) but it does eliminate the most infuriating cases where this usually crops up.
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\format\io;
|
||||
|
||||
use pocketmine\utils\Utils;
|
||||
use pocketmine\world\format\io\leveldb\LevelDB;
|
||||
use pocketmine\world\format\io\region\Anvil;
|
||||
use pocketmine\world\format\io\region\McRegion;
|
||||
@ -77,7 +78,7 @@ final class WorldProviderManager{
|
||||
*/
|
||||
public function getMatchingProviders(string $path) : array{
|
||||
$result = [];
|
||||
foreach($this->providers as $alias => $providerEntry){
|
||||
foreach(Utils::stringifyKeys($this->providers) as $alias => $providerEntry){
|
||||
if($providerEntry->isValid($path)){
|
||||
$result[$alias] = $providerEntry;
|
||||
}
|
||||
|
Reference in New Issue
Block a user