Skip to content

Commit d686c86

Browse files
authored
Merge pull request #5058 from codeigniter4/release-4.1.4
4.1.4 Ready code
2 parents 795e9c4 + 26b7a90 commit d686c86

File tree

828 files changed

+125750
-138262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

828 files changed

+125750
-138262
lines changed

.editorconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ root = true
66
end_of_line = lf
77

88
[*.php]
9-
indent_style = tab
9+
indent_style = space
10+
indent_size = 4
1011
charset = utf-8
1112
trim_trailing_whitespace = true
1213
insert_final_newline = true

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ utils/ export-ignore
2525
rector.php export-ignore
2626
phpunit.xml.dist export-ignore
2727
phpstan.neon.dist export-ignore
28+
.php-cs-fixer.dist.php export-ignore
2829

2930
# The source user guide, either
3031
user_guide_src/ export-ignore

.github/dependabot.yml

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
version: 2
2+
23
updates:
3-
- package-ecosystem: composer
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
4+
- package-ecosystem: 'composer'
5+
directory: '/'
6+
schedule:
7+
interval: 'daily'
8+
open-pull-requests-limit: 10
89

9-
- package-ecosystem: "github-actions"
10-
directory: "/"
11-
schedule:
12-
# Check for updates to GitHub Actions every weekday
13-
interval: "daily"
10+
- package-ecosystem: 'github-actions'
11+
directory: '/'
12+
schedule:
13+
interval: 'daily'
14+
ignore:
15+
- dependency-name: '*'
16+
update-types:
17+
- 'version-update:semver-minor'
18+
- 'version-update:semver-patch'

.github/workflows/deploy-apidocs.yml

+22-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# When changes are pushed to the develop branch,
22
# build the current version of the API documentation
3-
# with phpDocumentor and deploy it to the api branch.
3+
# with phpDocumentor and deploy it to codeigniter4/api.
44
name: Deploy API Documentation
55

66
on:
@@ -9,13 +9,14 @@ on:
99
- 'develop'
1010
paths:
1111
- 'system/**'
12+
- '.github/workflows/deploy-apidocs.yml'
1213

1314
jobs:
14-
1515
build:
1616
name: Deploy to api
17-
if: (github.repository == 'codeigniter4/CodeIgniter4')
18-
runs-on: ubuntu-latest
17+
if: github.repository == 'codeigniter4/CodeIgniter4'
18+
runs-on: ubuntu-20.04
19+
1920
steps:
2021
- name: Setup credentials
2122
run: |
@@ -37,37 +38,34 @@ jobs:
3738
- name: Setup PHP
3839
uses: shivammathur/setup-php@v2
3940
with:
40-
php-version: '7.4'
41-
extensions: intl
41+
php-version: '8.0'
42+
coverage: none
4243

43-
- name: Install GraphViz for phpDocumentor
44-
run: |
45-
sudo apt install -yq graphviz
46-
47-
- name: Download phpDocumentor
44+
- name: Download phpDocumentor v3.1
4845
run: |
4946
cd ./source
5047
curl \
51-
-L https://github.com/phpDocumentor/phpDocumentor/releases/download/v2.9.1/phpDocumentor.phar \
48+
-L https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.1.0/phpDocumentor.phar \
5249
-o admin/phpDocumentor.phar
5350
54-
- name: Prepare
51+
- name: Prepare API repo
52+
working-directory: api
5553
run: |
56-
cd ./api
57-
rm -rf ./api/docs*
58-
mkdir -p ./api/docs
5954
git reset --hard master
55+
rm -rfv docs
56+
mkdir --parents --verbose docs
6057
61-
- name: Build
58+
- name: Build API in source repo
59+
working-directory: source
6260
run: |
63-
cd ./source
64-
chmod +x admin/phpDocumentor.phar
65-
admin/phpDocumentor.phar
61+
php admin/phpDocumentor.phar run --ansi --verbose
6662
cp -R ${GITHUB_WORKSPACE}/source/api/build/* ${GITHUB_WORKSPACE}/api/docs
6763
68-
- name: Deploy
64+
- name: Deploy to API repo
65+
working-directory: api
6966
run: |
70-
cd ./api
7167
git add .
72-
git commit -m "API sync for ${GITHUB_SHA}"
73-
git push
68+
if ! git diff-index --quiet HEAD; then
69+
git commit -m "Updated API for commit ${GITHUB_SHA}"
70+
git push origin master
71+
fi

.github/workflows/deploy-framework.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
framework:
1111
name: Deploy to framework
12-
if: (github.repository == 'codeigniter4/CodeIgniter4')
12+
if: github.repository == 'codeigniter4/CodeIgniter4'
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Identify
@@ -36,7 +36,7 @@ jobs:
3636
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}
3737

3838
- name: Release
39-
uses: actions/github-script@v4.0.2
39+
uses: actions/github-script@v4
4040
with:
4141
github-token: ${{secrets.ACCESS_TOKEN}}
4242
script: |
@@ -54,7 +54,7 @@ jobs:
5454
5555
appstarter:
5656
name: Deploy to appstarter
57-
if: (github.repository == 'codeigniter4/CodeIgniter4')
57+
if: github.repository == 'codeigniter4/CodeIgniter4'
5858
runs-on: ubuntu-latest
5959
steps:
6060
- name: Identify
@@ -81,7 +81,7 @@ jobs:
8181
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}
8282

8383
- name: Release
84-
uses: actions/github-script@v4.0.2
84+
uses: actions/github-script@v4
8585
with:
8686
github-token: ${{secrets.ACCESS_TOKEN}}
8787
script: |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Coding Standards
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'spark'
8+
- '.github/workflows/test-coding-standards.yml'
9+
pull_request:
10+
paths:
11+
- '**.php'
12+
- 'spark'
13+
- '.github/workflows/test-coding-standards.yml'
14+
15+
jobs:
16+
lint:
17+
name: PHP ${{ matrix.php-version }} Lint with PHP CS Fixer
18+
runs-on: ubuntu-20.04
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
php-version:
24+
- '7.3'
25+
- '7.4'
26+
- '8.0'
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v2
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php-version }}
36+
extensions: tokenizer
37+
coverage: none
38+
39+
- name: Get composer cache directory
40+
id: composer-cache
41+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
42+
43+
- name: Cache dependencies
44+
uses: actions/cache@v2
45+
with:
46+
path: ${{ steps.composer-cache.outputs.dir }}
47+
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-${{ matrix.php-version }}-
50+
${{ runner.os }}-
51+
52+
- name: Install dependencies
53+
run: composer update --ansi --no-interaction
54+
55+
- name: Run lint on `app/`, `admin/`, `public/`
56+
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.no-header.php-cs-fixer.dist.php --using-cache=no --diff
57+
58+
- name: Run lint on `system/`, `tests`, `utils/`, and root PHP files
59+
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff

.github/workflows/test-phpcpd.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# When a PR is opened or a push is made, check code
2+
# for duplication with PHP Copy/Paste Detector.
3+
name: PHPCPD
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- 'develop'
9+
- '4.*'
10+
paths:
11+
- 'app/**'
12+
- 'public/**'
13+
- 'system/**'
14+
- '.github/workflows/test-phpcpd.yml'
15+
push:
16+
branches:
17+
- 'develop'
18+
- '4.*'
19+
paths:
20+
- 'app/**'
21+
- 'public/**'
22+
- 'system/**'
23+
- '.github/workflows/test-phpcpd.yml'
24+
25+
jobs:
26+
build:
27+
name: Duplicate Code Detection
28+
runs-on: ubuntu-20.04
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Setup PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: '8.0'
37+
tools: phive
38+
extensions: intl, json, mbstring, xml
39+
40+
- name: Detect code duplication
41+
run: |
42+
sudo phive --no-progress install --global --trust-gpg-keys 4AA394086372C20A phpcpd
43+
phpcpd --exclude system/Test --exclude system/ThirdParty --exclude system/Database/SQLSRV/Builder.php app/ public/ system/

.github/workflows/test-phpstan.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
5555

5656
- name: Cache composer dependencies
57-
uses: actions/cache@v2.1.5
57+
uses: actions/cache@v2
5858
with:
5959
path: ${{ steps.composer-cache.outputs.dir }}
6060
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -64,7 +64,7 @@ jobs:
6464
run: mkdir -p build/phpstan
6565

6666
- name: Cache PHPStan result cache directory
67-
uses: actions/cache@v2.1.5
67+
uses: actions/cache@v2
6868
with:
6969
path: build/phpstan
7070
key: ${{ runner.os }}-phpstan-${{ github.sha }}

.github/workflows/test-phpunit.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ jobs:
4444
db-platforms: ['MySQLi', 'Postgre', 'SQLite3', 'SQLSRV']
4545
mysql-versions: ['5.7']
4646
include:
47-
- php-versions: 7.4
47+
- php-versions: '7.4'
4848
db-platforms: MySQLi
49-
mysql-versions: 8.0
49+
mysql-versions: '8.0'
5050

5151
services:
5252
mysql:
@@ -107,13 +107,14 @@ jobs:
107107
run: |
108108
sudo apt-get install --reinstall libgs9-common fonts-noto-mono libgs9:amd64 libijs-0.35:amd64 fonts-urw-base35 ghostscript poppler-data libjbig2dec0:amd64 gsfonts libopenjp2-7:amd64 fonts-droid-fallback ttf-dejavu-core
109109
sudo apt-get install -y imagemagick
110+
sudo apt-get install --fix-broken
110111
111112
- name: Get composer cache directory
112113
id: composercache
113114
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
114115

115116
- name: Cache dependencies
116-
uses: actions/cache@v2.1.5
117+
uses: actions/cache@v2
117118
with:
118119
path: ${{ steps.composercache.outputs.dir }}
119120
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -122,7 +123,7 @@ jobs:
122123
- name: Install dependencies
123124
run: |
124125
composer update --ansi --no-interaction
125-
composer remove --ansi --dev --unused -W rector/rector phpstan/phpstan codeigniter4/codeigniter4-standard squizlabs/php_codesniffer
126+
composer remove --ansi --dev --unused -W rector/rector phpstan/phpstan friendsofphp/php-cs-fixer nexusphp/cs-config codeigniter/coding-standard
126127
php -r 'file_put_contents("vendor/laminas/laminas-zendframework-bridge/src/autoload.php", "");'
127128
env:
128129
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
@@ -140,7 +141,7 @@ jobs:
140141
- if: github.repository_owner == 'codeigniter4' && matrix.php-versions == '7.4'
141142
name: Run Coveralls
142143
run: |
143-
composer global require php-coveralls/php-coveralls:^2.4
144+
composer global require --ansi php-coveralls/php-coveralls:^2.4
144145
php-coveralls --coverage_clover=build/logs/clover.xml -v
145146
env:
146147
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-rector.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
5959

6060
- name: Cache composer dependencies
61-
uses: actions/cache@v2.1.5
61+
uses: actions/cache@v2
6262
with:
6363
path: ${{ steps.composer-cache.outputs.dir }}
6464
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,5 @@ nb-configuration.xml
126126
/results/
127127
/phpunit*.xml
128128
/.phpunit.*.cache
129+
130+
/.php-cs-fixer.php

.no-header.php-cs-fixer.dist.php

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of CodeIgniter 4 framework.
7+
*
8+
* (c) CodeIgniter Foundation <admin@codeigniter.com>
9+
*
10+
* For the full copyright and license information, please view
11+
* the LICENSE file that was distributed with this source code.
12+
*/
13+
14+
use CodeIgniter\CodingStandard\CodeIgniter4;
15+
use Nexus\CsConfig\Factory;
16+
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17+
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
18+
use Nexus\CsConfig\FixerGenerator;
19+
use PhpCsFixer\Finder;
20+
21+
$finder = Finder::create()
22+
->files()
23+
->in([
24+
__DIR__ . '/admin',
25+
__DIR__ . '/app',
26+
__DIR__ . '/public',
27+
])
28+
->notName('#Logger\.php$#');
29+
30+
$overrides = [];
31+
32+
$options = [
33+
'cacheFile' => 'build/.no-header.php-cs-fixer.cache',
34+
'finder' => $finder,
35+
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
36+
'customRules' => [
37+
NoCodeSeparatorCommentFixer::name() => true,
38+
SpaceAfterCommentStartFixer::name() => true,
39+
],
40+
];
41+
42+
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

0 commit comments

Comments
 (0)