Skip to content

Commit e04b581

Browse files
committed
Update toolkit
1 parent 6ab9e38 commit e04b581

10 files changed

+106
-50
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: composer
44
directory: "/"
55
schedule:
6-
interval: weekly
6+
interval: daily
77
open-pull-requests-limit: 10
88

99
- package-ecosystem: "github-actions"

.github/workflows/analyze.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
uses: actions/cache@v2
5757
with:
5858
path: ${{ steps.composer-cache.outputs.dir }}
59-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
59+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
6060
restore-keys: ${{ runner.os }}-composer-
6161

6262
- name: Create PHPStan cache directory
@@ -71,11 +71,11 @@ jobs:
7171

7272
- name: Install dependencies (limited)
7373
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
74-
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
74+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
7575

7676
- name: Install dependencies (authenticated)
7777
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
78-
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
78+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
7979
env:
8080
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
8181

.github/workflows/deduplicate.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
- 'app/**'
1111
- 'bonfire/**'
1212
- 'tests/**'
13-
- '.github/workflows/test-phpcpd.yml'
13+
- '.github/workflows/deduplicate.yml'
1414
push:
1515
branches:
1616
- 'develop'
1717
paths:
1818
- 'app/**'
1919
- 'bonfire/**'
2020
- 'tests/**'
21-
- '.github/workflows/test-phpcpd.yml'
21+
- '.github/workflows/deduplicate.yml'
2222

2323
jobs:
2424
build:
@@ -32,10 +32,8 @@ jobs:
3232
uses: shivammathur/setup-php@v2
3333
with:
3434
php-version: '8.0'
35-
tools: phive
36-
extensions: intl, json, mbstring, xml
35+
tools: phpcpd
36+
extensions: dom, mbstring
3737

3838
- name: Detect code duplication
39-
run: |
40-
sudo phive --no-progress install --global --trust-gpg-keys 4AA394086372C20A phpcpd
41-
phpcpd src/ tests/
39+
run: phpcpd app/ src/ tests/

.github/workflows/inspect.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: actions/cache@v2
5353
with:
5454
path: ${{ steps.composer-cache.outputs.dir }}
55-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
55+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
5656
restore-keys: ${{ runner.os }}-composer-
5757

5858
- name: Create Deptrac cache directory
@@ -67,15 +67,15 @@ jobs:
6767

6868
- name: Install dependencies (limited)
6969
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
70-
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
70+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
7171

7272
- name: Install dependencies (authenticated)
7373
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
74-
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
74+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
7575
env:
7676
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
7777

7878
- name: Run architectural inspection
7979
run: |
80-
sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac
81-
deptrac analyze --cache-file=build/deptrac.cache
80+
sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac
81+
deptrac analyze --cache-file=build/deptrac.cache

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ jobs:
4242
uses: actions/cache@v2
4343
with:
4444
path: ${{ steps.composer-cache.outputs.dir }}
45-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
45+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4646
restore-keys: ${{ runner.os }}-composer-
4747

4848
- name: Install dependencies (limited)
4949
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
50-
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
50+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
5151

5252
- name: Install dependencies (authenticated)
5353
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
54-
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
54+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
5555
env:
5656
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
5757

.gitignore

+6-3
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,12 @@ writable/uploads/*
6262

6363
writable/debugbar/*
6464

65-
php_errors.log
66-
6765
#-------------------------
6866
# Public Uploads
6967
#-------------------------
7068

7169
public/uploads/*
70+
public/error_log
7271

7372
#-------------------------
7473
# User Guide Temp Files
@@ -82,6 +81,11 @@ user_guide_src/cilexer/pycilexer.egg-info/*
8281
# Test Files
8382
#-------------------------
8483
tests/coverage*
84+
phpunit*.xml
85+
phpunit
86+
.phpunit*.cache
87+
php_errors.log
88+
build/
8589

8690
# Don't save phpunit under version control.
8791
phpunit
@@ -107,7 +111,6 @@ _modules/*
107111

108112
# Netbeans
109113
nbproject/
110-
build/
111114
nbbuild/
112115
dist/
113116
nbdist/

composer.json

+20-14
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
"name": "lonnieezell/bonfire",
33
"type": "project",
44
"description": "A project skeleton/admin area for CodeIgniter 4 projects",
5+
"keywords": [
6+
"codeigniter",
7+
"codeigniter4"
8+
],
9+
"homepage": "https://github.com/lonnieezell/Bonfire2",
510
"license": "MIT",
611
"require": {
7-
"php": "^7.4||^8.0",
12+
"php": "^7.4 || ^8.0",
813
"ext-json": "*",
9-
"codeigniter4/framework": "^4",
14+
"codeigniter4/framework": "^4.0",
1015
"tatter/alerts": "^2.1",
1116
"lonnieezell/codigniter-shield": "dev-develop",
1217
"components/font-awesome": "^5.15",
@@ -22,9 +27,6 @@
2227
"nexusphp/tachycardia": "^1.0",
2328
"phpstan/phpstan": "^1.1"
2429
},
25-
"suggest": {
26-
"ext-fileinfo": "Improves mime type detection for files"
27-
},
2830
"autoload": {
2931
"psr-4": {
3032
"App\\": "app",
@@ -36,17 +38,13 @@
3638
},
3739
"autoload-dev": {
3840
"psr-4": {
41+
"Bonfire\\": "bonfire",
3942
"Tests\\": "tests",
40-
"Tests\\Support\\": "tests/_support",
41-
"Bonfire\\": "bonfire"
43+
"Tests\\Support\\": "tests/_support"
4244
}
4345
},
44-
"repositories": [
45-
{
46-
"type": "vcs",
47-
"url": "https://github.com/lonnieezell/codigniter-shield"
48-
}
49-
],
46+
"minimum-stability": "dev",
47+
"prefer-stable": true,
5048
"scripts": {
5149
"analyze": "phpstan analyze",
5250
"ci": [
@@ -59,10 +57,18 @@
5957
],
6058
"deduplicate": "phpcpd app/ bonfire/",
6159
"inspect": "deptrac analyze --cache-file=build/deptrac.cache",
62-
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
6360
"style": "php-cs-fixer fix --verbose --ansi --using-cache=no",
6461
"test": "phpunit"
6562
},
63+
"repositories": [
64+
{
65+
"type": "vcs",
66+
"url": "https://github.com/lonnieezell/codigniter-shield"
67+
}
68+
],
69+
"suggest": {
70+
"ext-fileinfo": "Improves mime type detection for files"
71+
},
6672
"support": {
6773
"forum": "http://forum.codeigniter.com/",
6874
"source": "https://github.com/lonnieezell/Bonfire2"

depfile.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ layers:
4545
- type: bool
4646
must:
4747
- type: directory
48-
regex: src/Config/.*
48+
regex: app/Config/.*
4949
must_not:
5050
- type: className
5151
regex: .*Services
@@ -65,7 +65,7 @@ layers:
6565
- type: bool
6666
must:
6767
- type: directory
68-
regex: src/Entities/.*
68+
regex: app/Entities/.*
6969
must_not:
7070
- type: directory
7171
regex: vendor/.*
@@ -80,7 +80,7 @@ layers:
8080
- type: bool
8181
must:
8282
- type: directory
83-
regex: src/Views/.*
83+
regex: app/Views/.*
8484
must_not:
8585
- type: directory
8686
regex: vendor/.*
@@ -110,6 +110,7 @@ ruleset:
110110
- Entity
111111
- Service
112112
- Vendor Config
113+
- Vendor Entity
113114
- Vendor Model
114115
Service:
115116
- Config

phpstan.neon.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
- tests
88
bootstrapFiles:
99
- vendor/codeigniter4/framework/system/Test/bootstrap.php
10-
excludes_analyse:
10+
excludePaths:
1111
- **/Routes.php
1212
- **/Views/*
1313
ignoreErrors:

phpunit.xml.dist

+58-10
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,99 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
34
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
45
backupGlobals="false"
6+
beStrictAboutCoversAnnotation="true"
7+
beStrictAboutOutputDuringTests="true"
8+
beStrictAboutTodoAnnotatedTests="true"
59
colors="true"
610
convertErrorsToExceptions="true"
711
convertNoticesToExceptions="true"
812
convertWarningsToExceptions="true"
13+
executionOrder="random"
14+
failOnRisky="true"
15+
failOnWarning="true"
916
stopOnError="false"
1017
stopOnFailure="false"
1118
stopOnIncomplete="false"
1219
stopOnSkipped="false"
13-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
20+
verbose="true">
21+
1422
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
1523
<include>
1624
<directory suffix=".php">./app</directory>
25+
<directory suffix=".php">./bonfire</directory>
1726
</include>
1827
<exclude>
28+
<directory suffix=".php">./app/Config</directory>
1929
<directory suffix=".php">./app/Views</directory>
30+
<directory suffix=".php">./bonfire/Views</directory>
2031
<file>./app/Config/Routes.php</file>
2132
</exclude>
2233
<report>
23-
<clover outputFile="build/logs/clover.xml"/>
24-
<html outputDirectory="build/logs/html"/>
25-
<php outputFile="build/logs/coverage.serialized"/>
34+
<clover outputFile="build/phpunit/clover.xml"/>
35+
<html outputDirectory="build/phpunit/html"/>
36+
<php outputFile="build/phpunit/coverage.serialized"/>
2637
<text outputFile="php://stdout" showUncoveredFiles="false"/>
38+
<xml outputDirectory="build/phpunit/xml-coverage"/>
2739
</report>
2840
</coverage>
41+
2942
<testsuites>
30-
<testsuite name="App">
43+
<testsuite name="app">
3144
<directory>./tests</directory>
3245
</testsuite>
3346
</testsuites>
47+
48+
<extensions>
49+
<extension class="Nexus\PHPUnit\Extension\Tachycardia">
50+
<arguments>
51+
<array>
52+
<element key="timeLimit">
53+
<double>0.50</double>
54+
</element>
55+
<element key="reportable">
56+
<integer>30</integer>
57+
</element>
58+
<element key="precision">
59+
<integer>2</integer>
60+
</element>
61+
<element key="collectBare">
62+
<boolean>true</boolean>
63+
</element>
64+
<element key="tabulate">
65+
<boolean>true</boolean>
66+
</element>
67+
</array>
68+
</arguments>
69+
</extension>
70+
</extensions>
71+
3472
<logging>
35-
<testdoxHtml outputFile="build/logs/testdox.html"/>
36-
<testdoxText outputFile="build/logs/testdox.txt"/>
37-
<junit outputFile="build/logs/logfile.xml"/>
73+
<testdoxHtml outputFile="build/phpunit/testdox.html"/>
74+
<testdoxText outputFile="build/phpunit/testdox.txt"/>
75+
<junit outputFile="build/phpunit/junit.xml"/>
3876
</logging>
77+
3978
<php>
40-
<server name="app.baseURL" value="http://example.com/"/>
79+
<env name="XDEBUG_MODE" value="coverage"/>
80+
<server name="app.baseURL" value="http://example.com"/>
81+
4182
<!-- Directory containing phpunit.xml -->
4283
<const name="HOMEPATH" value="./"/>
84+
4385
<!-- Directory containing the Paths config file -->
4486
<const name="CONFIGPATH" value="./app/Config/"/>
87+
4588
<!-- Directory containing the front controller (index.php) -->
4689
<const name="PUBLICPATH" value="./public/"/>
90+
91+
<!-- https://getcomposer.org/xdebug -->
92+
<env name="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
93+
4794
<!-- Database configuration -->
48-
<!-- Uncomment to provide your own database for testing
95+
<env name="database.tests.strictOn" value="true"/>
96+
<!-- Uncomment to use alternate testing database configuration
4997
<env name="database.tests.hostname" value="localhost"/>
5098
<env name="database.tests.database" value="tests"/>
5199
<env name="database.tests.username" value="tests_user"/>

0 commit comments

Comments
 (0)