Skip to content

Commit 5435ea3

Browse files
committed
Dev: Remove the image error in phpstan-baseline.php
1 parent 06e5089 commit 5435ea3

3 files changed

Lines changed: 8 additions & 34 deletions

File tree

phpstan-baseline.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,21 +1416,6 @@
14161416
'count' => 1,
14171417
'path' => __DIR__ . '/system/Images/Exceptions/ImageException.php',
14181418
];
1419-
$ignoreErrors[] = [
1420-
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:_text\\(\\) has no return type specified\\.$#',
1421-
'count' => 1,
1422-
'path' => __DIR__ . '/system/Images/Handlers/BaseHandler.php',
1423-
];
1424-
$ignoreErrors[] = [
1425-
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:ensureResource\\(\\) has no return type specified\\.$#',
1426-
'count' => 1,
1427-
'path' => __DIR__ . '/system/Images/Handlers/BaseHandler.php',
1428-
];
1429-
$ignoreErrors[] = [
1430-
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:reproportion\\(\\) has no return type specified\\.$#',
1431-
'count' => 1,
1432-
'path' => __DIR__ . '/system/Images/Handlers/BaseHandler.php',
1433-
];
14341419
$ignoreErrors[] = [
14351420
'message' => '#^Property CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:\\$image \\(CodeIgniter\\\\Images\\\\Image\\) in empty\\(\\) is not falsy\\.$#',
14361421
'count' => 1,
@@ -1441,21 +1426,6 @@
14411426
'count' => 2,
14421427
'path' => __DIR__ . '/system/Images/Handlers/ImageMagickHandler.php',
14431428
];
1444-
$ignoreErrors[] = [
1445-
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\ImageMagickHandler\\:\\:_text\\(\\) has no return type specified\\.$#',
1446-
'count' => 1,
1447-
'path' => __DIR__ . '/system/Images/Handlers/ImageMagickHandler.php',
1448-
];
1449-
$ignoreErrors[] = [
1450-
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\ImageMagickHandler\\:\\:ensureResource\\(\\) has no return type specified\\.$#',
1451-
'count' => 1,
1452-
'path' => __DIR__ . '/system/Images/Handlers/ImageMagickHandler.php',
1453-
];
1454-
$ignoreErrors[] = [
1455-
'message' => '#^Method CodeIgniter\\\\Images\\\\Handlers\\\\ImageMagickHandler\\:\\:supportedFormatCheck\\(\\) has no return type specified\\.$#',
1456-
'count' => 1,
1457-
'path' => __DIR__ . '/system/Images/Handlers/ImageMagickHandler.php',
1458-
];
14591429
$ignoreErrors[] = [
14601430
'message' => '#^PHPDoc type string\\|null of property CodeIgniter\\\\Images\\\\Handlers\\\\ImageMagickHandler\\:\\:\\$resource is not covariant with PHPDoc type resource\\|null of overridden property CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:\\$resource\\.$#',
14611431
'count' => 1,

system/Images/Handlers/BaseHandler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ public function withFile(string $path)
156156

157157
/**
158158
* Make the image resource object if needed
159+
*
160+
* @return void
159161
*/
160162
abstract protected function ensureResource();
161163

@@ -422,6 +424,8 @@ public function text(string $text, array $options = [])
422424

423425
/**
424426
* Handler-specific method for overlaying text on an image.
427+
*
428+
* @return void
425429
*/
426430
abstract protected function _text(string $text, array $options = []);
427431

@@ -723,7 +727,7 @@ public function __call(string $name, array $args = [])
723727
* This function lets us re-proportion the width/height
724728
* if users choose to maintain the aspect ratio when resizing.
725729
*/
726-
protected function reproportion()
730+
protected function reproportion(): void
727731
{
728732
if (($this->width === 0 && $this->height === 0) || $this->image()->origWidth === 0 || $this->image()->origHeight === 0 || (! ctype_digit((string) $this->width) && ! ctype_digit((string) $this->height)) || ! ctype_digit((string) $this->image()->origWidth) || ! ctype_digit((string) $this->image()->origHeight)) {
729733
return;

system/Images/Handlers/ImageMagickHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ protected function getResourcePath()
292292
*
293293
* @throws Exception
294294
*/
295-
protected function ensureResource()
295+
protected function ensureResource(): void
296296
{
297297
$this->getResourcePath();
298298

@@ -304,7 +304,7 @@ protected function ensureResource()
304304
*
305305
* @throws ImageException
306306
*/
307-
protected function supportedFormatCheck()
307+
protected function supportedFormatCheck(): void
308308
{
309309
switch ($this->image()->imageType) {
310310
case IMAGETYPE_WEBP:
@@ -320,7 +320,7 @@ protected function supportedFormatCheck()
320320
*
321321
* @throws Exception
322322
*/
323-
protected function _text(string $text, array $options = [])
323+
protected function _text(string $text, array $options = []): void
324324
{
325325
$xAxis = 0;
326326
$yAxis = 0;

0 commit comments

Comments
 (0)