Skip to content

Commit af86430

Browse files
committed
Merge branch 'develop' into 4.7
2 parents cb9bcc8 + a57f2f3 commit af86430

21 files changed

Lines changed: 275 additions & 49 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,20 @@ body:
8383
validations:
8484
required: true
8585

86+
- type: dropdown
87+
id: environment
88+
attributes:
89+
label: Environment
90+
description: Which CI_ENVIRONMENT setting are you using?
91+
multiple: true
92+
options:
93+
- production
94+
- development
95+
- testing
96+
- other (custom)
97+
validations:
98+
required: true
99+
86100
- type: input
87101
id: database
88102
attributes:

.github/workflows/reusable-phpunit-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ on:
4343
description: Additional PHP extensions that are needed to be enabled
4444
type: string
4545
required: false
46+
extra-ini-options:
47+
description: Additional PHP configuration directives that should be appended to the php.ini
48+
type: string
49+
required: false
4650
extra-composer-options:
4751
description: Additional Composer options that should be appended to the `composer update` call
4852
type: string
@@ -163,6 +167,7 @@ jobs:
163167
php-version: ${{ inputs.php-version }}
164168
tools: composer
165169
extensions: gd, ${{ inputs.extra-extensions }}
170+
ini-values: ${{ inputs.extra-ini-options }}
166171
coverage: ${{ env.COVERAGE_DRIVER }}
167172
env:
168173
COVERAGE_DRIVER: ${{ inputs.enable-coverage && 'xdebug' || 'none' }}

.github/workflows/reusable-serviceless-phpunit-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ on:
3737
description: Additional PHP extensions that are needed to be enabled
3838
type: string
3939
required: false
40+
extra-ini-options:
41+
description: Additional PHP configuration directives that should be appended to the php.ini
42+
type: string
43+
required: false
4044
extra-composer-options:
4145
description: Additional Composer options that should be appended to the `composer update` call
4246
type: string
@@ -75,6 +79,7 @@ jobs:
7579
php-version: ${{ inputs.php-version }}
7680
tools: composer
7781
extensions: gd, ${{ inputs.extra-extensions }}
82+
ini-values: ${{ inputs.extra-ini-options }}
7883
coverage: ${{ env.COVERAGE_DRIVER }}
7984
env:
8085
COVERAGE_DRIVER: ${{ inputs.enable-coverage && 'xdebug' || 'none' }}

.php-cs-fixer.dist.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
'ThirdParty',
2727
'Validation/Views',
2828
])
29-
->notName('#Foobar.php$#')
3029
->append([
3130
__FILE__,
3231
__DIR__ . '/.php-cs-fixer.no-header.php',
@@ -37,9 +36,7 @@
3736
__DIR__ . '/spark',
3837
]);
3938

40-
$overrides = [
41-
'modernize_strpos' => ['modernize_stripos' => true],
42-
];
39+
$overrides = [];
4340

4441
$options = [
4542
'cacheFile' => 'build/.php-cs-fixer.cache',

.php-cs-fixer.tests.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
* the LICENSE file that was distributed with this source code.
1212
*/
1313

14-
use PhpCsFixer\ConfigInterface;
14+
use PhpCsFixer\Config;
1515
use PhpCsFixer\Finder;
16+
use Utils\PhpCsFixer\CodeIgniterRuleCustomisationPolicy;
1617

17-
/** @var ConfigInterface $config */
18+
/** @var Config $config */
1819
$config = require __DIR__ . '/.php-cs-fixer.dist.php';
1920

2021
$finder = Finder::create()
@@ -26,16 +27,15 @@
2627
'_support/View/Cells/multiplier.php',
2728
'_support/View/Cells/colors.php',
2829
'_support/View/Cells/addition.php',
29-
'system/Database/Live/PreparedQueryTest.php',
30-
])
31-
->notName('#Foobar.php$#');
30+
]);
3231

3332
$overrides = [
3433
'phpdoc_to_return_type' => true,
3534
'void_return' => true,
3635
];
3736

3837
return $config
38+
->setRuleCustomisationPolicy(new CodeIgniterRuleCustomisationPolicy())
3939
->setFinder($finder)
4040
->setCacheFile('build/.php-cs-fixer.tests.cache')
4141
->setRules(array_merge($config->getRules(), $overrides));

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@
114114
],
115115
"metrics": "utils/vendor/bin/phpmetrics --config=phpmetrics.json",
116116
"phpstan:baseline": [
117-
"bash -c \"rm -rf utils/phpstan-baseline/*.neon\"",
118-
"bash -c \"touch utils/phpstan-baseline/loader.neon\"",
119-
"phpstan analyse --ansi --generate-baseline=utils/phpstan-baseline/loader.neon --memory-limit=512M",
117+
"phpstan analyse --ansi --generate-baseline=utils/phpstan-baseline/loader.neon",
120118
"split-phpstan-baseline utils/phpstan-baseline/loader.neon"
121119
],
122120
"phpstan:check": "vendor/bin/phpstan analyse --verbose --ansi --memory-limit=512M",

system/Debug/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
399399
helper('filesystem');
400400

401401
// Updated to microtime() so we can get history
402-
$time = sprintf('%.6f', Time::now()->format('U.u'));
402+
$time = sprintf('%.6F', Time::now()->format('U.u'));
403403

404404
if (! is_dir(WRITEPATH . 'debugbar')) {
405405
mkdir(WRITEPATH . 'debugbar', 0777);

system/Debug/Toolbar/Collectors/History.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function setFiles(string $current, int $limit = 20)
9090
$contents = @json_decode($contents);
9191
if (json_last_error() === JSON_ERROR_NONE) {
9292
preg_match('/debugbar_(.*)\.json$/s', $filename, $time);
93-
$time = sprintf('%.6f', $time[1] ?? 0);
93+
$time = sprintf('%.6F', $time[1] ?? 0);
9494

9595
// Debugbar files shown in History Collector
9696
$files[] = [

tests/_support/Commands/Foobar.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
<?php
22

3+
/**
4+
* This file is part of CodeIgniter 4 framework.
5+
*
6+
* (c) CodeIgniter Foundation <admin@codeigniter.com>
7+
*
8+
* For the full copyright and license information, please view
9+
* the LICENSE file that was distributed with this source code.
10+
*/
11+
312
use Config\App;
413
use CodeIgniter\CLI\CLI;
514

615
return [
7-
'foo' => 'The command will use this as foo.',
8-
'bar' => 'The command will use this as bar.',
9-
'baz' => 'The baz is here.',
10-
'bas' => CLI::color('bas', 'green') . (new App())->baseURL,
16+
'foo' => 'The command will use this as foo.',
17+
'bar' => 'The command will use this as bar.',
18+
'baz' => 'The baz is here.',
19+
'bas' => CLI::color('bas', 'green') . (new App())->baseURL,
1120
];

tests/system/Database/Live/PreparedQueryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,15 @@ public function testDeallocatePreparedQueryThenTryToClose(): void
256256
'name' => 'a',
257257
'email' => 'b@example.com',
258258
'country' => 'x',
259-
])
259+
]),
260260
);
261261

262262
$this->query->close();
263263

264264
// Try to close a non-existing prepared statement
265265
$this->expectException(BadMethodCallException::class);
266266
$this->expectExceptionMessage(
267-
'Cannot call close on a non-existing prepared statement.'
267+
'Cannot call close on a non-existing prepared statement.',
268268
);
269269

270270
$this->query->close();
@@ -325,7 +325,7 @@ public function testHandleTransStatusMarksTransactionFailedDuringTransaction():
325325

326326
$this->seeInDatabase($this->db->DBPrefix . 'without_auto_increment', [
327327
'key' => 'test_key',
328-
'value' => 'test_value'
328+
'value' => 'test_value',
329329
]);
330330

331331
$this->assertFalse($this->query->execute('test_key', 'different_value'));
@@ -339,7 +339,7 @@ public function testHandleTransStatusMarksTransactionFailedDuringTransaction():
339339
// Verify the first insert was rolled back
340340
$this->dontSeeInDatabase($this->db->DBPrefix . 'without_auto_increment', [
341341
'key' => 'test_key',
342-
'value' => 'test_value'
342+
'value' => 'test_value',
343343
]);
344344

345345
$this->db->resetTransStatus();

0 commit comments

Comments
 (0)