original_string: public function beforeValidate()
      {
          if ($this->owner->{$this->attribute} instanceof UploadedFile) {
              $this->file = $this->owner->{$this->attribute};
              return;
          }
  
          $this->file = UploadedFile::getInstance($this->owner, $this->attribute);
  
          if (empty($this->file)) {
              $this->file = UploadedFile::getInstanceByName($this->attribute);
          }
  
          if ($this->file instanceof UploadedFile) {
              $this->owner->{$this->attribute} = $this->file;
          }
      }
code: public function beforeValidate()
      {
          if ($this->owner->{$this->attribute} instanceof UploadedFile) {
              $this->file = $this->owner->{$this->attribute};
              return;
          }
  
          $this->file = UploadedFile::getInstance($this->owner, $this->attribute);
  
          if (empty($this->file)) {
              $this->file = UploadedFile::getInstanceByName($this->attribute);
          }
  
          if ($this->file instanceof UploadedFile) {
              $this->owner->{$this->attribute} = $this->file;
          }
      }
code_tokens: public function beforeValidate ( ) { if ( $ this -> owner -> { $ this -> attribute } instanceof UploadedFile ) { $ this -> file = $ this -> owner -> { $ this -> attribute } ; return ; } $ this -> file = UploadedFile :: getInstance ( $ this -> owner , $ this -> attribute ) ; if ( empty ( $ this -> file ) ) { $ this -> file = UploadedFile :: getInstanceByName ( $ this -> attribute ) ; } if ( $ this -> file instanceof UploadedFile ) { $ this -> owner -> { $ this -> attribute } = $ this -> file ; } }
docstring: Before validate event.
docstring_tokens: Before validate event .