Skip to content

Commit 3184606

Browse files
authoredJun 11, 2023
Add support for Laravel 10 (#2)
1 parent 6fabd2e commit 3184606

8 files changed

+65
-7960
lines changed
 

‎.github/workflows/php-cs-fixer.yaml

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
name: Check & fix styling
1+
name: Fix Styling
22

33
on: [push]
44

55
jobs:
6-
php-cs-fixer:
7-
runs-on: ubuntu-latest
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
88

9-
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v2
12-
with:
13-
ref: ${{ github.head_ref }}
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
ref: ${{ github.head_ref }}
1414

15-
- name: Run PHP CS Fixer
16-
uses: docker://oskarstark/php-cs-fixer-ga
17-
with:
18-
args: --config=.php_cs.dist.php --allow-risky=yes
15+
- name: Run PHP CS Fixer
16+
uses: docker://oskarstark/php-cs-fixer-ga
17+
with:
18+
args: --config=.php_cs.dist.php --allow-risky=yes
1919

20-
- name: Commit changes
21-
uses: stefanzweifel/git-auto-commit-action@v4
22-
with:
23-
commit_message: Fix styling
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: Fix styling

‎.github/workflows/run-tests.yaml

+28-23
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
1-
name: Tests
1+
name: Run Tests
22

33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
6-
test:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
fail-fast: true
10-
matrix:
11-
os: [ubuntu-latest]
12-
php: [7.4, 8.0]
13-
stability: [prefer-lowest, prefer-stable]
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
php: [8.2, 8.1]
12+
laravel: [10.*]
13+
stability: [prefer-stable]
14+
include:
15+
- laravel: 10.*
16+
testbench: 8.*
1417

15-
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
18+
name: PHP ${{ matrix.php }} – Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}
1619

17-
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v2
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
2023

21-
- name: Setup PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ matrix.php }}
25-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
26-
coverage: none
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
29+
coverage: none
2730

28-
- name: Install dependencies
29-
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
31+
- name: Install dependencies
32+
run: |
33+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
34+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
3035
31-
- name: Execute tests
32-
run: vendor/bin/phpunit
36+
- name: Run tests
37+
run: vendor/bin/phpunit

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vendor
22
.DS_Store
33
.phpunit.result.cache
4+
.php-cs-fixer.cache

‎.php-cs-fixer.cache

-1
This file was deleted.

‎.php_cs.dist.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
$finder = Symfony\Component\Finder\Finder::create()
44
->in([
5-
__DIR__ . '/src',
6-
__DIR__ . '/tests',
5+
__DIR__.'/src',
6+
__DIR__.'/tests',
77
])
88
->name('*.php')
99
->notName('*.blade.php')
@@ -12,7 +12,7 @@
1212

1313
return (new PhpCsFixer\Config())
1414
->setRules([
15-
'@PSR12' => true,
15+
'@PSR2' => true,
1616
'array_syntax' => ['syntax' => 'short'],
1717
'ordered_imports' => ['sort_algorithm' => 'alpha'],
1818
'no_unused_imports' => true,
@@ -26,11 +26,6 @@
2626
],
2727
'phpdoc_single_line_var_spacing' => true,
2828
'phpdoc_var_without_name' => true,
29-
'class_attributes_separation' => [
30-
'elements' => [
31-
'method' => 'one',
32-
],
33-
],
3429
'method_argument_space' => [
3530
'on_multiline' => 'ensure_fully_multiline',
3631
'keep_multiple_spaces_after_comma' => true,

‎composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^8.0",
16-
"illuminate/support": "^8.0 || ^9.0",
15+
"php": "^8.1",
16+
"illuminate/support": "^10.0",
1717
"titasgailius/terminal": "^1.2"
1818
},
1919
"require-dev": {
20-
"orchestra/testbench": "^6.0 || ^7.4",
21-
"nunomaduro/collision": "^5.0 || ^6.2",
22-
"phpunit/phpunit": "^9.5"
20+
"nunomaduro/collision": "^7.0",
21+
"orchestra/testbench": "^8.0",
22+
"phpunit/phpunit": "^10.0"
2323
},
2424
"autoload": {
2525
"psr-4": {

‎composer.lock

-7,888
This file was deleted.

‎phpunit.xml

+12-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false">
11-
<testsuites>
12-
<testsuite name="Test Suite">
13-
<directory suffix="Test.php">./tests</directory>
14-
</testsuite>
15-
</testsuites>
16-
<filter>
17-
<whitelist processUncoveredFilesFromWhitelist="true">
18-
<directory suffix=".php">./src</directory>
19-
</whitelist>
20-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage/>
4+
<testsuites>
5+
<testsuite name="Test Suite">
6+
<directory>./tests</directory>
7+
</testsuite>
8+
</testsuites>
9+
<source>
10+
<include>
11+
<directory suffix=".php">./src</directory>
12+
</include>
13+
</source>
2114
</phpunit>

0 commit comments

Comments
 (0)
Please sign in to comment.