jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375925 )

Change subject: Short array syntax in README/code docs
......................................................................


Short array syntax in README/code docs

Change-Id: I230d41625152ff4fb403841664e8d47bd097f5ba
---
M README.md
M src/IPSet.php
2 files changed, 16 insertions(+), 16 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/README.md b/README.md
index 480e167..b34037a 100644
--- a/README.md
+++ b/README.md
@@ -8,11 +8,11 @@
 
 <pre lang="php">
 // At startup, calculate the optimized data structure for the set:
-$ipset = new IPSet( array(
+$ipset = new IPSet( [
     '208.80.154.0/26',
     '2620:0:861:1::/64',
     '10.64.0.0/22',
-) );
+] );
 
 // Runtime check against cached set (returns bool):
 if ( $ipset->match( $ip ) ) {
@@ -47,16 +47,16 @@
 The v4 tree would look like:
 
 <pre lang="php">
-root4 => array(
+root4 => [
     'comp' => 25,
-    'next' => array(
+    'next' => [
         0 => true,
-        1 => array(
+        1 => [
             0 => false,
             1 => true,
-        ),
-    ),
-);
+        ],
+    ],
+];
 </pre>
 
 (multi-byte compression nodes were attempted as well, but were
diff --git a/src/IPSet.php b/src/IPSet.php
index 92e2b0f..025f22b 100644
--- a/src/IPSet.php
+++ b/src/IPSet.php
@@ -28,11 +28,11 @@
  * Usage:
  *
  *     // At startup, calculate the optimized data structure for the set:
- *     $ipset = new IPSet( array(
+ *     $ipset = new IPSet( [
  *         '208.80.154.0/26',
  *         '2620:0:861:1::/64',
  *         '10.64.0.0/22',
- *     ) );
+ *     ] );
  *
  *     // Runtime check against cached set (returns bool):
  *     $allowme = $ipset->match( $ip );
@@ -65,16 +65,16 @@
  *
  * The v4 tree would look like:
  *
- *     root4 => array(
+ *     root4 => [
  *         'comp' => 25,
- *         'next' => array(
+ *         'next' => [
  *             0 => true,
- *             1 => array(
+ *             1 => [
  *                 0 => false,
  *                 1 => true,
- *             ),
- *         ),
- *     );
+ *             ],
+ *         ],
+ *     ];
  *
  * (multi-byte compression nodes were attempted as well, but were
  * a net loss in my test scenarios due to additional match complexity)

-- 
To view, visit https://gerrit.wikimedia.org/r/375925
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I230d41625152ff4fb403841664e8d47bd097f5ba
Gerrit-PatchSet: 1
Gerrit-Project: IPSet
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to