Skip to content

Commit d4fb3a8

Browse files
committed
add visibility modifier and type to constants
1 parent 16eb17f commit d4fb3a8

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

src/Analysis/Problem/CrashReport/TickingBlockEntityProblem.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
class TickingBlockEntityProblem extends TickingEntityProblem
88
{
9-
const PATTERN_ENTITY_NAME = "/-- Block entity being ticked --\nDetails:(?:\n\t.*)*\n\s+Name: ([\w\.]+:[\w\.]+)/";
10-
const PATTERN_ENTITY_TYPE = "/-- Block entity being ticked --\nDetails:(?:\n\s.*)*\n\s+Block[\s\w]*: .*?([\w\.]+:[\w\.]+)/";
11-
const PATTERN_ENTITY_LOCATION = "/-- Block entity being ticked --\nDetails:(?:\n\s.*)*\n\s+Block location: World: \(([\d-]+),([\d-]+),([\d-]+)\)/";
9+
protected const string PATTERN_ENTITY_NAME = "/-- Block entity being ticked --\nDetails:(?:\n\t.*)*\n\s+Name: ([\w\.]+:[\w\.]+)/";
10+
protected const string PATTERN_ENTITY_TYPE = "/-- Block entity being ticked --\nDetails:(?:\n\s.*)*\n\s+Block[\s\w]*: .*?([\w\.]+:[\w\.]+)/";
11+
protected const string PATTERN_ENTITY_LOCATION = "/-- Block entity being ticked --\nDetails:(?:\n\s.*)*\n\s+Block location: World: \(([\d-]+),([\d-]+),([\d-]+)\)/";
1212

1313
/**
1414
* @inheritDoc
@@ -25,4 +25,4 @@ protected function createSolution(): RemoveBlockEntitySolution
2525
{
2626
return new RemoveBlockEntitySolution();
2727
}
28-
}
28+
}

src/Analysis/Problem/CrashReport/TickingEntityProblem.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
class TickingEntityProblem extends CrashReportProblem
1111
{
12-
const PATTERN_ENTITY_TYPE = "/Entity Type: ([\w:_]+)/";
13-
const PATTERN_ENTITY_NAME = "/Entity Name: (.+)/";
14-
const PATTERN_ENTITY_LOCATION = "/Entity's Exact location: (-?[\d.]+), (-?[\d.]+), (-?[\d.]+)/";
15-
const PATTERN_DIMENSION = "/Level dimension: ([\w:-]+)/";
16-
const PATTERN_LEVEL_NAME = "/Level name: (.+)/";
12+
protected const string PATTERN_ENTITY_TYPE = "/Entity Type: ([\w:_]+)/";
13+
protected const string PATTERN_ENTITY_NAME = "/Entity Name: (.+)/";
14+
protected const string PATTERN_ENTITY_LOCATION = "/Entity's Exact location: (-?[\d.]+), (-?[\d.]+), (-?[\d.]+)/";
15+
protected const string PATTERN_DIMENSION = "/Level dimension: ([\w:-]+)/";
16+
protected const string PATTERN_LEVEL_NAME = "/Level name: (.+)/";
1717

1818
protected ?string $type = null;
1919
protected ?string $name = null;
@@ -175,4 +175,4 @@ public function getLevelName(): ?string
175175
public function setMatches(array $matches, mixed $patternKey): void
176176
{
177177
}
178-
}
178+
}

src/Analysis/Problem/Fabric/FabricModProblem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
abstract class FabricModProblem extends FabricProblem
88
{
9-
const MOD_NAME_REPLACEMENTS = ["fabric" => "FabricAPI"];
9+
protected const array MOD_NAME_REPLACEMENTS = ["fabric" => "FabricAPI"];
1010

1111
protected static string $modNamePattern = "(?:'([^\']+)' \((?:[^\)]+)\)|([\w-]+))";
1212
protected static string $modIDPattern = "([^ ,]+)";

src/Parser/ForgeParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class ForgeParser extends Parser
99
{
10-
const CHANNEL = "channel";
10+
public const string CHANNEL = "channel";
1111

1212
/**
1313
* Parse an entry match
@@ -29,4 +29,4 @@ protected function parseEntryMatch(Entry $entry, string $matchType, string $matc
2929
parent::parseEntryMatch($entry, $matchType, $matchString);
3030
}
3131
}
32-
}
32+
}

src/Parser/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class Parser extends PatternParser
99
{
10-
const PREFIX = "prefix";
10+
public const string PREFIX = "prefix";
1111
protected string $entryClass = \Aternos\Codex\Minecraft\Log\Entry::class;
1212

1313
/**
@@ -28,4 +28,4 @@ protected function parseEntryMatch(Entry $entry, string $matchType, string $matc
2828
parent::parseEntryMatch($entry, $matchType, $matchString);
2929
}
3030
}
31-
}
31+
}

src/Parser/ReportParser.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
class ReportParser extends \Aternos\Codex\Parser\Parser
99
{
10-
const LEVEL_INFO = "info";
11-
const LEVEL_WARNING = "warn";
12-
const LEVEL_TITLE = "title";
13-
const LEVEL_COMMENT = "comment";
14-
const LEVEL_STACKTRACE = "stacktrace";
10+
protected const string LEVEL_INFO = "info";
11+
protected const string LEVEL_WARNING = "warn";
12+
protected const string LEVEL_TITLE = "title";
13+
protected const string LEVEL_COMMENT = "comment";
14+
protected const string LEVEL_STACKTRACE = "stacktrace";
1515

16-
const DEFAULT_LEVEL = self::LEVEL_INFO;
16+
protected const string DEFAULT_LEVEL = self::LEVEL_INFO;
1717

18-
const PATTERN = [
18+
protected const array PATTERN = [
1919
self::LEVEL_WARNING => ["/\s*WARNING: .*$/"],
2020
self::LEVEL_STACKTRACE => ["/^\s+at (?:\w+\/+)?\S+\(.+\)$/", "/^(?:Caused by: )?[a-z]+\.(?:\w+\.?)+: .*$/", "/^\\tat [a-z]+\..*$/"],
2121
self::LEVEL_INFO => ["/^([^|:]+:) .+$/", "/^(\w+:)$/", "/^(\\t[^:.]+:)$/"],

src/Translator/Translator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class Translator
88
{
9-
protected const DEFAULT_LANGUAGE = "en";
9+
protected const string DEFAULT_LANGUAGE = "en";
1010

1111
protected static ?Translator $instance = null;
1212
protected static ?Translator $fallbackInstance = null;
@@ -146,4 +146,4 @@ protected function __construct()
146146
protected function __clone()
147147
{
148148
}
149-
}
149+
}

0 commit comments

Comments
 (0)