Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4729,7 +4729,7 @@
'Imagick::getColorspace' => ['Imagick::COLORSPACE_*'],
'Imagick::getCompression' => ['Imagick::COMPRESSION_*'],
'Imagick::getCompressionQuality' => ['int'],
'Imagick::getConfigureOptions' => ['string'],
'Imagick::getConfigureOptions' => ['array'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to be more specific here, is it array<uppercase-string, string>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ondrejmirtes I changed it here e92d478

It's not just uppercase strings.

'Imagick::getCopyright' => ['string'],
'Imagick::getFeatures' => ['string'],
'Imagick::getFilename' => ['string'],
Expand Down
9 changes: 9 additions & 0 deletions tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2829,6 +2829,15 @@ public function testBug5623(): void
$this->analyse([__DIR__ . '/data/bug-5623.php'], []);
}

public function testImagick(): void
{
$this->checkThisOnly = false;
$this->checkNullables = false;
$this->checkUnionTypes = true;
$this->checkExplicitMixed = false;
$this->analyse([__DIR__ . '/data/imagick.php'], []);
}

public function testImagickPixel(): void
{
$this->checkThisOnly = false;
Expand Down
13 changes: 13 additions & 0 deletions tests/PHPStan/Rules/Methods/data/imagick.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php declare(strict_types = 1);

namespace PHPStan\Rules\Methods\data;

use Imagick;

class ImagickText
{
public function isLcmsInstalled(): bool
{
return str_contains(Imagick::getConfigureOptions()['DELEGATES'], 'lcms');
}
}
Loading