378 Commits

Author SHA1 Message Date
Dylan K. Taylor
9cdea43794 provide more array type information for Internet functions 2020-01-29 20:45:03 +00:00
Dylan K. Taylor
e007fad5b8 fix return types for Utils/Internet getURL()/postURL() 2020-01-29 20:43:09 +00:00
Dylan K. Taylor
5cf2fcbbb7 simpleCurl() second return value is string[][], not string[] 2020-01-29 20:38:19 +00:00
Dylan K. Taylor
9e6cbb5b6a Internet: fix type information for getURL(), postURL() and simpleCurl() 2020-01-29 20:20:52 +00:00
Dylan K. Taylor
2b402e525a add some PHPStan-specific callable prototypes 2020-01-29 15:03:55 +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
0b9d0f3cdc utils: populate missing return type information 2020-01-19 17:07:48 +00:00
Dylan K. Taylor
f16a530849 MainLogger: add native return types to private functions 2020-01-18 17:47:38 +00:00
Dylan K. Taylor
7137b8a8a4 Config: added native void return types to private functions 2020-01-18 17:46:25 +00:00
Dylan K. Taylor
bac788fd00 Timezone: add missing return type for detectSystemTimezone() 2020-01-15 20:18:35 +00:00
Dylan K. Taylor
1303cbfe02 UUID: add some missing return type annotations 2020-01-14 15:35:46 +00:00
Dylan K. Taylor
ad4a211cba Color: add missing return type annotation for fromABGR() 2020-01-14 15:35:14 +00:00
Dylan K. Taylor
17720041a3 phpdoc: populate missing parameter typeinfo 2020-01-11 21:53:24 +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
0a39e580e9 MainLogger: log exception chains in logException(), closes #2447
this method is simpler than #2447 and easier to apply to stable.
2020-01-09 21:01:12 +00:00
Dylan K. Taylor
c4580dd56d MainLogger: extract a printErrorMessage() function from logException() 2020-01-09 20:51:13 +00:00
Dylan K. Taylor
fab81d28bc MainLogger: always log exceptions with CRITICAL level
if we reached this point, it's almost always due to a general exception handler which doesn't know what else to do with the error.
2020-01-09 20:44:21 +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
ee08286eca moved git hash detection code to its own unit 2020-01-02 21:01:31 +00:00
Dylan K. Taylor
9cbe378e8c Timezone: fix possible crash on CentOS 2019-12-18 11:23:24 +00:00
Dylan K. Taylor
494660102e Replace empty() usages with count() 2019-12-18 11:23:24 +00:00
Dylan K. Taylor
73d4ff6b52 more missed function imports 2019-12-09 21:16:35 +00:00
Dylan K. Taylor
9159e8f002 MainLogger: mark static logger field as nullable 2019-12-05 15:48:58 +00:00
Dylan K. Taylor
305c63ba4d MainLogger: initialize shutdown field in the conventional manner
this avoids uninitialized uses
2019-10-22 10:21:17 +01:00
Dylan K. Taylor
348c2a599b Internet: report PM version in user agent
this is useful for statistics
2019-10-04 10:59:32 +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
7fc45bc5c3 partial fix for #2986 2019-07-04 18:18:42 +01:00
Dylan K. Taylor
dbf4054b1f backport 209135492: UUID: add type docs 2019-06-16 14:44:13 +01:00
Dylan K. Taylor
82e4ef6d48 backport d8c81c0a1: UUID: remove useless default values
these are overwritten by the constructor, so they have no use here.
2019-06-16 14:43:28 +01:00
Dylan K. Taylor
d0d300a6f8 backport 342b48b75: VersionString: Use the correct bitwise operators 2019-06-16 14:21:02 +01:00
Dylan K. Taylor
0058bfcd23 Utils: Limit length of printed stack trace strings to 80 characters 2019-06-06 14:56:19 +01:00
Dylan K. Taylor
9f31b479e1 Improve stack trace rendering, show array and string lengths 2019-06-06 14:53:50 +01:00
Dylan K. Taylor
22d9260a3b remove unused import 2019-04-26 13:56:32 +01:00
Dylan K. Taylor
c2c210e25a Fixed --enable-ansi and --disable-ansi not being respected on threads
this causes some breakage to the behaviour of Terminal, and for that reason this is going on 4.0.

Terminal::hasFormattingCodes() will no longer auto-detect whether colour codes are supported.
2019-04-26 12:30:24 +01:00
Dylan K. Taylor
142d750b9f TextFormat: clean() now removes private-use area Unicode characters
the console can't print these, and these are being abused to cause mass crashes in the wild.
2019-04-15 18:42:09 +01:00
Dylan K. Taylor
383ec8a8e3 TextFormat: Fixed tokenize() not being Unicode-aware 2019-04-08 15:45:26 +01:00
Dylan K. Taylor
6f36fa504b TextFormat: make clean() less confusing, deduplicate some regex 2019-02-14 16:52:39 +00:00
Dylan K. Taylor
c433fad0a7 another /u modifier 2019-02-14 13:50:56 +00:00
Dylan K. Taylor
8fad5a6e30 TextFormat: use mb_scrub() in clean()
this redacts invalid characters to prevent them appearing in places that might break the client.
2019-02-13 20:01:36 +00:00
Dylan K. Taylor
7a6f279825 TextFormat: fixed clean() not being unicode-aware 2019-02-13 17:06:44 +00:00
Dylan K. Taylor
5da48f429f Fixed some remaining one-line field declarations, added type docs 2019-02-05 14:03:27 +00:00
Dylan T
71d17c50d6
Fixed internal IP detection (#2711), closes #2702 2019-01-29 12:51:53 +00:00
Dylan K. Taylor
c83b7d9b69 Utils: fixed getNiceClosureName() not processing namespaced closures properly 2019-01-26 12:08:07 +00:00
Dylan K. Taylor
3380aa3ac2 Config: Assert only whitespace precedes .properties key, fixes #commented properties not being skipped 2019-01-07 12:25:05 +00:00
Dylan K. Taylor
2cdf97b7b5 CrashDump: Scan full stack trace to determine plugin involvement 2019-01-06 18:07:29 +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
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