diff --git a/src/needs-parens.mjs b/src/needs-parens.mjs index 8ea379e2c..2bbf380ff 100644 --- a/src/needs-parens.mjs +++ b/src/needs-parens.mjs @@ -166,7 +166,7 @@ function needsParens(path, options) { return false; } else if (parent.kind === "assign") { return false; - } else if (parent.kind === "static") { + } else if (parent.kind === "staticvariable") { return false; } else if ( ["if", "do", "while", "foreach", "switch"].includes(parent.kind) diff --git a/tests/static/__snapshots__/jsfmt.spec.mjs.snap b/tests/static/__snapshots__/jsfmt.spec.mjs.snap index b7053ed68..ac5bf294c 100644 --- a/tests/static/__snapshots__/jsfmt.spec.mjs.snap +++ b/tests/static/__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[`static.php 1`] = ` ====================================options===================================== @@ -43,6 +43,8 @@ string string', $b = 'string string string'; +static $x = $a = 1; +static $x = $a = $b = 1; =====================================output=====================================