Update PHP-CS-Fixer

This commit is contained in:
Dylan K. Taylor 2025-05-04 17:18:58 +01:00
parent 6f3506360e
commit f2e7473629
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
5 changed files with 13 additions and 7 deletions

View File

@ -30,8 +30,8 @@ jobs:
- name: Setup PHP and tools
uses: shivammathur/setup-php@2.33.0
with:
php-version: 8.2
tools: php-cs-fixer:3.49
php-version: 8.3
tools: php-cs-fixer:3.75
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -6,6 +6,12 @@ $finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/tests')
->in(__DIR__ . '/tools')
->notPath('plugins/DevTools')
//JsonMapper will break if the FQNs in the doc comments for these are shortened :(
->notPath('crafting/json')
->notPath('inventory/json')
->notPath('data/bedrock/block/upgrade/model')
->notPath('data/bedrock/item/upgrade/model')
->notName('PocketMine.php');
return (new PhpCsFixer\Config)

View File

@ -31,8 +31,8 @@ require dirname(__DIR__) . '/vendor/autoload.php';
*/
/**
* @var string[]|\Closure[] $options
* @phpstan-var array<string, string|\Closure() : string> $options
* @var string[]|Closure[] $options
* @phpstan-var array<string, string|Closure() : string> $options
*/
$options = [
"base_version" => VersionInfo::BASE_VERSION,

View File

@ -32,7 +32,7 @@ use pocketmine\network\mcpe\protocol\types\CacheableNbt;
use function get_class;
abstract class Spawnable extends Tile{
/** @phpstan-var CacheableNbt<\pocketmine\nbt\tag\CompoundTag>|null */
/** @phpstan-var CacheableNbt<CompoundTag>|null */
private ?CacheableNbt $spawnCompoundCache = null;
/**
@ -73,7 +73,7 @@ abstract class Spawnable extends Tile{
* Returns encoded NBT (varint, little-endian) used to spawn this tile to clients. Uses cache where possible,
* populates cache if it is null.
*
* @phpstan-return CacheableNbt<\pocketmine\nbt\tag\CompoundTag>
* @phpstan-return CacheableNbt<CompoundTag>
*/
final public function getSerializedSpawnCompound() : CacheableNbt{
if($this->spawnCompoundCache === null){

View File

@ -360,7 +360,7 @@ class World implements ChunkManager{
private bool $doingTick = false;
/** @phpstan-var class-string<\pocketmine\world\generator\Generator> */
/** @phpstan-var class-string<generator\Generator> */
private string $generator;
private bool $unloaded = false;