Skip to content

Commit 60f9b8b

Browse files
authored
Imagick::getConfigureOptions() returns array instead of string
1 parent 4fc14ac commit 60f9b8b

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

resources/functionMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4729,7 +4729,7 @@
47294729
'Imagick::getColorspace' => ['Imagick::COLORSPACE_*'],
47304730
'Imagick::getCompression' => ['Imagick::COMPRESSION_*'],
47314731
'Imagick::getCompressionQuality' => ['int'],
4732-
'Imagick::getConfigureOptions' => ['string'],
4732+
'Imagick::getConfigureOptions' => ['array<string, string>'],
47334733
'Imagick::getCopyright' => ['string'],
47344734
'Imagick::getFeatures' => ['string'],
47354735
'Imagick::getFilename' => ['string'],

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,6 +2829,15 @@ public function testBug5623(): void
28292829
$this->analyse([__DIR__ . '/data/bug-5623.php'], []);
28302830
}
28312831

2832+
public function testImagick(): void
2833+
{
2834+
$this->checkThisOnly = false;
2835+
$this->checkNullables = false;
2836+
$this->checkUnionTypes = true;
2837+
$this->checkExplicitMixed = false;
2838+
$this->analyse([__DIR__ . '/data/imagick.php'], []);
2839+
}
2840+
28322841
public function testImagickPixel(): void
28332842
{
28342843
$this->checkThisOnly = false;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\Rules\Methods\data;
4+
5+
use Imagick;
6+
7+
class ImagickText
8+
{
9+
public function isLcmsInstalled(): bool
10+
{
11+
return str_contains(Imagick::getConfigureOptions()['DELEGATES'], 'lcms');
12+
}
13+
}

0 commit comments

Comments
 (0)