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