Skip to content

Commit 61a872e

Browse files
authored
Merge pull request #181 from MGatner/retool
Update DevKit
2 parents 6d8950e + 00a66db commit 61a872e

File tree

13 files changed

+1095
-76
lines changed

13 files changed

+1095
-76
lines changed

.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.0'
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

app/Config/Constants.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
defined('HOUR') || define('HOUR', 3600);
3939
defined('DAY') || define('DAY', 86400);
4040
defined('WEEK') || define('WEEK', 604800);
41-
defined('MONTH') || define('MONTH', 2592000);
42-
defined('YEAR') || define('YEAR', 31536000);
43-
defined('DECADE') || define('DECADE', 315360000);
41+
defined('MONTH') || define('MONTH', 2_592_000);
42+
defined('YEAR') || define('YEAR', 31_536_000);
43+
defined('DECADE') || define('DECADE', 315_360_000);
4444

4545
/*
4646
| --------------------------------------------------------------------------

app/Config/Routes.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,8 @@
4747
* needing to reload it.
4848
*/
4949
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
50+
/**
51+
* @psalm-suppress MissingFile
52+
*/
5053
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
5154
}

composer.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "codeigniter4projects/playground",
3-
"type": "project",
43
"description": "A space to learn and experience CodeIgniter 4",
4+
"license": "MIT",
5+
"type": "project",
56
"keywords": [
67
"codeigniter",
78
"codeigniter4"
89
],
9-
"homepage": "https://codeigniter.com",
10-
"license": "MIT",
1110
"authors": [
1211
{
1312
"name": "Matthew Gatner",
@@ -16,6 +15,12 @@
1615
"role": "Developer"
1716
}
1817
],
18+
"homepage": "https://codeigniter.com",
19+
"support": {
20+
"forum": "http://forum.codeigniter.com/",
21+
"source": "https://github.com/codeigniter4projects/playground",
22+
"slack": "https://codeigniterchat.slack.com"
23+
},
1924
"require": {
2025
"php": "^7.4 || ^8.0",
2126
"codeigniter4/framework": "^4.1"
@@ -29,6 +34,8 @@
2934
"phpstan/extension-installer": true
3035
}
3136
},
37+
"minimum-stability": "dev",
38+
"prefer-stable": true,
3239
"autoload": {
3340
"exclude-from-classmap": [
3441
"**/Database/Migrations/**"
@@ -39,8 +46,11 @@
3946
"Tests\\Support\\": "tests/_support"
4047
}
4148
},
42-
"minimum-stability": "dev",
43-
"prefer-stable": true,
49+
"config": {
50+
"allow-plugins": {
51+
"phpstan/extension-installer": true
52+
}
53+
},
4454
"scripts": {
4555
"analyze": "phpstan analyze",
4656
"ci": [
@@ -56,12 +66,8 @@
5666
"inspect": "deptrac analyze --cache-file=build/deptrac.cache",
5767
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
5868
"patch": "patch",
69+
"retool": "retool",
5970
"style": "php-cs-fixer fix --verbose --ansi --using-cache=no",
6071
"test": "phpunit"
61-
},
62-
"support": {
63-
"forum": "http://forum.codeigniter.com/",
64-
"source": "https://github.com/codeigniter4projects/playground",
65-
"slack": "https://codeigniterchat.slack.com"
6672
}
6773
}

0 commit comments

Comments
 (0)