From 332bedb6d881664f5980a9267be65463511df85a Mon Sep 17 00:00:00 2001 From: Grant Gaudet Date: Mon, 13 Nov 2023 18:11:00 -0700 Subject: [PATCH] Update psr-4 loader. --- composer.json | 4 ++-- composer.lock | 12 ++++++------ src/TwigRenderer.php | 2 +- src/server--async.php | 4 ++-- src/server--sync.php | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index ee38f96..c762e45 100644 --- a/composer.json +++ b/composer.json @@ -4,12 +4,12 @@ "license": "MIT", "autoload": { "psr-4": { - "BasaltInc\\TwigRenderer\\": "dist/" + "BasaltInc\\": "dist/" } }, "autoload-dev": { "psr-4": { - "BasaltInc\\TwigRenderer\\Tests\\": "tests/" + "BasaltInc\\Tests\\": "tests/" } }, "config": { diff --git a/composer.lock b/composer.lock index f40e334..90d3e3d 100644 --- a/composer.lock +++ b/composer.lock @@ -1291,16 +1291,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.38.0", + "version": "v3.38.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "7e6070026e76aa09d77a47519625c86593fb8e31" + "reference": "d872cdd543797ade030aaa307c0a4954a712e081" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7e6070026e76aa09d77a47519625c86593fb8e31", - "reference": "7e6070026e76aa09d77a47519625c86593fb8e31", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d872cdd543797ade030aaa307c0a4954a712e081", + "reference": "d872cdd543797ade030aaa307c0a4954a712e081", "shasum": "" }, "require": { @@ -1372,7 +1372,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.38.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.38.2" }, "funding": [ { @@ -1380,7 +1380,7 @@ "type": "github" } ], - "time": "2023-11-07T08:44:54+00:00" + "time": "2023-11-14T00:19:22+00:00" }, { "name": "myclabs/deep-copy", diff --git a/src/TwigRenderer.php b/src/TwigRenderer.php index f4e1a0c..7983769 100644 --- a/src/TwigRenderer.php +++ b/src/TwigRenderer.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace BasaltInc\TwigRenderer; +namespace BasaltInc; use Twig\Environment; use Twig\Loader\ArrayLoader; diff --git a/src/server--async.php b/src/server--async.php index 3b7dd9a..e5b7883 100644 --- a/src/server--async.php +++ b/src/server--async.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use BasaltInc\TwigRenderer\TwigRenderer; +use BasaltInc\TwigRenderer; use Psr\Http\Message\ServerRequestInterface; use React\EventLoop\Loop; use React\Http\Response; @@ -10,7 +10,7 @@ use React\Promise\Promise; use React\Socket\SocketServer; -require __DIR__.'/../vendor/autoload.php'; +require_once dirname(__DIR__).'/vendor/autoload.php'; // CLI args $port = $argv[1]; diff --git a/src/server--sync.php b/src/server--sync.php index 82a929d..200eb13 100644 --- a/src/server--sync.php +++ b/src/server--sync.php @@ -4,9 +4,9 @@ // WARNING: not tested nor supported (though it's very close to working) - actual support is on `server--async.php`. -require dirname(__DIR__).'/vendor/autoload.php'; +use BasaltInc\TwigRenderer; -use BasaltInc\TwigRenderer\TwigRenderer; +require dirname(__DIR__).'/vendor/autoload.php'; // HTTP Status Codes Used // 200 OK - The standard response for successful HTTP requests.