* @return string
*/
private function truncateInternal(
- $string, $length, $ellipsis, $adjustLength, $measureLength, $getSubstring
+ $string, $length, $ellipsis, $adjustLength, callable $measureLength, callable $getSubstring
) {
- if ( !is_callable( $measureLength ) || !is_callable( $getSubstring ) ) {
- throw new InvalidArgumentException( 'Invalid callback provided' );
- }
-
# Check if there is no need to truncate
if ( $measureLength( $string ) <= abs( $length ) ) {
return $string; // no need to truncate
* @param array $query Optional URL query parameter string
* @param bool $atend Optional param for specified if this is the last page
* @return string
+ * @deprecated since 1.33, use SpecialPage::viewPrevNext()
+ * instead.
*/
public function viewPrevNext( Title $title, $offset, $limit,
array $query = [], $atend = false