Skip to content

Commit 15ab72a

Browse files
committed
Add use statement to bin
1 parent e0454cd commit 15ab72a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/sql-formatter

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env php
22
<?php
33

4-
if("cli" !== php_sapi_name()) {
4+
use Doctrine\SqlFormatter\SqlFormatter;
5+
6+
if('cli' !== php_sapi_name()) {
57
echo "<p>Run this PHP script from the command line to see CLI syntax highlighting and formatting. It supports Unix pipes or command line argument style.</p>";
68
echo "<pre><code>php bin/sql-formatter \"SELECT * FROM MyTable WHERE (id>5 AND \\`name\\` LIKE \\&quot;testing\\&quot;);\"</code></pre>";
79
echo "<pre><code>echo \"SELECT * FROM MyTable WHERE (id>5 AND \\`name\\` LIKE \\&quot;testing\\&quot;);\" | php bin/sql-formatter</code></pre>";
@@ -27,4 +29,4 @@ foreach ($autoloadFiles as $autoloadFile) {
2729
}
2830
}
2931

30-
echo (new \Doctrine\SqlFormatter\SqlFormatter())->format($sql);
32+
echo (new SqlFormatter())->format($sql);

0 commit comments

Comments
 (0)