* Takes an array of field names with prefix and returns the unprefixed equivalent.
*
* @since 1.20
+ * @deprecated since 1.25, will be removed
*
- * @param array $fieldNames
+ * @param string[] $fieldNames
*
- * @return array
+ * @return string[]
*/
public function unprefixFieldNames( array $fieldNames );
* Takes a field name with prefix and returns the unprefixed equivalent.
*
* @since 1.20
+ * @deprecated since 1.25, will be removed
*
* @param string $fieldName
*
* Takes an array of field names with prefix and returns the unprefixed equivalent.
*
* @since 1.20
+ * @deprecated since 1.25, will be removed
*
- * @param array $fieldNames
+ * @param string[] $fieldNames
*
- * @return array
+ * @return string[]
*/
public function unprefixFieldNames( array $fieldNames ) {
+ wfDeprecated( __METHOD__, '1.25' );
+
+ return $this->stripFieldPrefix( $fieldNames );
+ }
+
+ /**
+ * Takes an array of field names with prefix and returns the unprefixed equivalent.
+ *
+ * @param string[] $fieldNames
+ *
+ * @return string[]
+ */
+ private function stripFieldPrefix( array $fieldNames ) {
$start = strlen( $this->fieldPrefix );
return array_map( function( $fieldName ) use ( $start ) {
* Takes a field name with prefix and returns the unprefixed equivalent.
*
* @since 1.20
+ * @deprecated since 1.25, will be removed
*
* @param string $fieldName
*
* @return string
*/
public function unprefixFieldName( $fieldName ) {
+ wfDeprecated( __METHOD__, '1.25' );
+
return substr( $fieldName, strlen( $this->fieldPrefix ) );
}
$result = (array)$result;
$rawFields = array_combine(
- $this->unprefixFieldNames( array_keys( $result ) ),
+ $this->stripFieldPrefix( array_keys( $result ) ),
array_values( $result )
);