From 5ef89200c683f3b06d54b2d1509400a0f95152f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:14:30 +0000 Subject: [PATCH 1/2] Bump phpstan/phpstan in the development-patch-updates group (#6620) --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index b9fb70b0e..bbcbe7314 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "symfony/filesystem": "~6.4.0" }, "require-dev": { - "phpstan/phpstan": "2.1.2", + "phpstan/phpstan": "2.1.4", "phpstan/phpstan-phpunit": "^2.0.0", "phpstan/phpstan-strict-rules": "^2.0.0", "phpunit/phpunit": "^10.5.24" diff --git a/composer.lock b/composer.lock index 26a3a510c..52490968f 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": "5321ac37e6830cae119d03082b2668a5", + "content-hash": "a6aa0a34a230d325528d2e11f1439057", "packages": [ { "name": "adhocore/json-comment", @@ -1386,16 +1386,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.2", + "version": "2.1.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "7d08f569e582ade182a375c366cbd896eccadd3a" + "reference": "8f99e18eb775dbaf6460c95fa0b65312da9c746a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7d08f569e582ade182a375c366cbd896eccadd3a", - "reference": "7d08f569e582ade182a375c366cbd896eccadd3a", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8f99e18eb775dbaf6460c95fa0b65312da9c746a", + "reference": "8f99e18eb775dbaf6460c95fa0b65312da9c746a", "shasum": "" }, "require": { @@ -1440,7 +1440,7 @@ "type": "github" } ], - "time": "2025-01-21T14:54:06+00:00" + "time": "2025-02-10T08:25:21+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -2967,5 +2967,5 @@ "platform-overrides": { "php": "8.1.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } From e29aa2f337f2cc8779e8b98653ca90729984c313 Mon Sep 17 00:00:00 2001 From: ipad54 <63200545+ipad54@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:15:42 +0300 Subject: [PATCH 2/2] Added resin material color (#6622) --- src/utils/Terminal.php | 6 +++++- src/utils/TextFormat.php | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/utils/Terminal.php b/src/utils/Terminal.php index 2abdbc357..bbd232969 100644 --- a/src/utils/Terminal.php +++ b/src/utils/Terminal.php @@ -69,6 +69,7 @@ abstract class Terminal{ public static string $COLOR_MATERIAL_DIAMOND = ""; public static string $COLOR_MATERIAL_LAPIS = ""; public static string $COLOR_MATERIAL_AMETHYST = ""; + public static string $COLOR_MATERIAL_RESIN = ""; private static ?bool $formattingCodes = null; @@ -131,6 +132,7 @@ abstract class Terminal{ self::$COLOR_MATERIAL_DIAMOND = $color(37); self::$COLOR_MATERIAL_LAPIS = $color(24); self::$COLOR_MATERIAL_AMETHYST = $color(98); + self::$COLOR_MATERIAL_RESIN = $color(208); } protected static function getEscapeCodes() : void{ @@ -174,11 +176,12 @@ abstract class Terminal{ self::$COLOR_MATERIAL_DIAMOND = $colors >= 256 ? $setaf(37) : $setaf(14); self::$COLOR_MATERIAL_LAPIS = $colors >= 256 ? $setaf(24) : $setaf(12); self::$COLOR_MATERIAL_AMETHYST = $colors >= 256 ? $setaf(98) : $setaf(13); + self::$COLOR_MATERIAL_RESIN = $colors >= 256 ? $setaf(208) : $setaf(11); }else{ self::$COLOR_BLACK = self::$COLOR_DARK_GRAY = self::$COLOR_MATERIAL_NETHERITE = $setaf(0); self::$COLOR_RED = self::$COLOR_DARK_RED = self::$COLOR_MATERIAL_REDSTONE = self::$COLOR_MATERIAL_COPPER = $setaf(1); self::$COLOR_GREEN = self::$COLOR_DARK_GREEN = self::$COLOR_MATERIAL_EMERALD = $setaf(2); - self::$COLOR_YELLOW = self::$COLOR_GOLD = self::$COLOR_MINECOIN_GOLD = self::$COLOR_MATERIAL_GOLD = $setaf(3); + self::$COLOR_YELLOW = self::$COLOR_GOLD = self::$COLOR_MINECOIN_GOLD = self::$COLOR_MATERIAL_GOLD = self::$COLOR_MATERIAL_RESIN = $setaf(3); self::$COLOR_BLUE = self::$COLOR_DARK_BLUE = self::$COLOR_MATERIAL_LAPIS = $setaf(4); self::$COLOR_LIGHT_PURPLE = self::$COLOR_PURPLE = self::$COLOR_MATERIAL_AMETHYST = $setaf(5); self::$COLOR_AQUA = self::$COLOR_DARK_AQUA = self::$COLOR_MATERIAL_DIAMOND = $setaf(6); @@ -253,6 +256,7 @@ abstract class Terminal{ TextFormat::MATERIAL_DIAMOND => Terminal::$COLOR_MATERIAL_DIAMOND, TextFormat::MATERIAL_LAPIS => Terminal::$COLOR_MATERIAL_LAPIS, TextFormat::MATERIAL_AMETHYST => Terminal::$COLOR_MATERIAL_AMETHYST, + TextFormat::MATERIAL_RESIN => Terminal::$COLOR_MATERIAL_RESIN, default => $token, }; } diff --git a/src/utils/TextFormat.php b/src/utils/TextFormat.php index fadf6ea4e..0c948592a 100644 --- a/src/utils/TextFormat.php +++ b/src/utils/TextFormat.php @@ -73,6 +73,7 @@ abstract class TextFormat{ public const MATERIAL_DIAMOND = TextFormat::ESCAPE . "s"; public const MATERIAL_LAPIS = TextFormat::ESCAPE . "t"; public const MATERIAL_AMETHYST = TextFormat::ESCAPE . "u"; + public const MATERIAL_RESIN = TextFormat::ESCAPE . "v"; public const COLORS = [ self::BLACK => self::BLACK, @@ -102,6 +103,7 @@ abstract class TextFormat{ self::MATERIAL_DIAMOND => self::MATERIAL_DIAMOND, self::MATERIAL_LAPIS => self::MATERIAL_LAPIS, self::MATERIAL_AMETHYST => self::MATERIAL_AMETHYST, + self::MATERIAL_RESIN => self::MATERIAL_RESIN, ]; public const OBFUSCATED = TextFormat::ESCAPE . "k"; @@ -150,7 +152,7 @@ abstract class TextFormat{ * @return string[] */ public static function tokenize(string $string) : array{ - $result = preg_split("/(" . TextFormat::ESCAPE . "[0-9a-u])/u", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); + $result = preg_split("/(" . TextFormat::ESCAPE . "[0-9a-v])/u", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); if($result === false) throw self::makePcreError(); return $result; } @@ -164,7 +166,7 @@ abstract class TextFormat{ $string = mb_scrub($string, 'UTF-8'); $string = self::preg_replace("/[\x{E000}-\x{F8FF}]/u", "", $string); //remove unicode private-use-area characters (they might break the console) if($removeFormat){ - $string = str_replace(TextFormat::ESCAPE, "", self::preg_replace("/" . TextFormat::ESCAPE . "[0-9a-u]/u", "", $string)); + $string = str_replace(TextFormat::ESCAPE, "", self::preg_replace("/" . TextFormat::ESCAPE . "[0-9a-v]/u", "", $string)); } return str_replace("\x1b", "", self::preg_replace("/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/u", "", $string)); } @@ -175,7 +177,7 @@ abstract class TextFormat{ * @param string $placeholder default "&" */ public static function colorize(string $string, string $placeholder = "&") : string{ - return self::preg_replace('/' . preg_quote($placeholder, "/") . '([0-9a-u])/u', TextFormat::ESCAPE . '$1', $string); + return self::preg_replace('/' . preg_quote($placeholder, "/") . '([0-9a-v])/u', TextFormat::ESCAPE . '$1', $string); } /** @@ -252,6 +254,7 @@ abstract class TextFormat{ TextFormat::MATERIAL_DIAMOND => "color:#2cb9a8", TextFormat::MATERIAL_LAPIS => "color:#20487a", TextFormat::MATERIAL_AMETHYST => "color:#9a5cc5", + TextFormat::MATERIAL_RESIN => "color:#fc7812", TextFormat::BOLD => "font-weight:bold", TextFormat::ITALIC => "font-style:italic", default => null