Skip to content

Commit 13f4807

Browse files
Merge pull request #1197 from algolia/develop
Pull in latest from develop for release v3.5.0
2 parents 338a943 + 5a7d46b commit 13f4807

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+935
-1091
lines changed

.circleci/config.yml

Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,115 @@
11
version: 2
22

33
shared: &shared
4-
working_directory: ~/build_directory/algoliasearch-magento-2
5-
steps:
6-
- checkout
4+
working_directory: ~/build_directory/algoliasearch-magento-2
5+
steps:
6+
- checkout
77

8-
- run:
9-
name: Override the Algolia extension with the cloned one
10-
command: |
11-
cd ~/magento_directory/vendor/algolia
12-
rm -rf algoliasearch-magento-2
13-
cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia
14-
cd ~/magento_directory
15-
composer dump-autoload
8+
- run:
9+
name: Override the Algolia extension with the cloned one
10+
command: |
11+
cd ~/magento_directory/vendor/algolia
12+
rm -rf algoliasearch-magento-2
13+
cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia
14+
cd ~/magento_directory
15+
composer dump-autoload
1616
17-
- run:
18-
name: Start database server
19-
command: |
20-
sudo service mysql start
21-
sleep 2
22-
ps aux | grep mysql
17+
- run:
18+
name: Start database server
19+
command: |
20+
sudo service mysql start
21+
sleep 2
22+
ps aux | grep mysql
2323
24-
- run:
25-
name: Install the extension
26-
command: |
27-
cd ~/magento_directory
28-
sudo service elasticsearch start # for some reasons has to be launched with the step
29-
sleep 10
30-
php -dmemory_limit=-1 bin/magento module:disable Magento_WebapiAsync Magento_Amqp Magento_MysqlMq Magento_MessageQueue
31-
php -dmemory_limit=-1 bin/magento module:enable Algolia_AlgoliaSearch
32-
php -dmemory_limit=-1 bin/magento setup:upgrade
24+
- run:
25+
name: Install the extension
26+
command: |
27+
cd ~/magento_directory
28+
sudo service elasticsearch start # for some reasons has to be launched with the step
29+
sleep 10
30+
php -dmemory_limit=-1 bin/magento module:disable Magento_WebapiAsync Magento_Amqp Magento_MysqlMq Magento_MessageQueue
31+
php -dmemory_limit=-1 bin/magento module:enable Algolia_AlgoliaSearch
32+
php -dmemory_limit=-1 bin/magento setup:upgrade
3333
34-
- run:
35-
name: Get the right tests config for DB and administration
36-
command: |
37-
rm -rf ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension/Test ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension-chat/Test
38-
mv ~/build_directory/algoliasearch-magento-2/dev/tests/install-config-mysql.php ~/magento_directory/dev/tests/integration/etc/install-config-mysql.php
34+
- run:
35+
name: Get the right tests config for DB and administration
36+
command: |
37+
rm -rf ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension/Test ~/magento_directory/vendor/dotmailer/dotmailer-magento2-extension-chat/Test
38+
mv ~/build_directory/algoliasearch-magento-2/dev/tests/install-config-mysql.php ~/magento_directory/dev/tests/integration/etc/install-config-mysql.php
3939
40-
- run:
41-
name: Before setup
42-
command: |
43-
echo 'memory_limit = 256M' | sudo tee /usr/local/etc/php/php.ini
40+
- run:
41+
name: Before setup
42+
command: |
43+
echo 'memory_limit = 256M' | sudo tee /usr/local/etc/php/php.ini
4444
45-
- run:
46-
name: Get keys from dealer
47-
command: |
48-
if [ "$CIRCLE_PR_REPONAME" ]; then
49-
curl -s https://algoliasearch-client-keygen.herokuapp.com | sh >> $BASH_ENV
50-
fi
45+
- run:
46+
name: Get keys from dealer
47+
command: |
48+
if [ "$CIRCLE_PR_REPONAME" ]; then
49+
curl -s https://algoliasearch-client-keygen.herokuapp.com | sh >> $BASH_ENV
50+
fi
5151
52-
- run:
53-
name: Run tests
54-
command: |
55-
cd ~/magento_directory/dev/tests/integration
56-
sudo service elasticsearch start # for some reasons has to be launched with the step
57-
sleep 10
58-
php -dmemory_limit=-1 ../../../vendor/bin/phpunit --debug ../../../vendor/algolia/algoliasearch-magento-2/Test
52+
- run:
53+
name: Run tests
54+
command: |
55+
cd ~/magento_directory/dev/tests/integration
56+
sudo service elasticsearch start # for some reasons has to be launched with the step
57+
sleep 10
58+
php -dmemory_limit=-1 ../../../vendor/bin/phpunit --debug ../../../vendor/algolia/algoliasearch-magento-2/Test
5959
6060
jobs:
61-
"magento-2.3":
62-
<<: *shared
63-
docker:
64-
- image: algolia/magento2-circleci:v3-2.3.5-p2
61+
"magento-2.3":
62+
<<: *shared
63+
docker:
64+
- image: algolia/magento2-circleci:v3-2.3.5-p2
65+
66+
"magento-2.4":
67+
<<: *shared
68+
docker:
69+
- image: algolia/magento2-circleci:v3-2.4.0
6570

66-
"magento-2.4":
67-
<<: *shared
68-
docker:
69-
- image: algolia/magento2-circleci:v3-2.4.0
71+
"quality-tools":
72+
docker:
73+
- image: algolia/magento2-circleci:2.4.4-php7.4-v1
74+
working_directory: ~/build_directory/algoliasearch-magento-2
75+
steps:
76+
- checkout
77+
- run:
78+
name: Setting permissions
79+
command: |
80+
sudo chown circleci:circleci ~/.composer/
81+
- restore_cache:
82+
keys:
83+
- composer-v4-{{ checksum "composer.json" }}
84+
- composer-v4-
7085

71-
"quality-tools":
72-
docker:
73-
- image: algolia/magento2-circleci:2.4.4-php7.4-v1
74-
working_directory: ~/build_directory/algoliasearch-magento-2
75-
steps:
76-
- checkout
77-
- run:
78-
name: Setting permissions
79-
command: |
80-
sudo chown circleci:circleci ~/.composer/
81-
- restore_cache:
82-
keys:
83-
- composer-v4-{{ checksum "composer.json" }}
84-
- composer-v4-
85-
86-
- run:
87-
name: Prepare environment
88-
command: |
89-
sudo chown circleci:circleci ~/.composer/
90-
composer global config prefer-stable true
91-
composer global config minimum-stability dev
92-
composer global require algolia/magento2-tools
86+
- run:
87+
name: Prepare environment
88+
command: |
89+
sudo chown circleci:circleci ~/.composer/
90+
composer global config prefer-stable true
91+
composer global config minimum-stability dev
92+
composer global require algolia/magento2-tools
9393
94-
# We have to do this again because we restore the cache above, overwriting the vendor with the original.
95-
mkdir ~/magento_directory/vendor/algolia
96-
# rm -rf algoliasearch-magento-2
97-
cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia
98-
cd ~/magento_directory
99-
composer dump-autoload
100-
- save_cache:
101-
key: composer-v4-{{ checksum "composer.json" }}
102-
paths:
103-
- vendor
104-
- run:
105-
name: Quality tools
106-
command: |
107-
sudo ~/.composer/vendor/bin/magento2-test ~/magento_directory/vendor/algolia/algoliasearch-magento-2 ~/.composer/vendor/bin/
94+
# We have to do this again because we restore the cache above, overwriting the vendor with the original.
95+
mkdir ~/magento_directory/vendor/algolia
96+
# rm -rf algoliasearch-magento-2
97+
cp -R ~/build_directory/algoliasearch-magento-2 ~/magento_directory/vendor/algolia
98+
cd ~/magento_directory
99+
composer dump-autoload
100+
- save_cache:
101+
key: composer-v4-{{ checksum "composer.json" }}
102+
paths:
103+
- vendor
104+
- run:
105+
name: Quality tools
106+
command: |
107+
sudo ~/.composer/vendor/bin/magento2-test ~/magento_directory/vendor/algolia/algoliasearch-magento-2 ~/.composer/vendor/bin/
108108
109109
workflows:
110-
version: 2
111-
build:
112-
jobs:
113-
- "magento-2.3"
114-
- "magento-2.4"
115-
- "quality-tools"
110+
version: 2
111+
build:
112+
jobs:
113+
- "magento-2.3"
114+
- "magento-2.4"
115+
- "quality-tools"

.php-cs-fixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/** @var PhpCsFixer\Config $config */
44
if (isset($_SERVER['argv']) && $_SERVER['argv'][3]) {
5-
$config = require dirname($_SERVER['argv'][3], 3) . '/.php-cs-fixer.dist.php';
5+
$config = require dirname($_SERVER['argv'][3], 3) . '/.php-cs-fixer.dist.php';
66
} else {
77
$config = require __DIR__ . '/../../../.php-cs-fixer.dist.php';
88
}
@@ -37,7 +37,7 @@
3737
'not_operator_with_space' => false,
3838
'object_operator_without_whitespace' => true,
3939
'phpdoc_annotation_without_dot' => true,
40-
'general_phpdoc_tag_rename' => true,
40+
'general_phpdoc_tag_rename' => true,
4141
'phpdoc_inline_tag_normalizer' => true,
4242
'phpdoc_tag_type' => true,
4343
'phpdoc_order' => true,

Api/Data/JobInterface.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@
99
*/
1010
interface JobInterface
1111
{
12-
const TABLE_NAME = 'algoliasearch_queue';
12+
public const TABLE_NAME = 'algoliasearch_queue';
1313

14-
const STATUS_NEW = 'new';
15-
const STATUS_PROCESSING = 'processing';
16-
const STATUS_ERROR = 'error';
17-
const STATUS_COMPLETE = 'complete';
14+
public const STATUS_NEW = 'new';
15+
public const STATUS_PROCESSING = 'processing';
16+
public const STATUS_ERROR = 'error';
17+
public const STATUS_COMPLETE = 'complete';
1818

1919
/**#@+
2020
* Constants for keys of data array. Identical to the name of the getter in snake case
2121
*/
22-
const FIELD_JOB_ID = 'job_id';
23-
const FIELD_CREATED = 'created';
24-
const FIELD_PID = 'pid';
25-
const FIELD_CLASS = 'class';
26-
const FIELD_METHOD = 'method';
27-
const FIELD_DATA = 'data';
28-
const FIELD_MAX_RETRIES = 'max_retries';
29-
const FIELD_RETRIES = 'retries';
30-
const FIELD_ERROR_LOG = 'error_log';
31-
const FIELD_DATA_SIZE = 'data_size';
22+
public const FIELD_JOB_ID = 'job_id';
23+
public const FIELD_CREATED = 'created';
24+
public const FIELD_PID = 'pid';
25+
public const FIELD_CLASS = 'class';
26+
public const FIELD_METHOD = 'method';
27+
public const FIELD_DATA = 'data';
28+
public const FIELD_MAX_RETRIES = 'max_retries';
29+
public const FIELD_RETRIES = 'retries';
30+
public const FIELD_ERROR_LOG = 'error_log';
31+
public const FIELD_DATA_SIZE = 'data_size';
3232

3333
/**
3434
* @return string

Api/Data/LandingPageInterface.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@
99
*/
1010
interface LandingPageInterface
1111
{
12-
const TABLE_NAME = 'algoliasearch_landing_page';
12+
public const TABLE_NAME = 'algoliasearch_landing_page';
1313

1414
/**#@+
1515
* Constants for keys of data array. Identical to the name of the getter in snake case
1616
*/
17-
const FIELD_LANDING_PAGE_ID = 'landing_page_id';
18-
const FIELD_STORE_ID = 'store_id';
19-
const FIELD_URL_KEY = 'url_key';
20-
const FIELD_IS_ACTIVE = 'is_active';
21-
const FIELD_TITLE = 'title';
22-
const FIELD_DATE_FROM = 'date_from';
23-
const FIELD_DATE_TO = 'date_to';
24-
const FIELD_META_TITLE = 'meta_title';
25-
const FIELD_META_DESCRIPTION = 'meta_description';
26-
const FIELD_META_KEYWORDS = 'meta_keywords';
27-
const FIELD_CONTENT = 'content';
28-
const FIELD_QUERY = 'query';
29-
const FIELD_CONFIGURATION = 'configuration';
30-
const FIELD_CUSTOM_JS = 'custom_js';
31-
const FIELD_CUSTOM_CSS = 'custom_css';
17+
public const FIELD_LANDING_PAGE_ID = 'landing_page_id';
18+
public const FIELD_STORE_ID = 'store_id';
19+
public const FIELD_URL_KEY = 'url_key';
20+
public const FIELD_IS_ACTIVE = 'is_active';
21+
public const FIELD_TITLE = 'title';
22+
public const FIELD_DATE_FROM = 'date_from';
23+
public const FIELD_DATE_TO = 'date_to';
24+
public const FIELD_META_TITLE = 'meta_title';
25+
public const FIELD_META_DESCRIPTION = 'meta_description';
26+
public const FIELD_META_KEYWORDS = 'meta_keywords';
27+
public const FIELD_CONTENT = 'content';
28+
public const FIELD_QUERY = 'query';
29+
public const FIELD_CONFIGURATION = 'configuration';
30+
public const FIELD_CUSTOM_JS = 'custom_js';
31+
public const FIELD_CUSTOM_CSS = 'custom_css';
3232
/**#@-*/
3333

3434
/**

Api/Data/QueryInterface.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
*/
1010
interface QueryInterface
1111
{
12-
const TABLE_NAME = 'algoliasearch_query';
12+
public const TABLE_NAME = 'algoliasearch_query';
1313

1414
/**#@+
1515
* Constants for keys of data array. Identical to the name of the getter in snake case
1616
*/
17-
const FIELD_QUERY_ID = 'query_id';
18-
const FIELD_STORE_ID = 'store_id';
19-
const FIELD_QUERY_TEXT = 'query_text';
20-
const FIELD_BANNER_IMAGE = 'banner_image';
21-
const FIELD_BANNER_URL = 'banner_url';
22-
const FIELD_BANNER_ALT = 'banner_alt';
23-
const FIELD_BANNER_CONTENT = 'banner_content';
24-
const FIELD_CREATED_AT = 'created_at';
17+
public const FIELD_QUERY_ID = 'query_id';
18+
public const FIELD_STORE_ID = 'store_id';
19+
public const FIELD_QUERY_TEXT = 'query_text';
20+
public const FIELD_BANNER_IMAGE = 'banner_image';
21+
public const FIELD_BANNER_URL = 'banner_url';
22+
public const FIELD_BANNER_ALT = 'banner_alt';
23+
public const FIELD_BANNER_CONTENT = 'banner_content';
24+
public const FIELD_CREATED_AT = 'created_at';
2525
/**#@-*/
2626

2727
/**

Api/Data/RunInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
*/
1010
interface RunInterface
1111
{
12-
const TABLE_NAME = 'algoliasearch_queue_log';
12+
public const TABLE_NAME = 'algoliasearch_queue_log';
1313

1414
/**#@+
1515
* Constants for keys of data array. Identical to the name of the getter in snake case
1616
*/
17-
const FIELD_RUN_ID = 'id';
18-
const FIELD_STARTED = 'started';
19-
const FIELD_DURATION = 'duration';
20-
const FIELD_PROCESSED_JOBS = 'processed_jobs';
21-
const FIELD_WITH_EMPTY_QUEUE = 'with_empty_queue';
17+
public const FIELD_RUN_ID = 'id';
18+
public const FIELD_STARTED = 'started';
19+
public const FIELD_DURATION = 'duration';
20+
public const FIELD_PROCESSED_JOBS = 'processed_jobs';
21+
public const FIELD_WITH_EMPTY_QUEUE = 'with_empty_queue';
2222
/**#@-*/
2323
}

Block/Adminhtml/Queue/Status.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
class Status extends Template
1414
{
15-
const CRON_QUEUE_FREQUENCY = 330;
15+
public const CRON_QUEUE_FREQUENCY = 330;
1616

17-
const QUEUE_NOT_PROCESSED_LIMIT = 3600;
17+
public const QUEUE_NOT_PROCESSED_LIMIT = 3600;
1818

19-
const QUEUE_FAST_LIMIT = 220;
19+
public const QUEUE_FAST_LIMIT = 220;
2020

2121
/** @var IndexerFactory */
2222
private $indexerFactory;

Block/Navigation/Renderer/DefaultRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DefaultRenderer extends Template implements FilterRendererInterface
1212
/** @var bool */
1313
private $isSearchable = true;
1414

15-
const JS_COMPONENT = 'Algolia_AlgoliaSearch/navigation/attribute-filter';
15+
public const JS_COMPONENT = 'Algolia_AlgoliaSearch/navigation/attribute-filter';
1616

1717
/**
1818
* Path to template file.

0 commit comments

Comments
 (0)