Skip to content

Commit c359982

Browse files
authored
Merge pull request #7 from tattersoftware/retool
Update for Release
2 parents fe0b3e7 + 3f22973 commit c359982

File tree

17 files changed

+315
-39
lines changed

17 files changed

+315
-39
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.github/workflows/deptrac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Set up PHP
3232
uses: shivammathur/setup-php@v2
3333
with:
34-
php-version: '8.0'
34+
php-version: '8.1'
3535
tools: phive
3636
extensions: intl, json, mbstring, xml
3737
coverage: none

.github/workflows/infection.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Set up PHP
3232
uses: shivammathur/setup-php@v2
3333
with:
34-
php-version: '8.0'
34+
php-version: '8.1'
3535
tools: infection, phpunit
3636
extensions: intl, json, mbstring, gd, xml, sqlite3
3737
coverage: xdebug

.github/workflows/phpcpd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2
2929
with:
30-
php-version: '8.0'
30+
php-version: '8.1'
3131
tools: phpcpd
3232
extensions: dom, mbstring
3333
coverage: none

.github/workflows/phpcsfixer.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@ on:
1616

1717
jobs:
1818
build:
19-
name: PHP ${{ matrix.php-versions }} Coding Standards
19+
name: Coding Standards
2020
runs-on: ubuntu-latest
2121
if: "!contains(github.event.head_commit.message, '[ci skip]')"
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
php-versions: ['7.4', '8.0', '8.1']
2622

2723
steps:
2824
- name: Checkout
@@ -31,7 +27,7 @@ jobs:
3127
- name: Set up PHP
3228
uses: shivammathur/setup-php@v2
3329
with:
34-
php-version: ${{ matrix.php-versions }}
30+
php-version: '8.1'
3531
extensions: json, tokenizer
3632
coverage: none
3733
env:

.github/workflows/psalm.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Psalm
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
paths:
8+
- '**.php'
9+
- 'composer.*'
10+
- 'psalm*'
11+
- '.github/workflows/psalm.yml'
12+
push:
13+
branches:
14+
- develop
15+
paths:
16+
- '**.php'
17+
- 'composer.*'
18+
- 'psalm*'
19+
- '.github/workflows/psalm.yml'
20+
21+
jobs:
22+
build:
23+
name: Psalm Analysis
24+
runs-on: ubuntu-latest
25+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '8.1'
35+
tools: phpstan, phpunit
36+
extensions: intl, json, mbstring, xml
37+
coverage: none
38+
env:
39+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Get composer cache directory
42+
id: composer-cache
43+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
44+
45+
- name: Cache composer dependencies
46+
uses: actions/cache@v3
47+
with:
48+
path: ${{ steps.composer-cache.outputs.dir }}
49+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
50+
restore-keys: ${{ runner.os }}-composer-
51+
52+
- name: Create Psalm cache directory
53+
run: mkdir -p build/psalm
54+
55+
- name: Cache Psalm results
56+
uses: actions/cache@v3
57+
with:
58+
path: build/psalm
59+
key: ${{ runner.os }}-psalm-${{ github.sha }}
60+
restore-keys: ${{ runner.os }}-psalm-
61+
62+
- name: Install dependencies
63+
run: |
64+
if [ -f composer.lock ]; then
65+
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
66+
else
67+
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
68+
fi
69+
70+
- name: Run Psalm analysis
71+
run: vendor/bin/psalm

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ jobs:
6363
6464
- name: Analyze for refactoring
6565
run: |
66-
composer global require --dev rector/rector:^0.12.16
66+
composer global require --dev rector/rector:^0.13.8
6767
rector process --dry-run --no-progress-bar

.github/workflows/unused.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup PHP
3030
uses: shivammathur/setup-php@v2
3131
with:
32-
php-version: '8.0'
32+
php-version: '8.1'
3333
tools: composer, composer-unused
3434
extensions: intl, json, mbstring, xml
3535
coverage: none

composer-unused.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
use ComposerUnused\ComposerUnused\Configuration\PatternFilter;
88
use Webmozart\Glob\Glob;
99

10-
return static function (Configuration $config): Configuration {
11-
return $config
12-
// ->addNamedFilter(NamedFilter::fromString('symfony/config'))
13-
// ->addPatternFilter(PatternFilter::fromString('/symfony-.*/'))
14-
->setAdditionalFilesFor('codeigniter4/framework', [
15-
...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'),
16-
]);
17-
};
10+
return static fn (Configuration $config): Configuration => $config
11+
// ->addNamedFilter(NamedFilter::fromString('symfony/config'))
12+
// ->addPatternFilter(PatternFilter::fromString('/symfony-.*/'))
13+
->setAdditionalFilesFor('codeigniter4/framework', [
14+
...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'),
15+
]);

composer.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
"name": "tatter/layouts",
3-
"type": "library",
43
"description": "Layout management service for CodeIgniter 4",
4+
"license": "MIT",
5+
"type": "library",
56
"keywords": [
67
"codeigniter",
78
"codeigniter4",
89
"layouts",
910
"frontend"
1011
],
11-
"homepage": "https://github.com/tattersoftware/codeigniter4-layouts",
12-
"license": "MIT",
1312
"authors": [
1413
{
1514
"name": "Matthew Gatner",
@@ -18,18 +17,16 @@
1817
"role": "Developer"
1918
}
2019
],
20+
"homepage": "https://github.com/tattersoftware/codeigniter4-layouts",
2121
"require": {
2222
"php": "^7.4 || ^8.0"
2323
},
2424
"require-dev": {
2525
"codeigniter4/framework": "^4.1",
2626
"tatter/tools": "^2.0"
2727
},
28-
"config": {
29-
"allow-plugins": {
30-
"phpstan/extension-installer": true
31-
}
32-
},
28+
"minimum-stability": "dev",
29+
"prefer-stable": true,
3330
"autoload": {
3431
"psr-4": {
3532
"Tatter\\Layouts\\": "src"
@@ -43,17 +40,24 @@
4340
"Tests\\Support\\": "tests/_support"
4441
}
4542
},
46-
"minimum-stability": "dev",
47-
"prefer-stable": true,
43+
"config": {
44+
"allow-plugins": {
45+
"phpstan/extension-installer": true
46+
}
47+
},
4848
"scripts": {
49-
"analyze": "phpstan analyze",
49+
"analyze": [
50+
"phpstan analyze",
51+
"psalm",
52+
"rector process --dry-run"
53+
],
5054
"ci": [
5155
"Composer\\Config::disableProcessTimeout",
5256
"@deduplicate",
5357
"@analyze",
58+
"@composer normalize --dry-run",
5459
"@test",
5560
"@inspect",
56-
"rector process",
5761
"@style"
5862
],
5963
"deduplicate": "phpcpd app/ src/",

0 commit comments

Comments
 (0)