original_string: protected function onSetAttribute($name, $value) {
      // Listen to these attributes
      $listen = [
        'message_type'=> 'type',
        'message_id'  => 'id',
        'credits_cost'=> 'credits',
        'rb_cost'     => 'cost',
      ];
      // If set
      if (isset($listen[$name])) {
        // If not yet set
        if ( ! isset($this->{$listen[$name]})) {
          // Set corresponding attribute
          $this->{$listen[$name]} = $value;
        }
      }
    }
code: protected function onSetAttribute($name, $value) {
      // Listen to these attributes
      $listen = [
        'message_type'=> 'type',
        'message_id'  => 'id',
        'credits_cost'=> 'credits',
        'rb_cost'     => 'cost',
      ];
      // If set
      if (isset($listen[$name])) {
        // If not yet set
        if ( ! isset($this->{$listen[$name]})) {
          // Set corresponding attribute
          $this->{$listen[$name]} = $value;
        }
      }
    }
code_tokens: protected function onSetAttribute ( $ name , $ value ) { // Listen to these attributes $ listen = [ 'message_type' => 'type' , 'message_id' => 'id' , 'credits_cost' => 'credits' , 'rb_cost' => 'cost' , ] ; // If set if ( isset ( $ listen [ $ name ] ) ) { // If not yet set if ( ! isset ( $ this -> { $ listen [ $ name ] } ) ) { // Set corresponding attribute $ this -> { $ listen [ $ name ] } = $ value ; } } }
docstring: When an attribute is set
docstring_tokens: When an attribute is set