Skip to content

Commit fb4a1f5

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
Conflicts: phpstan-baseline.php
2 parents 98a671e + 2c829f3 commit fb4a1f5

32 files changed

+121
-226
lines changed

admin/starter/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ExampleMigration extends Migration
88
{
99
protected $DBGroup = 'tests';
1010

11-
public function up()
11+
public function up(): void
1212
{
1313
$this->forge->addField('id');
1414
$this->forge->addField([
@@ -30,7 +30,7 @@ public function up()
3030
$this->forge->createTable('factories');
3131
}
3232

33-
public function down()
33+
public function down(): void
3434
{
3535
$this->forge->dropTable('factories');
3636
}

admin/starter/tests/_support/Database/Seeds/ExampleSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class ExampleSeeder extends Seeder
88
{
9-
public function run()
9+
public function run(): void
1010
{
1111
$factories = [
1212
[

admin/starter/tests/database/ExampleDatabaseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class ExampleDatabaseTest extends CIUnitTestCase
1414

1515
protected $seed = ExampleSeeder::class;
1616

17-
public function testModelFindAll()
17+
public function testModelFindAll(): void
1818
{
1919
$model = new ExampleModel();
2020

@@ -25,7 +25,7 @@ public function testModelFindAll()
2525
$this->assertCount(3, $objects);
2626
}
2727

28-
public function testSoftDeleteLeavesRow()
28+
public function testSoftDeleteLeavesRow(): void
2929
{
3030
$model = new ExampleModel();
3131
$this->setPrivateProperty($model, 'useSoftDeletes', true);

admin/starter/tests/session/ExampleSessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
final class ExampleSessionTest extends CIUnitTestCase
1010
{
11-
public function testSessionSimple()
11+
public function testSessionSimple(): void
1212
{
1313
$session = Services::session();
1414

admin/starter/tests/unit/HealthTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
*/
1111
final class HealthTest extends CIUnitTestCase
1212
{
13-
public function testIsDefinedAppPath()
13+
public function testIsDefinedAppPath(): void
1414
{
1515
$this->assertTrue(defined('APPPATH'));
1616
}
1717

18-
public function testBaseUrlHasBeenSet()
18+
public function testBaseUrlHasBeenSet(): void
1919
{
2020
$validation = Services::validation();
2121

app/Config/ContentSecurityPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ContentSecurityPolicy extends BaseConfig
122122
* The frame-src directive restricts the URLs which may
123123
* be loaded into nested browsing contexts.
124124
*
125-
* @var array|string|null
125+
* @var list<string>|string|null
126126
*/
127127
public $frameSrc;
128128

app/Config/Database.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class Database extends Config
2323

2424
/**
2525
* The default database connection.
26+
*
27+
* @var array<string, mixed>
2628
*/
2729
public array $default = [
2830
'DSN' => '',
@@ -53,6 +55,8 @@ class Database extends Config
5355
/**
5456
* This database connection is used when
5557
* running PHPUnit database tests.
58+
*
59+
* @var array<string, mixed>
5660
*/
5761
public array $tests = [
5862
'DSN' => '',

app/Config/Exceptions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class Exceptions extends BaseConfig
3030
* --------------------------------------------------------------------------
3131
* Any status codes here will NOT be logged if logging is turned on.
3232
* By default, only 404 (Page Not Found) exceptions are ignored.
33+
*
34+
* @var list<int>
3335
*/
3436
public array $ignoreCodes = [404];
3537

@@ -51,6 +53,8 @@ class Exceptions extends BaseConfig
5153
* Any data that you would like to hide from the debug trace.
5254
* In order to specify 2 levels, use "/" to separate.
5355
* ex. ['server', 'setup/password', 'secret_token']
56+
*
57+
* @var list<string>
5458
*/
5559
public array $sensitiveDataInTrace = [];
5660

app/Config/Filters.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class Filters extends BaseFilters
8787
* If you use this, you should disable auto-routing because auto-routing
8888
* permits any HTTP method to access a controller. Accessing the controller
8989
* with a method you don't expect could bypass the filter.
90+
*
91+
* @var array<string, list<string>>
9092
*/
9193
public array $methods = [];
9294

@@ -96,6 +98,8 @@ class Filters extends BaseFilters
9698
*
9799
* Example:
98100
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
101+
*
102+
* @var array<string, array<string, list<string>>>
99103
*/
100104
public array $filters = [];
101105
}

app/Config/Logger.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Logger extends BaseConfig
3636
* For a live site you'll usually enable Critical or higher (3) to be logged otherwise
3737
* your log files will fill up very fast.
3838
*
39-
* @var array|int
39+
* @var int|list<int>
4040
*/
4141
public $threshold = (ENVIRONMENT === 'production') ? 4 : 9;
4242

@@ -72,6 +72,8 @@ class Logger extends BaseConfig
7272
*
7373
* Handlers are executed in the order defined in this array, starting with
7474
* the handler on top and continuing down.
75+
*
76+
* @var array<class-string, array<string, int|list<string>|string>>
7577
*/
7678
public array $handlers = [
7779
/*

app/Config/Mimes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class Mimes
2222
{
2323
/**
2424
* Map of extensions to mime types.
25+
*
26+
* @var array<string, list<string>|string>
2527
*/
2628
public static array $mimes = [
2729
'hqx' => [

app/Config/Routing.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class Routing extends BaseRouting
2525
* found taking precedence.
2626
*
2727
* Default: APPPATH . 'Config/Routes.php'
28+
*
29+
* @var list<string>
2830
*/
2931
public array $routeFiles = [
3032
APPPATH . 'Config/Routes.php',
@@ -121,7 +123,7 @@ class Routing extends BaseRouting
121123
* 'blog' => 'Acme\Blog\Controllers',
122124
* ]
123125
*
124-
* @var array [ uri_segment => namespace ]
126+
* @var array<string, string>
125127
*/
126128
public array $moduleRoutes = [];
127129

app/Config/Toolbar.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Toolbar extends BaseConfig
3131
* List of toolbar collectors that will be called when Debug Toolbar
3232
* fires up and collects data from.
3333
*
34-
* @var list<string>
34+
* @var list<class-string>
3535
*/
3636
public array $collectors = [
3737
Timers::class,
@@ -99,6 +99,8 @@ class Toolbar extends BaseConfig
9999
* We restrict the values to keep performance as high as possible.
100100
*
101101
* NOTE: The ROOTPATH will be prepended to all values.
102+
*
103+
* @var list<string>
102104
*/
103105
public array $watchedDirectories = [
104106
'app',
@@ -111,6 +113,8 @@ class Toolbar extends BaseConfig
111113
*
112114
* Contains an array of file extensions that will be watched for changes and
113115
* used to determine if the hot-reload feature should reload the page or not.
116+
*
117+
* @var list<string>
114118
*/
115119
public array $watchedExtensions = [
116120
'php', 'css', 'js', 'html', 'svg', 'json', 'env',

app/Controllers/BaseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ abstract class BaseController extends Controller
3333
* class instantiation. These helpers will be available
3434
* to all other controllers that extend BaseController.
3535
*
36-
* @var array
36+
* @var list<string>
3737
*/
3838
protected $helpers = [];
3939

contributing/workflow.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ Latest commit only:
199199
> git push --force-with-lease origin your-branch
200200
```
201201

202+
Only the specified number of commits:
203+
```console
204+
> git switch your-branch
205+
> git rebase -i HEAD~3 --exec 'git commit --amend --no-edit --no-verify -S'
206+
> git push --force-with-lease origin your-branch
207+
```
208+
209+
> [!NOTE]
210+
> `HEAD~3` specifies the last 3 commits in the PR. Change *3* to the actual number of commits.
211+
202212
All commits:
203213
```console
204214
> git switch your-branch

0 commit comments

Comments
 (0)