Skip to content

Commit

Permalink
Merge pull request #7 from worksome/feature/php-8.2
Browse files Browse the repository at this point in the history
feat: require PHP 8.2 or later
  • Loading branch information
owenvoke authored Jan 4, 2023
2 parents 3a8ff5e + 9aeb440 commit df9c284
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0, 8.1]
laravel: [8.*, 9.*]
php: [8.2]
laravel: [9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: ^6.23
- laravel: 9.*
testbench: ^7.0

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

Expand All @@ -44,7 +39,6 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --ansi
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ansi
- name: Execute tests
Expand Down
21 changes: 0 additions & 21 deletions .php-cs-fixer.dist.php

This file was deleted.

22 changes: 8 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
}
],
"require": {
"php": "^8.0|^8.1",
"php": "^8.2",
"google/cloud-translate": "^1.12",
"illuminate/support": "^8.83|^9.0",
"illuminate/support": "^9.46",
"spatie/laravel-package-tools": "^1.11.3"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.4",
"nunomaduro/collision": "^5.11|^6.0",
"nunomaduro/larastan": "^1.0.3 || ^2.0",
"orchestra/testbench": "^6.24|^7.0",
"nunomaduro/collision": "^6.0",
"nunomaduro/larastan": "^2.2",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.2",
"pestphp/pest-plugin-parallel": "^1.0",
"spatie/laravel-ray": "^1.29",
"worksome/coding-style": "^0.16.0",
"worksome/coding-style": "^2.3.2",
"worksome/pest-plugin-silence": "^0.1"
},
"autoload": {
Expand All @@ -44,17 +44,11 @@
}
},
"scripts": {
"lint": [
"vendor/bin/php-cs-fixer fix --ansi",
"vendor/bin/phpcbf"
],
"lint": "vendor/bin/ecs --fix",
"test:unit": "vendor/bin/pest -p",
"test:coverage": "vendor/bin/pest -p --coverage",
"test:types": "vendor/bin/phpstan analyse",
"test:style": [
"vendor/bin/php-cs-fixer fix --dry-run --ansi",
"vendor/bin/phpcs -n"
],
"test:style": "vendor/bin/ecs",
"test": [
"@test:style",
"@test:types",
Expand Down
17 changes: 17 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use Symplify\EasyCodingStandard\Config\ECSConfig;
use Worksome\CodingStyle\WorksomeEcsConfig;


return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/config',
]);

WorksomeEcsConfig::setup($ecsConfig);
};
32 changes: 0 additions & 32 deletions phpcs.xml

This file was deleted.

23 changes: 23 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Worksome\CodingStyle\WorksomeRectorConfig;

return static function (RectorConfig $rectorConfig): void {
WorksomeRectorConfig::setup($rectorConfig);

$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

// Define extra rule sets to be applied
$rectorConfig->sets([
// SetList::DEAD_CODE,
]);

// Register extra a single rules
// $rectorConfig->rule(ClassOnObjectRector::class);
};
8 changes: 6 additions & 2 deletions tests/TranslatorManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
->toBeInstanceOf(NullDriver::class)
->translate('This is being translated', 'en', 'en')
->toBeInstanceOf(TranslationDTO::class)
->toEqual(new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated'));
->toEqual(
new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated')
);
});

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

expect($provider)
->toBeInstanceOf(TranslationDTO::class)
->toEqual(new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated'));
->toEqual(
new TranslationDTO(source: 'en', input: 'This is being translated', text: 'This is being translated')
);
});

0 comments on commit df9c284

Please sign in to comment.