Dylan K. Taylor
c2918709a3
Merge branch 'next-minor' into next-major
2023-01-06 01:59:04 +00:00
Alexey
172ce659b8
Use str_starts_with, str_ends_with and str_contains instead of strpos ( #5485 )
2022-12-31 13:02:23 +00:00
Alexey
0d31b25fba
Use str_starts_with and str_contains instead of strpos ( #5482 )
2022-12-30 21:41:30 +00:00
Dylan K. Taylor
4d79aced07
Merge branch 'next-minor' into next-major
2022-12-15 19:50:27 +00:00
Dylan K. Taylor
99996b62d6
Align PhpDoc @param tags according to PHP-CS-Fixer
2022-12-06 13:21:20 +00:00
Dylan K. Taylor
fdb07cdbcd
Added more missing native types according to 8.0 standards
2022-11-23 14:21:38 +00:00
Dylan K. Taylor
bfd1b2c635
PHPStan 1.9.1
2022-11-04 18:28:07 +00:00
Dylan K. Taylor
66cd156d80
Utils: use static property for core count cache, instead of local static variable
2022-09-02 19:18:01 +01:00
Dylan K. Taylor
1d253bc8c2
Utils: remove 32-bit specific code from javaStringHash()
...
this was necessary in the days of 32-bit, but for 64-bit, the 0xffffffff mask is sufficient and produces the exact same result.
2022-09-02 18:23:49 +01:00
Dylan K. Taylor
7f175b47e6
Fix CS
2022-08-25 18:19:22 +01:00
Dylan K. Taylor
0e73ffe555
CrashDump: Added JIT mode to data
...
this is necessary for identifying JIT-specific bugs, which, unfortunately, are very common.
2022-08-25 17:39:40 +01:00
Dylan K. Taylor
1ffd38b37b
Utils: fixed currentTrace() when xdebug is loaded, but not in develop mode
...
this is really dumb... why does it register the functions at all if they aren't usable ???
2022-08-25 16:56:26 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence
2022-06-04 17:34:49 +01:00
Dylan K. Taylor
9ff1bf6deb
Merge remote-tracking branch 'origin/stable' into next-minor
2022-05-11 13:12:45 +01:00
Dylan K. Taylor
a913736235
fix CS
2022-05-10 14:13:01 +01:00
Dylan K. Taylor
124edeacaf
fix build
2022-05-10 14:11:46 +01:00
Dylan K. Taylor
a216f4d089
Utils: improve representation of int, float and null in stack trace parameters
2022-05-10 14:07:07 +01:00
Dylan K. Taylor
17b0e0be84
Utils: use match to clean up stringifyValueForTrace()
2022-05-10 14:04:52 +01:00
Dylan K. Taylor
81d8aed2e2
Utils: account for named variadic arguments in printableTrace()
2022-05-10 13:59:42 +01:00
Dylan K. Taylor
6d7bf1c5d8
Utils: fixed missing property initializer
2022-04-28 14:52:21 +01:00
Dylan K. Taylor
0e7e776862
Modernize property declarations in src/utils
2022-04-28 13:12:12 +01:00
Dylan K. Taylor
f97ce6afef
Harden APIs which accept Vector3/Position/Location in event namespace
2022-03-09 22:22:37 +00:00
Dylan K. Taylor
282b430b1f
Replace disallowed operators in src/utils/
2022-01-20 19:02:26 +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
c6466a6da9
Utils: added crutch assumeNotFalse()
...
this can be used to get PHPStan to shut up about stuff that will never return false in normal contexts.
It's more fine-grained than @phpstan-ignore-line and less hassle than ignoreErrors (and works in PhpStorm too).
In addition, it's easy to search for references.
2021-12-08 18:58:39 +00:00
Dylan K. Taylor
b784a04e08
Utils: fixed parseDocComment() ignoring tags containing hyphens
2021-11-24 16:38:37 +00:00
Dylan K. Taylor
269231c228
Ban foreach(arrayWithStringKeys as k => v)
...
this is not as good as phpstan/phpstan-src#769 (e.g. array_key_first()/array_key_last() aren't covered by this, nor is array_rand()) but it does eliminate the most infuriating cases where this usually crops up.
2021-11-15 22:52:05 +00:00
Dylan K. Taylor
f827a555d5
Merge branch 'stable'
2021-11-01 18:13:24 +00:00
Dylan K. Taylor
1d99cd329a
CS again
2021-10-26 00:50:43 +01:00
Dylan K. Taylor
24d4daec90
Utils::testValidInstance() now accepts interfaces for the baseName
2021-10-26 00:32:32 +01:00
Dylan K. Taylor
4178c81209
Utils: fixed testValidInstance() not accepting the same valid class for both className and baseName
...
this caused problems in PlayerCreationEvent because plugins set the base class and then set the player class to the same thing.
2021-10-26 00:31:30 +01:00
Dylan K. Taylor
06e7338ff9
Move exception printing utilities from MainLogger to Utils
...
where they can be useful to other stuff apart from just the logger
2021-10-14 15:54:20 +01:00
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
cd9af7f9f6
Utils: be explicit about class existence checking in testValidInstance()
2021-08-21 15:57:57 +01:00
Dylan K. Taylor
1aa541aefe
Utils: remove useless commented code
2021-08-15 19:38:55 +01:00
Dylan K. Taylor
2b5667a56b
Move PHP minimum to 8.0
2021-07-26 20:29:39 +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
72de45f0e9
Drop pocketmine/uuid for ramsey/uuid
2021-03-16 23:03:00 +00:00
Dylan K. Taylor
bbae02264d
Merge branch 'stable'
2021-01-27 20:04:13 +00:00
Dylan K. Taylor
9228f006d4
Merge remote-tracking branch 'origin/stable'
...
# Conflicts:
# composer.json
# composer.lock
# resources/vanilla
# src/CrashDump.php
# src/PocketMine.php
# src/pocketmine/Server.php
# src/pocketmine/item/Bucket.php
# src/pocketmine/item/Item.php
# src/pocketmine/level/format/Chunk.php
# src/pocketmine/level/format/io/leveldb/LevelDB.php
# src/pocketmine/level/format/io/region/McRegion.php
# src/pocketmine/network/mcpe/protocol/BatchPacket.php
# src/pocketmine/tile/Furnace.php
# src/pocketmine/utils/UUID.php
# src/utils/ServerKiller.php
2020-12-20 20:54:13 +00:00
Dylan K. Taylor
531c191431
Finalize Utils class
2020-12-05 18:09:23 +00:00
Dylan K. Taylor
d6ed542fcd
Merge remote-tracking branch 'origin/stable' into master
...
# Conflicts:
# composer.json
# composer.lock
# src/CrashDump.php
# src/pocketmine/Server.php
# src/pocketmine/level/format/io/region/McRegion.php
# tests/phpstan/configs/check-explicit-mixed-baseline.neon
# tests/phpstan/configs/l7-baseline.neon
# tests/phpstan/configs/l8-baseline.neon
# tests/travis/setup-php.yml
2020-10-26 16:18:53 +00:00
Dylan K. Taylor
d840e8c4d4
Merge commit 'a34f3261c'
...
# Conflicts:
# resources/vanilla
# src/event/entity/EntityExplodeEvent.php
# src/pocketmine/event/block/SignChangeEvent.php
# src/utils/Utils.php
2020-07-04 22:39:40 +01:00
Dylan K. Taylor
9ce531fef4
(master) imports cleanup
2020-06-14 19:29:33 +01:00
Dylan K. Taylor
0025196a81
Merge branch 'next-minor'
...
# Conflicts:
# resources/vanilla
# src/network/upnp/UPnP.php
2020-05-23 11:16:19 +01:00
Dylan K. Taylor
5b7a55660f
Merge commit '786f416f2ef31726b9e6fa0a5edde36aecddf085'
...
# Conflicts:
# resources/vanilla
# src/plugin/PluginBase.php
# src/utils/Utils.php
2020-05-19 21:19:44 +01:00
Dylan K. Taylor
144a66c110
cumulative imports cleanup (again)
2020-05-12 22:38:59 +01:00
Dylan K. Taylor
b7cf4f01f9
remove utils\UUID, switch to pocketmine/uuid package
2020-05-11 10:46:48 +01:00