Merge "Fix 'Tags' padding to keep it farther from the edge and document the source...
[lhc/web/wiklou.git] / includes / Storage / NameTableStore.php
index 505ab4c..1982d02 100644 (file)
@@ -352,14 +352,9 @@ class NameTableStore {
 
                $dbw = $this->getDBConnection( DB_MASTER );
 
-               $insertFields = [ $this->nameField => $name ];
-               if ( $this->insertCallback !== null ) {
-                       $insertFields = call_user_func( $this->insertCallback, $insertFields );
-               }
-
                $dbw->insert(
                        $this->table,
-                       $insertFields,
+                       $this->getFieldsToStore( $name ),
                        __METHOD__,
                        [ 'IGNORE' ]
                );
@@ -374,4 +369,16 @@ class NameTableStore {
                return $dbw->insertId();
        }
 
+       /**
+        * @param string $name
+        * @return array
+        */
+       private function getFieldsToStore( $name ) {
+               $fields = [ $this->nameField => $name ];
+               if ( $this->insertCallback !== null ) {
+                       $fields = call_user_func( $this->insertCallback, $fields );
+               }
+               return $fields;
+       }
+
 }