Merge "block: Avoid use of empty() which doesn't warn on var non-existence"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 23 Mar 2019 18:59:26 +0000 (18:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 23 Mar 2019 18:59:26 +0000 (18:59 +0000)
includes/block/BlockRestriction.php

index ca36cda..b92cda8 100644 (file)
@@ -73,7 +73,7 @@ class BlockRestriction {
         * @return bool
         */
        public static function insert( array $restrictions ) {
-               if ( empty( $restrictions ) ) {
+               if ( !$restrictions ) {
                        return false;
                }
 
@@ -85,7 +85,7 @@ class BlockRestriction {
                        $rows[] = $restriction->toRow();
                }
 
-               if ( empty( $rows ) ) {
+               if ( !$rows ) {
                        return false;
                }