Commit Graph

583 Commits

Author SHA1 Message Date
Zach Borboa d6ede93924 Fix static type checker error
Error message:
    error: Import "urlparse" could not be resolved
    (reportMissingImports)
2023-10-21 19:19:57 -07:00
Zach Borboa a6e6110051 Update checks for decoding gzip-encoded responses 2023-08-29 07:01:18 -07:00
Zach Borboa 11bd600918 Rename ::setError() to ::afterSend() 2023-08-25 06:39:12 -07:00
Zach Borboa 5e5d284a9b Implement Curl::setError() and MultiCurl::setError() 2023-08-22 20:20:47 -07:00
Zach Borboa c745e59532 Merge branch 'master' into master 2023-07-06 20:46:55 -07:00
Robin van der Vliet 94d8cf948f Replace isset with null coalescing operator (#800) 2023-07-06 20:41:38 -07:00
Zach Borboa 0d7ff95736 Add coding standards rule to use the null coalescing operator ?? where possible 2023-07-05 20:41:54 -07:00
Zach Borboa efe4f69683 Normalize strings 2023-07-01 09:57:03 -07:00
Zach Borboa 6c49609b9f Format python files 2023-07-01 09:57:03 -07:00
Zach Borboa 314f373a17 Move long lines check to PHP_CodeSniffer 2023-07-01 06:43:51 -07:00
Zach Borboa cd924d10c3 Update PHP_CodeSniffer ruleset: PSR2 → PSR12 2023-06-30 01:23:37 -07:00
Zach Borboa 9bd4776b73 Apply additional coding standards 2023-06-30 00:37:30 -07:00
Zach Borboa b921ac3c52 Merge branch 'master' into master 2023-06-26 04:10:29 -07:00
Zach Borboa 2f532ab2b8 Merge branch 'master' into use-short-array-syntax 2023-06-26 02:57:15 -07:00
Zach Borboa 50320065ce Add coding standards rule to error on long array syntax 2023-06-25 16:02:46 -07:00
Zach Borboa 128a0c1ea2 Add PHP-CS-Fixer to check for unused imports 2023-06-24 19:33:48 -07:00
Robin van der Vliet c45f8e22de Use short array syntax 2023-06-23 19:50:18 +02:00
Zach Borboa 76e74fdc44 Improve and add tests for Curl::fastDownload() 2023-06-13 02:52:59 -07:00
Zach Borboa 2bb2f32087 Make method to display curl option value public 2023-06-12 20:27:16 -07:00
Zach Borboa bbf1e1417b Add test server support for specifying which requests fail and succeed 2023-06-12 19:31:49 -07:00
Zach Borboa 5427717469 Fix existing header overwritten after using MultiCurl::addCurl() 2023-06-08 19:18:32 -07:00
Zach Borboa 1b2e2d446f Return JSON from the retry test server endpoint 2023-06-03 04:50:41 -07:00
Zach Borboa c37bb58a48 Make function public 2023-05-23 20:35:36 -07:00
Zach Borboa 1c270272c8 Update Curl::diagnose() to detect bit flags with negative values 2023-05-20 13:32:44 -07:00
Zach Borboa 2a73070caf Run PHPCompatibility on PHP 7.2 and higher
Error message:

++ phpcs_to_use=vendor/bin/phpcs
++ vendor/bin/phpcs --version
PHP_CodeSniffer version 3.7.2 (stable) by Squiz (http://www.squiz.net)
++ vendor/bin/phpcs --extensions=php '--ignore=*/vendor/*' --standard=tests/ruleset.xml -p -s .
W...........................................................  60 / 116 (52%)
........................................................     116 / 116 (100%)

FILE: ...me/runner/work/php-curl-class/php-curl-class/examples/custom.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | IMPORTANT: Please be advised that for the most
   |         | reliable PHPCompatibility results, PHP 7.2 or higher
   |         | should be used. Support for lower versions will be
   |         | dropped in the foreseeable future. You are currently
   |         | using PHP 7.0.33-65+ubuntu22.04.1+deb.sury.org+1.
   |         | Please upgrade your PHP installation to version 7.2 or
   |         | higher.
   |         |
   |         | To disable this notice, add
   |         | --exclude=PHPCompatibility.Upgrade.LowPHP to your
   |         | command or add <exclude
   |         | name="PHPCompatibility.Upgrade.LowPHP.BelowRecommended_7_2"/>
   |         | to your custom ruleset.
   |         |
   |         | Thank you for using PHPCompatibility!
   |         | (PHPCompatibility.Upgrade.LowPHP.BelowRecommended_7_2)
----------------------------------------------------------------------
2023-05-20 10:41:23 -07:00
Zach Borboa a304084a61 Display bit flags in use when calling Curl::diagnose()
This change attempts to determine which underlying constants were
bitmasked together to reach the resulting value passed to curl_setopt()
using Curl::setOpt().
2023-05-18 16:11:07 -07:00
Zach Borboa f7b216a3d9 Fix #777: Handle missing content-type response header in Curl::diagnose() 2023-05-15 19:33:59 -07:00
Zach Borboa 5b39126488 Update article in Curl::diagnose() Allow header warning 2023-05-07 02:50:08 -07:00
Zach Borboa dfdd2f5fb0 Remove use of array_merge() inside loop 2023-03-11 05:01:00 -08:00
Zach Borboa 3971c2f081 Fix sed portability 2023-03-10 04:31:11 -08:00
Zach Borboa 4133006c9f Remove coding standard ruleset exclusion 2023-02-26 12:07:58 -08:00
Zach Borboa 1aa3f87115 Replace some private method names not in camel caps format 2023-02-26 12:07:58 -08:00
Zach Borboa c6256e31b3 Remove coding standard ruleset exclusion 2023-02-26 12:07:58 -08:00
Zach Borboa d4af343164 Add emits warning test for PHPUnit 10 2023-02-17 21:32:20 -08:00
Zach Borboa 10ead55ca4 Fail on risky tests
Catch the following:
  There was 1 risky test:

  1) CurlTest\PHPCurlClassTest::testRequiredOptionCurlOptReturnTransferEmitsWarning
  This test did not perform any assertions

  /home/runner/work/php-curl-class/php-curl-class/tests/PHPCurlClass/PHPCurlClassTest.php:3097
2023-02-17 20:21:54 -08:00
Zach Borboa 4ed7644250 Update tests to work with PHPUnit 10 2023-02-17 19:31:41 -08:00
Zach Borboa acf5443a68 Fix sed command portability
Error messages:
    $ sed -i'' '-e/->expectWarning(/d' ./PHPCurlClass/PHPCurlClassTest.php ./PHPCurlClass/PHPMultiCurlClassTest.php
    sed: 1: "./PHPCurlClass/PHPCurlC ...": invalid command code .

    + phpunit_v10_shim
    + remove_expectWarning
    + sed -i '' '-e/->expectWarning(/d' ./PHPCurlClass/PHPCurlClassTest.php ./PHPCurlClass/PHPMultiCurlClassTest.php
    sed: can't read : No such file or directory
2023-02-17 19:29:22 -08:00
Zach Borboa bcf3c1ad33 Remove --verbose option removed in PHPUnit 10
Error:
  + ../vendor/bin/phpunit --configuration phpunit.xml --verbose
  PHPUnit 10.0.1 by Sebastian Bergmann and contributors.

  Unknown option "--verbose"
2023-02-03 17:24:13 -08:00
Zach Borboa 43e666de0f Remove --debug option removed in PHPUnit 10 for continuous integration tests
Error:
  + ../vendor/bin/phpunit --configuration phpunit.xml --debug --verbose
  PHPUnit 10.0.1 by Sebastian Bergmann and contributors.

  Unknown option "--debug"
2023-02-03 17:16:17 -08:00
Zach Borboa 08850b1a90 Remove --debug option removed in PHPUnit 10
Error:
  + ../vendor/bin/phpunit --configuration phpunit.xml --debug --verbose
  PHPUnit 10.0.1 by Sebastian Bergmann and contributors.

  Unknown option "--debug"
2023-02-03 17:04:12 -08:00
Zach Borboa 99bd995288 Format response header type notice as sentence 2023-01-26 16:58:45 -08:00
Zach Borboa f6ed305633 Clean up 2023-01-15 19:09:34 -08:00
Zach Borboa b41168b89b Clean up 2023-01-15 13:28:04 -08:00
Zach Borboa 673564609a Add tests for using CURLStringFile 2023-01-15 13:28:04 -08: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 de7751b4e1 Add additional test cases for Curl::diagnose() 2023-01-13 05:42:29 -08:00
Zach Borboa 85794dacbe Display error messages found in Curl::diagnose() 2023-01-12 07:25:24 -08:00
Zach Borboa d40c3b3cb1 Fix Curl::diagnose() request type output for POST requests 2023-01-12 06:47:36 -08:00
Zach Borboa b20f535f7c Replace use of #[\AllowDynamicProperties] 2023-01-10 13:18:26 -08:00
Michael Bolli 95f4aac970 silence PHP 8.2 deprecation notices 2023-01-10 10:27:19 +01:00