docs: consolidate documentation into organized structure

- Move 12 markdown files from root to docs/ subdirectories
- Organize documentation by category:
  • docs/troubleshooting/ (1 file)  - Technical troubleshooting guides
  • docs/deployment/      (4 files) - Deployment and security documentation
  • docs/guides/          (3 files) - Feature-specific guides
  • docs/planning/        (4 files) - Planning and improvement proposals

Root directory cleanup:
- Reduced from 16 to 4 markdown files in root
- Only essential project files remain:
  • CLAUDE.md (AI instructions)
  • README.md (Main project readme)
  • CLEANUP_PLAN.md (Current cleanup plan)
  • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements)

This improves:
 Documentation discoverability
 Logical organization by purpose
 Clean root directory
 Better maintainability
This commit is contained in:
2025-10-05 11:05:04 +02:00
parent 887847dde6
commit 5050c7d73a
36686 changed files with 196456 additions and 12398919 deletions

View File

@@ -0,0 +1,126 @@
<?php
declare(strict_types=1);
namespace App\Framework\OAuth;
use App\Framework\HttpClient\HttpClient;
use App\Framework\OAuth\ValueObjects\OAuthToken;
/**
* Generic OAuth Client
*
* Handles HTTP requests to OAuth providers using framework's HttpClient
*/
final readonly class OAuthClient
{
public function __construct(
private HttpClient $httpClient,
) {}
/**
* Make GET request to OAuth provider
*
* @param array<string, string> $headers
* @return array<string, mixed>
*/
public function get(string $url, OAuthToken $token, array $headers = []): array
{
$response = $this->httpClient->get($url, [
'headers' => [
'Authorization' => $token->getAuthorizationHeader(),
...$headers,
],
]);
return json_decode($response->getBody(), true) ?? [];
}
/**
* Make POST request to OAuth provider
*
* @param array<string, mixed> $data
* @param array<string, string> $headers
* @return array<string, mixed>
*/
public function post(string $url, array $data = [], array $headers = []): array
{
$response = $this->httpClient->post($url, [
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded',
...$headers,
],
'body' => http_build_query($data),
]);
return json_decode($response->getBody(), true) ?? [];
}
/**
* Make authenticated POST request with OAuth token
*
* @param array<string, mixed> $data
* @param array<string, string> $headers
* @return array<string, mixed>
*/
public function postAuthenticated(
string $url,
OAuthToken $token,
array $data = [],
array $headers = []
): array {
$response = $this->httpClient->post($url, [
'headers' => [
'Authorization' => $token->getAuthorizationHeader(),
'Content-Type' => 'application/json',
...$headers,
],
'body' => json_encode($data),
]);
return json_decode($response->getBody(), true) ?? [];
}
/**
* Make PUT request with OAuth token
*
* @param array<string, mixed> $data
* @param array<string, string> $headers
* @return array<string, mixed>
*/
public function put(
string $url,
OAuthToken $token,
array $data = [],
array $headers = []
): array {
$response = $this->httpClient->put($url, [
'headers' => [
'Authorization' => $token->getAuthorizationHeader(),
'Content-Type' => 'application/json',
...$headers,
],
'body' => json_encode($data),
]);
return json_decode($response->getBody(), true) ?? [];
}
/**
* Make DELETE request with OAuth token
*
* @param array<string, string> $headers
* @return array<string, mixed>
*/
public function delete(string $url, OAuthToken $token, array $headers = []): array
{
$response = $this->httpClient->delete($url, [
'headers' => [
'Authorization' => $token->getAuthorizationHeader(),
...$headers,
],
]);
return json_decode($response->getBody(), true) ?? [];
}
}