Skip to content

Commit 26d7b48

Browse files
committed
Dev: Remove the Honeypot and I18n ignore errors in phpstan-baseline.php
1 parent 0e70713 commit 26d7b48

4 files changed

Lines changed: 77 additions & 24 deletions

File tree

phpstan-baseline.php

Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,54 +1147,99 @@
11471147
'path' => __DIR__ . '/system/Helpers/filesystem_helper.php',
11481148
];
11491149
$ignoreErrors[] = [
1150-
'message' => '#^Method CodeIgniter\\\\Honeypot\\\\Exceptions\\\\HoneypotException\\:\\:forNoHiddenValue\\(\\) has no return type specified\\.$#',
1150+
'message' => '#^Function d\\(\\) has no return type specified\\.$#',
11511151
'count' => 1,
1152-
'path' => __DIR__ . '/system/Honeypot/Exceptions/HoneypotException.php',
1152+
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
11531153
];
11541154
$ignoreErrors[] = [
1155-
'message' => '#^Method CodeIgniter\\\\Honeypot\\\\Exceptions\\\\HoneypotException\\:\\:forNoNameField\\(\\) has no return type specified\\.$#',
1155+
'message' => '#^Function d\\(\\) has parameter \\$vars with no type specified\\.$#',
11561156
'count' => 1,
1157-
'path' => __DIR__ . '/system/Honeypot/Exceptions/HoneypotException.php',
1157+
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
11581158
];
11591159
$ignoreErrors[] = [
1160-
'message' => '#^Method CodeIgniter\\\\Honeypot\\\\Exceptions\\\\HoneypotException\\:\\:forNoTemplate\\(\\) has no return type specified\\.$#',
1160+
'message' => '#^Function dd\\(\\) has no return type specified\\.$#',
1161+
'count' => 2,
1162+
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1163+
];
1164+
$ignoreErrors[] = [
1165+
'message' => '#^Function dd\\(\\) has parameter \\$vars with no type specified\\.$#',
1166+
'count' => 1,
1167+
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1168+
];
1169+
$ignoreErrors[] = [
1170+
'message' => '#^Function trace\\(\\) has no return type specified\\.$#',
1171+
'count' => 2,
1172+
'path' => __DIR__ . '/system/Helpers/kint_helper.php',
1173+
];
1174+
$ignoreErrors[] = [
1175+
'message' => '#^Function mock\\(\\) has no return type specified\\.$#',
1176+
'count' => 1,
1177+
'path' => __DIR__ . '/system/Helpers/test_helper.php',
1178+
];
1179+
$ignoreErrors[] = [
1180+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forEXIFUnsupported\\(\\) has no return type specified\\.$#',
1181+
'count' => 1,
1182+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1183+
];
1184+
$ignoreErrors[] = [
1185+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forFileNotSupported\\(\\) has no return type specified\\.$#',
11611186
'count' => 1,
1162-
'path' => __DIR__ . '/system/Honeypot/Exceptions/HoneypotException.php',
1187+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
11631188
];
11641189
$ignoreErrors[] = [
1165-
'message' => '#^Method CodeIgniter\\\\Honeypot\\\\Exceptions\\\\HoneypotException\\:\\:isBot\\(\\) has no return type specified\\.$#',
1190+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forImageProcessFailed\\(\\) has no return type specified\\.$#',
11661191
'count' => 1,
1167-
'path' => __DIR__ . '/system/Honeypot/Exceptions/HoneypotException.php',
1192+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
11681193
];
11691194
$ignoreErrors[] = [
1170-
'message' => '#^Method CodeIgniter\\\\Honeypot\\\\Honeypot\\:\\:attachHoneypot\\(\\) has no return type specified\\.$#',
1195+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidDirection\\(\\) has no return type specified\\.$#',
11711196
'count' => 1,
1172-
'path' => __DIR__ . '/system/Honeypot/Honeypot.php',
1197+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
11731198
];
11741199
$ignoreErrors[] = [
1175-
'message' => '#^Method CodeIgniter\\\\Honeypot\\\\Honeypot\\:\\:hasContent\\(\\) has no return type specified\\.$#',
1200+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidImageCreate\\(\\) has no return type specified\\.$#',
11761201
'count' => 1,
1177-
'path' => __DIR__ . '/system/Honeypot/Honeypot.php',
1202+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
11781203
];
11791204
$ignoreErrors[] = [
1180-
'message' => '#^Method CodeIgniter\\\\I18n\\\\Time\\:\\:setTestNow\\(\\) has no return type specified\\.$#',
1205+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidImageLibraryPath\\(\\) has no return type specified\\.$#',
11811206
'count' => 1,
1182-
'path' => __DIR__ . '/system/I18n/Time.php',
1207+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
11831208
];
11841209
$ignoreErrors[] = [
1185-
'message' => '#^Method CodeIgniter\\\\I18n\\\\Time\\:\\:toDateTimeString\\(\\) has no return type specified\\.$#',
1210+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forInvalidPath\\(\\) has no return type specified\\.$#',
11861211
'count' => 1,
1187-
'path' => __DIR__ . '/system/I18n/Time.php',
1212+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
11881213
];
11891214
$ignoreErrors[] = [
1190-
'message' => '#^Method CodeIgniter\\\\I18n\\\\TimeLegacy\\:\\:setTestNow\\(\\) has no return type specified\\.$#',
1215+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forMissingAngle\\(\\) has no return type specified\\.$#',
11911216
'count' => 1,
1192-
'path' => __DIR__ . '/system/I18n/TimeLegacy.php',
1217+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
11931218
];
11941219
$ignoreErrors[] = [
1195-
'message' => '#^Method CodeIgniter\\\\I18n\\\\TimeLegacy\\:\\:toDateTimeString\\(\\) has no return type specified\\.$#',
1220+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forMissingImage\\(\\) has no return type specified\\.$#',
11961221
'count' => 1,
1197-
'path' => __DIR__ . '/system/I18n/TimeLegacy.php',
1222+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1223+
];
1224+
$ignoreErrors[] = [
1225+
'message' => '#^Method CodeIgniter\\\\Images\\\\Exceptions\\\\ImageException\\:\\:forSaveFailed\\(\\) has no return type specified\\.$#',
1226+
'count' => 1,
1227+
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
1228+
];
1229+
$ignoreErrors[] = [
1230+
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:_text\\(\\) has no return type specified\\.$#',
1231+
'count' => 1,
1232+
'path' => __DIR__ . '/system/Images/Handlers/BaseHandler.php',
1233+
];
1234+
$ignoreErrors[] = [
1235+
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:ensureResource\\(\\) has no return type specified\\.$#',
1236+
'count' => 1,
1237+
'path' => __DIR__ . '/system/Images/Handlers/BaseHandler.php',
1238+
];
1239+
$ignoreErrors[] = [
1240+
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:reproportion\\(\\) has no return type specified\\.$#',
1241+
'count' => 1,
1242+
'path' => __DIR__ . '/system/Images/Handlers/BaseHandler.php',
11981243
];
11991244
$ignoreErrors[] = [
12001245
'message' => '#^Property CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:\\$image \\(CodeIgniter\\\\Images\\\\Image\\) in empty\\(\\) is not falsy\\.$#',

system/Honeypot/Exceptions/HoneypotException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616

1717
class HoneypotException extends ConfigException implements ExceptionInterface
1818
{
19-
public static function forNoTemplate()
19+
public static function forNoTemplate(): HoneypotException
2020
{
2121
return new static(lang('Honeypot.noTemplate'));
2222
}
2323

24-
public static function forNoNameField()
24+
public static function forNoNameField(): HoneypotException
2525
{
2626
return new static(lang('Honeypot.noNameField'));
2727
}
2828

29-
public static function forNoHiddenValue()
29+
public static function forNoHiddenValue(): HoneypotException
3030
{
3131
return new static(lang('Honeypot.noHiddenValue'));
3232
}
3333

34-
public static function isBot()
34+
public static function isBot(): HoneypotException
3535
{
3636
return new static(lang('Honeypot.theClientIsABot'));
3737
}

system/Honeypot/Honeypot.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public function __construct(HoneypotConfig $config)
5959

6060
/**
6161
* Checks the request if honeypot field has data.
62+
*
63+
* @return bool
6264
*/
6365
public function hasContent(RequestInterface $request)
6466
{
@@ -69,6 +71,8 @@ public function hasContent(RequestInterface $request)
6971

7072
/**
7173
* Attaches Honeypot template to response.
74+
*
75+
* @return void
7276
*/
7377
public function attachHoneypot(ResponseInterface $response)
7478
{

system/I18n/TimeTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ public function toDateTime()
320320
* @param DateTimeInterface|self|string|null $datetime
321321
* @param DateTimeZone|string|null $timezone
322322
*
323+
* @return void
324+
*
323325
* @throws Exception
324326
*/
325327
public static function setTestNow($datetime = null, $timezone = null, ?string $locale = null)
@@ -845,6 +847,8 @@ public function subYears(int $years)
845847
/**
846848
* Returns the localized value of the date in the format 'Y-m-d H:i:s'
847849
*
850+
* @return false|string
851+
*
848852
* @throws Exception
849853
*/
850854
public function toDateTimeString()

0 commit comments

Comments
 (0)