11<?php
2+ declare (strict_types=1 );
3+
24namespace Supabase ;
35use Supabase \Supabase ;
46
57class Functions extends Supabase
68{
7- public function getAllData ($ table =null )
9+ public function getAllData (? string $ table =null )
810 {
911 if (!isset ($ table )) {
1012 echo "Please provide your Supabase table name. " ;
@@ -16,7 +18,7 @@ public function getAllData($table=null)
1618 }
1719 }
1820
19- public function getSingleData ($ table =null , $ query =[])
21+ public function getSingleData (? string $ table =null , array $ query =[])
2022 {
2123 if (!isset ($ table )) {
2224 echo "Please provide your Supabase table name. " ;
@@ -30,7 +32,7 @@ public function getSingleData($table=null, $query=[])
3032 }
3133 }
3234
33- public function postData ($ table =null , $ query =[], $ on_conflict =null )
35+ public function postData (? string $ table =null , array $ query =[], ? string $ on_conflict =null )
3436 {
3537 if (!isset ($ table )) {
3638 echo "Please provide your Supabase table name. " ;
@@ -49,7 +51,7 @@ public function postData($table=null, $query=[], $on_conflict=null)
4951 }
5052 }
5153
52- public function updateData ($ table =null , ?int $ id =null , $ query =[])
54+ public function updateData (? string $ table =null , ?int $ id =null , array $ query =[])
5355 {
5456 if (!isset ($ table )) {
5557 echo "Please provide your Supabase table name. " ;
@@ -64,7 +66,7 @@ public function updateData($table=null, ?int $id=null, $query=[])
6466 }
6567 }
6668
67- public function deleteData ($ table =null , ?int $ id =null )
69+ public function deleteData (? string $ table =null , ?int $ id =null )
6870 {
6971 if (!isset ($ table )) {
7072 echo "Please provide your Supabase table name. " ;
@@ -77,23 +79,23 @@ public function deleteData($table=null, ?int $id=null)
7779 }
7880 }
7981
80- public function pages ($ table =null )
82+ public function pages (? string $ table =null )
8183 {
8284 $ path = "$ this ->url / $ table?select=* " ;
8385 $ html = $ this ->grab ($ path , "GET " );
8486 $ data = json_decode ($ html , true );
8587 return $ data ;
8688 }
8789
88- public function filter ($ table =null , ?int $ range =null )
90+ public function filter (? string $ table =null , ?int $ range =null )
8991 {
9092 $ path = "$ this ->url / $ table?id=eq. $ range&select=* " ;
9193 $ html = $ this ->grab ($ path , "GET " );
9294 $ data = json_decode ($ html , true );
9395 return $ data ;
9496 }
9597
96- public function matchs ($ table =null , $ query =[])
98+ public function matchs (? string $ table =null , array $ query =[])
9799 {
98100 $ path = "$ this ->url / $ table " ;
99101 $ html = $ this ->grab ($ path , "POST " , json_encode ($ query ));
0 commit comments