Dylan K. Taylor
912e612743
Utils: allow validateCallableSignature() to accept a manually constructed CallbackType instead of a closure
...
this allows more fine-grained control without PHPStan yelling at us.
2021-10-10 23:27:09 +01:00
Dylan K. Taylor
4910250a81
Config: fixed writeList()
2021-10-07 21:47:09 +01:00
Dylan K. Taylor
e0d2e24698
fix CS (again\!)
2021-10-07 21:19:44 +01:00
Dylan K. Taylor
d5f02a0bf8
Config: expose APIs to parse/emit list configs
2021-10-07 21:18:42 +01:00
Dylan K. Taylor
2a3a57c519
Enable parsing/emitting .properties without creating a Config object
...
this is useful when the contents are just going to get passed straight into a model, making Config object redundant anyway.
2021-10-07 20:53:15 +01:00
Dylan K. Taylor
5115387feb
fix CS (again)
2021-10-07 20:43:55 +01:00
Dylan K. Taylor
dd0aaf59b5
MainLogger: Log exceptions as a single block message
2021-10-07 20:40:20 +01:00
Dylan K. Taylor
a555f21b18
MainLogger: write messages before calling logger attachments
2021-10-07 20:32:02 +01:00
Dylan K. Taylor
1be9b2f037
Config: drop packing of arrays
...
we don't handle arrays on decode, so there's no reason to support them on encode either.
2021-10-07 20:30:56 +01:00
Dylan K. Taylor
90800a4124
Config: Try to coerce types, similar to YAML
2021-10-06 21:09:23 +01:00
Dylan K. Taylor
7d06b76aaf
PluginManager: account for possible invalid format of API version
...
we're seeing a lot of crashes because of this.
2021-10-05 18:36:00 +01:00
Dylan K. Taylor
0108888450
Process: silence taskkill complaining that it can't commit suicide
...
since taskkill is a subprocess of the server process, it gets included in taskkill's own attempted killing spree, but taskkill (wisely) won't kill itself.
2021-10-02 17:23:26 +01:00
Dylan K. Taylor
dd0c2fed82
Process: add subprocess parameter to kill()
...
fix CommandReader subprocess lingering on a crash and fucking up the console
2021-10-02 16:56:24 +01:00
Dylan K. Taylor
da0482d330
Solidify version comparison
2021-09-07 12:24:16 +01:00
Dylan K. Taylor
ed1e7322dd
be quiet phpstan
2021-09-03 21:16:37 +01:00
Dylan K. Taylor
62435fe935
Standardize clone denying
2021-09-03 21:07:39 +01:00
Dylan K. Taylor
b026ada489
Standardize serialize denying
2021-09-03 21:07:10 +01:00
Dylan K. Taylor
270ee5c085
Simplify registry method generation
2021-08-22 23:02:36 +01:00
Dylan K. Taylor
cd9af7f9f6
Utils: be explicit about class existence checking in testValidInstance()
2021-08-21 15:57:57 +01:00
Dylan K. Taylor
4d73c93886
fix CS
2021-08-21 15:54:11 +01:00
Dylan K. Taylor
5f3c9e6f19
Timezone: fix some implicit boolean type conversions
2021-08-21 15:43:30 +01:00
Dylan K. Taylor
668df85e3f
Merge branch 'stable'
2021-08-20 23:08:17 +01:00
Dylan K. Taylor
a012e7ccc0
VersionInfo: make static methods more constant-like
...
if we could have class constants declared at runtime, these would be constant.
2021-08-16 16:37:36 +01:00
Dylan K. Taylor
1aa541aefe
Utils: remove useless commented code
2021-08-15 19:38:55 +01:00
Dylan K. Taylor
ecdfd9ea26
Terminal: reduce code duplication in getFallbackEscapeCodes()
2021-08-13 14:04:13 +01:00
Dylan K. Taylor
78c2dcaee5
Terminal: fixed crash on platforms which don't support tput fully
...
in 8-bit colour mode, it seems that ITALIC is not supported. This only showed its face now because of typed properties.
closes #4365
closes #4366
2021-08-13 14:00:17 +01:00
Dylan K. Taylor
e907c70160
...
2021-08-12 23:37:24 +01:00
Dylan K. Taylor
34309bc810
TextFormat: do not assume that an array given to toHTML() is actually a tokenized string
...
this is a far stretch, since the documentation doesn't mention that the string needs to be tokenized. Anyone passing an array in here is most likely doing so by mistake.
2021-08-12 23:37:00 +01:00
Dylan K. Taylor
a59ac522ee
Terminal: do not assume that an array given to toANSI() is actually a tokenized string
...
this is a far stretch, since the documentation doesn't mention that the string needs to be tokenized. Anyone passing an array in here is most likely doing so by mistake.
2021-08-12 23:35:45 +01:00
Dylan K. Taylor
6a2a4cca4d
Terminal: use match instead of switch in toANSI()
...
phpstan seems to have some trouble with large match statements (phpstan/phpstan#5454 )
2021-08-12 20:13:44 +01:00
Dylan K. Taylor
2782af7e22
Terminal: use typed properties
2021-08-12 19:41:16 +01:00
Dylan K. Taylor
4d683c63d8
TextFormat: remove toJSON()
...
this is not used in the PM core, and is only used by 1 plugin in the whole public ecosystem: BigBrother. It makes more sense to make BigBrother maintainers shoulder the responsibility of maintaining this code, since they are the only ones that need it - besides, if this changed in any MCJE update in the last 5y, nobody has updated it, and nobody has maintained it either due to not having a fucking clue what the thing is for (the documentation is basically nonexistent).
2021-08-12 13:43:58 +01:00
Dylan K. Taylor
eb24e040f3
TextFormat: add COLORS and FORMATS constants
2021-08-12 13:13:33 +01:00
Dylan K. Taylor
2b5667a56b
Move PHP minimum to 8.0
2021-07-26 20:29:39 +01:00
Dylan K. Taylor
09eac0e129
Merge remote-tracking branch 'origin/stable'
2021-07-26 20:14:33 +01:00
Dylan K. Taylor
b7ea10b905
MainLogger: do not assume that exception codes are always integers
...
PDOException most notably breaks this rule.
closes #4294
2021-07-05 19:20:59 +01:00
Dylan K. Taylor
1170c8fe13
EnumTrait: override __clone, __sleep, __wakeup to prevent duplication
2021-06-29 19:55:43 +01:00
Dylan T
32d7b1e6af
Start using webmozart/pathutil for joining paths ( #4287 )
2021-06-29 19:40:43 +01:00
Dylan K. Taylor
3dd33cd35e
Get rid of EnumTrait::fromString()
...
it's better to just implement this for stuff where there's explicitly designated aliases, otherwise we could end up with unexpected BC breaks (e.g. hardcoding POSTWORLD in plugin.yml would suddenly break if the core enum was changed, even though it remained valid).
2021-06-27 20:52:56 +01:00
Dylan K. Taylor
43f71d0d63
FormatConverter: Copy worlds for backup if rename fails
...
this can fail if the backups directory points to a different drive than the original worlds location. In this case, we have to copy and delete the files instead, which is much slower, but works.
I REALLY advise against putting backups on a different mount point than worlds if you plan to convert large worlds.
2021-06-17 20:46:34 +01:00
Dylan K. Taylor
9702b51bd1
Utils: improve how boolean arguments are displayed in stack traces
2021-06-02 21:36:47 +01:00
Dylan K. Taylor
fadc96bb0e
Utils: include spl_object_id() in stack traces
2021-06-02 21:34:19 +01:00
Dylan K. Taylor
624495f4d3
Added a generic Promise type
...
I anticipate increasing demand for promises, and since all the libraries I could find suck, we'll stick to our own impl for now.
2021-05-08 15:57:30 +01:00
Dylan K. Taylor
7139eccfbe
Merge branch 'stable'
2021-03-28 18:11:53 +01:00
Dylan K. Taylor
06f20234f7
Scrub unused imports
2021-03-26 22:56:09 +00:00
Dylan K. Taylor
49438d360d
RegistryUtils: generate ordered doc comments
...
this makes things easier to find, especially in the large ones like VanillaBlocks.
2021-03-22 16:16:28 +00:00
Dylan K. Taylor
72de45f0e9
Drop pocketmine/uuid for ramsey/uuid
2021-03-16 23:03:00 +00:00
Dylan K. Taylor
dff13a884f
Merge branch 'stable'
2021-02-12 17:34:25 +00:00
Dylan K. Taylor
672622950f
ObjectSet: make add() and remove() variadic to match ds
...
there are still some variadic usages in the code, which, infuriatingly, phpstan does not detect (phpstan/phpstan#4528 ).
2021-02-11 15:54:05 +00:00
Dylan K. Taylor
c61f66d973
Removed ext-ds dependency
2021-02-11 15:40:37 +00:00