7 Commits

Author SHA1 Message Date
Zach Borboa 2cc50bd15e Actually increase psalm strictness (#926) 2025-02-19 22:13:10 -05:00
Zach Borboa 056de7d13d Use default for Psalm ensureOverrideAttribute (#923)
* Use default for Psalm ensureOverrideAttribute

* Fix missing Override attributes

Error: ../src/Curl/CaseInsensitiveArray.php:66:5:
MissingOverrideAttribute: Method Curl\CaseInsensitiveArray::offsetset
should have the "Override" attribute (see https://psalm.dev/358)
2025-02-18 21:49:22 -05:00
Zach Borboa fd902b4b7c Fix CI (PHPUnit) (#918)
* Add shims for PHPUnit

* Fix PHPUnit error: undefined method returnValue()

1) CurlTest\PHPCurlClassTest::testMock
Error: Call to undefined method CurlTest\PHPCurlClassTest::returnValue()

* Fix PHPUnit risky test by restoring error handler before exception thrown

There was 1 risky test:

1) CurlTest\PHPCurlClassTest::testRequiredOptionCurlOptReturnTransferEmitsWarningPHPUnit10Plus
Test code or tested code did not remove its own error handlers

* Fix psalm errors

* Add attributes for version constraint

* Temporarily pin psalm to fix ci
2025-02-17 18:24:42 -05:00
Zach Borboa 8259795c46 Fix CI tests (psalm) (#913)
* Display psalm version being run

* Update exclusions

* Use separate configuration for PHP 7.4

* Remove temporary workaround
2025-01-26 19:22:36 -05:00
Zach Borboa bd793d1287 Increase Psalm strictness (#909)
* Increase Psalm strictness

* Fix static analysis errors

ERROR: RedundantCast - ../src/Curl/CaseInsensitiveArray.php:91:16 - Redundant cast to bool (see https://psalm.dev/262)
        return (bool) array_key_exists(strtolower($offset), $this->data);

ERROR: RedundantCast - ../src/Curl/CaseInsensitiveArray.php:138:16 - Redundant cast to int<0, max> (see https://psalm.dev/262)
        return (int) count($this->data);

ERROR: RedundantCast - ../src/Curl/CaseInsensitiveArray.php:187:16 - Redundant cast to bool (see https://psalm.dev/262)
        return (bool) (key($this->data) !== null);

ERROR: ForbiddenCode - ../src/Curl/Curl.php:1765:13 - Unsafe var_dump (see https://psalm.dev/002)
            var_dump($value);

ERROR: ForbiddenCode - ../src/Curl/Curl.php:1770:13 - Unsafe var_dump (see https://psalm.dev/002)
            var_dump($value);

ERROR: InvalidOperand - ../src/Curl/Curl.php:1816:35 - Cannot concatenate with a value-of<TArray> (see https://psalm.dev/058)
                return $k . '=' . $v;
2025-01-11 23:11:26 -05:00
Zach Borboa b6b3800dfa Fix psalm UndefinedClass error
Message:
    ERROR: UndefinedClass - ../src/Curl/ArrayUtil.php:96:87 - Class, interface or enum named CURLStringFile does not exist (see https://psalm.dev/019)
        } elseif (class_exists('CURLStringFile') && $value instanceof \CURLStringFile) {
2023-01-15 13:28:04 -08:00
Zach Borboa 3cfe83b222 Move static analysis config under tests/ and exclude from git archive 2022-12-16 04:03:56 -08:00