*
* Use factory instead: MagicWord::get
*
- * @param string $id The internal name of the magic word
+ * @param string|null $id The internal name of the magic word
* @param string[]|string $syn synonyms for the magic word
* @param bool $cs If magic word is case sensitive
*/
public function compareStringLength( $s1, $s2 ) {
$l1 = strlen( $s1 );
$l2 = strlen( $s2 );
- if ( $l1 < $l2 ) {
- return 1;
- } elseif ( $l1 > $l2 ) {
- return -1;
- } else {
- return 0;
- }
+ return $l2 <=> $l1; // descending
}
/**