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