Skip to content

Commit 3c3cecb

Browse files
committed
Bump PHP requirement to 8.1
1 parent 16a3c31 commit 3c3cecb

File tree

8 files changed

+10
-83
lines changed

8 files changed

+10
-83
lines changed

.github/workflows/meilisearch-beta-tests.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ jobs:
3838
MEILI_NO_ANALYTICS: true
3939
strategy:
4040
matrix:
41-
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
41+
php-version: ['8.1', '8.2', '8.3', '8.4']
4242
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
4343
exclude:
44-
- php-version: '7.4'
45-
http-client: 'Symfony-HttpClient'
46-
- php-version: '8.0'
47-
http-client: 'Symfony-HttpClient'
4844
- php-version: '8.1'
4945
http-client: 'Symfony-HttpClient'
5046

.github/workflows/pre-release-tests.yml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ jobs:
3838
MEILI_NO_ANALYTICS: true
3939
strategy:
4040
matrix:
41-
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
41+
php-version: ['8.1', '8.2', '8.3', '8.4']
4242
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
4343
exclude:
44-
- php-version: '7.4'
45-
http-client: 'Symfony-HttpClient'
46-
- php-version: '8.0'
47-
http-client: 'Symfony-HttpClient'
4844
- php-version: '8.1'
4945
http-client: 'Symfony-HttpClient'
5046
steps:
@@ -88,39 +84,3 @@ jobs:
8884

8985
- name: Run test suite
9086
run: sh scripts/tests.sh
91-
92-
test_php_7_guzzle_6:
93-
runs-on: ubuntu-latest
94-
needs: ['meilisearch-version']
95-
name: integration-tests-against-rc (PHP 7.4 & Guzzle 6)
96-
services:
97-
meilisearch:
98-
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
99-
env:
100-
MEILI_MASTER_KEY: 'masterKey'
101-
MEILI_NO_ANALYTICS: 'true'
102-
ports:
103-
- '7700:7700'
104-
105-
steps:
106-
- name: Checkout code
107-
uses: actions/checkout@v4
108-
109-
- name: Install PHP
110-
uses: shivammathur/setup-php@v2
111-
with:
112-
php-version: '7.4'
113-
coverage: none
114-
115-
- name: Validate composer.json and composer.lock
116-
run: composer validate
117-
118-
- name: Switch to Guzzle 6
119-
run: |
120-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle6-adapter": "^2.0.2",/' composer.json
121-
122-
- name: Install dependencies
123-
uses: ramsey/composer-install@v3
124-
125-
- name: Run test suite - php-http/guzzle6-adapter
126-
run: sh scripts/tests.sh

.github/workflows/tests.yml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,9 @@ jobs:
7979
MEILI_NO_ANALYTICS: true
8080
strategy:
8181
matrix:
82-
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
82+
php-version: ['8.1', '8.2', '8.3', '8.4']
8383
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
8484
exclude:
85-
- php-version: '7.4'
86-
http-client: 'Symfony-HttpClient'
87-
- php-version: '8.0'
88-
http-client: 'Symfony-HttpClient'
8985
- php-version: '8.1'
9086
http-client: 'Symfony-HttpClient'
9187

@@ -150,30 +146,6 @@ jobs:
150146
MEILI_MASTER_KEY: masterKey
151147
MEILI_NO_ANALYTICS: true
152148

153-
name: integration-tests (PHP 7.4 & Guzzle 6)
154-
steps:
155-
- name: Checkout code
156-
uses: actions/checkout@v4
157-
158-
- name: Install PHP
159-
uses: shivammathur/setup-php@v2
160-
with:
161-
php-version: '7.4'
162-
coverage: none
163-
164-
- name: Validate composer.json and composer.lock
165-
run: composer validate
166-
167-
- name: Switch to Guzzle 6
168-
run: |
169-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle6-adapter": "^2.0.2",/' composer.json
170-
171-
- name: Install dependencies
172-
uses: ramsey/composer-install@v3
173-
174-
- name: Run test suite - php-http/guzzle6-adapter
175-
run: sh scripts/tests.sh
176-
177149
upload-coverage:
178150
name: Upload coverage to Codecov
179151
runs-on: ubuntu-latest

.php-cs-fixer.dist.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'],
1717
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
1818
'php_unit_strict' => true,
19-
// @todo: when we'll support only PHP 8.0 and upper, we can enable `parameters` for `trailing_comma_in_multiline` rule
20-
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match'/* , 'parameters' */]],
19+
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match', 'parameters']],
2120
])
2221
->setRiskyAllowed(true)
2322
->setFinder($finder);

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
],
2020
"minimum-stability": "stable",
2121
"require": {
22-
"php": "^7.4 || ^8.0",
22+
"php": "^8.1",
2323
"ext-json": "*",
24-
"php-http/discovery": "^1.7",
24+
"php-http/discovery": "^1.19",
2525
"psr/http-client": "^1.0"
2626
},
2727
"autoload": {
@@ -40,7 +40,7 @@
4040
"http-interop/http-factory-guzzle": "Factory for guzzlehttp/guzzle"
4141
},
4242
"require-dev": {
43-
"phpunit/phpunit": "^9.5 || ^10.5",
43+
"phpunit/phpunit": "^10.5",
4444
"php-cs-fixer/shim": "^3.59.3",
4545
"guzzlehttp/guzzle": "^7.8.1",
4646
"http-interop/http-factory-guzzle": "^1.2.0",

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(
4747
?ClientInterface $httpClient = null,
4848
?RequestFactoryInterface $requestFactory = null,
4949
array $clientAgents = [],
50-
?StreamFactoryInterface $streamFactory = null
50+
?StreamFactoryInterface $streamFactory = null,
5151
) {
5252
$this->http = new MeilisearchClientAdapter($url, $apiKey, $httpClient, $requestFactory, $clientAgents, $streamFactory);
5353
$this->index = new Indexes($this->http);

src/Endpoints/Keys.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function createDate($attribute): ?\DateTimeInterface
9595
return null;
9696
}
9797

98-
if (false === strpos($attribute, '.')) {
98+
if (!str_contains($attribute, '.')) {
9999
$date = \DateTimeImmutable::createFromFormat(\DateTimeInterface::ATOM, $attribute);
100100
} else {
101101
$attribute = preg_replace('/(\.\d{6})\d+/', '$1', $attribute, 1);

src/Http/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
?ClientInterface $httpClient = null,
4242
?RequestFactoryInterface $reqFactory = null,
4343
array $clientAgents = [],
44-
?StreamFactoryInterface $streamFactory = null
44+
?StreamFactoryInterface $streamFactory = null,
4545
) {
4646
$this->baseUrl = $url;
4747
$this->http = $httpClient ?? Psr18ClientDiscovery::find();

0 commit comments

Comments
 (0)