wp-includes/php-ai-client/third-party/Nyholm/Psr7/UploadedFile.php:94$targetPath public function moveTo($targetPath): void { $this->validateActive(); if (!\is_string($targetPath) || '' === $targetPath) { throw new \InvalidArgumentException('Invalid path provided for move operation; must be a non-empty string'); } if (null !== $this->file) { $this->moved = 'cli' === \PHP_SAPI ? @\rename($this->file, $targetPath) : @\move_uploaded_file($this->file, $targetPath); if (\false === $this->moved) { throw new \RuntimeException(\sprintf('Uploaded file could not be moved to "%s": %s', $targetPath, \error_get_last()['message'] ?? '')); } } else { $stream = $this->getStream(); if ($stream->isSeekable()) { $stream->rewind(); } if (\false === $resource = @\fopen($targetPath, 'w')) { throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $targetPath, \error_get_last()['message'] ?? '')); } $dest = Stream::create($resource); while (!$stream->eof()) { if (!$dest->write($stream->read(1048576))) { break; } } $this->moved = \true; } }Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
src/wp-includes/php-ai-client/third-party/Nyholm/Psr7/UploadedFile.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.