Skip to content

Commit

Permalink
chore:support laravel 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tintnaingwinn committed Apr 7, 2024
1 parent c78d3d0 commit 62b16c2
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 109 deletions.
23 changes: 14 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
* text=auto
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

/tests export-ignore
/docs export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.styleci.yml export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/art export-ignore
/tests export-ignore
/.editorconfig export-ignore
/CHANGELOG.md export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
39 changes: 25 additions & 14 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
name: Fix PHP code style issues
name: Check & fix styling

on:
push:
paths:
- '**.php'
on: [push]

jobs:
php-code-styling:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: true

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check out repository code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
ref: ${{ github.head_ref }}
php-version: 8.2
tools: composer:v2
coverage: none

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

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
- name: Install composer dependencies
uses: nick-fields/retry@v2
with:
commit_message: Fix styling
timeout_minutes: 3
max_attempts: 5
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress

- name: Check code style
timeout-minutes: 2
run: ./vendor/bin/pint --test --preset laravel
23 changes: 17 additions & 6 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,31 @@ on:

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: true

name: Static Analysis

steps:
- uses: actions/checkout@v3
- name: Check out repository code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: 8.2
tools: composer:v2
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
max_attempts: 5
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress

- name: Run PHPStan
timeout-minutes: 2
run: ./vendor/bin/phpstan --error-format=github
run: ./vendor/bin/phpstan analyse --error-format=github
38 changes: 21 additions & 17 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,42 @@ on:

jobs:
test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04

strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1]
laravel: [10.*, 9.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
larastan: 2.4.*
- laravel: 9.*
testbench: 7.*
larastan: 2.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
php: [ 8.1, 8.2, 8.3 ]
laravel: [ 9, 10, 11 ]
exclude:
- php: 8.1
laravel: 11
- php: 8.3
laravel: 9

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nunomaduro/larastan:${{ matrix.larastan }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
timeout-minutes: 2
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: "Update Changelog"

on:
release:
types: [released]
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: master
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: master

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}
- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: master
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
22 changes: 15 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/vendor
/.idea
/.vagrant
/build
.DS_Store
.vagrant
.idea
.php_cs
.php_cs.cache
.phpunit.result.cache
composer.phar
composer.lock
.DS_Stor
.phpunit.result.cache
coverage.clover
coverage
build
phpunit.xml
phpstan.neon
testbench.yaml
vendor
node_modules
.php-cs-fixer.cache
.phpunit.cache
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
}
],
"require": {
"php": "^8.1|^8.2",
"php": "^8.1",
"ext-json": "*",
"guzzlehttp/guzzle": "^7.0",
"illuminate/notifications": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0"
"illuminate/notifications": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0"
},
"require-dev": {
"laravel/pint": "^1.5",
"mockery/mockery": "^1.3",
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^7.0|^8.0",
"larastan/larastan": "^1.0|^2.0",
"orchestra/testbench": "^7.31|^8.11|^9.0",
"pestphp/pest": "^1.21|^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
Expand Down
51 changes: 21 additions & 30 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="true"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
>
<testsuites>
<testsuite name="Smspoh Channel Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap" />
<log type="junit" target="build/report.junit.xml" />
<log type="coverage-html" target="build/coverage" />
<log type="coverage-text" target="build/coverage.txt" />
<log type="coverage-clover" target="build/logs/clover.xml" />
</logging>
<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">
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="Smspoh Channel Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
1 change: 0 additions & 1 deletion src/SmspohChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class SmspohChannel
protected string $sender;

/**
* @var int
* The message body content count should be no longer than 6 message parts(918).
*/
protected int $character_limit_count = 918;
Expand Down

0 comments on commit 62b16c2

Please sign in to comment.