diff options
author | Kunal Mehta <legoktm@member.fsf.org> | 2016-02-17 01:09:32 -0800 |
---|---|---|
committer | Kunal Mehta <legoktm@member.fsf.org> | 2016-02-17 01:33:00 -0800 |
commit | 6e9b4f0e9ce4ccd6089c18b205065ef7fa077484 (patch) | |
tree | 58645fbce5c12d01b0d0fa87e338d4745e08920d /tests/phpunit/includes/libs/GenericArrayObjectTest.php | |
parent | 2fd379fa95f223c6b3f3c8eff6de068eca9e1a1a (diff) | |
download | mediawikicore-6e9b4f0e9ce4ccd6089c18b205065ef7fa077484.tar.gz mediawikicore-6e9b4f0e9ce4ccd6089c18b205065ef7fa077484.zip |
Convert all array() syntax to []
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
Diffstat (limited to 'tests/phpunit/includes/libs/GenericArrayObjectTest.php')
-rw-r--r-- | tests/phpunit/includes/libs/GenericArrayObjectTest.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php index 315bc7edb6d3..12c57871c724 100644 --- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php +++ b/tests/phpunit/includes/libs/GenericArrayObjectTest.php @@ -55,7 +55,7 @@ abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase { * @return array */ public function instanceProvider() { - $instances = array(); + $instances = []; foreach ( $this->elementInstancesProvider() as $elementInstances ) { $instances[] = $this->getNew( $elementInstances[0] ); @@ -71,7 +71,7 @@ abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase { * * @return GenericArrayObject */ - protected function getNew( array $elements = array() ) { + protected function getNew( array $elements = [] ) { $class = $this->getInstanceClass(); return new $class( $elements ); @@ -104,7 +104,7 @@ abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase { public function testIsEmpty( array $elements ) { $arrayObject = $this->getNew( $elements ); - $this->assertEquals( $elements === array(), $arrayObject->isEmpty() ); + $this->assertEquals( $elements === [], $arrayObject->isEmpty() ); } /** @@ -180,7 +180,7 @@ abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase { $elementClass = $list->getObjectType(); - foreach ( array( 42, 'foo', array(), new stdClass(), 4.2 ) as $element ) { + foreach ( [ 42, 'foo', [], new stdClass(), 4.2 ] as $element ) { $validValid = $element instanceof $elementClass; try { @@ -208,7 +208,7 @@ abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase { * @covers GenericArrayObject::offsetSet */ public function testOffsetSet( array $elements ) { - if ( $elements === array() ) { + if ( $elements === [] ) { $this->assertTrue( true ); return; |