Skip to content

Commit 5e2fa8e

Browse files
committed
Use type union syntax, rename constructor parameter
1 parent d38b2a8 commit 5e2fa8e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/php/text/json/FileOutput.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ class FileOutput extends Output {
1818
/**
1919
* Creates a new instance
2020
*
21-
* @param var $arg Either an io.File object or a file name
21+
* @param string|io.File $target
2222
* @param ?text.json.Format $format
2323
*/
24-
public function __construct($arg, $format= null) {
24+
public function __construct($target, $format= null) {
2525
parent::__construct($format);
26-
if ($arg instanceof File) {
27-
$this->file= $arg;
26+
if ($target instanceof File) {
27+
$this->file= $target;
2828
$this->wasOpen= $this->file->isOpen();
2929
} else {
30-
$this->file= new File($arg);
30+
$this->file= new File($target);
3131
$this->wasOpen= false;
3232
}
3333
$this->wasOpen || $this->file->open(File::WRITE);

0 commit comments

Comments
 (0)