File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 88
99namespace DevLancer \MinecraftStatus ;
1010
11+ use DevLancer \MinecraftStatus \Exception \ConnectionException ;
1112use DevLancer \MinecraftStatus \Exception \NotConnectedException ;
1213use DevLancer \MinecraftStatus \Exception \ReceiveStatusException ;
1314
@@ -20,6 +21,12 @@ class Ping extends AbstractPing implements PlayerListInterface, FaviconInterface
2021
2122 protected int $ delay = 0 ;
2223
24+ /**
25+ * @inheritDoc
26+ * @return Ping
27+ * @throws ConnectionException Thrown when failed to connect to resource
28+ * @throws ReceiveStatusException Thrown when the status has not been obtained or resolved
29+ */
2330 public function connect (): Ping
2431 {
2532 parent ::connect ();
@@ -92,12 +99,13 @@ protected function getStatus(): void
9299 */
93100 protected function resolvePlayerList (array $ data ): array
94101 {
102+ $ players = [];
95103 if (isset ($ data ['players ' ]['sample ' ])) {
96104 foreach ($ data ['players ' ]['sample ' ] as $ value )
97- $ this -> players [] = $ value ;
105+ $ players [] = $ value ;
98106 }
99107
100- return [] ;
108+ return $ players ;
101109 }
102110
103111 /**
You can’t perform that action at this time.
0 commit comments