soketi / echo-server-core

@@ -57,7 +57,11 @@
Loading
57 57
            $app['key'],
58 58
            $app['secret'],
59 59
            $app['maxConnections'] ?? -1,
60 -
            $app['enableStats'] ?? false
60 +
            $app['enableStats'] ?? false,
61 +
            $app['enable_client_messages'] ?? true,
62 +
            $app['max_backend_events_per_min'] ?? -1,
63 +
            $app['max_client_events_per_min'] ?? -1,
64 +
            $app['max_read_req_per_min'] ?? -1
61 65
        );
62 66
    }
63 67
}

@@ -29,7 +29,7 @@
Loading
29 29
    protected $secret;
30 30
31 31
    /**
32 -
     * The maximum amount of connexions.
32 +
     * The maximum amount of connections.
33 33
     *
34 34
     * @var int
35 35
     */
@@ -38,10 +38,38 @@
Loading
38 38
    /**
39 39
     * Enabling the stats collection.
40 40
     *
41 -
     * @var array
41 +
     * @var bool
42 42
     */
43 43
    protected $enableStats;
44 44
45 +
    /**
46 +
     * Enabling the client messages.
47 +
     *
48 +
     * @var bool
49 +
     */
50 +
    protected $enableClientMessages;
51 +
52 +
    /**
53 +
     * The maximum amount of provisioned backend events per minute.
54 +
     *
55 +
     * @var int
56 +
     */
57 +
    protected $maxBackendEventsPerMinute;
58 +
59 +
    /**
60 +
     * The maximum amount of provisioned client events per minute.
61 +
     *
62 +
     * @var int
63 +
     */
64 +
    protected $maxClientEventsPerMinute;
65 +
66 +
    /**
67 +
     * The maximum amount of provisioned read requests per minute.
68 +
     *
69 +
     * @var int
70 +
     */
71 +
    protected $maxReadRequestsPerMinute;
72 +
45 73
    /**
46 74
     * Initialize the app.
47 75
     *
@@ -50,6 +78,10 @@
Loading
50 78
     * @param  string  $secret
51 79
     * @param  int  $maxConnections
52 80
     * @param  bool  $enableStats
81 +
     * @param  bool  $enableClientMessages
82 +
     * @param  int  $maxBackendEventsPerMinute
83 +
     * @param  int  $maxClientEventsPerMinute
84 +
     * @param  int  $maxReadRequestsPerMinute
53 85
     * @return void
54 86
     */
55 87
    public function __construct(
@@ -57,13 +89,21 @@
Loading
57 89
        string $key,
58 90
        string $secret,
59 91
        int $maxConnections,
60 -
        bool $enableStats
92 +
        bool $enableStats,
93 +
        bool $enableClientMessages,
94 +
        int $maxBackendEventsPerMinute,
95 +
        int $maxClientEventsPerMinute,
96 +
        int $maxReadRequestsPerMinute
61 97
    ) {
62 98
        $this->id = $id;
63 99
        $this->key = $key;
64 100
        $this->secret = $secret;
65 101
        $this->maxConnections = $maxConnections;
66 102
        $this->enableStats = $enableStats;
103 +
        $this->enableClientMessages = $enableClientMessages;
104 +
        $this->maxBackendEventsPerMinute = $maxBackendEventsPerMinute;
105 +
        $this->maxClientEventsPerMinute = $maxClientEventsPerMinute;
106 +
        $this->maxReadRequestsPerMinute = $maxReadRequestsPerMinute;
67 107
    }
68 108
69 109
    /**
@@ -79,6 +119,10 @@
Loading
79 119
            'secret' => $this->secret,
80 120
            'maxConnections' => $this->maxConnections,
81 121
            'enableStats' => $this->enableStats,
122 +
            'enableClientMessages' => $this->enableClientMessages,
123 +
            'maxBackendEventsPerMinute' => $this->maxBackendEventsPerMinute,
124 +
            'maxClientEventsPerMinute' => $this->maxClientEventsPerMinute,
125 +
            'maxReadRequestsPerMinute' => $this->maxReadRequestsPerMinute,
82 126
        ];
83 127
    }
84 128

@@ -55,7 +55,11 @@
Loading
55 55
            $app->key,
56 56
            $app->secret,
57 57
            $app->max_connections,
58 -
            $app->enable_stats
58 +
            $app->enable_stats,
59 +
            $app->enable_client_messages,
60 +
            $app->max_backend_events_per_min,
61 +
            $app->max_client_events_per_min,
62 +
            $app->max_read_req_per_min
59 63
        );
60 64
    }
61 65
}
Files Complexity Coverage
src 30 91.04%
Project Totals (6 files) 30 91.04%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading