From 50e26871a22c25b2658814277d1f682d83bbdf0b Mon Sep 17 00:00:00 2001 From: Abraham Date: Wed, 8 Feb 2023 17:28:57 +0100 Subject: [PATCH 1/2] remove site_url field in SE management (docs and code) --- CHANGELOG.md | 3 + composer.json | 2 +- ...Doofinder-Management-ManagementClient.html | 2 - ...ofinder-Management-Model-SearchEngine.html | 84 +------------------ doc/js/searchIndex.js | 10 --- src/Management/ManagementClient.php | 2 - src/Management/Model/SearchEngine.php | 17 ---- src/Management/README_MANAGEMENT.md | 2 - .../ManagementClientSearchEngineTest.php | 9 -- .../Management/Resources/SearchEngineTest.php | 6 -- 10 files changed, 5 insertions(+), 132 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cc7af7..0ab505b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ 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-02-08 +### Changed +- site_url field is now deprecated for search engine management ## [7.0.3] - 2022-11-21 ### Changed 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/doc/classes/Doofinder-Management-ManagementClient.html b/doc/classes/Doofinder-Management-ManagementClient.html index 8c61826..d3360d1 100644 --- a/doc/classes/Doofinder-Management-ManagementClient.html +++ b/doc/classes/Doofinder-Management-ManagementClient.html @@ -1096,7 +1096,6 @@
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, '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 +1120,6 @@
'currency' => string, 'language' => string, 'name' => string, -'site_url' => string|null, '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..ff44dc3 100644 --- a/doc/classes/Doofinder-Management-Model-SearchEngine.html +++ b/doc/classes/Doofinder-Management-Model-SearchEngine.html @@ -210,13 +210,6 @@

 : string -
- -
- $siteUrl - -  : string|null -
@@ -280,13 +273,6 @@

 : string

-
- -
- getSiteUrl() - -  : string|null -
@@ -624,38 +610,7 @@

-
-

- $siteUrl - - - -

- - - - private - string|null - $siteUrl - - - - - - -
Return values

— - -
-

- getSiteUrl() - -

- - - - - public - getSiteUrl() : string|null - - - - - -
Return values
- string|null - — - -
private - __construct(mixed $language, mixed $name, mixed $currency, mixed $hashid, mixed $indices, mixed $inactive, mixed $searchUrl, mixed $siteUrl, mixed $stopwords, mixed $platform, mixed $hasGrouping) : mixed + __construct(mixed $language, mixed $name, mixed $currency, mixed $hashid, mixed $indices, mixed $inactive, mixed $searchUrl, mixed $stopwords, mixed $platform, mixed $hasGrouping) : mixed
@@ -1202,11 +1125,6 @@
Parameters
-
-
- $siteUrl - : mixed -
diff --git a/doc/js/searchIndex.js b/doc/js/searchIndex.js index 20d7e1b..dddc5ad 100644 --- a/doc/js/searchIndex.js +++ b/doc/js/searchIndex.js @@ -635,11 +635,6 @@ Search.appendIndex( "name": "getSearchUrl", "summary": "", "url": "classes/Doofinder-Management-Model-SearchEngine.html#method_getSearchUrl" - }, { - "fqsen": "\\Doofinder\\Management\\Model\\SearchEngine\u003A\u003AgetSiteUrl\u0028\u0029", - "name": "getSiteUrl", - "summary": "", - "url": "classes/Doofinder-Management-Model-SearchEngine.html#method_getSiteUrl" }, { "fqsen": "\\Doofinder\\Management\\Model\\SearchEngine\u003A\u003AisStopwords\u0028\u0029", "name": "isStopwords", @@ -695,11 +690,6 @@ Search.appendIndex( "name": "searchUrl", "summary": "", "url": "classes/Doofinder-Management-Model-SearchEngine.html#property_searchUrl" - }, { - "fqsen": "\\Doofinder\\Management\\Model\\SearchEngine\u003A\u003A\u0024siteUrl", - "name": "siteUrl", - "summary": "", - "url": "classes/Doofinder-Management-Model-SearchEngine.html#property_siteUrl" }, { "fqsen": "\\Doofinder\\Management\\Model\\SearchEngine\u003A\u003A\u0024stopwords", "name": "stopwords", diff --git a/src/Management/ManagementClient.php b/src/Management/ManagementClient.php index 1b9153d..a90a420 100644 --- a/src/Management/ManagementClient.php +++ b/src/Management/ManagementClient.php @@ -67,7 +67,6 @@ public static function create($host, $token, $userId) * 'currency' => string, * 'language' => string, * 'name' => string, - * 'site_url' => string|null, * 'stopwords' => boolean Default: false, * 'platform' => string, * 'has_grouping' => boolean, @@ -77,7 +76,6 @@ 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, * '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..a4c9b9b 100644 --- a/src/Management/Model/SearchEngine.php +++ b/src/Management/Model/SearchEngine.php @@ -44,11 +44,6 @@ class SearchEngine implements ModelInterface */ private $searchUrl; - /** - * @var string|null - */ - private $siteUrl; - /** * @var bool */ @@ -72,7 +67,6 @@ private function __construct( $indices, $inactive, $searchUrl, - $siteUrl, $stopwords, $platform, $hasGrouping @@ -84,7 +78,6 @@ private function __construct( $this->indices = $indices; $this->inactive = $inactive; $this->searchUrl = $searchUrl; - $this->siteUrl = $siteUrl; $this->stopwords = $stopwords; $this->platform = $platform; $this->hasGrouping = $hasGrouping; @@ -104,7 +97,6 @@ public static function createFromArray(array $data) $data['indices'], $data['inactive'], $data['search_url'], - $data['site_url'], $data['stopwords'], $data['platform'], $data['has_grouping'] @@ -167,14 +159,6 @@ public function getSearchUrl() return $this->searchUrl; } - /** - * @return string|null - */ - public function getSiteUrl() - { - return $this->siteUrl; - } - /** * @return bool */ @@ -212,7 +196,6 @@ public function jsonSerialize() 'indices' => $this->indices, 'inactive' => $this->inactive, 'search_url' => $this->searchUrl, - 'site_url' => $this->siteUrl, 'stopwords' => $this->stopwords, 'platform' => $this->platform, 'has_grouping' => $this->hasGrouping diff --git a/src/Management/README_MANAGEMENT.md b/src/Management/README_MANAGEMENT.md index ae11a7b..6d53874 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,6 @@ $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", "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..7ea43fb 100644 --- a/tests/Unit/Management/Resources/SearchEngineTest.php +++ b/tests/Unit/Management/Resources/SearchEngineTest.php @@ -33,7 +33,6 @@ public function testCreateSearchEngineSuccess() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false @@ -44,7 +43,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 +134,6 @@ public function testUpdateSearchEngineSuccess() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false @@ -147,7 +144,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 +209,6 @@ public function testGetSearchEngine() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false @@ -280,7 +275,6 @@ public function testListSearchEngine() 'indices' => [], 'inactive' => false, 'search_url' => 'fake_search_url', - 'site_url' => 'http://test.url.com/fake', 'stopwords' => false, 'platform' => 'shopify', 'has_grouping' => false From 6fa24d2fc5011354386ea80951ad060051a907db Mon Sep 17 00:00:00 2001 From: Abraham Date: Wed, 8 Feb 2023 17:33:17 +0100 Subject: [PATCH 2/2] added composer.lock file --- composer.lock | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 625dce0..fccceac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,35 +4,35 @@ "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": [ { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -57,10 +57,6 @@ "constructor", "instantiate" ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" - }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -75,7 +71,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "myclabs/deep-copy", @@ -1755,5 +1751,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "1.1.0" }