From: Fomafix Date: Wed, 3 Apr 2019 16:38:55 +0000 (+0200) Subject: Language: Use type hint instead of manual type check X-Git-Tag: 1.34.0-rc.0~2178^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=6212ab2d3d8cc0522d7fce12631edbfed4f2a817 Language: Use type hint instead of manual type check Change-Id: I9c68d0838d5865c29bff85b9a6bf50e02e83f556 --- diff --git a/languages/Language.php b/languages/Language.php index 9ed67f9619..f72ac1a25a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -3556,12 +3556,8 @@ class Language { * @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