"foo",
"barfoo" => "foobar",
"foobar" => "barfoo",
- ]
+ ],
); ?>
element(
@@ -1183,7 +1183,7 @@ printWidth: 80
"bar" => "foo",
"barfoo" => "foobar",
"foobar" => "barfoo",
- ]
+ ],
); ?>
@@ -1803,7 +1803,7 @@ printWidth: 80
value="id); ?>"
chosen, true); ?>
data-text="order_button_text
+ $gateway->order_button_text,
); ?>"
@@ -1874,7 +1874,7 @@ func(
@@ -1882,7 +1882,7 @@ func(
@@ -1890,7 +1890,7 @@ func(
@@ -1898,7 +1898,7 @@ func(
@@ -1906,7 +1906,7 @@ func(
@@ -1914,7 +1914,7 @@ func(
@@ -1922,7 +1922,7 @@ func(
diff --git a/tests/isset/__snapshots__/jsfmt.spec.mjs.snap b/tests/isset/__snapshots__/jsfmt.spec.mjs.snap
index f94ba9377..88f261c05 100644
--- a/tests/isset/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/isset/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`isset.php 1`] = `
====================================options=====================================
@@ -60,14 +60,14 @@ class T
a->b);
isset(
$veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongVariable
->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongProperty
- ->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongProperty
+ ->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongProperty,
);
if (isset($var)) {
diff --git a/tests/kitchen_sink/__snapshots__/jsfmt.spec.mjs.snap b/tests/kitchen_sink/__snapshots__/jsfmt.spec.mjs.snap
index ea8553b76..b468e90a5 100644
--- a/tests/kitchen_sink/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/kitchen_sink/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`kitchen_sink.php 1`] = `
====================================options=====================================
@@ -77,7 +77,7 @@ if ($test == 1) {
function really_long_function(
$test2 = 1,
$long_parameter_name,
- $even_longer_longer_longer_longer_longer_parameter_name
+ $even_longer_longer_longer_longer_longer_parameter_name,
) {
return $test2;
}
diff --git a/tests/list/__snapshots__/jsfmt.spec.mjs.snap b/tests/list/__snapshots__/jsfmt.spec.mjs.snap
index 027a6c996..c21e367f4 100644
--- a/tests/list/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/list/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`list.php 1`] = `
====================================options=====================================
@@ -159,110 +159,110 @@ list(
$info = ["coffee", "brown", "caffeine"];
// Listing all the variables
-list($drink, $color, $power) = $info;
+[$drink, $color, $power] = $info;
echo "$drink is $color and $power makes it special.\\n";
// Listing some of them
-list($drink, , $power) = $info;
+[$drink, , $power] = $info;
echo "$drink has $power.\\n";
// Or let's skip to only the third one
-list(, , $power) = $info;
+[, , $power] = $info;
echo "I need $power!\\n";
// list() doesn't work with strings
-list($bar) = "abcde";
+[$bar] = "abcde";
var_dump($bar); // NULL
-while (list($id, $name, $salary) = $result->fetch(PDO::FETCH_NUM)) {
+while ([$id, $name, $salary] = $result->fetch(PDO::FETCH_NUM)) {
}
-list($a, list($b, $c)) = [1, [2, 3]];
+[$a, [$b, $c]] = [1, [2, 3]];
$info = ["coffee", "brown", "caffeine"];
-list($a[0], $a[1], $a[2]) = $info;
+[$a[0], $a[1], $a[2]] = $info;
-list("id" => $id1, "name" => $name1) = $data[0];
-list(
+["id" => $id1, "name" => $name1] = $data[0];
+[
"veryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryLongValue,
"veryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryLongValue,
-) = $data[0];
-list(
+] = $data[0];
+[
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryVeryVeryVeryVeryLongValue,
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryVeryVeryVeryVeryLongValue,
-) = $data[0];
+] = $data[0];
-foreach ($data as list("id" => $id, "name" => $name)) {
+foreach ($data as ["id" => $id, "name" => $name]) {
// logic here with $id and $name
}
foreach (
$data
- as list(
+ as [
"veryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryLongValue,
"veryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryLongValue,
- )
+ ]
) {
// logic here with $id and $name
}
foreach (
$data
- as list(
+ as [
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryVeryVeryVeryVeryLongValue,
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongKey" => $veryVeryVeryVeryVeryVeryVeryVeryVeryLongValue,
- )
+ ]
) {
// logic here with $id and $name
}
-list(, $b) = ["a", "b"];
-list(, , $c) = ["a", "b", "c"];
+[, $b] = ["a", "b"];
+[, , $c] = ["a", "b", "c"];
-while (list($id, $name, $salary) = $result->fetch(PDO::FETCH_NUM)) {
+while ([$id, $name, $salary] = $result->fetch(PDO::FETCH_NUM)) {
echo " \\n" .
" | $name | \\n" .
" $salary | \\n" .
"
\\n";
}
-list($a, list($b, $c)) = [1, [2, 3]];
+[$a, [$b, $c]] = [1, [2, 3]];
-list($a[0], $a[1], $a[2]) = $info;
+[$a[0], $a[1], $a[2]] = $info;
foreach ($data as ["id" => $id, "name" => $name]) {
echo "id: $id, name: $name\\n";
}
-list(0 => $first, 1 => $second, 2 => $three, 3 => $fourth) = $arr;
-list(
+[0 => $first, 1 => $second, 2 => $three, 3 => $fourth] = $arr;
+[
0 => $first,
1 => $second,
2 => $three,
3 => $fourth,
-) = $arr;
+] = $arr;
-list($first, $second, $three, $fourth) = $arr;
-list(, $first, $second, $three, $fourth) = $arr;
-list(, , $first, $second, $three, $fourth, ,) = $arr;
-list(, , $first, , $second, , $three, , $fourth, ,) = $arr;
-list(, , , $first, $second, $three, $fourth, , ,) = $arr;
-list(, , , $first, , , $second, , , $three, , , $fourth, , ,) = $arr;
+[$first, $second, $three, $fourth] = $arr;
+[, $first, $second, $three, $fourth] = $arr;
+[, , $first, $second, $three, $fourth, ,] = $arr;
+[, , $first, , $second, , $three, , $fourth, ,] = $arr;
+[, , , $first, $second, $three, $fourth, , ,] = $arr;
+[, , , $first, , , $second, , , $three, , , $fourth, , ,] = $arr;
-list(
+[
0 => $firstVeryVeryVeryVeryLong,
1 => $secondVeryVeryVeryVeryLong,
2 => $threeVeryVeryVeryVeryLong,
3 => $fourthVeryVeryVeryVeryLong,
-) = $arr;
-list(
+] = $arr;
+[
,
0 => $firstVeryVeryVeryVeryLong,
1 => $secondVeryVeryVeryVeryLong,
2 => $threeVeryVeryVeryVeryLong,
3 => $fourthVeryVeryVeryVeryLong,
-) = $arr;
-list(
+] = $arr;
+[
,
,
0 => $firstVeryVeryVeryVeryLong,
@@ -270,8 +270,8 @@ list(
2 => $threeVeryVeryVeryVeryLong,
3 => $fourthVeryVeryVeryVeryLong,
,
-) = $arr;
-list(
+] = $arr;
+[
,
,
0 => $firstVeryVeryVeryVeryLong,
@@ -282,8 +282,8 @@ list(
,
3 => $fourthVeryVeryVeryVeryLong,
,
-) = $arr;
-list(
+] = $arr;
+[
,
,
,
@@ -293,8 +293,8 @@ list(
3 => $fourthVeryVeryVeryVeryLong,
,
,
-) = $arr;
-list(
+] = $arr;
+[
,
,
,
@@ -310,9 +310,9 @@ list(
3 => $fourthVeryVeryVeryVeryLong,
,
,
-) = $arr;
+] = $arr;
-list(
+[
0 => $firstVeryVeryVeryVeryLong,
1 => $secondVeryVeryVeryVeryLong,
@@ -320,12 +320,12 @@ list(
2 => $threeVeryVeryVeryVeryLong,
3 => $fourthVeryVeryVeryVeryLong,
-) = $arr;
+] = $arr;
-list("id" => $id1, "name" => $name1) = $data[0];
+["id" => $id1, "name" => $name1] = $data[0];
["id" => $id1, "name" => $name1] = $data[0];
-foreach ($data as list("id" => $id, "name" => $name)) {
+foreach ($data as ["id" => $id, "name" => $name]) {
// logic here with $id and $name
}
@@ -339,60 +339,60 @@ function swap(&$a, &$b): void
}
$array = [1, 2];
-list($a, &$b) = $array;
[$a, &$b] = $array;
-list(&$a, $b, , list(&$c, $d)) = $array;
+[$a, &$b] = $array;
+[&$a, $b, , [&$c, $d]] = $array;
[&$a, $b, , [&$c, $d]] = $array;
-foreach ($array as list(&$a, $b)) {
+foreach ($array as [&$a, $b]) {
}
foreach ($array as [&$a, $b]) {
}
-list(0 => $var) = $arr;
-list(0 => $var) = $arr;
-list(, 0 => $var) = $arr;
-list(0 => $var) = $arr;
-list(
+[0 => $var] = $arr;
+[0 => $var] = $arr;
+[, 0 => $var] = $arr;
+[0 => $var] = $arr;
+[
0 => $var,
-) = $arr;
-list(
+] = $arr;
+[
,
0 => $var,
-) = $arr;
-list(
+] = $arr;
+[
,
0 => $var,
-) = $arr;
-list(
+] = $arr;
+[
,
0 => $var,
,
-) = $arr;
-list(
+] = $arr;
+[
0 => $var,
1 => $other_var,
-) = $arr;
-list(
+] = $arr;
+[
,
0 => $var,
1 => $other_var,
-) = $arr;
-list(
+] = $arr;
+[
,
0 => $var,
1 => $other_var,
-) = $arr;
-list(
+] = $arr;
+[
,
0 => $var,
1 => $other_var,
,
-) = $arr;
-list(0 => $var) = $arr;
-list(
+] = $arr;
+[0 => $var] = $arr;
+[
0 => $var,
-) = $arr;
+] = $arr;
================================================================================
`;
diff --git a/tests/member_chain/__snapshots__/jsfmt.spec.mjs.snap b/tests/member_chain/__snapshots__/jsfmt.spec.mjs.snap
index 283177c24..4d8631650 100644
--- a/tests/member_chain/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/member_chain/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`break-last-call.php 1`] = `
====================================options=====================================
@@ -34,7 +34,7 @@ function call($store)
actionWith([
"response" => $response,
"type" => $successType,
- ])
+ ]),
);
},
function ($error) {
@@ -42,9 +42,9 @@ function call($store)
actionWith([
"type" => $failureType,
"error" => $error->message || "Something bad happened",
- ])
+ ]),
);
- }
+ },
);
}
@@ -87,10 +87,10 @@ $superSupersuperSupersuperSupersuperSupersuperSuperLong->{$exampleOfOrderOfGette
$superSupersuperSupersuperSupersuperSupersuperSuperLong::$exampleOfOrderOfGetterAndSetterReordered;
$superSupersuperSupersuperSupersuperSupersuperSuperLong
::$exampleOfOrderOfGetterAndSetterReordered[0];
-$superSupersuperSupersuperSupersuperSupersuperSuperLong = (new SuperSuperSuperSuperSuperSuperLongClassName())
+$superSupersuperSupersuperSupersuperSupersuperSuperLong = new SuperSuperSuperSuperSuperSuperLongClassName()
->some_very_long_member_expression;
new $superSupersuperSupersuperSupersuperSupersuperSuperLong->superSupersuperSupersuperSupersuperSupersuperSuperLong->superSupersuperSupersuperSupersuperSupersuperSuperLong();
-(new $superSupersuperSupersuperSupersuperSupersuperSuperLong->superSupersuperSupersuperSupersuperSupersuperSuperLong->superSupersuperSupersuperSupersuperSupersuperSuperLong())
+new $superSupersuperSupersuperSupersuperSupersuperSuperLong->superSupersuperSupersuperSupersuperSupersuperSuperLong->superSupersuperSupersuperSupersuperSupersuperSuperLong()
->superSupersuperSupersuperSupersuperSupersuperSuperLong;
$test =
$superSupersuperSupersuperSupersuperSupersuperSuperLong->exampleOfOrderOfGetterAndSetterReordered;
@@ -241,7 +241,7 @@ $object[
: $helper->responseBody($defaultUser)
]->map();
-(new TestClassWithReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName())
+new TestClassWithReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName()
->map()
->filter();
@@ -470,7 +470,7 @@ return tap(
$this->forceFill([
"approver_id" => $user instanceof User ? $user->id : $user,
"approved_at" => $this->freshTimestamp(),
- ])
+ ]),
)->save();
return collect(parent::jsonSerialize())
@@ -518,7 +518,7 @@ $a = $t
->once();
$this->loooooooooooong->lookup = (int) $this->getRequest()->getParam(
- "some-param"
+ "some-param",
);
$this->loooooooooooong->lookup = (int) $variable
@@ -541,38 +541,38 @@ $aVariable = $theThing
bar()();
bar(
- "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong"
+ "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong",
)();
bar()(
- "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong"
+ "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong",
);
bar(
- "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong"
+ "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong",
)()()()()();
$foo->bar()();
$foo->bar(
- "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong"
+ "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong",
)();
$foo->bar()(
- "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong"
+ "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong",
);
$foo->bar(
- "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong"
+ "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong",
)()()()()();
$brian->hotel->orders()->ordered()->with("smith")->get();
$brian::$hotel->orders()->ordered()->with("smith")->get();
$brian["hotel"]->orders()->ordered()->with("smith")->get();
Foo::$hotel->orders()->ordered()->with("smith")->get();
-(new Foo())->hotel->orders()->ordered()->with("smith")->get();
+new Foo()->hotel->orders()->ordered()->with("smith")->get();
(clone $a)->hotel->orders()->ordered()->with("smith")->get();
$var = $brian->hotel->orders()->ordered()->with("smith")->get();
$var = $brian::$hotel->orders()->ordered()->with("smith")->get();
$var = $brian["hotel"]->orders()->ordered()->with("smith")->get();
$var = Foo::$hotel->orders()->ordered()->with("smith")->get();
-$var = (new Foo())->hotel->orders()->ordered()->with("smith")->get();
+$var = new Foo()->hotel->orders()->ordered()->with("smith")->get();
$var = (clone $a)->hotel->orders()->ordered()->with("smith")->get();
$var = Foo::keys($items)
@@ -583,10 +583,10 @@ $var = Foo::keys($items)
return $x * 2;
});
-(new static(func_get_args()))->push($this)->each(function ($item) {
+new static(func_get_args())->push($this)->each(function ($item) {
VarDumper::dump($item);
});
-(new static(func_get_args()))
+new static(func_get_args())
->offset(10)
->push($this)
->each(function ($item) {
@@ -641,7 +641,7 @@ $wrapper
->find("SomewhatLongNodeName")
->prop(
"longPropFunctionName",
- "second argument that pushes this group past 80 characters"
+ "second argument that pushes this group past 80 characters",
)
->then(function () {
doSomething();
@@ -812,8 +812,8 @@ $window
->first()
->second();
-(new Foo())->call($foo->bar->baz)->first()->second();
-(new Foo())
+new Foo()->call($foo->bar->baz)->first()->second();
+new Foo()
->call($foo->bar->baz->foo())
->first()
->second();
@@ -971,7 +971,7 @@ DB::table("identity")->insert([
]);
DB::table(
- "identity"
+ "identity",
)->insertReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName([
"ref" => $ref,
"handle" => $handle,
@@ -991,7 +991,7 @@ Logger::use_logger("albus")->info(
[
"uuid" => $uuid,
"requested_date" => $date,
- ]
+ ],
);
DBwithlongname::table("identity")
@@ -1031,7 +1031,7 @@ $page = TableRegistry::insertReallyReallyReallyReallyReallyReallyReallyReallyRea
$page = TableRegistry::insertReallyReallyReallyLongName("Pages")[0];
$page = TableRegistry::insertReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName(
- "Pages"
+ "Pages",
)[0];
$component = find(".org-lclp-edit-copy-url-banner__link")[0]
@@ -1053,7 +1053,7 @@ static::viewFactory()
$view ?: static::$defaultSimpleView,
array_merge($data, [
"paginator" => $this,
- ])
+ ]),
)
->render();
static::viewFactory()
@@ -1061,7 +1061,7 @@ static::viewFactory()
$view ?: static::$defaultSimpleView,
array_merge($data, [
"paginator" => $this,
- ])
+ ]),
)
->render();
self::viewFactory()
@@ -1069,7 +1069,7 @@ self::viewFactory()
$view ?: static::$defaultSimpleView,
array_merge($data, [
"paginator" => $this,
- ])
+ ]),
)
->render();
parent::viewFactory()
@@ -1077,7 +1077,7 @@ parent::viewFactory()
$view ?: static::$defaultSimpleView,
array_merge($data, [
"paginator" => $this,
- ])
+ ]),
)
->render();
@@ -1086,7 +1086,7 @@ Foo::viewFactory()
$view ?: static::$defaultSimpleView,
array_merge($data, [
"paginator" => $this,
- ])
+ ]),
)
->render();
diff --git a/tests/new/__snapshots__/jsfmt.spec.mjs.snap b/tests/new/__snapshots__/jsfmt.spec.mjs.snap
index d29025a20..177c147da 100644
--- a/tests/new/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/new/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,8 +1,9 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`new.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -225,7 +226,7 @@ $class = (new Foo([
"VeryVeryVeryVeryVeryVeryVeryVeryVeryLongValue",
]))->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongMethod();
$class = (new PendingDispatch(new $this->class(...func_get_args())))->chain(
- $this->chain
+ $this->chain,
);
$dumper = in_array(PHP_SAPI, ["cli", "phpdbg"])
? new CliDumper()
@@ -236,10 +237,10 @@ $class = new static(
"] with ID [" .
$model->getKey() .
"] to JSON: " .
- $message
+ $message,
);
$response = new \\Illuminate\\Http\\JsonResponse(
- new JsonResponseTestJsonSerializeObject()
+ new JsonResponseTestJsonSerializeObject(),
);
$result = (new Pipeline(new \\Illuminate\\Container\\Container()))
->send("foo")
@@ -250,62 +251,64 @@ $result = (new Pipeline(new \\Illuminate\\Container\\Container()))
$var = new Foo(
<<<'EOD'
-Example of string
-spanning multiple lines
-using nowdoc syntax.
-EOD
+ Example of string
+ spanning multiple lines
+ using nowdoc syntax.
+ EOD
,
- $arg
+ $arg,
);
$var = new Foo(
$arg,
<<<'EOD'
-Example of string
-spanning multiple lines
-using nowdoc syntax.
-EOD
+ Example of string
+ spanning multiple lines
+ using nowdoc syntax.
+ EOD
+ ,
);
$var = new Foo(
$arg,
<<<'EOD'
-Example of string
-spanning multiple lines
-using nowdoc syntax.
-EOD
+ Example of string
+ spanning multiple lines
+ using nowdoc syntax.
+ EOD
,
- $arg
+ $arg,
);
$var = new Foo(
<< "veryVeryVeryVeryVeryVeryVeryVeryVeryLongString",
"key3" => "veryVeryVeryVeryVeryVeryVeryVeryVeryLongString",
- ]
+ ],
) {
return $arg;
}
@@ -211,7 +211,7 @@ function bar2(
$arg =
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongString" .
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongString" .
- "veryVeryVeryVeryVeryVeryVeryVeryVeryLongString"
+ "veryVeryVeryVeryVeryVeryVeryVeryVeryLongString",
) {
return $arg;
}
@@ -219,7 +219,7 @@ function bar2(
function bar3(
$arg = "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString"
? "1"
- : "2"
+ : "2",
) {
return $arg;
}
@@ -227,7 +227,7 @@ function bar3(
function bar4(
string $arg = "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString"
? "1"
- : "2"
+ : "2",
) {
return $arg;
}
@@ -237,7 +237,7 @@ function bar5(
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongString" ===
"veryVeryVeryVeryVeryVeryVeryVeryVeryLongString"
? "1"
- : "2"
+ : "2",
) {
return $arg;
}
@@ -245,7 +245,7 @@ function bar5(
function foo(
$arg = 'string
string
-string'
+string',
) {}
function foo(
@@ -254,7 +254,7 @@ string
string',
$arg = 'string
string
-string'
+string',
) {}
function foo(
@@ -262,7 +262,7 @@ function foo(
$b = 'string
string
string',
- $c
+ $c,
) {}
================================================================================
diff --git a/tests/parens/__snapshots__/jsfmt.spec.mjs.snap b/tests/parens/__snapshots__/jsfmt.spec.mjs.snap
index ed2b205ba..ccb74dd00 100644
--- a/tests/parens/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/parens/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,8 +1,9 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`array.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -107,7 +108,6 @@ $var = [new stdClass()][0];
exports[`array.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -212,6 +212,7 @@ $var = [new stdClass()][0];
exports[`assign.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -426,7 +427,6 @@ switch ($i = 1) {
exports[`assign.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -641,6 +641,7 @@ switch ($i = 1) {
exports[`assignref.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -689,7 +690,6 @@ call($a = &$b);
exports[`assignref.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -738,6 +738,7 @@ call($a = &$b);
exports[`bin.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -1505,7 +1506,6 @@ $result = 2 ** ($number - 1);
exports[`bin.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2273,6 +2273,7 @@ $result = 2 ** ($number - 1);
exports[`block.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2296,7 +2297,6 @@ function foo()
exports[`block.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2320,6 +2320,7 @@ function foo()
exports[`break.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2354,7 +2355,6 @@ break 2;
exports[`break.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2389,6 +2389,7 @@ break 2;
exports[`call.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2507,7 +2508,6 @@ Foo::call($a = new Foo());
exports[`call.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2626,6 +2626,7 @@ Foo::call($a = new Foo());
exports[`cast.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -2827,7 +2828,6 @@ $timeout =
exports[`cast.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3029,6 +3029,7 @@ $timeout =
exports[`clone.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3107,7 +3108,6 @@ $var = (clone $var->foo)->foo;
exports[`clone.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3186,6 +3186,7 @@ $var = (clone $var->foo)->foo;
exports[`closure.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3239,7 +3240,6 @@ var_dump(...(function () use ($type) {})());
exports[`closure.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3293,6 +3293,7 @@ var_dump(...(function () use ($type) {})());
exports[`continue.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3327,7 +3328,6 @@ continue 2;
exports[`continue.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3362,6 +3362,7 @@ continue 2;
exports[`control-structures.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3567,7 +3568,7 @@ switch ($var = 1) {
switch ($var = 1) {
}
-while (list($id, $name, $salary) = $result->fetch(PDO::FETCH_NUM)) {
+while ([$id, $name, $salary] = $result->fetch(PDO::FETCH_NUM)) {
}
while ([$id, $name, $salary] = $result->fetch(PDO::FETCH_NUM)) {
}
@@ -3589,7 +3590,6 @@ do {
exports[`control-structures.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3817,6 +3817,7 @@ do {
exports[`declare.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3839,7 +3840,6 @@ $a->c();
exports[`declare.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3862,6 +3862,7 @@ $a->c();
exports[`echo.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3953,7 +3954,6 @@ echo (function () {
exports[`echo.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4045,6 +4045,7 @@ echo (function () {
exports[`empty.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4076,7 +4077,6 @@ if (empty($var)) {
exports[`empty.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4108,6 +4108,7 @@ if (empty($var)) {
exports[`eval.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4151,7 +4152,6 @@ if (eval("return 1;") === 1) {
exports[`eval.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4195,6 +4195,7 @@ if (eval("return 1;") === 1) {
exports[`exit.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4235,7 +4236,6 @@ call(exit(1));
exports[`exit.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4276,6 +4276,7 @@ call(exit(1));
exports[`include.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4359,7 +4360,6 @@ include $_GET["id"] . ".php";
exports[`include.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4443,6 +4443,7 @@ include $_GET["id"] . ".php";
exports[`isset.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4478,7 +4479,6 @@ if (isset($var)) {
exports[`isset.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4514,6 +4514,7 @@ if (isset($var)) {
exports[`lookups.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4706,7 +4707,6 @@ $var = (function () {
exports[`lookups.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4899,6 +4899,7 @@ $var = (function () {
exports[`namespace.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4921,7 +4922,6 @@ $a->c();
exports[`namespace.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4944,6 +4944,7 @@ $a->c();
exports[`new.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5027,7 +5028,7 @@ new Translator(
new MessageFormatter(),
"en",
[],
- ["foo" => "bar"]
+ ["foo" => "bar"],
); ?>
"bar",
@@ -5086,7 +5087,6 @@ $var = (new class {})->foo;
exports[`new.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5229,6 +5229,7 @@ $var = new class {}->foo;
exports[`parens.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5247,7 +5248,6 @@ include $test ? "foo" : "bar";
exports[`parens.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5266,6 +5266,7 @@ include $test ? "foo" : "bar";
exports[`pre-post.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5394,7 +5395,6 @@ $var = call(--$var->_uuidCounter);
exports[`pre-post.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5523,6 +5523,7 @@ $var = call(--$var->_uuidCounter);
exports[`print.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5622,7 +5623,6 @@ print ($var || $var) && $var;
exports[`print.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5722,6 +5722,7 @@ print ($var || $var) && $var;
exports[`program.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5740,7 +5741,6 @@ $a->c();
exports[`program.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5759,6 +5759,7 @@ $a->c();
exports[`retif.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -5904,7 +5905,6 @@ $var = new $foo() ? true : false;
exports[`retif.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6050,6 +6050,7 @@ $var = new $foo() ? true : false;
exports[`return.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6090,7 +6091,6 @@ return $this->customer->paymentService ?? null;
exports[`return.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6131,6 +6131,7 @@ return $this->customer->paymentService ?? null;
exports[`silent.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6225,7 +6226,7 @@ try {
handle_exception();
}
-@list($width, $height) = getimagesize($file);
+@[$width, $height] = getimagesize($file);
// Todo https://github.com/glayzzle/php-parser/issues/356
// @(list($width, $height) = getimagesize($file));
@@ -6244,7 +6245,6 @@ echo @(1 / 0);
exports[`silent.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6358,6 +6358,7 @@ echo @(1 / 0);
exports[`throw.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6411,7 +6412,6 @@ $value = $a ? $a : throw new \\InvalidArgumentException("In ternary");
exports[`throw.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6465,6 +6465,7 @@ $value = $a ? $a : throw new \\InvalidArgumentException("In ternary");
exports[`unary.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6609,7 +6610,6 @@ if (!($token = $this->getToken())) {
exports[`unary.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6754,6 +6754,7 @@ if (!($token = $this->getToken())) {
exports[`unnecessary.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6876,7 +6877,6 @@ function foo($a = 1, $b = "string", $c = true, $d = __LINE__)
exports[`unnecessary.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
@@ -6999,6 +6999,7 @@ function foo($a = 1, $b = "string", $c = true, $d = __LINE__)
exports[`yield.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "8.3"
printWidth: 80
| printWidth
=====================================input======================================
@@ -7096,7 +7097,6 @@ function gen_one_to_three()
exports[`yield.php 2`] = `
====================================options=====================================
parsers: ["php"]
-phpVersion: "8.4"
printWidth: 80
| printWidth
=====================================input======================================
diff --git a/tests/parens/jsfmt.spec.mjs b/tests/parens/jsfmt.spec.mjs
index a2c158328..354bc7ea5 100644
--- a/tests/parens/jsfmt.spec.mjs
+++ b/tests/parens/jsfmt.spec.mjs
@@ -1,2 +1,2 @@
+run_spec(import.meta, ["php"], {phpVersion:"8.3"});
run_spec(import.meta, ["php"]);
-run_spec(import.meta, ["php"], { phpVersion: "8.4" });
diff --git a/tests/preserve_line/__snapshots__/jsfmt.spec.mjs.snap b/tests/preserve_line/__snapshots__/jsfmt.spec.mjs.snap
index 45c50c6ef..5a67bb15a 100644
--- a/tests/preserve_line/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/preserve_line/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`argument-list.php 1`] = `
====================================options=====================================
@@ -209,14 +209,14 @@ longArgNamesWithComments(
$longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,
/* Hello World */
- $longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3
+ $longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3,
);
shortArgNames(
$short,
$short2,
- $short3
+ $short3,
);
comments(
@@ -235,7 +235,7 @@ comments(
/* Long Long Long Long Long Comment */
// Long Long Long Long Long Comment
- $short3
+ $short3,
// More comments
);
@@ -244,7 +244,7 @@ differentArgTypes(
return true;
},
- isTrue ? doSomething() : 12
+ isTrue ? doSomething() : 12,
);
moreArgTypes(
@@ -261,31 +261,31 @@ moreArgTypes(
// Hello world again
["name" => "Hello World", "age" => 34],
- $oneThing + $anotherThing
+ $oneThing + $anotherThing,
// Comment
- )
+ ),
);
evenMoreArgTypes(
doSomething(
["name" => "Hello World", "age" => 34],
- true
+ true,
),
14,
1 + 2 - 90 / 80,
- !98 * 60 - 90
+ !98 * 60 - 90,
);
$foo->apply(
null,
// Array here
- [1, 2]
+ [1, 2],
);
$bar->on(
@@ -293,7 +293,7 @@ $bar->on(
function () {
doStuff();
- }
+ },
);
foo(
@@ -302,7 +302,7 @@ foo(
/* function here */
function () {
return true;
- }
+ },
);
$doSomething->apply(
@@ -310,13 +310,13 @@ $doSomething->apply(
// Comment
- ["Hello world 1", "Hello world 2", "Hello world 3"]
+ ["Hello world 1", "Hello world 2", "Hello world 3"],
);
doAnotherThing(
"node",
- [$solution_type, $time_frame]
+ [$solution_type, $time_frame],
);
$stuff->doThing(
@@ -327,7 +327,7 @@ $stuff->doThing(
"accept" => function ($node) {
doSomething($node);
},
- ]
+ ],
);
doThing(
@@ -339,7 +339,7 @@ doThing(
"decline" => function ($creditCard) {
takeMoney($creditCard);
},
- ]
+ ],
);
func(
@@ -347,7 +347,7 @@ func(
thing();
},
- ["yes" => true, "no" => 5]
+ ["yes" => true, "no" => 5],
);
doSomething(
@@ -358,7 +358,7 @@ doSomething(
/* Comment */
// This is important
- [$helloWorld, $someImportantStuff]
+ [$helloWorld, $someImportantStuff],
);
================================================================================
diff --git a/tests/print/__snapshots__/jsfmt.spec.mjs.snap b/tests/print/__snapshots__/jsfmt.spec.mjs.snap
index d93a2e400..922788033 100644
--- a/tests/print/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/print/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`print.php 1`] = `
====================================options=====================================
@@ -229,10 +229,10 @@ print esc_html(
__(
"Hi there. Your recent order on %s has been completed. " .
"Your order details are shown below for your reference:",
- "woocommerce"
+ "woocommerce",
),
- get_option("blogname")
- )
+ get_option("blogname"),
+ ),
);
print << "very_very_very_long_other_value",
];
public $var8 = <<<'EOD'
-hello world
-EOD;
+ hello world
+ EOD;
public $var9 = 11111111111111111111111111111111111111111111111111111111111111111111;
public $var10 = "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString";
public $var11 = true;
diff --git a/tests/propertylookup/__snapshots__/jsfmt.spec.mjs.snap b/tests/propertylookup/__snapshots__/jsfmt.spec.mjs.snap
index e0378115a..bbd1aa97f 100644
--- a/tests/propertylookup/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/propertylookup/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`offsets.php 1`] = `
====================================options=====================================
@@ -115,7 +115,7 @@ $this->loooooooooooong->loooooooooooong->loooooooooooong->lookup =
$this->loooooooooooong->loooooooooooong->loooooooooooong->lookup =
$other->looooooooooong->stuff;
$this->loooooooooooong->lookup = (int) $this->getRequest()->getParam(
- "instance-resource-id"
+ "instance-resource-id",
);
$obj->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongProperty;
diff --git a/tests/retif/__snapshots__/jsfmt.spec.mjs.snap b/tests/retif/__snapshots__/jsfmt.spec.mjs.snap
index 94fc73a9f..49603a8d0 100644
--- a/tests/retif/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/retif/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`retif.php 1`] = `
====================================options=====================================
@@ -259,7 +259,7 @@ $test =
bar(
$someOtherReallyReallyLongVariable,
$someOtherReallyReallyLongVariable,
- $someOtherReallyReallyLongVariable
+ $someOtherReallyReallyLongVariable,
);
$test =
$testReallyReallyReallyReallyReallyReallyLong >= 1 ?:
@@ -445,7 +445,7 @@ call(
function () {
return 1;
},
- $var ? 1 : 2
+ $var ? 1 : 2,
);
call(
@@ -454,7 +454,7 @@ call(
},
$someOtherReallyReallyLongVariable
? $someOtherReallyReallyLongVariable
- : $someOtherReallyReallyLongVariable
+ : $someOtherReallyReallyLongVariable,
);
call(
@@ -464,7 +464,7 @@ call(
$someOtherReallyReallyLongVariable ?:
$someOtherReallyReallyLongVariable ?:
$someOtherReallyReallyLongVariable ?:
- "test"
+ "test",
);
$var = [
@@ -553,13 +553,13 @@ call($var ?: $var ?: $var ?: "string");
call(
$someOtherReallyReallyLongVariable
? $someOtherReallyReallyLongVariable
- : $someOtherReallyReallyLongVariable
+ : $someOtherReallyReallyLongVariable,
);
call(
$someOtherReallyReallyLongVariable ?:
$someOtherReallyReallyLongVariable ?:
$someOtherReallyReallyLongVariable ?:
- "string"
+ "string",
);
exit($var ? "string" : "other-string");
diff --git a/tests/return/__snapshots__/jsfmt.spec.mjs.snap b/tests/return/__snapshots__/jsfmt.spec.mjs.snap
index c1c416e4a..45146d195 100644
--- a/tests/return/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/return/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`return.php 1`] = `
====================================options=====================================
@@ -425,7 +425,7 @@ return new Foo(
1024,
$veryVeryVeryVeryVeryVeryLongLine,
true,
- false
+ false,
);
return new Foo(
$arg,
@@ -433,7 +433,7 @@ return new Foo(
1024,
$veryVeryVeryVeryVeryVeryLongLine,
true,
- false
+ false,
) . "string";
return "string" .
new Foo(
@@ -442,7 +442,7 @@ return "string" .
1024,
$veryVeryVeryVeryVeryVeryLongLine,
true,
- false
+ false,
);
return [];
@@ -469,12 +469,12 @@ return $packages || [
];
return $this->events->until(
- new Events\\NotificationSending($notifiable, $notification, $channel)
+ new Events\\NotificationSending($notifiable, $notification, $channel),
) !== false;
return false !==
$this->events->until(
- new Events\\NotificationSending($notifiable, $notification, $channel)
+ new Events\\NotificationSending($notifiable, $notification, $channel),
);
return $this->getOptions()["endpoint"] ??
@@ -488,7 +488,7 @@ return $this->channels[$name] ??
with($this->resolve($name), function ($logger) use ($name) {
return $this->channels[$name] = $this->tap(
$name,
- new Logger($logger, $this->app["events"])
+ new Logger($logger, $this->app["events"]),
);
});
@@ -530,7 +530,7 @@ return $this->guards[$name] ??
($this->guards[$name] = $this->resolve($veryVeryVeryLongVariable));
return $this->guards[$veryVeryVeryLongVariable] ??
($this->guards[$veryVeryVeryLongVariable] = $this->resolve(
- $veryVeryVeryLongVariable
+ $veryVeryVeryLongVariable,
));
return call_user_func($this->passwordValidator, $credentials) &&
diff --git a/tests/silent/__snapshots__/jsfmt.spec.mjs.snap b/tests/silent/__snapshots__/jsfmt.spec.mjs.snap
index 77637a202..523f38a29 100644
--- a/tests/silent/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/silent/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`silent.php 1`] = `
====================================options=====================================
@@ -41,7 +41,7 @@ $variable = @foo()
$variable = @foo(
"VeryVeryVeryVeryVeryVeryLongArgument",
"VeryVeryVeryVeryVeryVeryLongArgument",
- "VeryVeryVeryVeryVeryVeryLongArgument"
+ "VeryVeryVeryVeryVeryVeryLongArgument",
);
@trigger_error($error, E_USER_DEPRECATED);
$value = @$cache[$key];
diff --git a/tests/single-quote-api/jsfmt.spec.mjs b/tests/single-quote-api/jsfmt.spec.mjs
index c95b4ab03..bb9db6fb7 100644
--- a/tests/single-quote-api/jsfmt.spec.mjs
+++ b/tests/single-quote-api/jsfmt.spec.mjs
@@ -13,7 +13,7 @@ test(`singleQuote option on format api`, async () => {
const expected = `
`;
diff --git a/tests/staticlookup/__snapshots__/jsfmt.spec.mjs.snap b/tests/staticlookup/__snapshots__/jsfmt.spec.mjs.snap
index 101adee06..121cb5059 100644
--- a/tests/staticlookup/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/staticlookup/__snapshots__/jsfmt.spec.mjs.snap
@@ -344,7 +344,7 @@ $var = $var[0]::foo;
$var = $var[0][1]::foo;
$var = $var[0][1]::foo;
$var = $var[0][1]::foo;
-$var = (new Foo())::bar;
+$var = new Foo()::bar;
$var = Foo::$bar["baz"]();
$var = Foo::$bar["baz"]();
$var = Foo::{$bar["baz"]}();
diff --git a/tests/string/__snapshots__/jsfmt.spec.mjs.snap b/tests/string/__snapshots__/jsfmt.spec.mjs.snap
index edef47687..a166868aa 100644
--- a/tests/string/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/string/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`multiline.php 1`] = `
====================================options=====================================
@@ -308,7 +308,7 @@ $string = "This is the value of the var named by the return value of getName():
$string = "This is the value of the var named by the return value of getName(): {\${getName(
$arg1,
$arg2,
- $arg3
+ $arg3,
)}}";
$string = "This is the value of the var named by the return value of \\$object->getName(): {\${$object->getName()}}";
$string = "I'd like an {\${beers::softdrink}}\\n";
diff --git a/tests/sys/__snapshots__/jsfmt.spec.mjs.snap b/tests/sys/__snapshots__/jsfmt.spec.mjs.snap
index 25eefe8ec..6cbfb3562 100644
--- a/tests/sys/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/sys/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`sys.php 1`] = `
====================================options=====================================
@@ -40,12 +40,12 @@ echo "test echo";
echo $test, $other;
$info = ["coffee", "brown", "caffeine"];
-list($drink, $color, $power) = $info;
-list(
+[$drink, $color, $power] = $info;
+[
$reallyReallyReallyReallyLongName,
$otherReallyReallyReallyLongName,
$lastOne,
-) = $info;
+] = $info;
print "test print";
print "parens test";
@@ -68,7 +68,7 @@ isset(
$test,
$test,
$test,
- $test
+ $test,
);
isset($test["foo"]);
diff --git a/tests/trailing_commas/__snapshots__/jsfmt.spec.mjs.snap b/tests/trailing_commas/__snapshots__/jsfmt.spec.mjs.snap
index 6650f4f14..c570a1a63 100644
--- a/tests/trailing_commas/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/trailing_commas/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,8 +1,9 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`array.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
| printWidth
=====================================input======================================
@@ -1753,6 +1754,7 @@ $expected = [
exports[`array.php 5`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
trailingComma: "all"
trailingCommaPHP: false
@@ -2179,6 +2181,7 @@ EOT
exports[`call.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3359,6 +3362,7 @@ $sel = $this->connections
exports[`call.php 5`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
trailingComma: "all"
trailingCommaPHP: false
@@ -3654,6 +3658,7 @@ $sel = $this->connections
exports[`isset.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
| printWidth
=====================================input======================================
@@ -3756,6 +3761,7 @@ var_dump(
exports[`isset.php 5`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
trailingComma: "all"
trailingCommaPHP: false
@@ -3782,6 +3788,7 @@ var_dump(
exports[`list.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4180,6 +4187,7 @@ list(,,,0 => $firstVeryVeryVeryVeryLong,,, 1 => $secondVeryVeryVeryVeryLong,,, 2
exports[`list.php 5`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
trailingComma: "all"
trailingCommaPHP: false
@@ -4280,6 +4288,7 @@ list(
exports[`unset.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4378,6 +4387,7 @@ unset(
exports[`unset.php 5`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
trailingComma: "all"
trailingCommaPHP: false
@@ -4403,6 +4413,7 @@ unset(
exports[`use.php 1`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
| printWidth
=====================================input======================================
@@ -4609,6 +4620,7 @@ use other_foo\\bar\\{
exports[`use.php 5`] = `
====================================options=====================================
parsers: ["php"]
+phpVersion: "7.0"
printWidth: 80
trailingComma: "all"
trailingCommaPHP: false
diff --git a/tests/trailing_commas/jsfmt.spec.mjs b/tests/trailing_commas/jsfmt.spec.mjs
index 695bbbc83..a9c95d350 100644
--- a/tests/trailing_commas/jsfmt.spec.mjs
+++ b/tests/trailing_commas/jsfmt.spec.mjs
@@ -1,8 +1,9 @@
-run_spec(import.meta, ["php"]);
+run_spec(import.meta, ["php"], { phpVersion: "7.0" });
run_spec(import.meta, ["php"], { trailingCommaPHP: true, phpVersion: "5.0" });
run_spec(import.meta, ["php"], { trailingCommaPHP: true, phpVersion: "7.2" });
run_spec(import.meta, ["php"], { trailingCommaPHP: true, phpVersion: "7.3" });
run_spec(import.meta, ["php"], {
trailingCommaPHP: false,
+ phpVersion: "7.0",
trailingComma: "all",
});
diff --git a/tests/unset/__snapshots__/jsfmt.spec.mjs.snap b/tests/unset/__snapshots__/jsfmt.spec.mjs.snap
index 949971bb3..3384bb48a 100644
--- a/tests/unset/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/unset/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`unset.php 1`] = `
====================================options=====================================
@@ -22,14 +22,14 @@ unset($veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryL
a->b);
unset(
$veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongVariable
->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongProperty
- ->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongProperty
+ ->veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongProperty,
);
================================================================================
diff --git a/tests/use/__snapshots__/jsfmt.spec.mjs.snap b/tests/use/__snapshots__/jsfmt.spec.mjs.snap
index f3b09702d..dca64bca2 100644
--- a/tests/use/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/use/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`use.php 1`] = `
====================================options=====================================
@@ -64,7 +64,7 @@ use Vendor\\Package\\SomeNamespace\\{
SubnamespaceOne\\ClassA,
SubnamespaceOne\\ClassB,
SubnamespaceTwo\\ClassY,
- ClassZ
+ ClassZ,
};
use Mizo\\Web\\{
Php\\WebSite,
@@ -74,7 +74,7 @@ use Mizo\\Web\\{
function JS\\printTotal,
function JS\\printList,
const JS\\BUAIKUM,
- const JS\\MAUTAM
+ const JS\\MAUTAM,
};
use Illuminate\\Foundation\\Bootstrap\\BootProviders;
use function some\\Full\\fn_a;
diff --git a/tests/variadic/__snapshots__/jsfmt.spec.mjs.snap b/tests/variadic/__snapshots__/jsfmt.spec.mjs.snap
index 4f7205633..64025ce9f 100644
--- a/tests/variadic/__snapshots__/jsfmt.spec.mjs.snap
+++ b/tests/variadic/__snapshots__/jsfmt.spec.mjs.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`variadic.php 1`] = `
====================================options=====================================
@@ -41,7 +41,7 @@ function f($req, $opt = null, ...$params)
'$req: %d; $opt: %d; number of params: %d' . "\\n",
$req,
$opt,
- count($params)
+ count($params),
);
}