Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ function lineShouldEndWithSemicolon(path) {
"property",
"string",
"boolean",
"number"
"number",
"nowdoc"
];
if (node.kind === "traituse") {
return !node.adaptations;
Expand Down
48 changes: 48 additions & 0 deletions tests/nowdoc/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`nowdoc.php 1`] = `
<?php

$str = <<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

$str = <<<'EOT'
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should not print a capital 'A': \\x41
EOT;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?php
$str = <<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

$str = <<<'EOT'
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should not print a capital 'A': \\x41
EOT;

`;

exports[`single.php 1`] = `
<?php
<<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?php
<<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

`;
1 change: 1 addition & 0 deletions tests/nowdoc/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run_spec(__dirname, ["php"]);
13 changes: 13 additions & 0 deletions tests/nowdoc/nowdoc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$str = <<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

$str = <<<'EOT'
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should not print a capital 'A': \x41
EOT;
6 changes: 6 additions & 0 deletions tests/nowdoc/single.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
<<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;