110 if ( $this->apiCode ===
null ) {
111 $key = $this->getKey();
112 if ( isset( self::$messageMap[$key] ) ) {
113 $this->apiCode = self::$messageMap[$key];
114 } elseif ( $key ===
'apierror-missingparam' ) {
116 $this->apiCode =
'no' . $this->getParams()[0];
117 } elseif ( str_starts_with( $key,
'apiwarn-' ) ) {
118 $this->apiCode = substr( $key, 8 );
119 } elseif ( str_starts_with( $key,
'apierror-' ) ) {
120 $this->apiCode = substr( $key, 9 );
122 $this->apiCode = $key;
126 $this->apiCode = preg_replace(
'/[^a-zA-Z0-9_-]/',
'_', $this->apiCode );