Skip to content

Commit

Permalink
Fixed deprecated code, updated CI tests (#232)
Browse files Browse the repository at this point in the history
* Fixed deprecated code, updated CI tests

* Updated phpunit version

* Updated CI tests

* Updated CI tests

* Updated CI tests

---------

Co-authored-by: nick <[email protected]>
  • Loading branch information
Nick-S-2018 and nick authored Jan 14, 2025
1 parent 799daac commit 42cabc6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,31 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
php-version: ['7.4', '8.0', '8.1']
phpunit-version: ['latest']
phpunit-deprecation-check: ['']
transport: ['', 'PhpHttp']

include:
- php-version: '8.2'
phpunit-deprecation-check: '--stop-on-deprecation'
os: 'ubuntu-latest'
phpunit-version: 'latest'
transport: ''
- php-version: '8.3'
phpunit-deprecation-check: '--stop-on-deprecation'
os: 'ubuntu-latest'
phpunit-version: 'latest'
transport: ''
- php-version: '8.2'
phpunit-deprecation-check: '--stop-on-deprecation'
os: 'ubuntu-latest'
phpunit-version: 'latest'
transport: 'PhpHttp'
- php-version: '8.3'
phpunit-deprecation-check: '--stop-on-deprecation'
os: 'ubuntu-latest'
phpunit-version: 'latest'
transport: 'PhpHttp'
services:
manticoresearch-manticore:
image: manticoresearch/manticore:dev
Expand Down Expand Up @@ -50,7 +71,7 @@ jobs:
run: composer require php-http/discovery php-http/curl-client guzzlehttp/psr7 php-http/message php-http/message-factory http-interop/http-factory-guzzle

- name: Test
run: vendor/bin/phpunit -d memory_limit=4G --stop-on-failure test/
run: vendor/bin/phpunit -d memory_limit=4G ${{ matrix.phpunit-deprecation-check }} --stop-on-failure test/
env:
MS_HOST: 127.0.0.1
MS_PORT: 9308
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require-dev" : {
"mockery/mockery" : "*",
"phpstan/phpstan" : "^1.4",
"phpunit/phpunit" : ">=7.5 || ^9.6",
"phpunit/phpunit" : ">=7.5 || ^10.5",
"slevomat/coding-standard" : "^7.0",
"squizlabs/php_codesniffer" : "^3.7"
},
Expand Down
8 changes: 6 additions & 2 deletions src/Manticoresearch/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public function getDocumentByIds($ids) {
// Deduplicate and order the list
static::checkIfList($ids);

array_walk($ids, 'static::checkDocumentId');
foreach ($ids as &$id) {
static::checkDocumentId($id);
}
$params = [
'body' => [
'index' => $this->index,
Expand Down Expand Up @@ -141,7 +143,9 @@ public function deleteDocumentsByIds(array $ids) {
// Deduplicate and order the list
static::checkIfList($ids);

array_walk($ids, 'static::checkDocumentId');
foreach ($ids as &$id) {
static::checkDocumentId($id);
}
$params = [
'body' => [
'index' => $this->index,
Expand Down

0 comments on commit 42cabc6

Please sign in to comment.