Dylan K. Taylor
f8ce01e2fd
ItemFactory: extract fromStringSingle() from fromString()
...
on PM4, the multiple functionality is removed, but on PM3 this is a problem for phpstan.
2020-03-13 17:54:25 +00:00
Dylan K. Taylor
3907a2b6ba
Process: split getMemoryUsage() into 2 functions
...
this isn't released yet so it's OK to change.
phpstan level 7 doesn't like these kinds of ambiguous return types because there's no way for it to tell which type is returned without a return type specifying extension, and it's easier to just change the API than to make PHPStan understand it.
2020-03-13 17:32:17 +00:00
Dylan K. Taylor
f08e411cad
Merge branch 'stable' into next-minor
2020-02-10 11:40:08 +00:00
Dylan K. Taylor
da3742b39e
Remove useless typecasts
2020-02-06 16:00:57 +00:00
Dylan K. Taylor
d26fcf7dee
Removed useless casts() from min/max calls
2020-02-06 15:58:27 +00:00
Dylan K. Taylor
1a5228e7a6
Fixed property types with missing null PhpDoc types
2020-02-05 20:55:03 +00:00
Dylan K. Taylor
faef4e8736
SimpleCommandMap: Command->getLabel() never returns null
2020-02-05 20:33:27 +00:00
Dylan K. Taylor
fa82cb26d8
added native types to closures (phpstan-strict-rules)
2020-02-05 16:35:10 +00:00
Dylan K. Taylor
c43e21235d
HelpCommand: do not overwrite non-foreach vars in foreach
2020-02-05 12:57:27 +00:00
Dylan K. Taylor
f1083bd9c4
SimpleCommandMap: beware case mismatches in alias recursion, closes #3281
2020-01-31 10:36:47 +00:00
Dylan K. Taylor
260ac47588
add some phpstan array types
2020-01-30 22:23:11 +00:00
Dylan K. Taylor
e61c3e8bf6
populate missing array value types in command namespace
2020-01-30 20:48:14 +00:00
Dylan K. Taylor
7ce6c8aa13
TimingsCommand: fix confusing indentation
2020-01-30 20:47:33 +00:00
Dylan K. Taylor
9abcc99c10
Command: fixed spacing of phpdoc on execute()
2020-01-30 20:46:25 +00:00
Dylan K. Taylor
f624871b3f
strip extra blank lines (php-cs-fixer)
2020-01-22 14:50:29 +00:00
Dylan K. Taylor
9cd6b3e1c7
fix remaining multiline @var annotations
2020-01-22 14:44:36 +00:00
Dylan K. Taylor
9f44adf04a
pass 2, manual removal of incorrect non-nullable @param for nullable native types
2020-01-21 15:44:34 +00:00
Dylan K. Taylor
c4793241f5
Mass removal of useless @param/@return PHPDoc annotations, pass 1
2020-01-21 15:10:18 +00:00
Dylan K. Taylor
e328d00cca
command: populate missing return type info
2020-01-19 17:02:55 +00:00
Dylan K. Taylor
8794292788
remove &$var reference notations in phpdoc
...
this isn't required by the spec and PHPStan chokes on it. I was previously having it ignore these errors, but it turns out that PHPStan is not making use of extended typeinfo provided if it can't parse the tag, which is problematic on level 6 and also a problem for array-of-type. Therefore, we are going to have to take the hit.
2020-01-11 21:20:55 +00:00
Dylan K. Taylor
1eedac87b2
added missing @var property types (reported by phpstan)
2020-01-09 14:13:54 +00:00
Dylan K. Taylor
494660102e
Replace empty() usages with count()
2019-12-18 11:23:24 +00:00
Dylan K. Taylor
9a67192f74
Merge branch 'stable' into next-minor
2019-12-03 10:45:51 +00:00
Dylan K. Taylor
4b65e1cbe1
Command: fix type doc comment for commandMap field
2019-12-01 21:01:57 +00:00
Dylan K. Taylor
ecbf3e9722
GamemodeCommand: fix CommandSender assignment causing troubles for type inference on static analyzers
...
this would never crash, but in strongly typed code it would be a compile failure.
2019-12-01 09:33:12 +00:00
SOFe
cb76f8a5df
Merge branch 'stable' into next-minor
2019-11-21 23:21:16 +08:00
Dylan K. Taylor
0d5d5e21a8
CommandReader: define $w and $e to make PHPStan happy
2019-10-25 16:11:02 +01:00
Dylan K. Taylor
0591458ef6
Merge branch 'stable' into next-minor
2019-10-22 18:49:22 +01:00
Dylan K. Taylor
bf44bd016d
TransferServerCommand: add missing boilerplate permission check
2019-10-20 14:28:53 +01:00
Dylan K. Taylor
bb048fb361
Merge branch 'stable' into next-minor
2019-07-26 19:50:17 +01:00
Dylan K. Taylor
622f93df45
remove usages of deprecated {} string access, closes #3035
2019-07-22 16:39:33 +01:00
Dylan K. Taylor
4635b93f4d
backport 23071d257 + deprecations: Extract process-related functions from Utils into a separate Process class
2019-06-16 14:40:51 +01:00
Dylan K. Taylor
ac5339414a
Merge branch 'stable' into next-minor
...
# Conflicts:
# build/preprocessor
2019-06-16 14:08:06 +01:00
Johnmacro
bb93d4f8de
TimeCommand: Fix commands.time.query message ( #2917 )
2019-05-12 09:21:39 +01:00
=?UTF-8?q?Fabian=20Fa=C3=9Fbender?=
932c489de1
Rename addTitle/addSubTitle/addActionBarMessage prefixes to "send", deprecated old variants
...
closes #2896
these deprecated methods will be removed in 4.0.
2019-05-01 18:54:20 +01:00
Dylan K. Taylor
4c268acc00
Fixed /whitelist on/off permissions, closes #2849
2019-04-14 17:58:53 +01:00
Dylan K. Taylor
e9a87978a6
Fixed usages of commands.generic.permission
...
apparently this doesn't exist in the client anymore
2019-04-07 15:07:24 +01:00
Dylan K. Taylor
5c12bee874
Backport other part of 2bffd5cc1c326670c25386ce78e5c690f4c5fd54: Add timer measurements for autosave
2019-03-10 11:20:51 +00:00
Dylan K. Taylor
0659d2fbef
Backport 6bd43a8215b9e612478fe789da9a58b36f0f0e73: Firehose auto-tick-rate anti-feature, closes #2665
2019-03-09 19:20:53 +00:00
Dylan K. Taylor
65529ff2ce
Command: add @throws CommandException
2019-02-14 15:09:41 +00:00
Dylan K. Taylor
c346c45d42
Use regex for command argument parsing, fixes #2266
...
moral of the story: don't abuse functions for things they weren't designed for... lol
2019-02-14 15:07:58 +00:00
Jack Noordhuis
27767e7ddb
Verify player name command input, closes #2729 , closes #2749
2019-02-13 14:50:43 +00:00
Dylan K. Taylor
243c12de7c
EffectCommand: fix bounds check, closes #2055
2019-02-13 14:37:40 +00:00
Dylan K. Taylor
82dddde159
Remove dead code in /time command handler
2019-01-19 15:15:04 +00:00
Dylan K. Taylor
bc709efb77
Prevent stupidity with /enchant
2019-01-19 15:14:51 +00:00
Dylan K. Taylor
93969197f7
Enable status,gc,dumpmemory OOB
...
dumpmemory has been confined to console by default due to the hazards it poses to a running server.
closes #2528
2019-01-05 18:56:57 +00:00
Dylan K. Taylor
4b9a142a5d
Import global functions and constants for enhanced performance
...
This is better for performance because these then don't need to be reevaluated every time they are called.
When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.
However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
Dylan K. Taylor
0bacf51729
Fix another swathe of number_format() truncation bugs
2019-01-04 19:39:51 +00:00
Dylan K. Taylor
33f6b441d8
Fixed /gc truncating memory freed
...
wtf PHP?
2019-01-04 17:30:35 +00:00
Dylan K. Taylor
d71a543d10
Fixed a bunch of things PHPStan finds unpalatable
...
close #2614 , fix a bunch of docs bugs, fix sendCreativeContents() crash on Human holders, move some inline variable declarations
2019-01-04 00:23:09 +00:00