Skip to content

Commit df9c284

Browse files
authored
Merge pull request #7 from worksome/feature/php-8.2
feat: require PHP 8.2 or later
2 parents 3a8ff5e + 9aeb440 commit df9c284

File tree

8 files changed

+57
-78
lines changed

8 files changed

+57
-78
lines changed

.github/workflows/phpstan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: '8.0'
20+
php-version: '8.2'
2121
coverage: none
2222

2323
- name: Install composer dependencies

.github/workflows/run-tests.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ jobs:
1515
fail-fast: true
1616
matrix:
1717
os: [ubuntu-latest, windows-latest]
18-
php: [8.0, 8.1]
19-
laravel: [8.*, 9.*]
18+
php: [8.2]
19+
laravel: [9.*]
2020
stability: [prefer-lowest, prefer-stable]
21-
include:
22-
- laravel: 8.*
23-
testbench: ^6.23
24-
- laravel: 9.*
25-
testbench: ^7.0
2621

2722
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2823

@@ -44,7 +39,6 @@ jobs:
4439
4540
- name: Install dependencies
4641
run: |
47-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --ansi
4842
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ansi
4943
5044
- name: Execute tests

.php-cs-fixer.dist.php

-21
This file was deleted.

composer.json

+8-14
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.0|^8.1",
19+
"php": "^8.2",
2020
"google/cloud-translate": "^1.12",
21-
"illuminate/support": "^8.83|^9.0",
21+
"illuminate/support": "^9.46",
2222
"spatie/laravel-package-tools": "^1.11.3"
2323
},
2424
"require-dev": {
2525
"guzzlehttp/guzzle": "^7.4",
26-
"nunomaduro/collision": "^5.11|^6.0",
27-
"nunomaduro/larastan": "^1.0.3 || ^2.0",
28-
"orchestra/testbench": "^6.24|^7.0",
26+
"nunomaduro/collision": "^6.0",
27+
"nunomaduro/larastan": "^2.2",
28+
"orchestra/testbench": "^7.0",
2929
"pestphp/pest": "^1.21",
3030
"pestphp/pest-plugin-laravel": "^1.2",
3131
"pestphp/pest-plugin-parallel": "^1.0",
3232
"spatie/laravel-ray": "^1.29",
33-
"worksome/coding-style": "^0.16.0",
33+
"worksome/coding-style": "^2.3.2",
3434
"worksome/pest-plugin-silence": "^0.1"
3535
},
3636
"autoload": {
@@ -44,17 +44,11 @@
4444
}
4545
},
4646
"scripts": {
47-
"lint": [
48-
"vendor/bin/php-cs-fixer fix --ansi",
49-
"vendor/bin/phpcbf"
50-
],
47+
"lint": "vendor/bin/ecs --fix",
5148
"test:unit": "vendor/bin/pest -p",
5249
"test:coverage": "vendor/bin/pest -p --coverage",
5350
"test:types": "vendor/bin/phpstan analyse",
54-
"test:style": [
55-
"vendor/bin/php-cs-fixer fix --dry-run --ansi",
56-
"vendor/bin/phpcs -n"
57-
],
51+
"test:style": "vendor/bin/ecs",
5852
"test": [
5953
"@test:style",
6054
"@test:types",

ecs.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symplify\EasyCodingStandard\Config\ECSConfig;
6+
use Worksome\CodingStyle\WorksomeEcsConfig;
7+
8+
9+
return static function (ECSConfig $ecsConfig): void {
10+
$ecsConfig->paths([
11+
__DIR__ . '/src',
12+
__DIR__ . '/tests',
13+
__DIR__ . '/config',
14+
]);
15+
16+
WorksomeEcsConfig::setup($ecsConfig);
17+
};

phpcs.xml

-32
This file was deleted.

rector.php

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Worksome\CodingStyle\WorksomeRectorConfig;
7+
8+
return static function (RectorConfig $rectorConfig): void {
9+
WorksomeRectorConfig::setup($rectorConfig);
10+
11+
$rectorConfig->paths([
12+
__DIR__ . '/src',
13+
__DIR__ . '/tests',
14+
]);
15+
16+
// Define extra rule sets to be applied
17+
$rectorConfig->sets([
18+
// SetList::DEAD_CODE,
19+
]);
20+
21+
// Register extra a single rules
22+
// $rectorConfig->rule(ClassOnObjectRector::class);
23+
};

tests/TranslatorManagerTest.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
->toBeInstanceOf(NullDriver::class)
2929
->translate('This is being translated', 'en', 'en')
3030
->toBeInstanceOf(TranslationDTO::class)
31-
->toEqual(new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated'));
31+
->toEqual(
32+
new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated')
33+
);
3234
});
3335

3436
it('can detect input language using the null driver', function () {
@@ -50,5 +52,7 @@
5052

5153
expect($provider)
5254
->toBeInstanceOf(TranslationDTO::class)
53-
->toEqual(new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated'));
55+
->toEqual(
56+
new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated')
57+
);
5458
});

0 commit comments

Comments
 (0)