Loading core/modules/file/src/FileRepository.php +3 −3 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public function __construct(FileSystemInterface $fileSystem, StreamWrapperManage */ public function writeData(string $data, string $destination, int $replace = FileSystemInterface::EXISTS_RENAME): FileInterface { if (!$this->streamWrapperManager->isValidUri($destination)) { throw new InvalidStreamWrapperException(sprintf('Invalid stream wrapper: %destination', ['%destination' => $destination])); throw new InvalidStreamWrapperException("Invalid stream wrapper: {$destination}"); } $uri = $this->fileSystem->saveData($data, $destination, $replace); return $this->createOrUpdate($uri, $destination, $replace === FileSystemInterface::EXISTS_RENAME); Loading Loading @@ -132,7 +132,7 @@ protected function createOrUpdate(string $uri, string $destination, bool $rename */ public function copy(FileInterface $source, string $destination, int $replace = FileSystemInterface::EXISTS_RENAME): FileInterface { if (!$this->streamWrapperManager->isValidUri($destination)) { throw new InvalidStreamWrapperException(sprintf('Invalid stream wrapper: %destination', ['%destination' => $destination])); throw new InvalidStreamWrapperException("Invalid stream wrapper: {$destination}"); } $uri = $this->fileSystem->copy($source->getFileUri(), $destination, $replace); Loading Loading @@ -166,7 +166,7 @@ public function copy(FileInterface $source, string $destination, int $replace = */ public function move(FileInterface $source, string $destination, int $replace = FileSystemInterface::EXISTS_RENAME): FileInterface { if (!$this->streamWrapperManager->isValidUri($destination)) { throw new InvalidStreamWrapperException(sprintf('Invalid stream wrapper: %destination', ['%destination' => $destination])); throw new InvalidStreamWrapperException("Invalid stream wrapper: {$destination}"); } $uri = $this->fileSystem->move($source->getFileUri(), $destination, $replace); $delete_source = FALSE; Loading core/modules/file/tests/src/Kernel/CopyTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public function testExistingError() { */ public function testInvalidStreamWrapper() { $this->expectException(InvalidStreamWrapperException::class); $this->expectExceptionMessage('Invalid stream wrapper: foo://'); $source = $this->createFile(); $this->fileRepository->copy($source, 'foo://'); } Loading core/modules/file/tests/src/Kernel/FileRepositoryTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ public function testExistingError() { */ public function testInvalidStreamWrapper() { $this->expectException(InvalidStreamWrapperException::class); $this->expectExceptionMessage('Invalid stream wrapper: foo://'); $this->fileRepository->writeData('asdf', 'foo://'); } Loading core/modules/file/tests/src/Kernel/MoveTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ public function testExistingError() { */ public function testInvalidStreamWrapper() { $this->expectException(InvalidStreamWrapperException::class); $this->expectExceptionMessage('Invalid stream wrapper: foo://'); $source = $this->createFile(); $this->fileRepository->move($source, 'foo://'); } Loading Loading
core/modules/file/src/FileRepository.php +3 −3 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public function __construct(FileSystemInterface $fileSystem, StreamWrapperManage */ public function writeData(string $data, string $destination, int $replace = FileSystemInterface::EXISTS_RENAME): FileInterface { if (!$this->streamWrapperManager->isValidUri($destination)) { throw new InvalidStreamWrapperException(sprintf('Invalid stream wrapper: %destination', ['%destination' => $destination])); throw new InvalidStreamWrapperException("Invalid stream wrapper: {$destination}"); } $uri = $this->fileSystem->saveData($data, $destination, $replace); return $this->createOrUpdate($uri, $destination, $replace === FileSystemInterface::EXISTS_RENAME); Loading Loading @@ -132,7 +132,7 @@ protected function createOrUpdate(string $uri, string $destination, bool $rename */ public function copy(FileInterface $source, string $destination, int $replace = FileSystemInterface::EXISTS_RENAME): FileInterface { if (!$this->streamWrapperManager->isValidUri($destination)) { throw new InvalidStreamWrapperException(sprintf('Invalid stream wrapper: %destination', ['%destination' => $destination])); throw new InvalidStreamWrapperException("Invalid stream wrapper: {$destination}"); } $uri = $this->fileSystem->copy($source->getFileUri(), $destination, $replace); Loading Loading @@ -166,7 +166,7 @@ public function copy(FileInterface $source, string $destination, int $replace = */ public function move(FileInterface $source, string $destination, int $replace = FileSystemInterface::EXISTS_RENAME): FileInterface { if (!$this->streamWrapperManager->isValidUri($destination)) { throw new InvalidStreamWrapperException(sprintf('Invalid stream wrapper: %destination', ['%destination' => $destination])); throw new InvalidStreamWrapperException("Invalid stream wrapper: {$destination}"); } $uri = $this->fileSystem->move($source->getFileUri(), $destination, $replace); $delete_source = FALSE; Loading
core/modules/file/tests/src/Kernel/CopyTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public function testExistingError() { */ public function testInvalidStreamWrapper() { $this->expectException(InvalidStreamWrapperException::class); $this->expectExceptionMessage('Invalid stream wrapper: foo://'); $source = $this->createFile(); $this->fileRepository->copy($source, 'foo://'); } Loading
core/modules/file/tests/src/Kernel/FileRepositoryTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ public function testExistingError() { */ public function testInvalidStreamWrapper() { $this->expectException(InvalidStreamWrapperException::class); $this->expectExceptionMessage('Invalid stream wrapper: foo://'); $this->fileRepository->writeData('asdf', 'foo://'); } Loading
core/modules/file/tests/src/Kernel/MoveTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ public function testExistingError() { */ public function testInvalidStreamWrapper() { $this->expectException(InvalidStreamWrapperException::class); $this->expectExceptionMessage('Invalid stream wrapper: foo://'); $source = $this->createFile(); $this->fileRepository->move($source, 'foo://'); } Loading