mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Make use of Utils::assumeNotFalse() in a bunch of places
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
This commit is contained in:
@ -237,8 +237,7 @@ class PluginManager{
|
||||
$files = iterator_to_array(new \FilesystemIterator($path, \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS));
|
||||
shuffle($files); //this prevents plugins implicitly relying on the filesystem name order when they should be using dependency properties
|
||||
}elseif(is_file($path)){
|
||||
$realPath = realpath($path);
|
||||
if($realPath === false) throw new AssumptionFailedError("realpath() should not return false on an accessible, existing file");
|
||||
$realPath = Utils::assumeNotFalse(realpath($path), "realpath() should not return false on an accessible, existing file");
|
||||
$files = [$realPath];
|
||||
}else{
|
||||
return;
|
||||
|
Reference in New Issue
Block a user