mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 08:35:20 +00:00
pmmpthread support
This commit is contained in:
35
tests/phpstan/stubs/pmmpthread.stub
Normal file
35
tests/phpstan/stubs/pmmpthread.stub
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace pmmp\thread;
|
||||
|
||||
/**
|
||||
* @implements \IteratorAggregate<array-key, mixed>
|
||||
*/
|
||||
abstract class ThreadSafe implements \IteratorAggregate{
|
||||
|
||||
/**
|
||||
* @template TReturn
|
||||
* @param \Closure() : TReturn $function
|
||||
* @param mixed ...$args
|
||||
* @return TReturn
|
||||
*/
|
||||
public function synchronized(\Closure $function, mixed ...$args) : mixed{}
|
||||
}
|
||||
|
||||
/**
|
||||
* @template TKey of array-key
|
||||
* @template TValue
|
||||
* @implements \ArrayAccess<TKey, TValue>
|
||||
*/
|
||||
final class ThreadSafeArray extends ThreadSafe implements \Countable, \ArrayAccess{
|
||||
|
||||
/**
|
||||
* @return TValue|null
|
||||
*/
|
||||
public function pop() : mixed{}
|
||||
|
||||
/**
|
||||
* @return TValue|null
|
||||
*/
|
||||
public function shift() : mixed{}
|
||||
}
|
Reference in New Issue
Block a user