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