Skip to content

Commit 2aa4bd5

Browse files
committed
Dev: Remove the Pager, Publisher and RESTful ignore errors in phpstan-baseline.php
1 parent 6ec3a09 commit 2aa4bd5

7 files changed

Lines changed: 16 additions & 61 deletions

File tree

phpstan-baseline.php

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,61 +1466,6 @@
14661466
'count' => 1,
14671467
'path' => __DIR__ . '/system/Model.php',
14681468
];
1469-
$ignoreErrors[] = [
1470-
'message' => '#^Method CodeIgniter\\\\Pager\\\\Exceptions\\\\PagerException\\:\\:forInvalidPaginationGroup\\(\\) has no return type specified\\.$#',
1471-
'count' => 1,
1472-
'path' => __DIR__ . '/system/Pager/Exceptions/PagerException.php',
1473-
];
1474-
$ignoreErrors[] = [
1475-
'message' => '#^Method CodeIgniter\\\\Pager\\\\Exceptions\\\\PagerException\\:\\:forInvalidTemplate\\(\\) has no return type specified\\.$#',
1476-
'count' => 1,
1477-
'path' => __DIR__ . '/system/Pager/Exceptions/PagerException.php',
1478-
];
1479-
$ignoreErrors[] = [
1480-
'message' => '#^Method CodeIgniter\\\\Pager\\\\Pager\\:\\:calculateCurrentPage\\(\\) has no return type specified\\.$#',
1481-
'count' => 1,
1482-
'path' => __DIR__ . '/system/Pager/Pager.php',
1483-
];
1484-
$ignoreErrors[] = [
1485-
'message' => '#^Method CodeIgniter\\\\Pager\\\\Pager\\:\\:ensureGroup\\(\\) has no return type specified\\.$#',
1486-
'count' => 1,
1487-
'path' => __DIR__ . '/system/Pager/Pager.php',
1488-
];
1489-
$ignoreErrors[] = [
1490-
'message' => '#^Method CodeIgniter\\\\Pager\\\\PagerRenderer\\:\\:updatePages\\(\\) has no return type specified\\.$#',
1491-
'count' => 1,
1492-
'path' => __DIR__ . '/system/Pager/PagerRenderer.php',
1493-
];
1494-
$ignoreErrors[] = [
1495-
'message' => '#^Method CodeIgniter\\\\Publisher\\\\Exceptions\\\\PublisherException\\:\\:forCollision\\(\\) has no return type specified\\.$#',
1496-
'count' => 1,
1497-
'path' => __DIR__ . '/system/Publisher/Exceptions/PublisherException.php',
1498-
];
1499-
$ignoreErrors[] = [
1500-
'message' => '#^Method CodeIgniter\\\\Publisher\\\\Exceptions\\\\PublisherException\\:\\:forDestinationNotAllowed\\(\\) has no return type specified\\.$#',
1501-
'count' => 1,
1502-
'path' => __DIR__ . '/system/Publisher/Exceptions/PublisherException.php',
1503-
];
1504-
$ignoreErrors[] = [
1505-
'message' => '#^Method CodeIgniter\\\\Publisher\\\\Exceptions\\\\PublisherException\\:\\:forFileNotAllowed\\(\\) has no return type specified\\.$#',
1506-
'count' => 1,
1507-
'path' => __DIR__ . '/system/Publisher/Exceptions/PublisherException.php',
1508-
];
1509-
$ignoreErrors[] = [
1510-
'message' => '#^Method CodeIgniter\\\\Publisher\\\\Publisher\\:\\:verifyAllowed\\(\\) has no return type specified\\.$#',
1511-
'count' => 1,
1512-
'path' => __DIR__ . '/system/Publisher/Publisher.php',
1513-
];
1514-
$ignoreErrors[] = [
1515-
'message' => '#^Method CodeIgniter\\\\RESTful\\\\BaseResource\\:\\:initController\\(\\) has no return type specified\\.$#',
1516-
'count' => 1,
1517-
'path' => __DIR__ . '/system/RESTful/BaseResource.php',
1518-
];
1519-
$ignoreErrors[] = [
1520-
'message' => '#^Method CodeIgniter\\\\RESTful\\\\BaseResource\\:\\:setModel\\(\\) has no return type specified\\.$#',
1521-
'count' => 1,
1522-
'path' => __DIR__ . '/system/RESTful/BaseResource.php',
1523-
];
15241469
$ignoreErrors[] = [
15251470
'message' => '#^Method CodeIgniter\\\\Router\\\\AutoRouter\\:\\:setDirectory\\(\\) has no return type specified\\.$#',
15261471
'count' => 1,

system/Pager/Exceptions/PagerException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
class PagerException extends FrameworkException
1717
{
18-
public static function forInvalidTemplate(?string $template = null)
18+
public static function forInvalidTemplate(?string $template = null): PagerException
1919
{
2020
return new static(lang('Pager.invalidTemplate', [$template]));
2121
}
2222

23-
public static function forInvalidPaginationGroup(?string $group = null)
23+
public static function forInvalidPaginationGroup(?string $group = null): PagerException
2424
{
2525
return new static(lang('Pager.invalidPaginationGroup', [$group]));
2626
}

system/Pager/Pager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ public function only(array $queries): self
388388
* Ensures that an array exists for the group specified.
389389
*
390390
* @param int $perPage
391+
*
392+
* @return void
391393
*/
392394
protected function ensureGroup(string $group, ?int $perPage = null)
393395
{
@@ -414,6 +416,8 @@ protected function ensureGroup(string $group, ?int $perPage = null)
414416

415417
/**
416418
* Calculating the current page
419+
*
420+
* @return void
417421
*/
418422
protected function calculateCurrentPage(string $group)
419423
{

system/Pager/PagerRenderer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ public function links(): array
289289
* to show.
290290
*
291291
* @param int|null $count The new "surroundCount"
292+
*
293+
* @return void
292294
*/
293295
protected function updatePages(?int $count = null)
294296
{

system/Publisher/Exceptions/PublisherException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ class PublisherException extends FrameworkException
2626
* @param string $from The source file
2727
* @param string $to The destination file
2828
*/
29-
public static function forCollision(string $from, string $to)
29+
public static function forCollision(string $from, string $to): PublisherException
3030
{
3131
return new static(lang('Publisher.collision', [filetype($to), $from, $to]));
3232
}
3333

3434
/**
3535
* Throws when given a destination that is not in the list of allowed directories.
3636
*/
37-
public static function forDestinationNotAllowed(string $destination)
37+
public static function forDestinationNotAllowed(string $destination): PublisherException
3838
{
3939
return new static(lang('Publisher.destinationNotAllowed', [$destination]));
4040
}
4141

4242
/**
4343
* Throws when a file fails to match the allowed pattern for its destination.
4444
*/
45-
public static function forFileNotAllowed(string $file, string $directory, string $pattern)
45+
public static function forFileNotAllowed(string $file, string $directory, string $pattern): PublisherException
4646
{
4747
return new static(lang('Publisher.fileNotAllowed', [$file, $directory, $pattern]));
4848
}

system/Publisher/Publisher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ public function addLineBefore(string $file, string $line, string $before): bool
466466
/**
467467
* Verify this is an allowed file for its destination.
468468
*/
469-
private function verifyAllowed(string $from, string $to)
469+
private function verifyAllowed(string $from, string $to): void
470470
{
471471
// Verify this is an allowed file for its destination
472472
foreach ($this->restrictions as $directory => $pattern) {

system/RESTful/BaseResource.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ abstract class BaseResource extends Controller
3939

4040
/**
4141
* Constructor.
42+
*
43+
* @return void
4244
*/
4345
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
4446
{
@@ -52,6 +54,8 @@ public function initController(RequestInterface $request, ResponseInterface $res
5254
* Given either the name or the object, determine the other.
5355
*
5456
* @param object|string|null $which
57+
*
58+
* @return void
5559
*/
5660
public function setModel($which = null)
5761
{

0 commit comments

Comments
 (0)