Skip to content

Commit dda036a

Browse files
authored
chore: removing support for php 7.2 (#181)
* chore: removing support for php 7.2 * ci: running php sdk tests against php 8 * chore(deps-dev): pulling squizlabs/php_codesniffer@master * fix: restoring support for laravel 6 * fix: laravel 6 support * ci: cleaning up the php workflow
1 parent 7c4a310 commit dda036a

File tree

3 files changed

+9
-52
lines changed

3 files changed

+9
-52
lines changed

.github/workflows/php.yml

+2-45
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,8 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
php: [7.2, 7.3, 7.4]
16-
laravel: [6.*, 7.*]
17-
dependency-version: [prefer-lowest, prefer-stable]
18-
19-
name: build (${{ matrix.php }} w/ Laravel ${{ matrix.laravel }} @${{ matrix.dependency-version }})
20-
21-
steps:
22-
- uses: actions/[email protected]
23-
24-
- name: Cache dependencies
25-
uses: actions/cache@v2
26-
with:
27-
path: ~/.composer/cache/files
28-
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
29-
30-
- name: Setup PHP
31-
uses: shivammathur/setup-php@v2
32-
with:
33-
php-version: ${{ matrix.php }}
34-
35-
- name: Install dependencies
36-
run: |
37-
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
38-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
39-
40-
- name: Check code standards
41-
run: composer run-script lint
42-
43-
- name: Execute static analysis
44-
run: composer run-script psalm
45-
46-
- name: Run tests
47-
run: composer run-script phpunit
48-
49-
test-laravel8:
50-
runs-on: ubuntu-latest
51-
defaults:
52-
run:
53-
working-directory: packages/php
54-
55-
strategy:
56-
fail-fast: true
57-
matrix:
58-
php: [7.3, 7.4]
59-
laravel: [8.*]
15+
php: [7.3, 7.4, 8.0]
16+
laravel: [6.*, 7.*, 8.*]
6017
dependency-version: [prefer-lowest, prefer-stable]
6118

6219
name: build (${{ matrix.php }} w/ Laravel ${{ matrix.laravel }} @${{ matrix.dependency-version }})

packages/php/composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"readme"
1515
],
1616
"require": {
17-
"php": "^7.2",
17+
"php": "^7.3 | ^7.4 | ^8.0",
1818
"illuminate/http": "^6.8 | ^7.0 | ^8.0",
1919
"illuminate/support": "^6.8 | ^7.0 | ^8.0",
2020
"ocramius/package-versions": "^1.4",
@@ -23,10 +23,10 @@
2323
"guzzlehttp/guzzle": "^7.0"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "^8.5",
27-
"squizlabs/php_codesniffer": "^3.5",
28-
"mockery/mockery": "^1.3",
29-
"vimeo/psalm": "^3.14"
26+
"phpunit/phpunit": "^9.5",
27+
"mockery/mockery": "^1.4",
28+
"vimeo/psalm": "dev-master",
29+
"squizlabs/php_codesniffer": "dev-master"
3030
},
3131
"extra": {
3232
"laravel": {

packages/php/tests/MetricsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function testTrack(bool $development_mode): void
133133
$this->assertContains('x-documentation-url', array_keys($response->headers->all()));
134134
$documentation_header = array_shift($response->headers->all()['x-documentation-url']);
135135
$log_id = $this->getLogIdFromDocumentationHeader($documentation_header);
136-
$this->assertRegExp(self::UUID_PATTERN, $log_id);
136+
$this->assertMatchesRegularExpression(self::UUID_PATTERN, $log_id);
137137

138138
// Assert that we only tracked a single request and also the payload looks as expected.
139139
$this->assertCount(1, $this->api_calls);
@@ -299,7 +299,7 @@ public function testConstructPayload(): void
299299

300300
$payload_entry = $payload['request']['log']['entries'][0];
301301
$this->assertSame($request->url(), $payload_entry['pageref']);
302-
$this->assertRegExp(
302+
$this->assertMatchesRegularExpression(
303303
'/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})\+(\d{2}:\d{2})/',
304304
$payload_entry['startedDateTime'],
305305
'startedDateTime was not in a format matching `2019-12-19T01:17:51+00:00`.'

0 commit comments

Comments
 (0)