Skip to content

Commit 75bc05b

Browse files
committed
chore:support laravel 11.x
1 parent 09261a8 commit 75bc05b

8 files changed

+62
-53
lines changed

.github/workflows/fix-php-code-style-issues.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ on: [push]
44

55
jobs:
66
php-code-styling:
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-22.04
8+
9+
strategy:
10+
fail-fast: true
811

912
steps:
1013
- name: Checkout code

.github/workflows/phpstan.yml

+17-6
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@v4
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@v3
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

+12-17
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,18 @@ 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, 8.0]
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.*
16+
php: [ 8.1, 8.2, 8.3 ]
17+
laravel: [ 10, 11 ]
2618
exclude:
27-
- laravel: 10.*
28-
php: 8.0
19+
- php: 8.1
20+
laravel: 11
2921

30-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
22+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
3123

3224
steps:
3325
- name: Checkout code
@@ -37,6 +29,9 @@ jobs:
3729
uses: shivammathur/setup-php@v2
3830
with:
3931
php-version: ${{ matrix.php }}
32+
ini-values: error_reporting=E_ALL
33+
tools: composer:v2
34+
coverage: none
4035

4136
- name: Setup problem matchers
4237
run: |
@@ -45,8 +40,8 @@ jobs:
4540
4641
- name: Install dependencies
4742
run: |
48-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nunomaduro/larastan:${{ matrix.larastan }}" --no-interaction --no-update
49-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
43+
composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
44+
composer update --prefer-dist --no-interaction --no-progress
5045
5146
- name: Execute tests
5247
timeout-minutes: 2
+20-20
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@v4
14-
with:
15-
ref: main
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
ref: main
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@v5
25-
with:
26-
branch: main
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: main
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md

README.md

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

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/ageekdev/laravel-num.svg?style=flat-square)](https://packagist.org/packages/ageekdev/laravel-num)
44
[![Laravel 9.x](https://img.shields.io/badge/Laravel-9.x-red.svg?style=flat-square)](https://laravel.com/docs/9.x)
5-
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red.svg?style=flat-square)](http://laravel.com)
5+
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red.svg?style=flat-square)](https://laravel.com/docs/10.x)
6+
[![Laravel 11.x](https://img.shields.io/badge/Laravel-11.x-red.svg?style=flat-square)](https://laravel.com/docs/11.x)
67
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ageekdev/laravel-num/run-tests.yml?label=tests&style=flat-square)](https://github.com/ageekdev/laravel-num/actions/workflows/run-tests.yml)
78
[![Total Downloads](https://img.shields.io/packagist/dt/ageekdev/laravel-num.svg?style=flat-square)](https://packagist.org/packages/ageekdev/laravel-num)
89

composer.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@
1818
}
1919
],
2020
"require": {
21-
"php": "^8.0|^8.1|^8.2",
22-
"illuminate/support": "^9.0|^10.0"
21+
"php": "^8.1",
22+
"illuminate/support": "^9.0|^10.0|^11.0"
2323
},
2424
"require-dev": {
2525
"laravel/pint": "^1.5",
2626
"phpstan/extension-installer": "^1.1",
2727
"phpstan/phpstan-deprecation-rules": "^1.0",
2828
"phpstan/phpstan-phpunit": "^1.0",
29-
"nunomaduro/collision": "^5.11|^6.2|^7.0",
30-
"nunomaduro/larastan": "^2.0",
31-
"orchestra/testbench": "^7.6|^8.0",
29+
"larastan/larastan": "^2.0",
30+
"orchestra/testbench": "^7.31|^8.11|^9.0",
3231
"pestphp/pest": "^1.21|^2.0",
33-
"pestphp/pest-plugin-laravel": "^1.2|^2.0",
32+
"pestphp/pest-plugin-laravel": "^1.4|^2.0",
3433
"roave/security-advisories": "dev-latest"
3534
},
3635
"autoload": {

src/Num.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Num
1515
*
1616
* Supported Languages: "Myanmar", "English", "Thai"
1717
*/
18-
public function convert(int|string|null $string, string $to = 'en', string $from = null): ?string
18+
public function convert(int|string|null $string, string $to = 'en', ?string $from = null): ?string
1919
{
2020
if ($string === null || $string === '') {
2121
return $string;

src/helpers.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Support Language: "Myanmar", "English", "Thai"
1010
*/
11-
function num_convert(int|string|null $string, string $to = 'en', string $from = null): ?string
11+
function num_convert(int|string|null $string, string $to = 'en', ?string $from = null): ?string
1212
{
1313
return Num::convert($string, $to, $from);
1414
}

0 commit comments

Comments
 (0)