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 09261a8 commit 75bc05b
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 53 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on: [push]

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

strategy:
fail-fast: true

steps:
- name: Checkout code
Expand Down
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@v4
- 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@v3
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
29 changes: 12 additions & 17 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,18 @@ 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, 8.0]
laravel: [10.*, 9.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
larastan: 2.4.*
- laravel: 9.*
testbench: 7.*
larastan: 2.*
php: [ 8.1, 8.2, 8.3 ]
laravel: [ 10, 11 ]
exclude:
- laravel: 10.*
php: 8.0
- php: 8.1
laravel: 11

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

steps:
- name: Checkout code
Expand All @@ -37,6 +29,9 @@ jobs:
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: |
Expand All @@ -45,8 +40,8 @@ jobs:
- 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@v4
with:
ref: main
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main

- 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@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[![Latest Version on Packagist](https://img.shields.io/packagist/v/ageekdev/laravel-num.svg?style=flat-square)](https://packagist.org/packages/ageekdev/laravel-num)
[![Laravel 9.x](https://img.shields.io/badge/Laravel-9.x-red.svg?style=flat-square)](https://laravel.com/docs/9.x)
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red.svg?style=flat-square)](http://laravel.com)
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red.svg?style=flat-square)](https://laravel.com/docs/10.x)
[![Laravel 11.x](https://img.shields.io/badge/Laravel-11.x-red.svg?style=flat-square)](https://laravel.com/docs/11.x)
[![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)
[![Total Downloads](https://img.shields.io/packagist/dt/ageekdev/laravel-num.svg?style=flat-square)](https://packagist.org/packages/ageekdev/laravel-num)

Expand Down
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@
}
],
"require": {
"php": "^8.0|^8.1|^8.2",
"illuminate/support": "^9.0|^10.0"
"php": "^8.1",
"illuminate/support": "^9.0|^10.0|^11.0"
},
"require-dev": {
"laravel/pint": "^1.5",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"nunomaduro/collision": "^5.11|^6.2|^7.0",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^7.6|^8.0",
"larastan/larastan": "^2.0",
"orchestra/testbench": "^7.31|^8.11|^9.0",
"pestphp/pest": "^1.21|^2.0",
"pestphp/pest-plugin-laravel": "^1.2|^2.0",
"pestphp/pest-plugin-laravel": "^1.4|^2.0",
"roave/security-advisories": "dev-latest"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/Num.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Num
*
* Supported Languages: "Myanmar", "English", "Thai"
*/
public function convert(int|string|null $string, string $to = 'en', string $from = null): ?string
public function convert(int|string|null $string, string $to = 'en', ?string $from = null): ?string
{
if ($string === null || $string === '') {
return $string;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Support Language: "Myanmar", "English", "Thai"
*/
function num_convert(int|string|null $string, string $to = 'en', string $from = null): ?string
function num_convert(int|string|null $string, string $to = 'en', ?string $from = null): ?string
{
return Num::convert($string, $to, $from);
}
Expand Down

0 comments on commit 75bc05b

Please sign in to comment.