diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8acff71d6..97607ab8f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,22 @@ updates: update-types: - "version-update:semver-major" - "version-update:semver-minor" + groups: + production-patch-updates: + dependency-type: production + patterns: + - "*" + update-types: + - "patch" + development-patch-updates: + dependency-type: development + patterns: + - "*" + update-types: + - "patch" + phpstan: + patterns: + - "phpstan/*" - package-ecosystem: gitsubmodule directory: "/" diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 6e035e735..b3d6661e9 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -53,7 +53,7 @@ jobs: run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT - name: Build image for tag - uses: docker/build-push-action@v5.3.0 + uses: docker/build-push-action@v6.5.0 with: push: true context: ./pocketmine-mp @@ -66,7 +66,7 @@ jobs: - name: Build image for major tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v5.3.0 + uses: docker/build-push-action@v6.5.0 with: push: true context: ./pocketmine-mp @@ -79,7 +79,7 @@ jobs: - name: Build image for minor tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v5.3.0 + uses: docker/build-push-action@v6.5.0 with: push: true context: ./pocketmine-mp @@ -92,7 +92,7 @@ jobs: - name: Build image for latest tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v5.3.0 + uses: docker/build-push-action@v6.5.0 with: push: true context: ./pocketmine-mp diff --git a/.github/workflows/discord-release-notify.yml b/.github/workflows/discord-release-notify.yml index ce8a16ebc..8d0add224 100644 --- a/.github/workflows/discord-release-notify.yml +++ b/.github/workflows/discord-release-notify.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP and tools - uses: shivammathur/setup-php@2.30.4 + uses: shivammathur/setup-php@2.31.1 with: php-version: 8.2 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 311e0c827..c47a4399b 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -20,7 +20,7 @@ jobs: submodules: true - name: Setup PHP - uses: shivammathur/setup-php@2.30.4 + uses: shivammathur/setup-php@2.31.1 with: php-version: ${{ matrix.php-version }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92bd7171b..7c92c0b8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP and tools - uses: shivammathur/setup-php@2.30.4 + uses: shivammathur/setup-php@2.31.1 with: php-version: 8.2 tools: php-cs-fixer:3.49 diff --git a/composer.json b/composer.json index 299f69f78..28ef5e9c2 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "symfony/filesystem": "~6.4.0" }, "require-dev": { - "phpstan/phpstan": "1.11.2", + "phpstan/phpstan": "1.11.9", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^10.5.24" diff --git a/composer.lock b/composer.lock index 0547560cc..e3211e7c5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d459605b85f247204988a879982aab50", + "content-hash": "cddee8096f4b575629ff671000543d3f", "packages": [ { "name": "adhocore/json-comment", @@ -1389,16 +1389,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.2", + "version": "1.11.9", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec" + "reference": "e370bcddadaede0c1716338b262346f40d296f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e370bcddadaede0c1716338b262346f40d296f82", + "reference": "e370bcddadaede0c1716338b262346f40d296f82", "shasum": "" }, "require": { @@ -1443,25 +1443,25 @@ "type": "github" } ], - "time": "2024-05-24T13:23:04+00:00" + "time": "2024-08-01T16:25:18+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.16", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "d5242a59d035e46774f2e634b374bc39ff62cb95" + "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d5242a59d035e46774f2e634b374bc39ff62cb95", - "reference": "d5242a59d035e46774f2e634b374bc39ff62cb95", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f3ea021866f4263f07ca3636bf22c64be9610c11", + "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.11" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -1493,27 +1493,27 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.16" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.0" }, - "time": "2024-02-23T09:51:20+00:00" + "time": "2024-04-20T06:39:00+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.5.5", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "2e193a07651a6f4be3baa44ddb21d822681f5918" + "reference": "363f921dd8441777d4fc137deb99beb486c77df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2e193a07651a6f4be3baa44ddb21d822681f5918", - "reference": "2e193a07651a6f4be3baa44ddb21d822681f5918", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/363f921dd8441777d4fc137deb99beb486c77df1", + "reference": "363f921dd8441777d4fc137deb99beb486c77df1", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.60" + "phpstan/phpstan": "^1.11" }, "require-dev": { "nikic/php-parser": "^4.13.0", @@ -1542,9 +1542,9 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.5" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.0" }, - "time": "2024-04-19T15:12:26+00:00" + "time": "2024-04-20T06:37:51+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/src/data/bedrock/block/BlockStateData.php b/src/data/bedrock/block/BlockStateData.php index 51899b72b..2c67ded73 100644 --- a/src/data/bedrock/block/BlockStateData.php +++ b/src/data/bedrock/block/BlockStateData.php @@ -38,6 +38,9 @@ use function implode; final class BlockStateData{ /** * Bedrock version of the most recent backwards-incompatible change to blockstates. + * + * This is *not* the same as current game version. It should match the numbers in the + * newest blockstate upgrade schema used in BedrockBlockUpgradeSchema. */ public const CURRENT_VERSION = (1 << 24) | //major diff --git a/src/resourcepacks/ResourcePack.php b/src/resourcepacks/ResourcePack.php index 04feeeb3d..cdab3447b 100644 --- a/src/resourcepacks/ResourcePack.php +++ b/src/resourcepacks/ResourcePack.php @@ -60,6 +60,8 @@ interface ResourcePack{ * @param int $start Offset to start reading the chunk from * @param int $length Maximum length of data to return. * + * @phpstan-param positive-int $length + * * @return string byte-array * @throws \InvalidArgumentException if the chunk does not exist */ diff --git a/src/resourcepacks/ZippedResourcePack.php b/src/resourcepacks/ZippedResourcePack.php index da7db1db7..c4daeedf7 100644 --- a/src/resourcepacks/ZippedResourcePack.php +++ b/src/resourcepacks/ZippedResourcePack.php @@ -154,6 +154,9 @@ class ZippedResourcePack implements ResourcePack{ } public function getPackChunk(int $start, int $length) : string{ + if($length < 1){ + throw new \InvalidArgumentException("Pack length must be positive"); + } fseek($this->fileResource, $start); if(feof($this->fileResource)){ throw new \InvalidArgumentException("Requested a resource pack chunk with invalid start offset"); diff --git a/src/world/format/io/data/BedrockWorldData.php b/src/world/format/io/data/BedrockWorldData.php index 9dc89ad99..7bcc44c0b 100644 --- a/src/world/format/io/data/BedrockWorldData.php +++ b/src/world/format/io/data/BedrockWorldData.php @@ -51,12 +51,12 @@ use function time; class BedrockWorldData extends BaseNbtWorldData{ public const CURRENT_STORAGE_VERSION = 10; - public const CURRENT_STORAGE_NETWORK_VERSION = 685; + public const CURRENT_STORAGE_NETWORK_VERSION = 686; public const CURRENT_CLIENT_VERSION_TARGET = [ 1, //major 21, //minor - 0, //patch - 3, //revision + 2, //patch + 2, //revision 0 //is beta ]; diff --git a/src/world/format/io/region/RegionLocationTableEntry.php b/src/world/format/io/region/RegionLocationTableEntry.php index abb92accf..ad0b1ce48 100644 --- a/src/world/format/io/region/RegionLocationTableEntry.php +++ b/src/world/format/io/region/RegionLocationTableEntry.php @@ -27,6 +27,7 @@ use function range; class RegionLocationTableEntry{ private int $firstSector; + /** @phpstan-var positive-int */ private int $sectorCount; private int $timestamp; @@ -61,6 +62,9 @@ class RegionLocationTableEntry{ return range($this->getFirstSector(), $this->getLastSector()); } + /** + * @phpstan-return positive-int + */ public function getSectorCount() : int{ return $this->sectorCount; }