Skip to content

Commit

Permalink
chore:support laravel11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tintnaingwinn committed Jul 18, 2024
1 parent e6e0395 commit f96f952
Show file tree
Hide file tree
Showing 31 changed files with 350 additions and 267 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
Expand All @@ -10,6 +13,3 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
27 changes: 17 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/art export-ignore
/docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist.php export-ignore
/.php_cs.php export-ignore
/auth.json export-ignore
/CHANGELOG.md export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
/pint.json export-ignore
/README.md export-ignore
/UPGRADING.md export-ignore
File renamed without changes.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/Fawkes-Creatives/myanmar-phone/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/Fawkes-Creatives/myanmar-phone/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/Fawkes-Creatives/myanmar-phone/security/policy
about: Learn how to notify us for sensitive bugs
- name: Report a bug
url: https://github.com/Fawkes-Creatives/myanmar-phone/issues/new
about: Report a reproducable bug

3 changes: 3 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

If you discover any security related issues, please email fawkescreatives@gmail.com instead of using the issue tracker.
32 changes: 32 additions & 0 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check & fix styling

on: [push]

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

strategy:
fail-fast: true

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

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

- name: Install composer dependencies
uses: nick-fields/retry@v2
with:
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
38 changes: 38 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
runs-on: ubuntu-22.04

strategy:
fail-fast: true

name: Static Analysis

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

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

- name: Install composer dependencies
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 analyse --error-format=github
48 changes: 48 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: run-tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-22.04

strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2, 8.3 ]
laravel: [ 10, 11 ]
exclude:
- php: 8.1
laravel: 11

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

steps:
- name: Checkout code
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 }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
timeout-minutes: 2
run: vendor/bin/pest
28 changes: 28 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest

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: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.DS_Store
.vagrant
.idea
.php_cs
.php_cs.cache
.phpunit.result.cache
build
composer.phar
composer.lock
coverage
docs
build
phpunit.xml
phpstan.neon
testbench.yaml
Expand Down
21 changes: 17 additions & 4 deletions README-en.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 align="center">Laravel Myanmar Phone</h1>

[![Latest Version on Packagist](https://img.shields.io/packagist/v/fawkescreatives/myanmar-phone.svg)](https://packagist.org/packages/fawkescreatives/myanmar-phone)
[![Laravel 8.x](https://img.shields.io/badge/Laravel-8.x-red.svg)](https://laravel.com/docs/8.x)
[![Laravel 9.x](https://img.shields.io/badge/Laravel-9.x-red.svg)](https://laravel.com)
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red.svg)](https://laravel.com/docs/10.x)
[![Laravel 11.x](https://img.shields.io/badge/Laravel-11.x-red.svg)](https://laravel.com/docs/11.x)
[![Total Downloads](https://poser.pugx.org/fawkescreatives/myanmar-phone/downloads)](https://packagist.org/packages/fawkescreatives/myanmar-phone)
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://packagist.org/packages/fawkescreatives/myanmar-phone)

Expand Down Expand Up @@ -103,6 +103,19 @@ You can run the tests with:
composer test
```

### License
## Changelog

The MIT License (MIT). Please see [License File](https://github.com/Fawkes-Creatives/myanmar-phone/blob/main/LICENSE.md) for more information.
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.


## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1 align="center">Laravel Myanmar Phone</h1>

[![Latest Version on Packagist](https://img.shields.io/packagist/v/fawkescreatives/myanmar-phone.svg)](https://packagist.org/packages/fawkescreatives/myanmar-phone)
[![Laravel 8.x](https://img.shields.io/badge/Laravel-8.x-red.svg)](https://laravel.com/docs/8.x)
[![Laravel 9.x](https://img.shields.io/badge/Laravel-9.x-red.svg)](https://laravel.com)
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red.svg)](https://laravel.com/docs/10.x)
[![Laravel 11.x](https://img.shields.io/badge/Laravel-11.x-red.svg)](https://laravel.com/docs/11.x)
[![Total Downloads](https://poser.pugx.org/fawkescreatives/myanmar-phone/downloads)](https://packagist.org/packages/fawkescreatives/myanmar-phone)
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://packagist.org/packages/fawkescreatives/myanmar-phone)

Expand Down Expand Up @@ -118,7 +118,18 @@ You can run the tests with:
composer test
```

### License
## Changelog

The MIT License (MIT). Please see [License File](https://github.com/Fawkes-Creatives/myanmar-phone/blob/main/LICENSE.md)
for more information.
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
23 changes: 14 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
}
],
"require": {
"php": "^7.3|^8.0",
"illuminate/support": "^8.0|^9.0",
"php": "^8.1",
"illuminate/contracts": "^10.0|^11.0",
"giggsey/libphonenumber-for-php": "^8.0"
},
"require-dev": {
"nunomaduro/collision": "^5.10|^6.1",
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^6.22|^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"laravel/pint": "^1.10",
"larastan/larastan": "^2.0",
"orchestra/testbench": "^8.11|^9.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
Expand All @@ -47,10 +47,15 @@
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage"
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
}
},
"extra": {
"laravel": {
Expand Down
4 changes: 2 additions & 2 deletions config/myanmar_phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
| RFC3966 => 3 (eg.., tel:+95-9-123-456-789)
|
*/
'default_format' => 0, // 0 || 1 || 2 || 3
];
'default_format' => 0, // 0 || 1 || 2 || 3
];
Empty file removed phpstan-baseline.neon
Empty file.
4 changes: 0 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
includes:
- phpstan-baseline.neon

parameters:
level: 4
paths:
Expand All @@ -9,5 +6,4 @@ parameters:
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false

Loading

0 comments on commit f96f952

Please sign in to comment.