Skip to content

Commit ff6cd4d

Browse files
authored
wip
1 parent f137b58 commit ff6cd4d

7 files changed

+174
-44
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.gitattributes

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

3-
/.editorconfig export-ignore
4-
/phpunit.php export-ignore
5-
/phpunit.xml.dist export-ignore
6-
/README.md export-ignore
7-
/.github export-ignore
8-
/.gitattributes export-ignore
9-
/.gitignore export-ignore
10-
/tests/ export-ignore
4+
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/art export-ignore
10+
/docs export-ignore
11+
/tests export-ignore
12+
/.editorconfig export-ignore
13+
/.php_cs.dist.php export-ignore
14+
/psalm.xml export-ignore
15+
/psalm.xml.dist export-ignore
16+
/testbench.yaml export-ignore
17+
/UPGRADING.md export-ignore
18+
/phpstan.neon.dist export-ignore
19+
/phpstan-baseline.neon export-ignore

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Please see the documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
labels:
12+
- "dependencies"
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Fix code styling
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
compile:
9+
uses: sertxudeveloper/.github/.github/workflows/php-coding-standards.yml@main
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: dependabot-auto-merge
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
jobs:
9+
dependabot:
10+
uses: sertxudeveloper/.github/.github/workflows/dependabot-auto-merge.yml@main

.github/workflows/run-tests.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: run-tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
os: [ubuntu-latest, windows-latest]
18+
php: [8.1]
19+
laravel: [9.*]
20+
coverage-driver: [pcov]
21+
stability: [prefer-lowest, prefer-stable]
22+
include:
23+
- laravel: 9.*
24+
testbench: 7.*
25+
26+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v3
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php }}
36+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
37+
coverage: ${{ matrix.coverage-driver }}
38+
39+
- name: Setup problem matchers
40+
run: |
41+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
42+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
43+
44+
- name: Install dependencies
45+
run: |
46+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
47+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
48+
49+
- name: Execute tests
50+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
51+
52+
- name: Send code coverage report to Codecov.io
53+
uses: codecov/codecov-action@v3

composer.json

+57-35
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,59 @@
11
{
2-
"name": "sertxudeveloper/laravel-translatable",
3-
"description": "Manage localized routes and use translatable models in a Laravel app.",
4-
"keywords": ["laravel", "translatable", "localization"],
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Sertxu Developer",
9-
"email": "[email protected]"
10-
}
11-
],
12-
"minimum-stability": "dev",
13-
"require": {
14-
"php": "^7.4|^8.0",
15-
"illuminate/support": "^8.0|^9.0"
16-
},
17-
"autoload": {
18-
"psr-4": {
19-
"SertxuDeveloper\\Translatable\\": "src/"
20-
}
21-
},
22-
"autoload-dev": {
23-
"psr-4": {
24-
"SertxuDeveloper\\Translatable\\Tests\\": "tests/"
25-
}
26-
},
27-
"extra": {
28-
"laravel": {
29-
"providers": [
30-
"SertxuDeveloper\\Translatable\\TranslatableServiceProvider"
31-
],
32-
"aliases": {
33-
"Translatable": "SertxuDeveloper\\Translatable\\Facades\\Translatable"
34-
}
35-
}
36-
}
2+
"name": "sertxudeveloper/laravel-translatable",
3+
"description": "Manage localized routes and use translatable models in a Laravel app.",
4+
"keywords": [
5+
"laravel",
6+
"translatable",
7+
"localization"
8+
],
9+
"homepage": "https://github.com/sertxudeveloper/laravel-translatable",
10+
"license": "MIT",
11+
"authors": [
12+
{
13+
"name": "Sertxu Developer",
14+
"email": "[email protected]",
15+
"role": "Developer"
16+
}
17+
],
18+
"require": {
19+
"php": "^7.4|^8.0",
20+
"illuminate/contracts": "^8.0|^9.0",
21+
"illuminate/support": "^8.0|^9.0",
22+
"illuminate/database": "^8.0|^9.0"
23+
},
24+
"require-dev": {
25+
"nunomaduro/collision": "^6.0",
26+
"orchestra/testbench": "^7.5",
27+
"phpunit/phpunit": "^9.5"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"SertxuDeveloper\\Translatable\\": "src/"
32+
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"SertxuDeveloper\\Translatable\\Tests\\": "tests/",
37+
"SertxuDeveloper\\Translatable\\Tests\\Database\\Factories\\": "tests/database/factories"
38+
}
39+
},
40+
"scripts": {
41+
"test": "vendor/bin/phpunit",
42+
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
43+
},
44+
"config": {
45+
"sort-packages": true
46+
},
47+
"extra": {
48+
"laravel": {
49+
"providers": [
50+
"SertxuDeveloper\\Translatable\\TranslatableServiceProvider"
51+
],
52+
"aliases": {
53+
"Translatable": "SertxuDeveloper\\Translatable\\Facades\\Translatable"
54+
}
55+
}
56+
},
57+
"minimum-stability": "dev",
58+
"prefer-stable": true
3759
}

0 commit comments

Comments
 (0)