Skip to content

Commit 72b8d96

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.6
2 parents 2d8b3bd + f9d77a2 commit 72b8d96

File tree

3 files changed

+25
-46
lines changed

3 files changed

+25
-46
lines changed

.github/workflows/test-phpcpd.yml

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212
- 'public/**.php'
1313
- 'system/**.php'
1414
- '.github/workflows/test-phpcpd.yml'
15-
1615
push:
1716
branches:
1817
- 'develop'
@@ -23,40 +22,21 @@ on:
2322
- 'system/**.php'
2423
- '.github/workflows/test-phpcpd.yml'
2524

26-
concurrency:
27-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
28-
cancel-in-progress: true
29-
30-
permissions:
31-
contents: read
32-
3325
jobs:
34-
build:
35-
name: Duplicate Code Detection
36-
runs-on: ubuntu-22.04
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v4
40-
41-
- name: Setup PHP
42-
uses: shivammathur/setup-php@v2
43-
with:
44-
php-version: '8.1'
45-
tools: phpcpd
46-
extensions: dom, mbstring
47-
48-
- name: Detect code duplication
49-
run: phpcpd
50-
--exclude system/Test
51-
--exclude system/ThirdParty
52-
--exclude system/Database/SQLSRV/Builder.php
53-
--exclude system/Database/SQLSRV/Forge.php
54-
--exclude system/Database/MySQLi/Builder.php
55-
--exclude system/Database/OCI8/Builder.php
56-
--exclude system/Database/Postgre/Builder.php
57-
--exclude system/Debug/Exceptions.php
58-
--exclude system/HTTP/SiteURI.php
59-
--exclude system/Validation/Rules.php
60-
--exclude system/Autoloader/Autoloader.php
61-
--exclude system/Config/Filters.php
62-
-- app/ public/ system/
26+
phpcpd:
27+
uses: codeigniter4/.github/.github/workflows/phpcpd.yml@main
28+
with:
29+
dirs: "app/ public/ system/"
30+
options: >-
31+
--exclude system/Test
32+
--exclude system/ThirdParty
33+
--exclude system/Database/SQLSRV/Builder.php
34+
--exclude system/Database/SQLSRV/Forge.php
35+
--exclude system/Database/MySQLi/Builder.php
36+
--exclude system/Database/OCI8/Builder.php
37+
--exclude system/Database/Postgre/Builder.php
38+
--exclude system/Debug/Exceptions.php
39+
--exclude system/HTTP/SiteURI.php
40+
--exclude system/Validation/Rules.php
41+
--exclude system/Autoloader/Autoloader.php
42+
--exclude system/Config/Filters.php

contributing/internals.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ projects outside of CodeIgniter. Basically, this means that any
1313
dependencies should be kept to a minimum. Any dependencies must be able
1414
to be passed into the constructor. If you do need to use one of the
1515
other core packages, you can create that in the constructor using the
16-
`Services` class, as long as you provide a way for dependencies to
16+
`service()` function, as long as you provide a way for dependencies to
1717
override that:
1818

1919
```php
2020
public function __construct(?Foo $foo = null)
2121
{
22-
$this->foo = $foo ?? \Config\Services::foo();
22+
$this->foo = $foo ?? service('foo');
2323
}
2424
```
2525

26-
## Type declarations
26+
## Type Declarations
2727

2828
PHP7 provides [Type declarations](https://www.php.net/manual/en/language.types.declarations.php)
2929
for method parameters and return types. Use it where possible. Return type
@@ -112,10 +112,9 @@ should generally match the package name.
112112

113113
## Autoloader
114114

115-
All files within the package should be added to
116-
**system/Config/AutoloadConfig.php**, in the "classmap" property. This
117-
is only used for core framework files, and helps to minimize file system
118-
scans and keep performance high.
115+
All source files within the **system/ThirdParty** should be added to
116+
**system/Config/AutoloadConfig.php**, in the `$coreClassmap` property. This
117+
is only used for loading the third party packages without Composer.
119118

120119
## Command-Line Support
121120

contributing/pull_request.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ PHPStan is expected to scan the entire framework by running this command in your
260260
terminal:
261261

262262
```console
263-
vendor/bin/phpstan analyse
263+
composer phpstan:check
264264
```
265265

266266
See also:
@@ -272,7 +272,7 @@ false positive and should be ignored, the baseline can be updated with the follo
272272
command:
273273

274274
```console
275-
vendor/bin/phpstan analyze --generate-baseline phpstan-baseline.php
275+
composer phpstan:baseline
276276
```
277277

278278
#### Rector

0 commit comments

Comments
 (0)