Skip to content

Commit f66ccb6

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
Conflicts: system/Exceptions/FrameworkException.php
2 parents f4c17e8 + cfd8898 commit f66ccb6

22 files changed

Lines changed: 411 additions & 171 deletions

File tree

.github/workflows/deploy-apidocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ jobs:
4343
- name: Setup PHP
4444
uses: shivammathur/setup-php@v2
4545
with:
46-
php-version: '8.0'
46+
php-version: '8.1'
4747
tools: phive
4848
coverage: none
4949

5050
- name: Download latest phpDocumentor
5151
working-directory: source
52-
run: sudo phive --no-progress install --global --trust-gpg-keys 67F861C3D889C656 phpDocumentor
52+
run: phive --no-progress install --trust-gpg-keys 8AC0BAA79732DD42 phpDocumentor
5353

5454
- name: Prepare API repo
5555
working-directory: api
@@ -61,7 +61,7 @@ jobs:
6161
- name: Build API in source repo
6262
working-directory: source
6363
run: |
64-
phpDocumentor run --ansi --verbose
64+
php tools/phpDocumentor run --ansi --verbose
6565
cp -R ${GITHUB_WORKSPACE}/source/api/build/* ${GITHUB_WORKSPACE}/api/docs
6666
6767
- name: Deploy to API repo

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"phpunit/phpcov": "^8.2",
3131
"phpunit/phpunit": "^9.1",
3232
"predis/predis": "^1.1 || ^2.0",
33-
"rector/rector": "0.17.13",
33+
"rector/rector": "0.18.0",
3434
"vimeo/psalm": "^5.0"
3535
},
3636
"suggest": {

phpstan-baseline.php

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -706,116 +706,6 @@
706706
'count' => 1,
707707
'path' => __DIR__ . '/system/Events/Events.php',
708708
];
709-
$ignoreErrors[] = [
710-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\CastException\\:\\:forInvalidJsonFormatException\\(\\) has no return type specified\\.$#',
711-
'count' => 1,
712-
'path' => __DIR__ . '/system/Exceptions/CastException.php',
713-
];
714-
$ignoreErrors[] = [
715-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ConfigException\\:\\:forDisabledMigrations\\(\\) has no return type specified\\.$#',
716-
'count' => 1,
717-
'path' => __DIR__ . '/system/Exceptions/ConfigException.php',
718-
];
719-
$ignoreErrors[] = [
720-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetBinary\\(\\) has no return type specified\\.$#',
721-
'count' => 1,
722-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
723-
];
724-
$ignoreErrors[] = [
725-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetCache\\(\\) has no return type specified\\.$#',
726-
'count' => 1,
727-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
728-
];
729-
$ignoreErrors[] = [
730-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetFilePath\\(\\) has no return type specified\\.$#',
731-
'count' => 1,
732-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
733-
];
734-
$ignoreErrors[] = [
735-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetStatusCode\\(\\) has no return type specified\\.$#',
736-
'count' => 1,
737-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
738-
];
739-
$ignoreErrors[] = [
740-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forNotFoundDownloadSource\\(\\) has no return type specified\\.$#',
741-
'count' => 1,
742-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
743-
];
744-
$ignoreErrors[] = [
745-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forCopyError\\(\\) has no return type specified\\.$#',
746-
'count' => 1,
747-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
748-
];
749-
$ignoreErrors[] = [
750-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forEnabledZlibOutputCompression\\(\\) has no return type specified\\.$#',
751-
'count' => 1,
752-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
753-
];
754-
$ignoreErrors[] = [
755-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forFabricatorCreateFailed\\(\\) has no return type specified\\.$#',
756-
'count' => 1,
757-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
758-
];
759-
$ignoreErrors[] = [
760-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forInvalidFile\\(\\) has no return type specified\\.$#',
761-
'count' => 1,
762-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
763-
];
764-
$ignoreErrors[] = [
765-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forMissingExtension\\(\\) has no return type specified\\.$#',
766-
'count' => 1,
767-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
768-
];
769-
$ignoreErrors[] = [
770-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forNoHandlers\\(\\) has no return type specified\\.$#',
771-
'count' => 1,
772-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
773-
];
774-
$ignoreErrors[] = [
775-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ModelException\\:\\:forMethodNotAvailable\\(\\) has no return type specified\\.$#',
776-
'count' => 1,
777-
'path' => __DIR__ . '/system/Exceptions/ModelException.php',
778-
];
779-
$ignoreErrors[] = [
780-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ModelException\\:\\:forNoDateFormat\\(\\) has no return type specified\\.$#',
781-
'count' => 1,
782-
'path' => __DIR__ . '/system/Exceptions/ModelException.php',
783-
];
784-
$ignoreErrors[] = [
785-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ModelException\\:\\:forNoPrimaryKey\\(\\) has no return type specified\\.$#',
786-
'count' => 1,
787-
'path' => __DIR__ . '/system/Exceptions/ModelException.php',
788-
];
789-
$ignoreErrors[] = [
790-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forControllerNotFound\\(\\) has no return type specified\\.$#',
791-
'count' => 1,
792-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
793-
];
794-
$ignoreErrors[] = [
795-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forEmptyController\\(\\) has no return type specified\\.$#',
796-
'count' => 1,
797-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
798-
];
799-
$ignoreErrors[] = [
800-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forLocaleNotSupported\\(\\) has no return type specified\\.$#',
801-
'count' => 1,
802-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
803-
];
804-
$ignoreErrors[] = [
805-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forMethodNotFound\\(\\) has no return type specified\\.$#',
806-
'count' => 1,
807-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
808-
];
809-
$ignoreErrors[] = [
810-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forPageNotFound\\(\\) has no return type specified\\.$#',
811-
'count' => 1,
812-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
813-
];
814-
$ignoreErrors[] = [
815-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\TestException\\:\\:forInvalidMockClass\\(\\) has no return type specified\\.$#',
816-
'count' => 1,
817-
'path' => __DIR__ . '/system/Exceptions/TestException.php',
818-
];
819709
$ignoreErrors[] = [
820710
'message' => '#^Property CodeIgniter\\\\Files\\\\File\\:\\:\\$size \\(int\\) on left side of \\?\\? is not nullable\\.$#',
821711
'count' => 1,

system/Exceptions/CastException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public function getExitCode(): int
2727
return EXIT_CONFIG;
2828
}
2929

30+
/**
31+
* @return static
32+
*/
3033
public static function forInvalidJsonFormatException(int $error)
3134
{
3235
switch ($error) {

system/Exceptions/ConfigException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public function getExitCode(): int
2323
return EXIT_CONFIG;
2424
}
2525

26+
/**
27+
* @return static
28+
*/
2629
public static function forDisabledMigrations()
2730
{
2831
return new static(lang('Migrations.disabled'));

system/Exceptions/DownloadException.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,41 @@ class DownloadException extends RuntimeException implements ExceptionInterface
2020
{
2121
use DebugTraceableTrait;
2222

23+
/**
24+
* @return static
25+
*/
2326
public static function forCannotSetFilePath(string $path)
2427
{
2528
return new static(lang('HTTP.cannotSetFilepath', [$path]));
2629
}
2730

31+
/**
32+
* @return static
33+
*/
2834
public static function forCannotSetBinary()
2935
{
3036
return new static(lang('HTTP.cannotSetBinary'));
3137
}
3238

39+
/**
40+
* @return static
41+
*/
3342
public static function forNotFoundDownloadSource()
3443
{
3544
return new static(lang('HTTP.notFoundDownloadSource'));
3645
}
3746

47+
/**
48+
* @return static
49+
*/
3850
public static function forCannotSetCache()
3951
{
4052
return new static(lang('HTTP.cannotSetCache'));
4153
}
4254

55+
/**
56+
* @return static
57+
*/
4358
public static function forCannotSetStatusCode(int $code, string $reason)
4459
{
4560
return new static(lang('HTTP.cannotSetStatusCode', [$code, $reason]));

system/Exceptions/FrameworkException.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ class FrameworkException extends RuntimeException implements ExceptionInterface
2323
{
2424
use DebugTraceableTrait;
2525

26+
/**
27+
* @return static
28+
*/
2629
public static function forEnabledZlibOutputCompression()
2730
{
2831
return new static(lang('Core.enabledZlibOutputCompression'));
2932
}
3033

34+
/**
35+
* @return static
36+
*/
3137
public static function forInvalidFile(string $path)
3238
{
3339
return new static(lang('Core.invalidFile', [$path]));
@@ -46,6 +52,9 @@ public static function forCopyError(string $path)
4652
return new static(lang('Core.copyError', [$path]));
4753
}
4854

55+
/**
56+
* @return static
57+
*/
4958
public static function forMissingExtension(string $extension)
5059
{
5160
if (strpos($extension, 'intl') !== false) {
@@ -62,11 +71,17 @@ public static function forMissingExtension(string $extension)
6271
return new static($message);
6372
}
6473

74+
/**
75+
* @return static
76+
*/
6577
public static function forNoHandlers(string $class)
6678
{
6779
return new static(lang('Core.noHandlers', [$class]));
6880
}
6981

82+
/**
83+
* @return static
84+
*/
7085
public static function forFabricatorCreateFailed(string $table, string $reason)
7186
{
7287
return new static(lang('Fabricator.createFailed', [$table, $reason]));

system/Exceptions/ModelException.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,25 @@
1616
*/
1717
class ModelException extends FrameworkException
1818
{
19+
/**
20+
* @return static
21+
*/
1922
public static function forNoPrimaryKey(string $modelName)
2023
{
2124
return new static(lang('Database.noPrimaryKey', [$modelName]));
2225
}
2326

27+
/**
28+
* @return static
29+
*/
2430
public static function forNoDateFormat(string $modelName)
2531
{
2632
return new static(lang('Database.noDateFormat', [$modelName]));
2733
}
2834

35+
/**
36+
* @return static
37+
*/
2938
public static function forMethodNotAvailable(string $modelName, string $methodName)
3039
{
3140
return new static(lang('Database.methodNotAvailable', [$modelName, $methodName]));

system/Exceptions/PageNotFoundException.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,41 @@ class PageNotFoundException extends OutOfBoundsException implements ExceptionInt
2525
*/
2626
protected $code = 404;
2727

28+
/**
29+
* @return static
30+
*/
2831
public static function forPageNotFound(?string $message = null)
2932
{
3033
return new static($message ?? self::lang('HTTP.pageNotFound'));
3134
}
3235

36+
/**
37+
* @return static
38+
*/
3339
public static function forEmptyController()
3440
{
3541
return new static(self::lang('HTTP.emptyController'));
3642
}
3743

44+
/**
45+
* @return static
46+
*/
3847
public static function forControllerNotFound(string $controller, string $method)
3948
{
4049
return new static(self::lang('HTTP.controllerNotFound', [$controller, $method]));
4150
}
4251

52+
/**
53+
* @return static
54+
*/
4355
public static function forMethodNotFound(string $method)
4456
{
4557
return new static(self::lang('HTTP.methodNotFound', [$method]));
4658
}
4759

60+
/**
61+
* @return static
62+
*/
4863
public static function forLocaleNotSupported(string $locale)
4964
{
5065
return new static(self::lang('HTTP.localeNotSupported', [$locale]));

system/Exceptions/TestException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class TestException extends CriticalError
1818
{
1919
use DebugTraceableTrait;
2020

21+
/**
22+
* @return static
23+
*/
2124
public static function forInvalidMockClass(string $name)
2225
{
2326
return new static(lang('Test.invalidMockClass', [$name]));

0 commit comments

Comments
 (0)