original_string: public static function uploadError($check, $allowNoFile = false)
      {
          if ($check instanceof UploadedFileInterface) {
              $code = $check->getError();
          } elseif (is_array($check) && isset($check['error'])) {
              $code = $check['error'];
          } else {
              $code = $check;
          }
          if ($allowNoFile) {
              return in_array((int)$code, [UPLOAD_ERR_OK, UPLOAD_ERR_NO_FILE], true);
          }
  
          return (int)$code === UPLOAD_ERR_OK;
      }
code: public static function uploadError($check, $allowNoFile = false)
      {
          if ($check instanceof UploadedFileInterface) {
              $code = $check->getError();
          } elseif (is_array($check) && isset($check['error'])) {
              $code = $check['error'];
          } else {
              $code = $check;
          }
          if ($allowNoFile) {
              return in_array((int)$code, [UPLOAD_ERR_OK, UPLOAD_ERR_NO_FILE], true);
          }
  
          return (int)$code === UPLOAD_ERR_OK;
      }
code_tokens: public static function uploadError ( $ check , $ allowNoFile = false ) { if ( $ check instanceof UploadedFileInterface ) { $ code = $ check -> getError ( ) ; } elseif ( is_array ( $ check ) && isset ( $ check [ 'error' ] ) ) { $ code = $ check [ 'error' ] ; } else { $ code = $ check ; } if ( $ allowNoFile ) { return in_array ( ( int ) $ code , [ UPLOAD_ERR_OK , UPLOAD_ERR_NO_FILE ] , true ) ; } return ( int ) $ code === UPLOAD_ERR_OK ; }
docstring: Checking for upload errors
  
  @param string|array|\Psr\Http\Message\UploadedFileInterface $check Value to check.
  @param bool $allowNoFile Set to true to allow UPLOAD_ERR_NO_FILE as a pass.
  @return bool
  @see https://secure.php.net/manual/en/features.file-upload.errors.php
docstring_tokens: Checking for upload errors