diff --git a/tests/phpstan/bootstrap.php b/tests/phpstan/bootstrap.php index d6cbdd166..ba8ccd3fc 100644 --- a/tests/phpstan/bootstrap.php +++ b/tests/phpstan/bootstrap.php @@ -21,13 +21,13 @@ declare(strict_types=1); -if(!\defined('LEVELDB_ZLIB_RAW_COMPRESSION')){ +if(!defined('LEVELDB_ZLIB_RAW_COMPRESSION')){ //leveldb might not be loaded - \define('LEVELDB_ZLIB_RAW_COMPRESSION', 4); + define('LEVELDB_ZLIB_RAW_COMPRESSION', 4); } -if(!\extension_loaded('libdeflate')){ +if(!extension_loaded('libdeflate')){ function libdeflate_deflate_compress(string $data, int $level = 6) : string{} } //TODO: these need to be defined properly or removed -\define('pocketmine\COMPOSER_AUTOLOADER_PATH', \dirname(__DIR__, 2) . '/vendor/autoload.php'); +define('pocketmine\COMPOSER_AUTOLOADER_PATH', dirname(__DIR__, 2) . '/vendor/autoload.php'); diff --git a/tests/phpunit/block/regenerate_consistency_check.php b/tests/phpunit/block/regenerate_consistency_check.php index d1ff6c770..aac5194c9 100644 --- a/tests/phpunit/block/regenerate_consistency_check.php +++ b/tests/phpunit/block/regenerate_consistency_check.php @@ -21,14 +21,14 @@ declare(strict_types=1); -require \dirname(__DIR__, 3) . '/vendor/autoload.php'; +require dirname(__DIR__, 3) . '/vendor/autoload.php'; /* This script needs to be re-run after any intentional blockfactory change (adding or removing a block state). */ $factory = new \pocketmine\block\BlockFactory(); -$old = \json_decode(\file_get_contents(__DIR__ . '/block_factory_consistency_check.json'), true); -$new = \array_map( +$old = json_decode(file_get_contents(__DIR__ . '/block_factory_consistency_check.json'), true); +$new = array_map( function(\pocketmine\block\Block $block) : string{ return $block->getName(); }, @@ -46,6 +46,6 @@ foreach($new as $k => $name){ echo "Name changed (" . ($k >> 4) . ":" . ($k & 0xf) . "): " . $old[$k] . " -> " . $name . "\n"; } } -\file_put_contents(__DIR__ . '/block_factory_consistency_check.json', \json_encode( +file_put_contents(__DIR__ . '/block_factory_consistency_check.json', json_encode( $new ));