File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,12 @@ public function getUser(string $field, $value): Struct\UserInfo
6868 }
6969
7070 /**
71- * @param string $field
71+ * @param string|null $field
7272 * @param int|string $value
7373 *
7474 * @return Struct\Info[]
7575 */
76- public function getAll (string $ field , $ value ): array
76+ public function getAll (? string $ field , $ value ): array
7777 {
7878 $ response = $ this ->getBy ('get-db ' , $ field , $ value );
7979 $ items = [];
@@ -107,18 +107,20 @@ public function getAllUsers(string $field, $value): array
107107
108108 /**
109109 * @param string $command
110- * @param string $field
110+ * @param string|null $field
111111 * @param int|string $value
112112 *
113113 * @return XmlResponse
114114 */
115- private function getBy (string $ command , string $ field , $ value ): XmlResponse
115+ private function getBy (string $ command , ? string $ field , $ value ): XmlResponse
116116 {
117117 $ packet = $ this ->client ->getPacket ();
118118 $ getTag = $ packet ->addChild ($ this ->wrapperTag )->addChild ($ command );
119119
120120 $ filterTag = $ getTag ->addChild ('filter ' );
121- $ filterTag ->{$ field } = (string ) $ value ;
121+ if (!is_null ($ field )) {
122+ $ filterTag ->{$ field } = (string ) $ value ;
123+ }
122124
123125 return $ this ->client ->request ($ packet , \PleskX \Api \Client::RESPONSE_FULL );
124126 }
You can’t perform that action at this time.
0 commit comments