mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11824307499
This commit is contained in:
@@ -362,6 +362,8 @@ class Block{
|
||||
*
|
||||
* A replacement block may be returned. This is useful if the block type changed due to reading of world data (e.g.
|
||||
* data from a block entity).
|
||||
*
|
||||
* @phpstan-impure
|
||||
*/
|
||||
public function readStateFromWorld() : Block{
|
||||
return $this;
|
||||
|
@@ -89,6 +89,11 @@ interface RuntimeDataDescriber{
|
||||
|
||||
public function straightOnlyRailShape(int &$railShape) : void;
|
||||
|
||||
/**
|
||||
* @phpstan-template T of \UnitEnum
|
||||
* @phpstan-param T &$case
|
||||
* @phpstan-param-out T $case
|
||||
*/
|
||||
public function enum(\UnitEnum &$case) : void;
|
||||
|
||||
/**
|
||||
|
@@ -69,16 +69,17 @@ final class Promise{
|
||||
*
|
||||
* @phpstan-template TPromiseValue
|
||||
* @phpstan-template TKey of array-key
|
||||
* @phpstan-param non-empty-array<TKey, Promise<TPromiseValue>> $promises
|
||||
* @phpstan-param array<TKey, Promise<TPromiseValue>> $promises
|
||||
*
|
||||
* @phpstan-return Promise<array<TKey, TPromiseValue>>
|
||||
*/
|
||||
public static function all(array $promises) : Promise{
|
||||
if(count($promises) === 0){
|
||||
throw new \InvalidArgumentException("At least one promise must be provided");
|
||||
}
|
||||
/** @phpstan-var PromiseResolver<array<TKey, TPromiseValue>> $resolver */
|
||||
$resolver = new PromiseResolver();
|
||||
if(count($promises) === 0){
|
||||
$resolver->resolve([]);
|
||||
return $resolver->getPromise();
|
||||
}
|
||||
$values = [];
|
||||
$toResolve = count($promises);
|
||||
$continue = true;
|
||||
|
Reference in New Issue
Block a user