Skip to content

Commit 250077c

Browse files
committed
Fix compatibility by removing type constraints
1 parent 957c2f3 commit 250077c

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

ChangeLog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ JSON for the XP Framework ChangeLog
66
## 5.1.0 / 2024-03-24
77

88
* Made compatible with XP 12 - @thekid
9-
109
* Added PHP 8.4 to test matrix - @thekid
1110

1211
## 5.0.4 / 2023-04-17

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class FileOutput extends Output {
1919
* Creates a new instance
2020
*
2121
* @param var $arg Either an io.File object or a file name
22-
* @param text.json.Format $format
22+
* @param ?text.json.Format $format
2323
*/
24-
public function __construct($arg, Format $format= null) {
24+
public function __construct($arg, $format= null) {
2525
parent::__construct($format);
2626
if ($arg instanceof File) {
2727
$this->file= $arg;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public static function write($value, Output $output) {
3838
* Returns the output as a string
3939
*
4040
* @param var $value
41-
* @param text.json.Format $format
41+
* @param ?text.json.Format $format
4242
* @return string
4343
*/
44-
public static function of($value, Format $format= null) {
44+
public static function of($value, $format= null) {
4545
$output= new StringOutput($format ?: Format::$DEFAULT);
4646
$output->write($value);
4747
return $output->bytes();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ abstract class Output implements Value {
99
/**
1010
* Creates a new instance
1111
*
12-
* @param text.json.Format $format
12+
* @param ?text.json.Format $format
1313
*/
14-
public function __construct(Format $format= null) {
15-
$this->format= $format ?: Format::$DEFAULT;
14+
public function __construct($format= null) {
15+
$this->format= $format ?? Format::$DEFAULT;
1616
}
1717

1818
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class StreamOutput extends Output {
1919
* Creates a new instance
2020
*
2121
* @param io.streams.OutputStream $out
22-
* @param text.json.Format $format
22+
* @param ?text.json.Format $format
2323
*/
24-
public function __construct(OutputStream $out, Format $format= null) {
24+
public function __construct(OutputStream $out, $format= null) {
2525
parent::__construct($format);
2626
$this->stream= $out;
2727
}

0 commit comments

Comments
 (0)