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/unit/includes/composer/ComposerVersionNormalizerTest.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/unit/includes/composer/ComposerVersionNormalizerTest.php')
-rw-r--r-- | tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php b/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php index 05d4277d0c19..7682471f0e92 100644 --- a/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php +++ b/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php @@ -24,7 +24,7 @@ class ComposerVersionNormalizerTest extends MediaWikiUnitTestCase { [ null ], [ 42 ], [ [] ], - [ new stdClass() ], + [ (object)[] ], [ true ], ]; } |