original_string: protected function validateFileName($fileName = null)
      {
          if ($fileName === null) {
              $fileName = $this->fileName;
          }
  
          $fileName = trim($fileName);
  
          if (!strlen($fileName)) {
              throw new ValidationException(['fileName' =>
                  Lang::get('cms::lang.cms_object.file_name_required', [
                      'allowed' => implode(', ', $this->allowedExtensions),
                      'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                  ])
              ]);
          }
  
          if (!FileHelper::validateExtension($fileName, $this->allowedExtensions, false)) {
              throw new ValidationException(['fileName' =>
                  Lang::get('cms::lang.cms_object.invalid_file_extension', [
                      'allowed' => implode(', ', $this->allowedExtensions),
                      'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                  ])
              ]);
          }
  
          if (!FileHelper::validatePath($fileName, null)) {
              throw new ValidationException(['fileName' =>
                  Lang::get('cms::lang.cms_object.invalid_file', [
                      'name' => $fileName
                  ])
              ]);
          }
      }
code: protected function validateFileName($fileName = null)
      {
          if ($fileName === null) {
              $fileName = $this->fileName;
          }
  
          $fileName = trim($fileName);
  
          if (!strlen($fileName)) {
              throw new ValidationException(['fileName' =>
                  Lang::get('cms::lang.cms_object.file_name_required', [
                      'allowed' => implode(', ', $this->allowedExtensions),
                      'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                  ])
              ]);
          }
  
          if (!FileHelper::validateExtension($fileName, $this->allowedExtensions, false)) {
              throw new ValidationException(['fileName' =>
                  Lang::get('cms::lang.cms_object.invalid_file_extension', [
                      'allowed' => implode(', ', $this->allowedExtensions),
                      'invalid' => pathinfo($fileName, PATHINFO_EXTENSION)
                  ])
              ]);
          }
  
          if (!FileHelper::validatePath($fileName, null)) {
              throw new ValidationException(['fileName' =>
                  Lang::get('cms::lang.cms_object.invalid_file', [
                      'name' => $fileName
                  ])
              ]);
          }
      }
code_tokens: protected function validateFileName ( $ fileName = null ) { if ( $ fileName === null ) { $ fileName = $ this -> fileName ; } $ fileName = trim ( $ fileName ) ; if ( ! strlen ( $ fileName ) ) { throw new ValidationException ( [ 'fileName' => Lang :: get ( 'cms::lang.cms_object.file_name_required' , [ 'allowed' => implode ( ', ' , $ this -> allowedExtensions ) , 'invalid' => pathinfo ( $ fileName , PATHINFO_EXTENSION ) ] ) ] ) ; } if ( ! FileHelper :: validateExtension ( $ fileName , $ this -> allowedExtensions , false ) ) { throw new ValidationException ( [ 'fileName' => Lang :: get ( 'cms::lang.cms_object.invalid_file_extension' , [ 'allowed' => implode ( ', ' , $ this -> allowedExtensions ) , 'invalid' => pathinfo ( $ fileName , PATHINFO_EXTENSION ) ] ) ] ) ; } if ( ! FileHelper :: validatePath ( $ fileName , null ) ) { throw new ValidationException ( [ 'fileName' => Lang :: get ( 'cms::lang.cms_object.invalid_file' , [ 'name' => $ fileName ] ) ] ) ; } }
docstring: Validate the supplied filename, extension and path.
  @param string $fileName
docstring_tokens: Validate the supplied filename extension and path .