original_string: protected static function getFilename($check)
      {
          if ($check instanceof UploadedFileInterface) {
              try {
                  // Uploaded files throw exceptions on upload errors.
                  return $check->getStream()->getMetadata('uri');
              } catch (RuntimeException $e) {
                  return false;
              }
          }
          if (is_array($check) && isset($check['tmp_name'])) {
              return $check['tmp_name'];
          }
  
          if (is_string($check)) {
              return $check;
          }
  
          return false;
      }
code: protected static function getFilename($check)
      {
          if ($check instanceof UploadedFileInterface) {
              try {
                  // Uploaded files throw exceptions on upload errors.
                  return $check->getStream()->getMetadata('uri');
              } catch (RuntimeException $e) {
                  return false;
              }
          }
          if (is_array($check) && isset($check['tmp_name'])) {
              return $check['tmp_name'];
          }
  
          if (is_string($check)) {
              return $check;
          }
  
          return false;
      }
code_tokens: protected static function getFilename ( $ check ) { if ( $ check instanceof UploadedFileInterface ) { try { // Uploaded files throw exceptions on upload errors. return $ check -> getStream ( ) -> getMetadata ( 'uri' ) ; } catch ( RuntimeException $ e ) { return false ; } } if ( is_array ( $ check ) && isset ( $ check [ 'tmp_name' ] ) ) { return $ check [ 'tmp_name' ] ; } if ( is_string ( $ check ) ) { return $ check ; } return false ; }
docstring: Helper for reading the file out of the various file implementations
  we accept.
  
  @param string|array|\Psr\Http\Message\UploadedFileInterface $check The data to read a filename out of.
  @return string|bool Either the filename or false on failure.
docstring_tokens: Helper for reading the file out of the various file implementations we accept .