Skip to content

Commit

Permalink
doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorris committed Dec 16, 2023
1 parent 8da6708 commit cc576fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/src/test/php.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ describe.each(SupportedPHPVersions)('PHP %s', (phpVersion) => {
php.mkdir(testDirPath1);
php.mkdir(testDirPath2);
php.writeFile(testDirPath1 + '/1.txt', '1');
php.cp(testDirPath1 + '/1.txt', testDirPath2, { recursive: true });
php.cp(testDirPath1 + '/1.txt', testDirPath2);
expect(php.fileExists(testDirPath2 + '/1.txt')).toEqual(true);
expect(php.readFileAsText(testDirPath2 + '/1.txt')).toEqual('1');
});
Expand Down
12 changes: 11 additions & 1 deletion packages/php-wasm/universal/src/lib/universal-php.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,17 @@ export interface IsomorphicLocalPHP extends RequestHandler {

/**
* Copies a file or directory in the PHP filesystem to a
* new location.
* new location. The target directory's parent must be a
* valid location in the filesystem prior to copying.
*
* If the target path is a file that already exists,
* it will be overwritten.
*
* If the target path is a directory that already exists,
* the file or directory will be copied into it.
*
* If the target path's parent directory does not exist,
* an error will be thrown.
*
* @param oldPath The file or directory to be copied.
* @param newPath The new, full path to copy the file or directory to.
Expand Down

0 comments on commit cc576fc

Please sign in to comment.