Skip to content

Commit 62b16c2

Browse files
author
Tint Naing Win
committed
chore:support laravel 11.x
1 parent c78d3d0 commit 62b16c2

File tree

9 files changed

+138
-109
lines changed

9 files changed

+138
-109
lines changed

.gitattributes

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
* text=auto
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
23

3-
/tests export-ignore
4-
/docs export-ignore
5-
.editorconfig export-ignore
6-
.gitattributes export-ignore
7-
.gitignore export-ignore
8-
.styleci.yml export-ignore
9-
.travis.yml export-ignore
10-
phpunit.xml.dist export-ignore
4+
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/art export-ignore
9+
/tests export-ignore
10+
/.editorconfig export-ignore
11+
/CHANGELOG.md export-ignore
12+
/phpstan.neon.dist export-ignore
13+
/phpstan-baseline.neon export-ignore
14+
/phpunit.xml.dist export-ignore
15+
/README.md export-ignore
Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1-
name: Fix PHP code style issues
1+
name: Check & fix styling
22

3-
on:
4-
push:
5-
paths:
6-
- '**.php'
3+
on: [push]
74

85
jobs:
96
php-code-styling:
10-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-22.04
8+
9+
strategy:
10+
fail-fast: true
1111

1212
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v3
13+
- name: Check out repository code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
1518
with:
16-
ref: ${{ github.head_ref }}
19+
php-version: 8.2
20+
tools: composer:v2
21+
coverage: none
1722

18-
- name: Fix PHP code style issues
19-
uses: aglipanci/[email protected]
23+
- name: Composer & GitHub Authentication
24+
run: composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
2025

21-
- name: Commit changes
22-
uses: stefanzweifel/git-auto-commit-action@v4
26+
- name: Install composer dependencies
27+
uses: nick-fields/retry@v2
2328
with:
24-
commit_message: Fix styling
29+
timeout_minutes: 3
30+
max_attempts: 5
31+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
32+
33+
- name: Check code style
34+
timeout-minutes: 2
35+
run: ./vendor/bin/pint --test --preset laravel

.github/workflows/phpstan.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,31 @@ on:
88

99
jobs:
1010
phpstan:
11-
name: phpstan
12-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
12+
13+
strategy:
14+
fail-fast: true
15+
16+
name: Static Analysis
17+
1318
steps:
14-
- uses: actions/checkout@v3
19+
- name: Check out repository code
20+
uses: actions/checkout@v4
1521

1622
- name: Setup PHP
1723
uses: shivammathur/setup-php@v2
1824
with:
19-
php-version: '8.2'
25+
php-version: 8.2
26+
tools: composer:v2
2027
coverage: none
2128

2229
- name: Install composer dependencies
23-
uses: ramsey/composer-install@v2
30+
uses: nick-fields/retry@v2
31+
with:
32+
timeout_minutes: 3
33+
max_attempts: 5
34+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
2435

2536
- name: Run PHPStan
2637
timeout-minutes: 2
27-
run: ./vendor/bin/phpstan --error-format=github
38+
run: ./vendor/bin/phpstan analyse --error-format=github

.github/workflows/run-tests.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,42 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ${{ matrix.os }}
11+
runs-on: ubuntu-22.04
12+
1213
strategy:
1314
fail-fast: true
1415
matrix:
15-
os: [ubuntu-latest]
16-
php: [8.2, 8.1]
17-
laravel: [10.*, 9.*]
18-
dependency-version: [prefer-lowest, prefer-stable]
19-
include:
20-
- laravel: 10.*
21-
testbench: 8.*
22-
larastan: 2.4.*
23-
- laravel: 9.*
24-
testbench: 7.*
25-
larastan: 2.*
26-
27-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
16+
php: [ 8.1, 8.2, 8.3 ]
17+
laravel: [ 9, 10, 11 ]
18+
exclude:
19+
- php: 8.1
20+
laravel: 11
21+
- php: 8.3
22+
laravel: 9
23+
24+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
2825

2926
steps:
3027
- name: Checkout code
31-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
3229

3330
- name: Setup PHP
3431
uses: shivammathur/setup-php@v2
3532
with:
3633
php-version: ${{ matrix.php }}
34+
ini-values: error_reporting=E_ALL
35+
tools: composer:v2
3736
coverage: none
3837

38+
- name: Setup problem matchers
39+
run: |
40+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
41+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
42+
3943
- name: Install dependencies
4044
run: |
41-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nunomaduro/larastan:${{ matrix.larastan }}" --no-interaction --no-update
42-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
45+
composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
46+
composer update --prefer-dist --no-interaction --no-progress
4347
4448
- name: Execute tests
4549
timeout-minutes: 2
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
name: "Update Changelog"
22

33
on:
4-
release:
5-
types: [released]
4+
release:
5+
types: [released]
66

77
jobs:
8-
update:
9-
runs-on: ubuntu-latest
8+
update:
9+
runs-on: ubuntu-latest
1010

11-
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v3
14-
with:
15-
ref: master
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
ref: master
1616

17-
- name: Update Changelog
18-
uses: stefanzweifel/changelog-updater-action@v1
19-
with:
20-
latest-version: ${{ github.event.release.name }}
21-
release-notes: ${{ github.event.release.body }}
17+
- name: Update Changelog
18+
uses: stefanzweifel/changelog-updater-action@v1
19+
with:
20+
latest-version: ${{ github.event.release.name }}
21+
release-notes: ${{ github.event.release.body }}
2222

23-
- name: Commit updated CHANGELOG
24-
uses: stefanzweifel/git-auto-commit-action@v4
25-
with:
26-
branch: master
27-
commit_message: Update CHANGELOG
28-
file_pattern: CHANGELOG.md
23+
- name: Commit updated CHANGELOG
24+
uses: stefanzweifel/git-auto-commit-action@v5
25+
with:
26+
branch: master
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md

.gitignore

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
/vendor
2-
/.idea
3-
/.vagrant
4-
/build
1+
.DS_Store
2+
.vagrant
3+
.idea
4+
.php_cs
5+
.php_cs.cache
6+
.phpunit.result.cache
57
composer.phar
68
composer.lock
7-
.DS_Stor
8-
.phpunit.result.cache
9-
coverage.clover
9+
coverage
10+
build
11+
phpunit.xml
12+
phpstan.neon
13+
testbench.yaml
14+
vendor
15+
node_modules
16+
.php-cs-fixer.cache
17+
.phpunit.cache

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^8.1|^8.2",
16+
"php": "^8.1",
1717
"ext-json": "*",
1818
"guzzlehttp/guzzle": "^7.0",
19-
"illuminate/notifications": "^9.0|^10.0",
20-
"illuminate/support": "^9.0|^10.0"
19+
"illuminate/notifications": "^9.0|^10.0|^11.0",
20+
"illuminate/support": "^9.0|^10.0|^11.0"
2121
},
2222
"require-dev": {
2323
"laravel/pint": "^1.5",
2424
"mockery/mockery": "^1.3",
25-
"nunomaduro/larastan": "^1.0|^2.0",
26-
"orchestra/testbench": "^7.0|^8.0",
25+
"larastan/larastan": "^1.0|^2.0",
26+
"orchestra/testbench": "^7.31|^8.11|^9.0",
2727
"pestphp/pest": "^1.21|^2.0",
2828
"phpstan/extension-installer": "^1.1",
2929
"phpstan/phpstan-deprecation-rules": "^1.0",

phpunit.xml.dist

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
beStrictAboutTestsThatDoNotTestAnything="true"
5-
bootstrap="vendor/autoload.php"
6-
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnError="false"
12-
stopOnFailure="false"
13-
verbose="true"
14-
>
15-
<testsuites>
16-
<testsuite name="Smspoh Channel Test Suite">
17-
<directory suffix="Test.php">./tests</directory>
18-
</testsuite>
19-
</testsuites>
20-
<filter>
21-
<whitelist processUncoveredFilesFromWhitelist="true">
22-
<directory suffix=".php">./src</directory>
23-
</whitelist>
24-
</filter>
25-
<logging>
26-
<log type="tap" target="build/report.tap" />
27-
<log type="junit" target="build/report.junit.xml" />
28-
<log type="coverage-html" target="build/coverage" />
29-
<log type="coverage-text" target="build/coverage.txt" />
30-
<log type="coverage-clover" target="build/logs/clover.xml" />
31-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" beStrictAboutTestsThatDoNotTestAnything="true" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage>
4+
<report>
5+
<clover outputFile="build/logs/clover.xml"/>
6+
<html outputDirectory="build/coverage"/>
7+
<text outputFile="build/coverage.txt"/>
8+
</report>
9+
</coverage>
10+
<testsuites>
11+
<testsuite name="Smspoh Channel Test Suite">
12+
<directory suffix="Test.php">./tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<logging>
16+
<junit outputFile="build/report.junit.xml"/>
17+
</logging>
18+
<source>
19+
<include>
20+
<directory suffix=".php">./src</directory>
21+
</include>
22+
</source>
3223
</phpunit>

src/SmspohChannel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class SmspohChannel
1818
protected string $sender;
1919

2020
/**
21-
* @var int
2221
* The message body content count should be no longer than 6 message parts(918).
2322
*/
2423
protected int $character_limit_count = 918;

0 commit comments

Comments
 (0)