-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
122 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sajya\Server; | ||
|
||
use Sajya\Server\Http\Request; | ||
|
||
interface Proxy | ||
{ | ||
/** | ||
* The method used by request handlers. | ||
* | ||
* @param \Sajya\Server\Http\Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function __invoke(Request $request): mixed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "foobar", | ||
"id": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "foobar", | ||
"method": "fixture@foobar", | ||
"id": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "proxy@any", | ||
"params": { | ||
"firstname": "Vere", | ||
"lastname": "Bonilla", | ||
"city": "Padang", | ||
"country": "Jordan", | ||
"countryCode": "BE", | ||
"group": "default" | ||
}, | ||
"id": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"id": "1", | ||
"result": "Alexandr", | ||
"result": "binding@deepValue Alexandr", | ||
"jsonrpc": "2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"error": { | ||
"code": -32601, | ||
"message": "Method not found", | ||
"data": null | ||
}, | ||
"id": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"id": "1", | ||
"result": { | ||
"firstname": "Vere", | ||
"lastname": "Bonilla", | ||
"city": "Padang", | ||
"country": "Jordan", | ||
"countryCode": "BE", | ||
"group": "default" | ||
}, | ||
"jsonrpc": "2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sajya\Server\Tests; | ||
|
||
use Sajya\Server\Http\Request; | ||
use Sajya\Server\Procedure; | ||
use Sajya\Server\Proxy; | ||
|
||
class FixtureProxyProcedure extends Procedure implements Proxy | ||
{ | ||
/** | ||
* The name of the procedure that will be | ||
* displayed and taken into account in the search. | ||
* | ||
* @var string | ||
*/ | ||
public static string $name = 'proxy'; | ||
|
||
/** | ||
* The method that will be called if there is no match. | ||
* | ||
* @param \Sajya\Server\Http\Request $request | ||
* | ||
* @return mixed | ||
*/ | ||
public function __invoke(Request $request): mixed | ||
{ | ||
return $request->getMethod(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters