Skip to content

Commit 6525ed5

Browse files
committed
refactor: Fix phpstan greaterOrEqual.invalid
1 parent db12ec3 commit 6525ed5

File tree

6 files changed

+31
-54
lines changed

6 files changed

+31
-54
lines changed

system/Images/Handlers/BaseHandler.php

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -396,23 +396,6 @@ public function flip(string $dir = 'vertical')
396396
*/
397397
abstract protected function _flip(string $direction);
398398

399-
/**
400-
* Overlays a string of text over the image.
401-
*
402-
* Valid options:
403-
*
404-
* - color Text Color (hex number)
405-
* - shadowColor Color of the shadow (hex number)
406-
* - hAlign Horizontal alignment: left, center, right
407-
* - vAlign Vertical alignment: top, middle, bottom
408-
* - hOffset
409-
* - vOffset
410-
* - fontPath
411-
* - fontSize
412-
* - shadowOffset
413-
*
414-
* @return $this
415-
*/
416399
public function text(string $text, array $options = [])
417400
{
418401
$options = array_merge($this->textDefaults, $options);
@@ -427,6 +410,21 @@ public function text(string $text, array $options = [])
427410
/**
428411
* Handler-specific method for overlaying text on an image.
429412
*
413+
* @param array{
414+
* color?: string,
415+
* shadowColor?: string,
416+
* hAlign?: string,
417+
* vAlign?: string,
418+
* hOffset?: int,
419+
* vOffset?: int,
420+
* fontPath?: string,
421+
* fontSize?: int,
422+
* shadowOffset?: int,
423+
* opacity?: float,
424+
* padding?: int,
425+
* withShadow?: bool|string
426+
* } $options
427+
*
430428
* @return void
431429
*/
432430
abstract protected function _text(string $text, array $options = []);

system/Images/Handlers/ImageMagickHandler.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,6 @@ protected function supportedFormatCheck()
329329
/**
330330
* Handler-specific method for overlaying text on an image.
331331
*
332-
* @return void
333-
*
334332
* @throws Exception
335333
*/
336334
protected function _text(string $text, array $options = [])

system/Images/ImageHandlerInterface.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,21 @@ public function fit(int $width, int $height, string $position);
117117
* - shadowColor Color of the shadow (hex number)
118118
* - hAlign Horizontal alignment: left, center, right
119119
* - vAlign Vertical alignment: top, middle, bottom
120-
* - hOffset
121-
* - vOffset
122-
* - fontPath
123-
* - fontSize
124-
* - shadowOffset
120+
*
121+
* @param array{
122+
* color?: string,
123+
* shadowColor?: string,
124+
* hAlign?: string,
125+
* vAlign?: string,
126+
* hOffset?: int,
127+
* vOffset?: int,
128+
* fontPath?: string,
129+
* fontSize?: int,
130+
* shadowOffset?: int,
131+
* opacity?: float,
132+
* padding?: int,
133+
* withShadow?: bool|string
134+
* } $options
125135
*
126136
* @return $this
127137
*/

utils/phpstan-baseline/greaterOrEqual.invalid.neon

Lines changed: 0 additions & 8 deletions
This file was deleted.

utils/phpstan-baseline/loader.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ includes:
2020
- function.inner.neon
2121
- generator.returnType.neon
2222
- generator.valueType.neon
23-
- greaterOrEqual.invalid.neon
2423
- isset.offset.neon
2524
- isset.property.neon
2625
- method.alreadyNarrowedType.neon

utils/phpstan-baseline/missingType.iterableValue.neon

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 1685 errors
1+
# total 1681 errors
22

33
parameters:
44
ignoreErrors:
@@ -4687,11 +4687,6 @@ parameters:
46874687
count: 1
46884688
path: ../../system/Images/Handlers/BaseHandler.php
46894689

4690-
-
4691-
message: '#^Method CodeIgniter\\Images\\Handlers\\BaseHandler\:\:_text\(\) has parameter \$options with no value type specified in iterable type array\.$#'
4692-
count: 1
4693-
path: ../../system/Images/Handlers/BaseHandler.php
4694-
46954690
-
46964691
message: '#^Method CodeIgniter\\Images\\Handlers\\BaseHandler\:\:calcAspectRatio\(\) return type has no value type specified in iterable type array\.$#'
46974692
count: 1
@@ -4702,11 +4697,6 @@ parameters:
47024697
count: 1
47034698
path: ../../system/Images/Handlers/BaseHandler.php
47044699

4705-
-
4706-
message: '#^Method CodeIgniter\\Images\\Handlers\\BaseHandler\:\:text\(\) has parameter \$options with no value type specified in iterable type array\.$#'
4707-
count: 1
4708-
path: ../../system/Images/Handlers/BaseHandler.php
4709-
47104700
-
47114701
message: '#^Property CodeIgniter\\Images\\Handlers\\BaseHandler\:\:\$supportTransparency type has no value type specified in iterable type array\.$#'
47124702
count: 1
@@ -4717,11 +4707,6 @@ parameters:
47174707
count: 1
47184708
path: ../../system/Images/Handlers/BaseHandler.php
47194709

4720-
-
4721-
message: '#^Method CodeIgniter\\Images\\Handlers\\ImageMagickHandler\:\:_text\(\) has parameter \$options with no value type specified in iterable type array\.$#'
4722-
count: 1
4723-
path: ../../system/Images/Handlers/ImageMagickHandler.php
4724-
47254710
-
47264711
message: '#^Method CodeIgniter\\Images\\Handlers\\ImageMagickHandler\:\:process\(\) return type has no value type specified in iterable type array\.$#'
47274712
count: 1
@@ -4732,11 +4717,6 @@ parameters:
47324717
count: 1
47334718
path: ../../system/Images/Image.php
47344719

4735-
-
4736-
message: '#^Method CodeIgniter\\Images\\ImageHandlerInterface\:\:text\(\) has parameter \$options with no value type specified in iterable type array\.$#'
4737-
count: 1
4738-
path: ../../system/Images/ImageHandlerInterface.php
4739-
47404720
-
47414721
message: '#^Method CodeIgniter\\Language\\Language\:\:formatMessage\(\) has parameter \$message with no value type specified in iterable type array\.$#'
47424722
count: 1

0 commit comments

Comments
 (0)