66use Typesense \Exceptions \TypesenseClientError ;
77
88/**
9- * Class Document
9+ * Class Stopwords
1010 *
1111 * @package \Typesense
1212 * @date 4/5/20
@@ -22,7 +22,7 @@ class Stopwords
2222 public const STOPWORDS_PATH = '/stopwords ' ;
2323
2424 /**
25- * Document constructor.
25+ * Stopwords constructor.
2626 *
2727 * @param ApiCall $apiCall
2828 */
@@ -43,6 +43,7 @@ public function get(string $stopwordsName)
4343 []
4444 );
4545 }
46+
4647 /**
4748 * @return array|string
4849 * @throws HttpClientException
@@ -54,32 +55,27 @@ public function getAll()
5455 }
5556
5657 /**
57- * @param array $options
58+ * @param array $stopwordSet
5859 *
5960 * @return array
6061 * @throws HttpClientException
6162 * @throws TypesenseClientError
6263 */
63- public function put (array $ options = [] )
64+ public function put (array $ stopwordSet )
6465 {
65- $ stopwordsName = $ options ['stopwords_name ' ];
66- $ stopwordsData = $ options ['stopwords_data ' ];
67- return $ this ->apiCall ->put (
68- $ this ->endpointPath ($ stopwordsName ),
69- ['stopwords ' => $ stopwordsData ]
70- );
66+ return $ this ->apiCall ->put ($ this ->endpointPath ($ stopwordSet ['name ' ]), $ stopwordSet );
7167 }
7268
7369 /**
74- * @param $presetName
70+ * @param $stopwordsName
7571 * @return array
7672 * @throws HttpClientException
7773 * @throws TypesenseClientError
7874 */
79- public function delete ($ presetName )
75+ public function delete ($ stopwordsName )
8076 {
8177 return $ this ->apiCall ->delete (
82- $ this ->endpointPath ($ presetName )
78+ $ this ->endpointPath ($ stopwordsName )
8379 );
8480 }
8581
0 commit comments