118 Commits

Author SHA1 Message Date
Dylan K. Taylor
6bf9a305de
Rename confusing PHPStan rule name
it never occurred to me that this was misleading until I read some Devin documentation,
noticed that Devin misunderstood was the class was for, and then realized actually
Devin understood correctly, and it was the name of the class that was wrong. Funny
how that happens...
2025-05-03 19:24:21 +01:00
Dylan K. Taylor
77be5f8e25
Update PHPStan 2025-02-17 17:51:39 +00:00
Dylan K. Taylor
e34f34f9f4
Update BedrockProtocol dependency 2025-01-07 23:09:28 +00:00
Dylan K. Taylor
9633b7d8a7
Update to PHPStan 2.x 2025-01-07 22:34:43 +00:00
Dylan K. Taylor
84ec8b7abe
Removed dead error patterns
I do think these are PHPStan bugs, since the trait should inherit the parent class's doc comment
But for the sake of catching more bugs, these doc comments have been manually added anyway.
2025-01-06 23:02:18 +00:00
ipad54
b341078765
Implement new pale oak blocks (#6570) 2024-12-12 17:53:52 +03:00
Dylan T.
61560ec375
Support for collecting timings from threads, and implement async task timings (#6333)
The following callbacks can now be registered in timings, to allow threads to be notified of these events:
- Turning on/off (`TimingsHandler::getToggleCallbacks()->add(...)`)
- Reset (`TimingsHandler::getReloadCallbacks()->add(...)`)
- Collect (`TimingsHandler::getCollectCallbacks()->add(...)`)

Collect callbacks must return `list<Promise>`. The promises must be `resolve()`d with `list<string>` of printed timings records, as returned by `TimingsHandler::printCurrentThreadRecords()`. It's recommended to use 1 promise per thread.

A timings report will be produced once all promises have been resolved.

This system is used internally to collect timings for async tasks (closes #6166).

For timings viewer developers:
Timings format version has been bumped to 3 to accommodate this change. Timings groups should now include a `ThreadId`  at the end of timings group names to ensure that their record IDs are segregated correctly, as they could otherwise conflict between threads. The main thread is not required to specify a thread ID. See pmmp/timings@13cefa6279 for implementation examples.

New PHPStan error is caused by phpstan/phpstan#10924
2024-12-01 14:49:27 +00:00
Dylan K. Taylor
12ae8dc03b
Merge branch 'stable' into minor-next 2024-11-25 14:32:30 +00:00
Dylan K. Taylor
5325ecee37
Deal with a whole lot of PHPStan suppressed key casting errors
closes #6534
2024-11-25 14:30:58 +00:00
Dylan T.
33a7b46329
Use reflection to locate BlockTypeIds and ItemTypeIds for VanillaBlocks/VanillaItems (#6498)
Use reflection to locate BlockTypeIds and ItemTypeIds for VanillaBlocks/VanillaItems

Since BlockTypeIds and ItemTypeIds are derived from VanillaBlocks and VanillaItems respectively anyway (they only exist to allow identifying blocks/items without having to create instances of them), this hack is probably OK, and reduces the chances of mistakes.
Previously it was explored to have these IDs generated by auto-incrementing in VanillaBlocks/Items and have the constants generated that way, but this proved to be too problematic because of unstable diffs no matter how we chose to sort the elements. See #6313 for previous research on the subject.

This is obviously not a desirable hack to keep long-term. In the future it will probably make sense to redesign VanillaBlocks like so:

enum VanillaBlocks { ... }
VanillaBlocks::STONE (the type ID)
VanillaBlocks::STONE->new() (to create a block)

However, more research is needed on this, as I'd prefer not to make block creation any more verbose.
2024-11-14 17:32:22 +00:00
Dylan K. Taylor
72fc138631
Regenerate PHPStan baselines 2024-11-03 14:43:34 +00:00
IvanCraft623
4e6b34f573
Implement new 1.21 copper blocks (#6366)
Added the following new blocks:
- All types of Copper Bulb
- All types of Copper Door
- All types of Copper Trapdoor
- All types of Chiseled Copper
- All types of Copper Grate
2024-09-24 21:25:10 -05:00
ShockedPlot7560
6bb84bc46c
Add Promise::all (#6152) 2024-02-06 12:42:24 +00:00
Dylan K. Taylor
58ce746ae1
Remove dead PHPStan ignored error 2023-12-20 14:44:24 +00:00
Dylan K. Taylor
2f1d6115a0
Merge branch 'legacy/pm4' into stable 2023-12-06 14:55:18 +00:00
Dylan K. Taylor
2a136c7804
Update composer dependencies 2023-12-06 14:37:27 +00:00
Dylan K. Taylor
d138a15a32
Merge branch 'legacy/pm4' into stable 2023-09-21 13:27:04 +01:00
Dylan K. Taylor
912fd3f5c6
PHPStan 1.10.35, plus workarounds 2023-09-21 13:22:14 +01:00
Dylan K. Taylor
9509d7e04d
Scrub PHPStan baselines 2023-05-20 01:51:21 +01:00
Dylan K. Taylor
a619fd2be6
Scrub PHPStan baselines 2023-03-19 16:37:38 +00:00
Dylan K. Taylor
222415859a
Require pthreads ^5.1
This version of pthreads has a substantially improved API, improved
performance, improved memory usage, and much less magical and broken
behaviour.
2023-01-23 20:02:33 +00:00
Dylan K. Taylor
8b5e4c1c16
Updated PHPStan 2022-12-15 20:16:56 +00:00
Dylan K. Taylor
bfd1b2c635
PHPStan 1.9.1 2022-11-04 18:28:07 +00:00
Dylan K. Taylor
37ec1193ea
Update PHPStan baselines 2022-09-28 18:34:01 +01:00
Dylan K. Taylor
85678aa356
phpstan 1.8.3 2022-09-02 18:28:33 +01:00
Dylan K. Taylor
ac056044ce
Updated PHPStan baseline 2022-08-21 20:46:38 +01:00
Dylan K. Taylor
c13170a00b
Avoid implicit integer cast in Normal::pickBiome()
this throws deprecation warnings on PHP 8.1.
2022-08-20 17:16:38 +01:00
Dylan K. Taylor
caa4b78a3f
Update composer dependencies 2022-06-21 20:21:02 +01:00
Dylan K. Taylor
869d340f10
Regenerate PHPStan baselines 2022-05-10 12:38:20 +01:00
Rush2929
741182c55f
InGamePacketHandler: skip processing movement if the player's position
was changed during processing other properties (#4913)

fixes #4952
2022-04-10 21:02:45 +01:00
Dylan K. Taylor
194cb1fb84
phpstan 1.5.1 2022-03-28 17:12:00 +01:00
Dylan K. Taylor
8efa299c65
phpstan 1.4.8 2022-03-09 18:30:54 +00:00
Dylan K. Taylor
856fd2a33b
fix PHPStan failures 2022-03-09 17:26:05 +00:00
Dylan K. Taylor
ee6548aa50
Merge branch 'stable' into next-minor 2022-01-14 00:45:49 +00:00
Dylan K. Taylor
0a5b146189
substr() returns an empty string instead of false in 8.0
an empty string will pass through preg_match_all() without any harmful effects, so we don't need to check for it.
2022-01-07 22:38:00 +00:00
Dylan K. Taylor
65dabefa3b
Config: improve config loading and parsing error handling
closes #4654
closes #3454
2021-12-19 16:53:29 +00:00
Dylan K. Taylor
bb7683158f
Remove dead ignoreErrors patterns 2021-11-24 23:52:51 +00:00
Dylan K. Taylor
fad96b77ce
stfu 2021-11-24 23:49:56 +00:00
Dylan K. Taylor
4c3a5fdd73
Clean PHPStan baselines from 1.0.2 2021-11-04 19:28:52 +00:00
Dylan K. Taylor
84f8b3eb2d
Move CrashDump to pocketmine\crash namespace 2021-11-04 19:23:45 +00:00
Dylan K. Taylor
c60144210f
Regenerate PHPStan bugs baseline 2021-11-04 19:18:29 +00:00
Dylan K. Taylor
f827a555d5
Merge branch 'stable' 2021-11-01 18:13:24 +00:00
Dylan K. Taylor
ff27c5f7db
PHPStan 1.0.0 2021-11-01 17:24:20 +00:00
Dylan K. Taylor
b5699679ef
Merge commit 'e38866c4ba90f8efd5630dbe674fd7ca15f586ff' 2021-10-12 23:23:27 +01:00
Dylan K. Taylor
e38866c4ba
phpstan 0.12.99 2021-10-09 19:33:43 +01:00
Dylan K. Taylor
668df85e3f
Merge branch 'stable' 2021-08-20 23:08:17 +01:00
Dylan K. Taylor
ff4aa148ef
phpstan 0.12.95 2021-08-20 22:47:29 +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
b72d81be5e
Cleanup PHPStan baselines 2021-08-04 21:24:13 +01:00
Dylan K. Taylor
09eac0e129
Merge remote-tracking branch 'origin/stable' 2021-07-26 20:14:33 +01:00