diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cc7af7..6f89979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [7.0.4] - 2023-03-13 +### Changed +- Deprecated "site_url" field in Search Engine object + ## [7.0.3] - 2022-11-21 ### Changed - Updated the "Installation & Usage" section of the readmes diff --git a/composer.json b/composer.json index 96ed8a8..c8d99cc 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "doofinder/php-doofinder", - "version": "7.0.3", + "version": "7.0.4", "type": "library", "description": "Doofinder PHP API Client", "keywords": [ diff --git a/composer.lock b/composer.lock index 625dce0..fa29621 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5f932ddea3e5c1e3e9795bec8288f312", + "content-hash": "4b15a6b375e3b9611f80006b1fbfdad3", "packages": [], "packages-dev": [ { diff --git a/doc/classes/Doofinder-Management-ManagementClient.html b/doc/classes/Doofinder-Management-ManagementClient.html index 8c61826..8b75dfb 100644 --- a/doc/classes/Doofinder-Management-ManagementClient.html +++ b/doc/classes/Doofinder-Management-ManagementClient.html @@ -1096,7 +1096,7 @@
Parameters
'currency' => string, // Default: "EUR" ("AED", "ARS", "AUD", "BAM", "BDT", "BGN", "BOB", "BRL", "BYN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "DOP", "EGP", "EUR", "GBP", "HKD", "HRK", "HUF", "IDR", "ILS", "INR", "IRR", "ISK", "JPY", "KRW", "KWD", "MXN", "MYR", "NOK", "NZD", "PEN", "PLN", "RON", "RSD", "RUB", "SAR", "SEK", "TRY", "TWD", "UAH", "USD", "VEF", "VND", "XPF", "ZAR") 'language' => string, // ("ar", "hy", "eu", "pt-br", "bg", "ca", "cs", "da", "nl", "en", "fi", "fr", "de", "el", "hi", "hu", "id", "it", "no", "pt", "ro", "ru", "es", "sv", "tr"), 'name' => string, -'site_url' => string|null, +'site_url' => string|null, // Deprecated 'stopwords' => boolean Default: false, 'platform' => string, // Default: ("api", "api", "shopify", "woocommerce", "bigcommerce", "crawler", "ecommerce", "ekm", "file", "magento", "magento2", "opencart", "oscommerce", "prestashop", "shopify"), 'has_grouping' => boolean, // Default: false @@ -1121,7 +1121,7 @@
'currency' => string, 'language' => string, 'name' => string, -'site_url' => string|null, +'site_url' => string|null, // Deprecated 'stopwords' => boolean Default: false, 'platform' => string, 'has_grouping' => boolean, diff --git a/doc/classes/Doofinder-Management-Model-SearchEngine.html b/doc/classes/Doofinder-Management-Model-SearchEngine.html index 663057d..be7b698 100644 --- a/doc/classes/Doofinder-Management-Model-SearchEngine.html +++ b/doc/classes/Doofinder-Management-Model-SearchEngine.html @@ -384,7 +384,7 @@

@@ -576,7 +576,7 @@

@@ -629,7 +629,7 @@

phpdocumentor-element -property -private - " + -deprecated " >

$siteUrl @@ -640,12 +640,12 @@

- + private string|null $siteUrl @@ -654,6 +654,20 @@

+

+ Tags + +
+
+
+ deprecated +
+
+ 7.0.4 + + +
+
@@ -708,7 +722,7 @@

@@ -750,7 +764,7 @@

@@ -782,7 +796,7 @@

@@ -814,7 +828,7 @@

@@ -846,7 +860,7 @@

@@ -878,7 +892,7 @@

@@ -910,7 +924,7 @@

@@ -942,7 +956,7 @@

@@ -965,7 +979,7 @@

Return values
class="phpdocumentor-element -method -public - " + -deprecated " >

getSiteUrl() @@ -974,18 +988,32 @@

- + public getSiteUrl() : string|null +
+ Tags + +
+
+
+ deprecated +
+
+ 7.0.4 + + +
+
Return values
string|null @@ -1006,7 +1034,7 @@

@@ -1038,7 +1066,7 @@

@@ -1070,7 +1098,7 @@

@@ -1102,7 +1130,7 @@

@@ -1134,7 +1162,7 @@

diff --git a/doc/reports/deprecated.html b/doc/reports/deprecated.html index c950e08..74269c4 100644 --- a/doc/reports/deprecated.html +++ b/doc/reports/deprecated.html @@ -99,10 +99,32 @@

Fil
diff --git a/src/Management/ManagementClient.php b/src/Management/ManagementClient.php index 1b9153d..a1bdf09 100644 --- a/src/Management/ManagementClient.php +++ b/src/Management/ManagementClient.php @@ -67,7 +67,7 @@ public static function create($host, $token, $userId) * 'currency' => string, * 'language' => string, * 'name' => string, - * 'site_url' => string|null, + * 'site_url' => string|null, // Deprecated * 'stopwords' => boolean Default: false, * 'platform' => string, * 'has_grouping' => boolean, @@ -77,7 +77,7 @@ public static function create($host, $token, $userId) * 'currency' => string, // Default: "EUR" ("AED", "ARS", "AUD", "BAM", "BDT", "BGN", "BOB", "BRL", "BYN", "CAD", "CHF", "CLP", "CNY", "COP", "CZK", "DKK", "DOP", "EGP", "EUR", "GBP", "HKD", "HRK", "HUF", "IDR", "ILS", "INR", "IRR", "ISK", "JPY", "KRW", "KWD", "MXN", "MYR", "NOK", "NZD", "PEN", "PLN", "RON", "RSD", "RUB", "SAR", "SEK", "TRY", "TWD", "UAH", "USD", "VEF", "VND", "XPF", "ZAR") * 'language' => string, // ("ar", "hy", "eu", "pt-br", "bg", "ca", "cs", "da", "nl", "en", "fi", "fr", "de", "el", "hi", "hu", "id", "it", "no", "pt", "ro", "ru", "es", "sv", "tr"), * 'name' => string, - * 'site_url' => string|null, + * 'site_url' => string|null, // Deprecated * 'stopwords' => boolean Default: false, * 'platform' => string, // Default: ("api", "api", "shopify", "woocommerce", "bigcommerce", "crawler", "ecommerce", "ekm", "file", "magento", "magento2", "opencart", "oscommerce", "prestashop", "shopify"), * 'has_grouping' => boolean, // Default: false diff --git a/src/Management/Model/SearchEngine.php b/src/Management/Model/SearchEngine.php index 44fb437..68bd394 100644 --- a/src/Management/Model/SearchEngine.php +++ b/src/Management/Model/SearchEngine.php @@ -46,6 +46,7 @@ class SearchEngine implements ModelInterface /** * @var string|null + * @deprecated 7.0.4 */ private $siteUrl; @@ -104,7 +105,7 @@ public static function createFromArray(array $data) $data['indices'], $data['inactive'], $data['search_url'], - $data['site_url'], + isset($data['site_url']) ? $data['site_url'] : null, $data['stopwords'], $data['platform'], $data['has_grouping'] @@ -169,6 +170,7 @@ public function getSearchUrl() /** * @return string|null + * @deprecated 7.0.4 */ public function getSiteUrl() { diff --git a/src/Management/README_MANAGEMENT.md b/src/Management/README_MANAGEMENT.md index ae11a7b..1eccd35 100644 --- a/src/Management/README_MANAGEMENT.md +++ b/src/Management/README_MANAGEMENT.md @@ -147,7 +147,6 @@ $searchEngineParams = [ 'currency' => 'EUR', 'language' => 'es', 'name' => 'search_engine_test', - 'site_url' => 'https://fake_site.es', 'stopwords' => false, 'platform' => 'api', 'has_grouping' => false, @@ -519,7 +518,7 @@ $managementClient->deleteItemsInBulkInTemporalIndex($searchEngine->getHashid(), "language" => "(string) An ISO 639-1 language code that determines the language of the search engine. The language affects how the words indexed are tokenized and which stopwords to use.", "name" => "(string) A short name that helps identifying the search engine.", "search_url" => "(string) Indicates the search server domain for this search engine. You should use this domain to perform searches to this search engine.", - "site_url" => "(string or null) The URL of the site to be integrated with the search engine. It determines the default allowed domains for requests", + "site_url" => "(deprecated) (string or null) The URL of the site to be integrated with the search engine. It determines the default allowed domains for requests. This field is deprecated since version 7.0.4 and it is useless now. It will be removed in a further version", "stopwords" => "(boolean) Default: false. Ignores high-frequency terms like 'the', 'and', 'is'. These words have a low weight and contribute little to the relevance score.", "platform" => "(string) Indicates which platform the search engine is associated with.", "has_grouping" => "(boolean) When this option is selected, only one of the item variants is returned in the search results. This only works if the indexed item have the group_id field." diff --git a/tests/Unit/Management/ManagementClientSearchEngineTest.php b/tests/Unit/Management/ManagementClientSearchEngineTest.php index 3f68d0c..06bed5a 100644 --- a/tests/Unit/Management/ManagementClientSearchEngineTest.php +++ b/tests/Unit/Management/ManagementClientSearchEngineTest.php @@ -26,7 +26,6 @@ public function setUp() 'currency' => 'EUR', 'language' => 'es', 'name' => 'test_create', - 'site_url' => 'http://test.url.com/fake', 'search_url' => 'http://search.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', @@ -68,7 +67,6 @@ public function invalidParamsProvider() [[ 'currency' => 'fake_currency', 'language' => 'fake_language', - 'site_url' => '', 'stop_words' => '', 'platform' => '', 'has_grouping' => '', @@ -111,7 +109,6 @@ public function testCreateSearchEngineSuccess() 'currency' => 'EUR', 'language' => 'lslsls', 'name' => 'test_create', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false, @@ -141,7 +138,6 @@ public function testCreateSearchEngineSuccess() $this->assertSame($this->searchEngine->getLanguage(), $searchEngine->getLanguage()); $this->assertSame($this->searchEngine->getName(), $searchEngine->getName()); $this->assertSame($this->searchEngine->getSearchUrl(), $searchEngine->getSearchUrl()); - $this->assertSame($this->searchEngine->getSiteUrl(), $searchEngine->getSiteUrl()); $this->assertSame($this->searchEngine->isStopwords(), $searchEngine->isStopwords()); $this->assertSame($this->searchEngine->getPlatform(), $searchEngine->getPlatform()); $this->assertSame($this->searchEngine->isHasGrouping(), $searchEngine->isHasGrouping()); @@ -209,7 +205,6 @@ public function testUpdateSearchEngineInvalidHashid() 'currency' => 'EUR', 'language' => 'es', 'name' => 'test_create', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false, @@ -246,7 +241,6 @@ public function testUpdateSearchEngineSuccess() 'currency' => 'USD', 'language' => 'es', 'name' => 'another_name', - 'site_url' => 'fake_url', 'stopwords' => true, 'platform' => 'shopify', 'has_grouping' => true, @@ -276,7 +270,6 @@ public function testUpdateSearchEngineSuccess() $this->assertSame($this->searchEngine->getLanguage(), $searchEngine->getLanguage()); $this->assertSame($this->searchEngine->getName(), $searchEngine->getName()); $this->assertSame($this->searchEngine->getSearchUrl(), $searchEngine->getSearchUrl()); - $this->assertSame($this->searchEngine->getSiteUrl(), $searchEngine->getSiteUrl()); $this->assertSame($this->searchEngine->isStopwords(), $searchEngine->isStopwords()); $this->assertSame($this->searchEngine->getPlatform(), $searchEngine->getPlatform()); $this->assertSame($this->searchEngine->isHasGrouping(), $searchEngine->isHasGrouping()); @@ -361,7 +354,6 @@ public function testGetSearchEngineSuccess() $this->assertSame($this->searchEngine->getLanguage(), $searchEngine->getLanguage()); $this->assertSame($this->searchEngine->getName(), $searchEngine->getName()); $this->assertSame($this->searchEngine->getSearchUrl(), $searchEngine->getSearchUrl()); - $this->assertSame($this->searchEngine->getSiteUrl(), $searchEngine->getSiteUrl()); $this->assertSame($this->searchEngine->isStopwords(), $searchEngine->isStopwords()); $this->assertSame($this->searchEngine->getPlatform(), $searchEngine->getPlatform()); $this->assertSame($this->searchEngine->isHasGrouping(), $searchEngine->isHasGrouping()); @@ -418,7 +410,6 @@ public function testListSearchEngineSuccess() $this->assertSame($this->searchEngine->getLanguage(), $searchEngine->getLanguage()); $this->assertSame($this->searchEngine->getName(), $searchEngine->getName()); $this->assertSame($this->searchEngine->getSearchUrl(), $searchEngine->getSearchUrl()); - $this->assertSame($this->searchEngine->getSiteUrl(), $searchEngine->getSiteUrl()); $this->assertSame($this->searchEngine->isStopwords(), $searchEngine->isStopwords()); $this->assertSame($this->searchEngine->getPlatform(), $searchEngine->getPlatform()); $this->assertSame($this->searchEngine->isHasGrouping(), $searchEngine->isHasGrouping()); diff --git a/tests/Unit/Management/Resources/SearchEngineTest.php b/tests/Unit/Management/Resources/SearchEngineTest.php index 80c92ae..9f88390 100644 --- a/tests/Unit/Management/Resources/SearchEngineTest.php +++ b/tests/Unit/Management/Resources/SearchEngineTest.php @@ -33,7 +33,7 @@ public function testCreateSearchEngineSuccess() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', + 'site_url' => null, 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false @@ -44,7 +44,6 @@ public function testCreateSearchEngineSuccess() 'currency' => 'EUR', 'language' => 'es', 'name' => 'test_create', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false, @@ -136,7 +135,7 @@ public function testUpdateSearchEngineSuccess() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', + 'site_url' => null, 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false @@ -147,7 +146,6 @@ public function testUpdateSearchEngineSuccess() 'currency' => 'EUR', 'language' => 'es', 'name' => 'test_update', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false, @@ -213,7 +211,7 @@ public function testGetSearchEngine() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', + 'site_url' => null, 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false @@ -280,7 +278,7 @@ public function testListSearchEngine() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', + 'site_url' => null, 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false