Most planned callers of RecentChange::addTags() only want to add a
single tag, so forcing them to create an array seems unfriendly. Plus
this lets us avoid a array_merge call.
Change-Id: If001ba9ff01a33be158e7edd5c5e4de9825fa180
*
* @since 1.28
*
- * @param array $tags
+ * @param string|array $tags
*/
public function addTags( $tags ) {
- $this->tags = array_merge( $tags, $this->tags );
+ if ( is_string( $tags ) ) {
+ $this->tags[] = $tags;
+ } else {
+ $this->tags = array_merge( $tags, $this->tags );
+ }
}
}