diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/functions-php.iml b/.idea/functions-php.iml new file mode 100644 index 0000000..720d2ab --- /dev/null +++ b/.idea/functions-php.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e6489dc --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..0e09af4 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/composer.json b/composer.json index 0010f7d..381de60 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,6 @@ "keywords": ["supabase","functions", "functions-php"], "homepage": "https://github.com/supabase-community/functions-php", "autoload": { - "psr-0": { "": "src/" }, "psr-4": { "Supabase\\Functions\\": "src/" } diff --git a/src/Functions/FunctionsClient.php b/src/Functions/FunctionsClient.php index b7caa1a..e1deadb 100644 --- a/src/Functions/FunctionsClient.php +++ b/src/Functions/FunctionsClient.php @@ -4,10 +4,11 @@ * A PHP client library to interact with Supabase Edge Functions. */ -namespace Supabase\Functions; +namespace Supabase\Util; + use Psr\Http\Message\ResponseInterface; -use Supabase\Util\Request; +use Supabase\Functions\Util\Request; class FunctionsClient { diff --git a/src/Util/EnvSetup.php b/src/Util/EnvSetup.php deleted file mode 100644 index 0403283..0000000 --- a/src/Util/EnvSetup.php +++ /dev/null @@ -1,40 +0,0 @@ -safeLoad(); - if (key_exists('API_KEY', $loaded)) { - $apiKey = $loaded['API_KEY']; - } - - if (key_exists('REFERENCE_ID', $loaded)) { - $refId = $loaded['REFERENCE_ID']; - } - } - - if (empty($apiKey)) { - throw new \Exception('Could not load API_KEY'); - } - - if (empty($refId)) { - throw new \Exception('Could not load REFERENCE_ID'); - } - - return [ - 'API_KEY' => $apiKey, - 'REFERENCE_ID' => $refId, - ]; - } -} diff --git a/tests/integration/FunctionsTest.php b/tests/integration/FunctionsTest.php index 211acbd..e571e39 100644 --- a/tests/integration/FunctionsTest.php +++ b/tests/integration/FunctionsTest.php @@ -4,7 +4,7 @@ use PHPUnit\Framework\TestCase; use Supabase\Functions\FunctionsClient; -use Supabase\Functions\Util\EnvSetup; +use Supabase\Common\EnvSetup; final class FunctionsTest extends TestCase {