File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public function __construct(
67
67
$ this ->messageFactory = $ messageFactory ?? MessageFactoryDiscovery::find ();
68
68
}
69
69
70
- public function getResource (string $ resourceName )
70
+ public function getResource (string $ resourceName ): Resource
71
71
{
72
72
$ resource = $ this ->resources ->findByName ($ resourceName );
73
73
@@ -94,17 +94,17 @@ public static function doReturn(...$arguments): void
94
94
echo Translator::toServer ($ arguments );
95
95
}
96
96
97
- public function callFunction (string $ resourceName , string $ function , array $ arguments = null )
97
+ public function callFunction (string $ resourceName , string $ function , array $ arguments = null ): ? array
98
98
{
99
99
$ json_output = $ arguments ? Translator::toServer ($ arguments ) : '' ;
100
100
$ path = sprintf ('/%s/call/%s ' , $ resourceName , $ function );
101
101
$ result = $ this ->do_post_request ($ path , $ json_output );
102
102
$ out = Translator::fromServer ($ result );
103
103
104
- return $ out ?? false ;
104
+ return $ out ?? null ;
105
105
}
106
106
107
- protected function do_post_request ($ path , $ json_data )
107
+ protected function do_post_request ($ path , $ json_data ): string
108
108
{
109
109
$ request = RequestFactory::useMessageFactory ($ this ->messageFactory );
110
110
$ request ->setMethod ('POST ' );
You can’t perform that action at this time.
0 commit comments