Skip to content

Commit 91ae4b0

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into when-whennot-typehint
2 parents 3202853 + 9e48fa0 commit 91ae4b0

13 files changed

Lines changed: 94 additions & 121 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

phpstan-baseline.php

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -726,116 +726,6 @@
726726
'count' => 1,
727727
'path' => __DIR__ . '/system/Events/Events.php',
728728
];
729-
$ignoreErrors[] = [
730-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\CastException\\:\\:forInvalidJsonFormatException\\(\\) has no return type specified\\.$#',
731-
'count' => 1,
732-
'path' => __DIR__ . '/system/Exceptions/CastException.php',
733-
];
734-
$ignoreErrors[] = [
735-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ConfigException\\:\\:forDisabledMigrations\\(\\) has no return type specified\\.$#',
736-
'count' => 1,
737-
'path' => __DIR__ . '/system/Exceptions/ConfigException.php',
738-
];
739-
$ignoreErrors[] = [
740-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetBinary\\(\\) has no return type specified\\.$#',
741-
'count' => 1,
742-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
743-
];
744-
$ignoreErrors[] = [
745-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetCache\\(\\) has no return type specified\\.$#',
746-
'count' => 1,
747-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
748-
];
749-
$ignoreErrors[] = [
750-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetFilePath\\(\\) has no return type specified\\.$#',
751-
'count' => 1,
752-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
753-
];
754-
$ignoreErrors[] = [
755-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forCannotSetStatusCode\\(\\) has no return type specified\\.$#',
756-
'count' => 1,
757-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
758-
];
759-
$ignoreErrors[] = [
760-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\DownloadException\\:\\:forNotFoundDownloadSource\\(\\) has no return type specified\\.$#',
761-
'count' => 1,
762-
'path' => __DIR__ . '/system/Exceptions/DownloadException.php',
763-
];
764-
$ignoreErrors[] = [
765-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forCopyError\\(\\) has no return type specified\\.$#',
766-
'count' => 1,
767-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
768-
];
769-
$ignoreErrors[] = [
770-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forEnabledZlibOutputCompression\\(\\) has no return type specified\\.$#',
771-
'count' => 1,
772-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
773-
];
774-
$ignoreErrors[] = [
775-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forFabricatorCreateFailed\\(\\) has no return type specified\\.$#',
776-
'count' => 1,
777-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
778-
];
779-
$ignoreErrors[] = [
780-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forInvalidFile\\(\\) has no return type specified\\.$#',
781-
'count' => 1,
782-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
783-
];
784-
$ignoreErrors[] = [
785-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forMissingExtension\\(\\) has no return type specified\\.$#',
786-
'count' => 1,
787-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
788-
];
789-
$ignoreErrors[] = [
790-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\FrameworkException\\:\\:forNoHandlers\\(\\) has no return type specified\\.$#',
791-
'count' => 1,
792-
'path' => __DIR__ . '/system/Exceptions/FrameworkException.php',
793-
];
794-
$ignoreErrors[] = [
795-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ModelException\\:\\:forMethodNotAvailable\\(\\) has no return type specified\\.$#',
796-
'count' => 1,
797-
'path' => __DIR__ . '/system/Exceptions/ModelException.php',
798-
];
799-
$ignoreErrors[] = [
800-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ModelException\\:\\:forNoDateFormat\\(\\) has no return type specified\\.$#',
801-
'count' => 1,
802-
'path' => __DIR__ . '/system/Exceptions/ModelException.php',
803-
];
804-
$ignoreErrors[] = [
805-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\ModelException\\:\\:forNoPrimaryKey\\(\\) has no return type specified\\.$#',
806-
'count' => 1,
807-
'path' => __DIR__ . '/system/Exceptions/ModelException.php',
808-
];
809-
$ignoreErrors[] = [
810-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forControllerNotFound\\(\\) has no return type specified\\.$#',
811-
'count' => 1,
812-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
813-
];
814-
$ignoreErrors[] = [
815-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forEmptyController\\(\\) has no return type specified\\.$#',
816-
'count' => 1,
817-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
818-
];
819-
$ignoreErrors[] = [
820-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forLocaleNotSupported\\(\\) has no return type specified\\.$#',
821-
'count' => 1,
822-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
823-
];
824-
$ignoreErrors[] = [
825-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forMethodNotFound\\(\\) has no return type specified\\.$#',
826-
'count' => 1,
827-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
828-
];
829-
$ignoreErrors[] = [
830-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\PageNotFoundException\\:\\:forPageNotFound\\(\\) has no return type specified\\.$#',
831-
'count' => 1,
832-
'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php',
833-
];
834-
$ignoreErrors[] = [
835-
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\TestException\\:\\:forInvalidMockClass\\(\\) has no return type specified\\.$#',
836-
'count' => 1,
837-
'path' => __DIR__ . '/system/Exceptions/TestException.php',
838-
];
839729
$ignoreErrors[] = [
840730
'message' => '#^Property CodeIgniter\\\\Files\\\\File\\:\\:\\$size \\(int\\) on left side of \\?\\? is not nullable\\.$#',
841731
'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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,33 @@ 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]));
3440
}
3541

42+
/**
43+
* @return static
44+
*/
3645
public static function forCopyError(string $path)
3746
{
3847
return new static(lang('Core.copyError', [$path]));
3948
}
4049

50+
/**
51+
* @return static
52+
*/
4153
public static function forMissingExtension(string $extension)
4254
{
4355
if (strpos($extension, 'intl') !== false) {
@@ -54,11 +66,17 @@ public static function forMissingExtension(string $extension)
5466
return new static($message);
5567
}
5668

69+
/**
70+
* @return static
71+
*/
5772
public static function forNoHandlers(string $class)
5873
{
5974
return new static(lang('Core.noHandlers', [$class]));
6075
}
6176

77+
/**
78+
* @return static
79+
*/
6280
public static function forFabricatorCreateFailed(string $table, string $reason)
6381
{
6482
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]));

system/Validation/Validation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public function __construct($config, RendererInterface $view)
107107
$this->config = $config;
108108

109109
$this->view = $view;
110+
111+
$this->loadRuleSets();
110112
}
111113

112114
/**
@@ -127,7 +129,6 @@ public function run(?array $data = null, ?string $group = null, ?string $dbGroup
127129
// `DBGroup` is a reserved name. For is_unique and is_not_unique
128130
$data['DBGroup'] = $dbGroup;
129131

130-
$this->loadRuleSets();
131132
$this->loadRuleGroup($group);
132133

133134
// If no rules exist, we return false to ensure

0 commit comments

Comments
 (0)