• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tochka-developers / jsonrpc / 4135501466

pending completion
4135501466

push

github

darkdarin
Merge remote-tracking branch 'origin/v5.0'

209 of 813 new or added lines in 51 files covered. (25.71%)

233 of 1307 relevant lines covered (17.83%)

1.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Support/ServerConfig.php
1
<?php
2

3
namespace Tochka\JsonRpc\Support;
4

5
/**
6
 * @psalm-api
7
 * @psalm-type ServerConfigArray = array{
8
 *   summary?: string,
9
 *   description?: string,
10
 *   namespace?: string,
11
 *   controllerSuffix?: string,
12
 *   methodDelimiter?: string,
13
 *   endpoint?: string,
14
 *   dynamicEndpoint?: string,
15
 *   middleware?: array<string, array>|array<string>
16
 * }
17
 */
18
class ServerConfig
19
{
20
    public const DYNAMIC_ENDPOINT_NONE = 'none';
21
    public const DYNAMIC_ENDPOINT_CONTROLLER_NAMESPACE = 'controller_namespace';
22
    public const DYNAMIC_ENDPOINT_FULL_CONTROLLER_NAME = 'controller_name';
23

24
    public string $summary;
25
    public string $description;
26
    public string $namespace;
27
    public string $controllerSuffix;
28
    public string $methodDelimiter;
29
    public string $endpoint;
30
    public string $dynamicEndpoint;
31
    /** @var array<string, array>|array<string>|array */
32
    public array $middleware = [];
33

34
    /**
35
     * @param ServerConfigArray $config
36
     */
37
    public function __construct(array $config)
38
    {
NEW
39
        $this->summary = $config['summary'] ?? 'JsonRpc Server';
×
NEW
40
        $this->description = $config['description'] ?? 'JsonRpc Server';
×
NEW
41
        $this->namespace = $config['namespace'] ?? 'App\Http\Controllers';
×
NEW
42
        $this->controllerSuffix = $config['controllerSuffix'] ?? 'Controller';
×
NEW
43
        $this->methodDelimiter = $config['methodDelimiter'] ?? '_';
×
NEW
44
        $this->endpoint = $config['endpoint'] ?? '/api/v1/public/jsonrpc';
×
NEW
45
        $this->dynamicEndpoint = $config['dynamicEndpoint'] ?? self::DYNAMIC_ENDPOINT_NONE;
×
NEW
46
        $this->middleware = $config['middleware'] ?? [];
×
47
    }
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc