code: public function validateAttribute($model, $attribute)
      {
          $value = $model->$attribute;
  
          $result = $this->validateSubnet($value);
          if (is_array($result)) {
              $result[1] = array_merge(['ip' => is_array($value) ? 'array()' : $value], $result[1]);
              $this->addError($model, $attribute, $result[0], $result[1]);
          } else {
              $model->$attribute = $result;
          }
      }
docs: {@inheritdoc}