mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
phpstan 0.12.65
This commit is contained in:
@ -29,7 +29,10 @@ namespace pocketmine\metadata;
|
||||
use pocketmine\plugin\Plugin;
|
||||
|
||||
abstract class MetadataStore{
|
||||
/** @var \SplObjectStorage[]|MetadataValue[][] */
|
||||
/**
|
||||
* @var \SplObjectStorage[]|MetadataValue[][]
|
||||
* @phpstan-var array<string, \SplObjectStorage<Plugin, MetadataValue>>
|
||||
*/
|
||||
private $metadataMap;
|
||||
|
||||
/**
|
||||
@ -41,6 +44,7 @@ abstract class MetadataStore{
|
||||
$owningPlugin = $newMetadataValue->getOwningPlugin();
|
||||
|
||||
if(!isset($this->metadataMap[$key])){
|
||||
/** @phpstan-var \SplObjectStorage<Plugin, MetadataValue> $entry */
|
||||
$entry = new \SplObjectStorage();
|
||||
$this->metadataMap[$key] = $entry;
|
||||
}else{
|
||||
@ -92,7 +96,6 @@ abstract class MetadataStore{
|
||||
* @return void
|
||||
*/
|
||||
public function invalidateAll(Plugin $owningPlugin){
|
||||
/** @var \SplObjectStorage|MetadataValue[] $values */
|
||||
foreach($this->metadataMap as $values){
|
||||
if(isset($values[$owningPlugin])){
|
||||
$values[$owningPlugin]->invalidate();
|
||||
|
@ -51,6 +51,7 @@ use function unserialize;
|
||||
abstract class AsyncTask extends Collectable{
|
||||
/**
|
||||
* @var \SplObjectStorage|null
|
||||
* @phpstan-var \SplObjectStorage<AsyncTask, mixed>
|
||||
* Used to store objects on the main thread which should not be serialized.
|
||||
*/
|
||||
private static $threadLocalStorage;
|
||||
@ -258,7 +259,9 @@ abstract class AsyncTask extends Collectable{
|
||||
}
|
||||
|
||||
if(self::$threadLocalStorage === null){
|
||||
self::$threadLocalStorage = new \SplObjectStorage(); //lazy init
|
||||
/** @phpstan-var \SplObjectStorage<AsyncTask, mixed> $storage */
|
||||
$storage = new \SplObjectStorage();
|
||||
self::$threadLocalStorage = $storage; //lazy init
|
||||
}
|
||||
|
||||
if(isset(self::$threadLocalStorage[$this])){
|
||||
|
Reference in New Issue
Block a user