Skip to content

Commit 1abb9f6

Browse files
committed
laravel/pint
1 parent ea39a69 commit 1abb9f6

File tree

5 files changed

+103
-153
lines changed

5 files changed

+103
-153
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,34 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
8-
7+
branches: [master]
98

109
jobs:
1110
phpcs:
1211
runs-on: ubuntu-latest
1312
steps:
14-
- uses: actions/checkout@v2
15-
- name: Setup PHP environment
16-
uses: shivammathur/setup-php@v2
17-
- name: Install dependencies
18-
run: composer install
19-
- name: PHPCSFixer check
20-
run: composer check-style
13+
- uses: actions/checkout@v2
14+
- name: Setup PHP environment
15+
uses: shivammathur/setup-php@v2
16+
- name: Install dependencies
17+
run: composer install
18+
- name: PHPCSFixer check
19+
run: composer check-style
2120
phpunit:
2221
strategy:
2322
matrix:
24-
php_version: [7.4, 8.0]
23+
php_version: [8.0, 8.1, 8.2]
2524
runs-on: ubuntu-latest
2625
steps:
27-
- uses: actions/checkout@v2
28-
- name: Setup PHP environment
29-
uses: shivammathur/setup-php@v2
30-
with:
31-
php-version: ${{ matrix.php_version }}
32-
coverage: xdebug
33-
- name: Install dependencies
34-
run: composer install
35-
- name: PHPUnit check
36-
run: ./vendor/bin/phpunit --coverage-text
26+
- uses: actions/checkout@v2
27+
- name: Setup PHP environment
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php_version }}
31+
coverage: xdebug
32+
- name: Install dependencies
33+
run: composer install
34+
- name: PHPUnit check
35+
run: ./vendor/bin/phpunit --coverage-text

.php-cs-fixer.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

composer.json

Lines changed: 77 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,81 @@
11
{
2-
"name": "overtrue/laravel-package",
3-
"description": "Laravel package template",
4-
"license": "MIT",
5-
"authors": [
6-
{
7-
"name": "overtrue",
8-
"email": "[email protected]"
9-
}
10-
],
11-
"require": {
12-
"laravel/framework": "^9.4",
13-
"phpstan/phpstan": "^1.4"
14-
},
15-
"autoload": {
16-
"psr-4": {
17-
"Overtrue\\LaravelPackage\\": "src"
18-
}
19-
},
20-
"autoload-dev": {
21-
"psr-4": {
22-
"Tests\\": "tests"
23-
}
24-
},
25-
"require-dev": {
26-
"mockery/mockery": "^1.2",
27-
"phpunit/phpunit": "^9.0",
28-
"orchestra/testbench": "^7.1",
29-
"friendsofphp/php-cs-fixer": "^3.0",
30-
"vimeo/psalm": "^4.10",
31-
"jetbrains/phpstorm-attributes": "^1.0"
32-
},
33-
"extra": {
34-
"laravel": {
35-
"providers": [
36-
"\\Overtrue\\LaravelPackage\\PackageServiceProvider"
37-
]
38-
},
39-
"hooks": {
40-
"pre-commit": [
41-
"composer check-style",
42-
"composer phpstan",
43-
"composer test"
44-
],
45-
"pre-push": [
46-
"composer check-style"
47-
]
48-
}
49-
},
50-
"scripts": {
51-
"post-update-cmd": [
52-
"cghooks remove",
53-
"cghooks add --ignore-lock",
54-
"cghooks update"
55-
],
56-
"post-merge": "composer install",
57-
"post-install-cmd": [
58-
"cghooks remove",
59-
"cghooks add --ignore-lock",
60-
"cghooks update"
61-
],
62-
"cghooks": "vendor/bin/cghooks",
63-
"check-style": "php-cs-fixer fix --using-cache=no --diff --dry-run --ansi",
64-
"fix-style": "php-cs-fixer fix --using-cache=no --ansi",
65-
"test": "phpunit --colors",
66-
"phpstan": "phpstan analyse",
67-
"psalm": "psalm --show-info=true --no-cache",
68-
"psalm-fix": "psalm --no-cache --alter --issues=MissingReturnType,MissingParamType"
69-
},
70-
"scripts-descriptions": {
71-
"test": "Run all tests.",
72-
"check-style": "Run style checks (only dry run - no fixing!).",
73-
"fix-style": "Run style checks and fix violations."
2+
"name": "overtrue/laravel-package",
3+
"description": "Laravel package template",
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "overtrue",
8+
"email": "[email protected]"
9+
}
10+
],
11+
"require": {
12+
"laravel/framework": "^9.4",
13+
"phpstan/phpstan": "^1.4"
14+
},
15+
"autoload": {
16+
"psr-4": {
17+
"Overtrue\\LaravelPackage\\": "src"
18+
}
19+
},
20+
"autoload-dev": {
21+
"psr-4": {
22+
"Tests\\": "tests"
23+
}
24+
},
25+
"require-dev": {
26+
"mockery/mockery": "^1.2",
27+
"phpunit/phpunit": "^9.0",
28+
"orchestra/testbench": "^7.1",
29+
"vimeo/psalm": "^4.10",
30+
"jetbrains/phpstorm-attributes": "^1.0",
31+
"brainmaestro/composer-git-hooks": "dev-master",
32+
"laravel/pint": "^1.1"
33+
},
34+
"extra": {
35+
"laravel": {
36+
"providers": [
37+
"\\Overtrue\\LaravelPackage\\PackageServiceProvider"
38+
]
7439
},
75-
"config": {
76-
"allow-plugins": {
77-
"composer/package-versions-deprecated": true
78-
}
40+
"hooks": {
41+
"pre-commit": [
42+
"composer check-style",
43+
"composer phpstan",
44+
"composer test"
45+
],
46+
"pre-push": [
47+
"composer check-style"
48+
]
49+
}
50+
},
51+
"scripts": {
52+
"post-update-cmd": [
53+
"cghooks remove",
54+
"cghooks add --ignore-lock",
55+
"cghooks update"
56+
],
57+
"post-merge": "composer install",
58+
"post-install-cmd": [
59+
"cghooks remove",
60+
"cghooks add --ignore-lock",
61+
"cghooks update"
62+
],
63+
"cghooks": "vendor/bin/cghooks",
64+
"check-style": "vendor/bin/pint --test",
65+
"fix-style": "vendor/bin/pint",
66+
"test": "phpunit --colors",
67+
"phpstan": "phpstan analyse",
68+
"psalm": "psalm --show-info=true --no-cache",
69+
"psalm-fix": "psalm --no-cache --alter --issues=MissingReturnType,MissingParamType"
70+
},
71+
"scripts-descriptions": {
72+
"test": "Run all tests.",
73+
"check-style": "Run style checks (only dry run - no fixing!).",
74+
"fix-style": "Run style checks and fix violations."
75+
},
76+
"config": {
77+
"allow-plugins": {
78+
"composer/package-versions-deprecated": true
7979
}
80+
}
8081
}

src/PackageServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ class PackageServiceProvider extends ServiceProvider
1212
public function boot()
1313
{
1414
$this->publishes([
15-
\dirname(__DIR__) . '/migrations/' => database_path('migrations'),
15+
\dirname(__DIR__).'/migrations/' => database_path('migrations'),
1616
], 'migrations');
1717

1818
if ($this->app->runningInConsole()) {
19-
$this->loadMigrationsFrom(\dirname(__DIR__) . '/migrations/');
19+
$this->loadMigrationsFrom(\dirname(__DIR__).'/migrations/');
2020
}
2121
}
2222

tests/TestCase.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
99
/**
1010
* Load package service provider.
1111
*
12-
* @param \Illuminate\Foundation\Application $app
13-
*
12+
* @param \Illuminate\Foundation\Application $app
1413
* @return array
1514
*/
1615
protected function getPackageProviders($app)
@@ -21,7 +20,7 @@ protected function getPackageProviders($app)
2120
/**
2221
* Define environment setup.
2322
*
24-
* @param \Illuminate\Foundation\Application $app
23+
* @param \Illuminate\Foundation\Application $app
2524
*/
2625
protected function getEnvironmentSetUp($app)
2726
{
@@ -37,7 +36,7 @@ protected function getEnvironmentSetUp($app)
3736
protected function setUp(): void
3837
{
3938
parent::setUp();
40-
$this->loadMigrationsFrom(__DIR__ . '/migrations');
41-
$this->loadMigrationsFrom(dirname(__DIR__) . '/migrations');
39+
$this->loadMigrationsFrom(__DIR__.'/migrations');
40+
$this->loadMigrationsFrom(dirname(__DIR__).'/migrations');
4241
}
4342
}

0 commit comments

Comments
 (0)