58 Commits

Author SHA1 Message Date
Dylan K. Taylor
083a35f970
Modernize property type declarations 2022-06-04 18:16:32 +01:00
Dylan K. Taylor
0e7e776862
Modernize property declarations in src/utils 2022-04-28 13:12:12 +01:00
Dylan K. Taylor
282b430b1f
Replace disallowed operators in src/utils/ 2022-01-20 19:02:26 +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
ea1fceece2
Merge branch 'legacy/pm3' into stable 2021-12-14 23:15:53 +00:00
Dylan K. Taylor
8e37f86480
Avoid file_put_contents() when overwriting files
this fixes many cases of corruption during disk-full situations - file_put_contents() would write an empty file, destroying the original data.
fixes #3152
2021-12-05 00:26:48 +00:00
Dylan K. Taylor
8e8cee45b8
Config: use JSON_THROW_ON_ERROR for encoding 2021-12-04 21:44:12 +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
e34364412b
Replace InvalidStateException usages with InvalidArgument or LogicException 2021-11-02 16:05:54 +00:00
Dylan K. Taylor
4eef458d29
Config: throw AssumptionFailedError if config type is invalid or DETECT during save()
this should never happen ... it was already checked in load()
2021-11-02 16:03:43 +00: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
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
668df85e3f
Merge branch 'stable' 2021-08-20 23:08:17 +01:00
Dylan T
32d7b1e6af
Start using webmozart/pathutil for joining paths (#4287) 2021-06-29 19:40:43 +01:00
Dylan K. Taylor
163c3855eb Merge branch 'next-minor'
# Conflicts:
#	resources/vanilla
#	src/plugin/PluginBase.php
#	src/plugin/PluginDescription.php
#	src/pocketmine/Player.php
#	src/pocketmine/network/rcon/RCON.php
#	src/pocketmine/network/rcon/RCONInstance.php
#	src/pocketmine/scheduler/AsyncTask.php
#	src/pocketmine/tile/Spawnable.php
#	src/scheduler/AsyncPool.php
#	src/utils/Config.php
#	src/utils/Timezone.php
#	src/utils/UUID.php
#	src/utils/Utils.php
#	src/world/format/io/region/RegionLoader.php
2020-04-19 11:13:41 +01:00
Dylan K. Taylor
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
Dylan K. Taylor
cb16f5c142 Merge commit '260ac47588c76a2e6814cfba46773a990fb8c5da'
# Conflicts:
#	resources/vanilla
#	src/Server.php
#	src/lang/Language.php
#	src/network/mcpe/protocol/AddItemActorPacket.php
#	src/network/mcpe/protocol/AddPlayerPacket.php
#	src/network/mcpe/protocol/SetActorDataPacket.php
#	src/network/mcpe/serializer/NetworkBinaryStream.php
#	src/permission/Permission.php
#	src/pocketmine/block/Leaves.php
#	src/pocketmine/entity/DataPropertyManager.php
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/item/Banner.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/io/LevelProvider.php
#	src/pocketmine/level/format/io/LevelProviderManager.php
#	src/pocketmine/network/mcpe/protocol/AddActorPacket.php
#	src/pocketmine/network/mcpe/protocol/LoginPacket.php
#	src/pocketmine/tile/Banner.php
#	src/scheduler/BulkCurlTask.php
#	src/updater/AutoUpdater.php
#	src/utils/Config.php
#	src/utils/Utils.php
#	src/world/generator/Flat.php
#	src/world/generator/Generator.php
2020-01-31 21:07:34 +00:00
Dylan K. Taylor
721bd8f02b Merge commit 'd3021c628134293c2b8af505806efc2fba4fe947'
# Conflicts:
#	resources/vanilla
2020-01-31 20:03:27 +00:00
Dylan K. Taylor
3a68f5e3d0 Merge commit 'da43ae82fe3b8839a4d153b0365f815cf9859d77'
# Conflicts:
#	resources/vanilla
#	src/utils/Config.php
#	src/utils/Timezone.php
#	src/utils/Utils.php
2020-01-31 20:02:39 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
3ee6887792 populate remaining missing return types, using native returns where possible
this is done separately to stable so that stable changes can be integrated easily using an empty merge.
2020-01-19 10:26:35 +00:00
Dylan K. Taylor
96b91af66a Merge branch 'stable' 2020-01-11 21:41:38 +00:00
Dylan K. Taylor
cda1143a79 Merge branch 'stable' 2020-01-09 17:17:42 +00:00
Dylan K. Taylor
0f718ea28b Merge commit '8726604899d1a371567141e0831ed570d3233356' 2019-12-25 14:19:35 +00:00
Dylan K. Taylor
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00
Shoghi Cervantes
cbc64462e6 New directory structure. More powerful startup scripts 2014-03-08 04:41:43 +01:00
Shoghi Cervantes
993620341a Added Villager class and NPC interface 2014-03-06 23:33:35 +01:00
Shoghi Cervantes
c08bf3ef86 Removed code remove comments 2014-03-06 13:16:44 +01:00
Shoghi Cervantes
5ea31b57ce First step to namespaces 2014-03-05 23:43:16 +01:00
Shoghi Cervantes
23b8fc32ff removed DocBlock header for logo 2014-03-05 11:15:47 +01:00
Shoghi Cervantes
3864630bcd New PMF level (uses NBT Entity and TileEntity) 2014-02-26 17:15:31 +01:00
Shoghi Cervantes
7bdc48509e things 2014-02-19 17:41:12 +01:00
Shoghi Cervantes
f1b5f83fd4 Lots of typos fixed, undefined variables, unused code 2014-02-19 01:55:42 +01:00
Shoghi Cervantes
b481c94f45 Added new PHP YAML extension 2014-01-30 00:36:44 +01:00
Shoghi Cervantes
1526c6cae9 Fixed "Take this ridiculously retarded IF formatting!" by @sekjun9878 2014-01-28 11:37:29 +01:00
Michael Yoo
a141ea5018 Config Object PHPDoc 2013-12-19 18:42:45 +10:30
Michael Yoo
01e9ca7852 Fix #971. Add lowercase checking of Config. 2013-12-14 16:06:28 +10:30
Michael Yoo
e2298d861c Fix #996 2013-12-14 15:27:38 +10:30
Shoghi Cervantes
e9e59c33cc Fixed 969 2013-12-02 17:45:01 +01:00
Shoghi Cervantes
3ff4b9eae0 Achievements API 2013-11-24 00:51:04 +01:00
Shoghi Cervantes
ae8c934b5f Allow accessing Config data keys directly 2013-11-23 19:14:45 +01:00
Shoghi Cervantes
a21bb5ab6d Revert "Revert "Roll back""
This reverts commit e1e804ffe35f9e6c6411b8ed6425af3f8e72f608.
2013-08-29 18:52:12 +02:00
Shoghi Cervantes
e1e804ffe3 Revert "Roll back"
This reverts commit 29504c09f263e73492c6ffecea201a81dcf3591d.
2013-08-28 20:55:58 +02:00
Shoghi Cervantes
093b86fa43 Fixed URL 2013-08-27 19:16:11 +02:00
Shoghi Cervantes
36ff8331b7 Updated headers 2013-08-27 18:16:57 +02:00
Shoghi Cervantes
ffc95bf311 Fixed {} 2013-08-26 11:10:25 +02:00