-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(php): Implement RawClient.php (#4625)
- Loading branch information
Showing
442 changed files
with
17,553 additions
and
1,428 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
22 changes: 22 additions & 0 deletions
22
generators/php/codegen/src/asIs/BaseApiRequest.Template.php
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,22 @@ | ||
<?php | ||
|
||
namespace <%= namespace%>; | ||
|
||
abstract class BaseApiRequest | ||
{ | ||
/** | ||
* @param string $baseUrl The base URL for the request | ||
* @param string $path The path for the request | ||
* @param HttpMethod $method The HTTP method for the request | ||
* @param array<string, string> $headers Additional headers for the request (optional) | ||
* @param array<string, mixed> $query Query parameters for the request (optional) | ||
*/ | ||
public function __construct( | ||
public readonly string $baseUrl, | ||
public readonly string $path, | ||
public readonly HttpMethod $method, | ||
public readonly array $headers = [], | ||
public readonly array $query = [], | ||
) { | ||
} | ||
} |
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 @@ | ||
<?php | ||
|
||
namespace <%= namespace%>; | ||
|
||
enum HttpMethod | ||
{ | ||
case GET; | ||
case POST; | ||
case PUT; | ||
case PATCH; | ||
case DELETE; | ||
} |
25 changes: 25 additions & 0 deletions
25
generators/php/codegen/src/asIs/JsonApiRequest.Template.php
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,25 @@ | ||
<?php | ||
|
||
namespace <%= namespace%>; | ||
|
||
class JsonApiRequest extends BaseApiRequest | ||
{ | ||
/** | ||
* @param string $baseUrl The base URL for the request | ||
* @param string $path The path for the request | ||
* @param HttpMethod $method The HTTP method for the request | ||
* @param array<string, string> $headers Additional headers for the request (optional) | ||
* @param array<string, mixed> $query Query parameters for the request (optional) | ||
* @param mixed|null $body The JSON request body (optional) | ||
*/ | ||
public function __construct( | ||
string $baseUrl, | ||
string $path, | ||
HttpMethod $method, | ||
array $headers = [], | ||
array $query = [], | ||
public readonly mixed $body = null | ||
) { | ||
parent::__construct($baseUrl, $path, $method, $headers, $query); | ||
} | ||
} |
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
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
Oops, something went wrong.