diff --git a/bin/sql-formatter b/bin/sql-formatter index d3079ef..9ff7331 100755 --- a/bin/sql-formatter +++ b/bin/sql-formatter @@ -1,7 +1,9 @@ #!/usr/bin/env php Run this PHP script from the command line to see CLI syntax highlighting and formatting. It supports Unix pipes or command line argument style.
"; echo "php bin/sql-formatter \"SELECT * FROM MyTable WHERE (id>5 AND \\`name\\` LIKE \\"testing\\");\"
";
echo "echo \"SELECT * FROM MyTable WHERE (id>5 AND \\`name\\` LIKE \\"testing\\");\" | php bin/sql-formatter
";
@@ -27,4 +29,4 @@ foreach ($autoloadFiles as $autoloadFile) {
}
}
-echo (new \Doctrine\SqlFormatter\SqlFormatter())->format($sql);
+echo (new SqlFormatter())->format($sql);
diff --git a/examples/cli.php b/examples/cli.php
index b924414..1023a30 100644
--- a/examples/cli.php
+++ b/examples/cli.php
@@ -2,6 +2,11 @@
declare(strict_types=1);
+use Doctrine\SqlFormatter\SqlFormatter;
+use Doctrine\SqlFormatter\Tokenizer;
+
+require_once __DIR__ . '/../vendor/autoload.php';
+
if (PHP_SAPI !== 'cli') :?>
Run this php script from the command line to see CLI syntax highlighting and
@@ -23,11 +28,6 @@
$sql = stream_get_contents($fp);
}
-require_once __DIR__ . '/../vendor/autoload.php';
-
-use Doctrine\SqlFormatter\SqlFormatter;
-use Doctrine\SqlFormatter\Tokenizer;
-
assert($sql !== false);
echo (new SqlFormatter())->format($sql);
diff --git a/examples/examples.php b/examples/examples.php
index f34b55f..3c5c1a2 100644
--- a/examples/examples.php
+++ b/examples/examples.php
@@ -2,12 +2,12 @@
declare(strict_types=1);
-require_once __DIR__ . '/../vendor/autoload.php';
-
use Doctrine\SqlFormatter\NullHighlighter;
use Doctrine\SqlFormatter\SqlFormatter;
use Doctrine\SqlFormatter\Tokenizer;
+require_once __DIR__ . '/../vendor/autoload.php';
+
$formatter = new SqlFormatter();
// Example statements for formatting and highlighting
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index fe9fbb4..65ce6a3 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -18,13 +18,13 @@