diff options
author | Thiemo Kreuz <thiemo.kreuz@wikimedia.de> | 2020-02-28 16:13:53 +0100 |
---|---|---|
committer | Krinkle <krinklemail@gmail.com> | 2020-03-04 21:18:30 +0000 |
commit | 6b2c9deef51a63221e99171d3229a6104d22f665 (patch) | |
tree | 5e285923569f935b1f77fee324f43ae67b23d0a2 /tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php | |
parent | 6512ef160c0323b2bb4e89c4eedc8146d4743ae7 (diff) | |
download | mediawikicore-6b2c9deef51a63221e99171d3229a6104d22f665.tar.gz mediawikicore-6b2c9deef51a63221e99171d3229a6104d22f665.zip |
Replace all `new stdClass()` with identical `(object)[]`
This should be the exact same. Its more a style change than anything.
So why do it then?
* I believe this is much less confusing than code mentioning a weird
"standard class". Barely anybody knows what this is, and what the
difference between "object" and "stdClass" is.
* The code is shorter.
* It's even faster. In my micro benchmark it's twice as fast.
Change-Id: I7ee0e8ae6d9264a89b6cd1dd861f0466ae620ccc
Diffstat (limited to 'tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php')
-rw-r--r-- | tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php b/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php index 3abc94737024..b98a999345cb 100644 --- a/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php @@ -1398,7 +1398,7 @@ class FileBackendIntegrationTest extends MediaWikiIntegrationTestCase { ); } - $obj = new stdClass(); + $obj = (object)[]; $tmpFile->bind( $obj ); } |