change error identifier

This commit is contained in:
Dylan K. Taylor 2025-03-09 00:54:39 +00:00
parent 2291546610
commit 95284bc9de
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ parameters:
- -
message: '#^Dynamic new is not allowed\.$#' message: '#^Dynamic new is not allowed\.$#'
identifier: pocketmine.new.noDynamic identifier: pocketmine.new.dynamic
count: 1 count: 1
path: ../../../src/Server.php path: ../../../src/Server.php
@ -62,7 +62,7 @@ parameters:
- -
message: '#^Dynamic new is not allowed\.$#' message: '#^Dynamic new is not allowed\.$#'
identifier: pocketmine.new.noDynamic identifier: pocketmine.new.dynamic
count: 1 count: 1
path: ../../../src/block/Block.php path: ../../../src/block/Block.php
@ -524,7 +524,7 @@ parameters:
- -
message: '#^Dynamic new is not allowed\.$#' message: '#^Dynamic new is not allowed\.$#'
identifier: pocketmine.new.noDynamic identifier: pocketmine.new.dynamic
count: 1 count: 1
path: ../../../src/block/tile/TileFactory.php path: ../../../src/block/tile/TileFactory.php
@ -956,7 +956,7 @@ parameters:
- -
message: '#^Dynamic new is not allowed\.$#' message: '#^Dynamic new is not allowed\.$#'
identifier: pocketmine.new.noDynamic identifier: pocketmine.new.dynamic
count: 1 count: 1
path: ../../../src/plugin/PluginManager.php path: ../../../src/plugin/PluginManager.php
@ -1274,7 +1274,7 @@ parameters:
- -
message: '#^Dynamic new is not allowed\.$#' message: '#^Dynamic new is not allowed\.$#'
identifier: pocketmine.new.noDynamic identifier: pocketmine.new.dynamic
count: 1 count: 1
path: ../../../src/world/generator/GeneratorRegisterTask.php path: ../../../src/world/generator/GeneratorRegisterTask.php

View File

@ -45,7 +45,7 @@ final class DisallowDynamicNewRule implements Rule{
return [ return [
RuleErrorBuilder::message("Dynamic new is not allowed.") RuleErrorBuilder::message("Dynamic new is not allowed.")
->tip("For factories, use closures instead. Closures can implement custom logic, are statically analyzable, and don't restrict the constructor signature.") ->tip("For factories, use closures instead. Closures can implement custom logic, are statically analyzable, and don't restrict the constructor signature.")
->identifier("pocketmine.new.noDynamic") ->identifier("pocketmine.new.dynamic")
->build() ->build()
]; ];
} }