103 if ( $this->apiCode ===
null ) {
104 $key = $this->getKey();
105 if ( isset( self::$messageMap[$key] ) ) {
106 $this->apiCode = self::$messageMap[$key];
107 } elseif ( $key ===
'apierror-missingparam' ) {
109 $this->apiCode =
'no' . $this->getParams()[0];
110 } elseif ( str_starts_with( $key,
'apiwarn-' ) ) {
111 $this->apiCode = substr( $key, 8 );
112 } elseif ( str_starts_with( $key,
'apierror-' ) ) {
113 $this->apiCode = substr( $key, 9 );
115 $this->apiCode = $key;
119 $this->apiCode = preg_replace(
'/[^a-zA-Z0-9_-]/',
'_', $this->apiCode );