Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 300d119

Browse files
Rename methods. Add descriptions
1 parent 16f50d0 commit 300d119

File tree

7 files changed

+43
-11
lines changed

7 files changed

+43
-11
lines changed

src/Config/ApplicationsStatistics.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,41 @@
88
{
99
public function __construct(private array $_data)
1010
{
11+
//
1112
}
1213

1314
/**
1415
* @inheritDoc
1516
*/
16-
public function getAll(): array
17+
public function getData(): array
1718
{
1819
return $this->_data;
1920
}
2021

2122
/**
2223
* @inheritDoc
2324
*/
24-
public function getRequests(): int
25+
public function getRequests(): array
26+
{
27+
return $this->_data['requests'];
28+
}
29+
30+
/**
31+
* @inheritDoc
32+
*/
33+
public function getActiveRequests(): int
2534
{
2635
return $this->_data['requests']['active'];
2736
}
2837

38+
/**
39+
* @inheritDoc
40+
*/
41+
public function getProcesses(): array
42+
{
43+
return $this->_data['processes'];
44+
}
45+
2946
/**
3047
* @inheritDoc
3148
*/

src/Config/ConnectionsStatistics.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function __construct(private array $_data)
1414
/**
1515
* @inheritDoc
1616
*/
17-
public function getAll(): array
17+
public function getData(): array
1818
{
1919
return $this->_data;
2020
}

src/Config/RequestsStatistics.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44

55
use Pavlusha311245\UnitPhpSdk\Interfaces\RequestsStatisticsInterface;
66

7-
class RequestsStatistics implements RequestsStatisticsInterface
7+
readonly class RequestsStatistics implements RequestsStatisticsInterface
88
{
99
public function __construct(private array $_data)
1010
{
11+
//
1112
}
1213

1314
/**
1415
* @inheritDoc
1516
*/
16-
public function getAll(): array
17+
public function getData(): array
1718
{
1819
return $this->_data;
1920
}

src/Interfaces/ApplicationsStatisticsInterface.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,28 @@ interface ApplicationsStatisticsInterface
99
*
1010
* @return array
1111
*/
12-
public function getAll(): array;
12+
public function getData(): array;
1313

1414
/**
15-
* Get count of all application requests
15+
* Get array of all application requests
16+
*
17+
* @return array
18+
*/
19+
public function getRequests(): array;
20+
21+
/**
22+
* Get count of all application active requests
1623
*
1724
* @return int
1825
*/
19-
public function getRequests(): int;
26+
public function getActiveRequests(): int;
27+
28+
/**
29+
* Return all statistics by processes
30+
*
31+
* @return array
32+
*/
33+
public function getProcesses(): array;
2034

2135
/**
2236
* Get count of starting application processes

src/Interfaces/ConnectionsStatisticsInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface ConnectionsStatisticsInterface
99
*
1010
* @return array
1111
*/
12-
public function getAll(): array;
12+
public function getData(): array;
1313

1414
/**
1515
* Get count of idle connection

src/Interfaces/RequestsStatisticsInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface RequestsStatisticsInterface
99
*
1010
* @return array
1111
*/
12-
public function getAll(): array;
12+
public function getData(): array;
1313

1414
/**
1515
* Return total requests statistics

src/Unit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getConfig(): Interfaces\ConfigInterface
4646
* @return void
4747
* @throws UnitException
4848
*/
49-
private function loadConfig()
49+
private function loadConfig(): void
5050
{
5151
$request = new UnitRequest($this->socket, $this->address);
5252
$result = $request->send('/config');

0 commit comments

Comments
 (0)