File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11<?php
22namespace Supabase \Supabase ;
3+ use Exception ;
34
45class Supabase
56{
@@ -10,14 +11,14 @@ class Supabase
1011 protected $ url ;
1112 public $ data ;
1213
13- public function __construct ($ url =null , $ apikey =null )
14- {
15-
16- if (isset ($ url ) && isset ($ apikey )) {
17- $ this ->apikey = $ apikey ;
18- $ this ->project_id = $ url ;
14+ public function __construct ($ url =null , $ apikey =null ){
15+ if (!isset ($ url )){
16+ throw new Exception ("Supabase URL must be specified " );
17+ } elseif (!isset ($ apikey )){
18+ throw new Exception ("Supabase API_KEY must be specified " , 1 );
1919 } else {
20- echo "Please provide Supabase full Details. \r\n" ;
20+ $ this ->apikey = $ apikey ;
21+ $ this ->project_id = $ url ;
2122 }
2223
2324 $ URL = "$ this ->project_id /rest/v1/ $ this ->table " ;
You can’t perform that action at this time.
0 commit comments