فهرست منبع

update guzzle
add php html parser

CauseFX 5 سال پیش
والد
کامیت
3295b491ca
100فایلهای تغییر یافته به همراه7600 افزوده شده و 1842 حذف شده
  1. 2 1
      api/composer.json
  2. 396 12
      api/composer.lock
  3. 66 5
      api/vendor/composer/InstalledVersions.php
  4. 1 0
      api/vendor/composer/autoload_namespaces.php
  5. 5 0
      api/vendor/composer/autoload_psr4.php
  6. 38 0
      api/vendor/composer/autoload_static.php
  7. 411 9
      api/vendor/composer/installed.json
  8. 66 5
      api/vendor/composer/installed.php
  9. 2 2
      api/vendor/composer/platform_check.php
  10. 0 23
      api/vendor/guzzlehttp/guzzle/.php_cs
  11. 114 6
      api/vendor/guzzlehttp/guzzle/CHANGELOG.md
  12. 0 18
      api/vendor/guzzlehttp/guzzle/Dockerfile
  13. 1 1
      api/vendor/guzzlehttp/guzzle/LICENSE
  14. 20 31
      api/vendor/guzzlehttp/guzzle/README.md
  15. 53 3
      api/vendor/guzzlehttp/guzzle/UPGRADING.md
  16. 20 7
      api/vendor/guzzlehttp/guzzle/composer.json
  17. 87 0
      api/vendor/guzzlehttp/guzzle/psalm.baseline.xml
  18. 16 0
      api/vendor/guzzlehttp/guzzle/psalm.xml
  19. 93 131
      api/vendor/guzzlehttp/guzzle/src/Client.php
  20. 10 13
      api/vendor/guzzlehttp/guzzle/src/ClientInterface.php
  21. 241 0
      api/vendor/guzzlehttp/guzzle/src/ClientTrait.php
  22. 63 66
      api/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
  23. 9 11
      api/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
  24. 28 18
      api/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
  25. 20 15
      api/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
  26. 91 84
      api/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
  27. 21 9
      api/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
  28. 1 0
      api/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php
  29. 29 10
      api/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
  30. 4 18
      api/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php
  31. 29 57
      api/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
  32. 0 27
      api/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php
  33. 1 0
      api/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php
  34. 1 0
      api/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php
  35. 1 0
      api/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php
  36. 167 152
      api/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
  37. 3 5
      api/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
  38. 13 9
      api/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
  39. 81 42
      api/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
  40. 41 14
      api/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
  41. 71 50
      api/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php
  42. 14 10
      api/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
  43. 154 123
      api/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
  44. 66 72
      api/vendor/guzzlehttp/guzzle/src/HandlerStack.php
  45. 48 32
      api/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
  46. 22 0
      api/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
  47. 53 48
      api/vendor/guzzlehttp/guzzle/src/Middleware.php
  48. 21 22
      api/vendor/guzzlehttp/guzzle/src/Pool.php
  49. 11 15
      api/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
  50. 35 54
      api/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
  51. 32 31
      api/vendor/guzzlehttp/guzzle/src/RequestOptions.php
  52. 32 42
      api/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
  53. 30 21
      api/vendor/guzzlehttp/guzzle/src/TransferStats.php
  54. 0 237
      api/vendor/guzzlehttp/guzzle/src/UriTemplate.php
  55. 394 0
      api/vendor/guzzlehttp/guzzle/src/Utils.php
  56. 53 280
      api/vendor/guzzlehttp/guzzle/src/functions.php
  57. 1 1
      api/vendor/guzzlehttp/guzzle/src/functions_include.php
  58. 18 0
      api/vendor/myclabs/php-enum/LICENSE
  59. 138 0
      api/vendor/myclabs/php-enum/README.md
  60. 11 0
      api/vendor/myclabs/php-enum/SECURITY.md
  61. 33 0
      api/vendor/myclabs/php-enum/composer.json
  62. 35 0
      api/vendor/myclabs/php-enum/psalm.xml
  63. 305 0
      api/vendor/myclabs/php-enum/src/Enum.php
  64. 54 0
      api/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php
  65. 14 0
      api/vendor/paquettg/php-html-parser/.gitattributes
  66. 12 0
      api/vendor/paquettg/php-html-parser/.github/FUNDING.yml
  67. 41 0
      api/vendor/paquettg/php-html-parser/.scrutinizer.yml
  68. 11 0
      api/vendor/paquettg/php-html-parser/SECURITY.md
  69. 38 0
      api/vendor/paquettg/php-html-parser/composer.json
  70. 257 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Content.php
  71. 16 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Dom/CleanerInterface.php
  72. 33 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Dom/ParserInterface.php
  73. 23 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/DomInterface.php
  74. 12 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Selector/ParserInterface.php
  75. 17 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Selector/SeekerInterface.php
  76. 31 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Selector/SelectorInterface.php
  77. 41 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Selector/ParsedSelectorCollectionDTO.php
  78. 41 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Selector/ParsedSelectorDTO.php
  79. 100 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Selector/RuleDTO.php
  80. 60 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Tag/AttributeDTO.php
  81. 74 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/TagDTO.php
  82. 25 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/CleanerDiscovery.php
  83. 25 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/DomParserDiscovery.php
  84. 25 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/SeekerDiscovery.php
  85. 25 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/SelectorParserDiscovery.php
  86. 251 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom.php
  87. 130 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Cleaner.php
  88. 495 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/AbstractNode.php
  89. 45 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/ArrayNode.php
  90. 156 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/Collection.php
  91. 244 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/HtmlNode.php
  92. 442 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/InnerNode.php
  93. 21 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/LeafNode.php
  94. 155 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/TextNode.php
  95. 348 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Parser.php
  96. 100 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/RootAccessTrait.php
  97. 365 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Tag.php
  98. 23 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Enum/StringToken.php
  99. 14 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Exceptions/ChildNotFoundException.php
  100. 14 0
      api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Exceptions/CircularException.php

+ 2 - 1
api/composer.json

@@ -15,6 +15,7 @@
     "slim/slim": "^4.0",
     "slim/psr7": "^1.1",
     "zircote/swagger-php": "^3.0",
-    "bogstag/oauth2-trakt": "^1.0"
+    "bogstag/oauth2-trakt": "^1.0",
+    "paquettg/php-html-parser": "^3.1"
   }
 }

+ 396 - 12
api/composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "1620f8d6a2da9fd3302c753d432b19bc",
+    "content-hash": "6c33c6a831d0034c65fe02a8df137f7c",
     "packages": [
         {
             "name": "adldap2/adldap2",
@@ -440,37 +440,43 @@
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "6.5.2",
+            "version": "7.1.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "43ece0e75098b7ecd8d13918293029e555a50f82"
+                "reference": "7427d6f99df41cc01f33cd59832f721c150ffdf3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82",
-                "reference": "43ece0e75098b7ecd8d13918293029e555a50f82",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7427d6f99df41cc01f33cd59832f721c150ffdf3",
+                "reference": "7427d6f99df41cc01f33cd59832f721c150ffdf3",
                 "shasum": ""
             },
             "require": {
                 "ext-json": "*",
                 "guzzlehttp/promises": "^1.0",
                 "guzzlehttp/psr7": "^1.6.1",
-                "php": ">=5.5"
+                "php": "^7.2.5",
+                "psr/http-client": "^1.0"
+            },
+            "provide": {
+                "psr/http-client-implementation": "1.0"
             },
             "require-dev": {
                 "ext-curl": "*",
-                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
+                "php-http/client-integration-tests": "dev-phpunit8",
+                "phpunit/phpunit": "^8.5.5",
                 "psr/log": "^1.1"
             },
             "suggest": {
+                "ext-curl": "Required for CURL handler support",
                 "ext-intl": "Required for Internationalized Domain Name (IDN) support",
                 "psr/log": "Required for using the Log middleware"
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "6.5-dev"
+                    "dev-master": "7.1-dev"
                 }
             },
             "autoload": {
@@ -490,6 +496,11 @@
                     "name": "Michael Dowling",
                     "email": "mtdowling@gmail.com",
                     "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://sagikazarmark.hu"
                 }
             ],
             "description": "Guzzle is a PHP HTTP client library",
@@ -500,10 +511,34 @@
                 "framework",
                 "http",
                 "http client",
+                "psr-18",
+                "psr-7",
                 "rest",
                 "web service"
             ],
-            "time": "2019-12-23T11:57:10+00:00"
+            "support": {
+                "issues": "https://github.com/guzzle/guzzle/issues",
+                "source": "https://github.com/guzzle/guzzle/tree/7.1.1"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/Nyholm",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/alexeyshockov",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/gmponos",
+                    "type": "github"
+                }
+            ],
+            "time": "2020-09-30T08:51:17+00:00"
         },
         {
             "name": "guzzlehttp/promises",
@@ -686,7 +721,7 @@
                 "shasum": ""
             },
             "require": {
-                "guzzlehttp/guzzle": "^6.1"
+                "guzzlehttp/guzzle": "^6.0 || ^7.0"
             },
             "type": "library",
             "autoload": {
@@ -722,7 +757,7 @@
                 "shasum": ""
             },
             "require": {
-                "guzzlehttp/guzzle": "^6.1"
+                "guzzlehttp/guzzle": "^6.0 || ^7.0"
             },
             "type": "library",
             "autoload": {
@@ -758,7 +793,7 @@
                 "shasum": ""
             },
             "require": {
-                "guzzlehttp/guzzle": "^6.1"
+                "guzzlehttp/guzzle": "^6.0 || ^7.0"
             },
             "type": "library",
             "autoload": {
@@ -904,6 +939,66 @@
             },
             "time": "2020-10-28T02:03:40+00:00"
         },
+        {
+            "name": "myclabs/php-enum",
+            "version": "1.8.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/myclabs/php-enum.git",
+                "reference": "46cf3d8498b095bd33727b13fd5707263af99421"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/myclabs/php-enum/zipball/46cf3d8498b095bd33727b13fd5707263af99421",
+                "reference": "46cf3d8498b095bd33727b13fd5707263af99421",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "php": "^7.3 || ^8.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^9.5",
+                "squizlabs/php_codesniffer": "1.*",
+                "vimeo/psalm": "^4.5.1"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "MyCLabs\\Enum\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP Enum contributors",
+                    "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
+                }
+            ],
+            "description": "PHP Enum implementation",
+            "homepage": "http://github.com/myclabs/php-enum",
+            "keywords": [
+                "enum"
+            ],
+            "support": {
+                "issues": "https://github.com/myclabs/php-enum/issues",
+                "source": "https://github.com/myclabs/php-enum/tree/1.8.0"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/mnapoli",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-02-15T16:11:48+00:00"
+        },
         {
             "name": "nikic/fast-route",
             "version": "v1.3.0",
@@ -950,6 +1045,124 @@
             ],
             "time": "2018-02-13T20:26:39+00:00"
         },
+        {
+            "name": "paquettg/php-html-parser",
+            "version": "3.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/paquettg/php-html-parser.git",
+                "reference": "4e01a438ad5961cc2d7427eb9798d213c8a12629"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/paquettg/php-html-parser/zipball/4e01a438ad5961cc2d7427eb9798d213c8a12629",
+                "reference": "4e01a438ad5961cc2d7427eb9798d213c8a12629",
+                "shasum": ""
+            },
+            "require": {
+                "ext-curl": "*",
+                "ext-mbstring": "*",
+                "ext-zlib": "*",
+                "guzzlehttp/guzzle": "^7.0",
+                "guzzlehttp/psr7": "^1.6",
+                "myclabs/php-enum": "^1.7",
+                "paquettg/string-encode": "~1.0.0",
+                "php": ">=7.2",
+                "php-http/httplug": "^2.1"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "^2.16",
+                "infection/infection": "^0.13.4",
+                "mockery/mockery": "^1.2",
+                "phan/phan": "^2.4",
+                "phpunit/phpunit": "^7.5.1"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "PHPHtmlParser\\": "src/PHPHtmlParser"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Gilles Paquette",
+                    "email": "paquettg@gmail.com",
+                    "homepage": "http://gillespaquette.ca"
+                }
+            ],
+            "description": "An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.",
+            "homepage": "https://github.com/paquettg/php-html-parser",
+            "keywords": [
+                "dom",
+                "html",
+                "parser"
+            ],
+            "support": {
+                "issues": "https://github.com/paquettg/php-html-parser/issues",
+                "source": "https://github.com/paquettg/php-html-parser/tree/3.1.1"
+            },
+            "funding": [
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/paquettg/php-html-parser",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-11-01T20:34:43+00:00"
+        },
+        {
+            "name": "paquettg/string-encode",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/paquettg/string-encoder.git",
+                "reference": "a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/paquettg/string-encoder/zipball/a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee",
+                "reference": "a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^7.5.1"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "stringEncode": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Gilles Paquette",
+                    "email": "paquettg@gmail.com",
+                    "homepage": "http://gillespaquette.ca"
+                }
+            ],
+            "description": "Facilitating the process of altering string encoding in PHP.",
+            "homepage": "https://github.com/paquettg/string-encoder",
+            "keywords": [
+                "charset",
+                "encoding",
+                "string"
+            ],
+            "support": {
+                "issues": "https://github.com/paquettg/string-encoder/issues",
+                "source": "https://github.com/paquettg/string-encoder/tree/1.0.1"
+            },
+            "time": "2018-12-21T02:25:09+00:00"
+        },
         {
             "name": "paragonie/constant_time_encoding",
             "version": "v2.2.2",
@@ -1139,6 +1352,125 @@
             ],
             "time": "2018-08-29T22:02:48+00:00"
         },
+        {
+            "name": "php-http/httplug",
+            "version": "2.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-http/httplug.git",
+                "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-http/httplug/zipball/191a0a1b41ed026b717421931f8d3bd2514ffbf9",
+                "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1 || ^8.0",
+                "php-http/promise": "^1.1",
+                "psr/http-client": "^1.0",
+                "psr/http-message": "^1.0"
+            },
+            "require-dev": {
+                "friends-of-phpspec/phpspec-code-coverage": "^4.1",
+                "phpspec/phpspec": "^5.1 || ^6.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Http\\Client\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Eric GELOEN",
+                    "email": "geloen.eric@gmail.com"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://sagikazarmark.hu"
+                }
+            ],
+            "description": "HTTPlug, the HTTP client abstraction for PHP",
+            "homepage": "http://httplug.io",
+            "keywords": [
+                "client",
+                "http"
+            ],
+            "support": {
+                "issues": "https://github.com/php-http/httplug/issues",
+                "source": "https://github.com/php-http/httplug/tree/master"
+            },
+            "time": "2020-07-13T15:43:23+00:00"
+        },
+        {
+            "name": "php-http/promise",
+            "version": "1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-http/promise.git",
+                "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88",
+                "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1 || ^8.0"
+            },
+            "require-dev": {
+                "friends-of-phpspec/phpspec-code-coverage": "^4.3.2",
+                "phpspec/phpspec": "^5.1.2 || ^6.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Http\\Promise\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Joel Wurtz",
+                    "email": "joel.wurtz@gmail.com"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com"
+                }
+            ],
+            "description": "Promise used for asynchronous HTTP requests",
+            "homepage": "http://httplug.io",
+            "keywords": [
+                "promise"
+            ],
+            "support": {
+                "issues": "https://github.com/php-http/promise/issues",
+                "source": "https://github.com/php-http/promise/tree/1.1.0"
+            },
+            "time": "2020-07-07T09:29:14+00:00"
+        },
         {
             "name": "phpmailer/phpmailer",
             "version": "v6.2.0",
@@ -1325,6 +1657,58 @@
             ],
             "time": "2017-02-14T16:28:37+00:00"
         },
+        {
+            "name": "psr/http-client",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/http-client.git",
+                "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+                "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.0 || ^8.0",
+                "psr/http-message": "^1.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Http\\Client\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for HTTP clients",
+            "homepage": "https://github.com/php-fig/http-client",
+            "keywords": [
+                "http",
+                "http-client",
+                "psr",
+                "psr-18"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/http-client/tree/master"
+            },
+            "time": "2020-06-29T06:28:15+00:00"
+        },
         {
             "name": "psr/http-factory",
             "version": "1.0.1",

+ 66 - 5
api/vendor/composer/InstalledVersions.php

@@ -29,7 +29,7 @@ private static $installed = array (
     'aliases' => 
     array (
     ),
-    'reference' => '4e3765a9a4e63d1a4353ba100264632bad9e38ed',
+    'reference' => '178b03ea57831f8952256b9c0078e5784c0518a8',
     'name' => '__root__',
   ),
   'versions' => 
@@ -41,7 +41,7 @@ private static $installed = array (
       'aliases' => 
       array (
       ),
-      'reference' => '4e3765a9a4e63d1a4353ba100264632bad9e38ed',
+      'reference' => '178b03ea57831f8952256b9c0078e5784c0518a8',
     ),
     'adldap2/adldap2' => 
     array (
@@ -115,12 +115,12 @@ private static $installed = array (
     ),
     'guzzlehttp/guzzle' => 
     array (
-      'pretty_version' => '6.5.2',
-      'version' => '6.5.2.0',
+      'pretty_version' => '7.1.1',
+      'version' => '7.1.1.0',
       'aliases' => 
       array (
       ),
-      'reference' => '43ece0e75098b7ecd8d13918293029e555a50f82',
+      'reference' => '7427d6f99df41cc01f33cd59832f721c150ffdf3',
     ),
     'guzzlehttp/promises' => 
     array (
@@ -194,6 +194,15 @@ private static $installed = array (
       ),
       'reference' => 'badb01e62383430706433191b82506b6df24ad98',
     ),
+    'myclabs/php-enum' => 
+    array (
+      'pretty_version' => '1.8.0',
+      'version' => '1.8.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '46cf3d8498b095bd33727b13fd5707263af99421',
+    ),
     'nikic/fast-route' => 
     array (
       'pretty_version' => 'v1.3.0',
@@ -203,6 +212,24 @@ private static $installed = array (
       ),
       'reference' => '181d480e08d9476e61381e04a71b34dc0432e812',
     ),
+    'paquettg/php-html-parser' => 
+    array (
+      'pretty_version' => '3.1.1',
+      'version' => '3.1.1.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '4e01a438ad5961cc2d7427eb9798d213c8a12629',
+    ),
+    'paquettg/string-encode' => 
+    array (
+      'pretty_version' => '1.0.1',
+      'version' => '1.0.1.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => 'a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee',
+    ),
     'paragonie/constant_time_encoding' => 
     array (
       'pretty_version' => 'v2.2.2',
@@ -230,6 +257,24 @@ private static $installed = array (
       ),
       'reference' => '3f2fd07977541b4d630ea0365ad0eceddee5179c',
     ),
+    'php-http/httplug' => 
+    array (
+      'pretty_version' => '2.2.0',
+      'version' => '2.2.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '191a0a1b41ed026b717421931f8d3bd2514ffbf9',
+    ),
+    'php-http/promise' => 
+    array (
+      'pretty_version' => '1.1.0',
+      'version' => '1.1.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '4c4c1f9b7289a2ec57cde7f1e9762a5789506f88',
+    ),
     'phpmailer/phpmailer' => 
     array (
       'pretty_version' => 'v6.2.0',
@@ -257,6 +302,22 @@ private static $installed = array (
       ),
       'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f',
     ),
+    'psr/http-client' => 
+    array (
+      'pretty_version' => '1.0.1',
+      'version' => '1.0.1.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
+    ),
+    'psr/http-client-implementation' => 
+    array (
+      'provided' => 
+      array (
+        0 => '1.0',
+      ),
+    ),
     'psr/http-factory' => 
     array (
       'pretty_version' => '1.0.1',

+ 1 - 0
api/vendor/composer/autoload_namespaces.php

@@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
 $baseDir = dirname($vendorDir);
 
 return array(
+    'stringEncode' => array($vendorDir . '/paquettg/string-encode/src'),
     'Requests' => array($vendorDir . '/rmccue/requests/library'),
 );

+ 5 - 0
api/vendor/composer/autoload_psr4.php

@@ -23,18 +23,23 @@ return array(
     'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
     'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'),
     'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
+    'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
     'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
     'PragmaRX\\Google2FA\\Tests\\' => array($vendorDir . '/pragmarx/google2fa/tests'),
     'PragmaRX\\Google2FA\\' => array($vendorDir . '/pragmarx/google2fa/src'),
     'ParagonIE\\ConstantTime\\' => array($vendorDir . '/paragonie/constant_time_encoding/src'),
     'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
+    'PHPHtmlParser\\' => array($vendorDir . '/paquettg/php-html-parser/src/PHPHtmlParser'),
     'OpenApi\\' => array($vendorDir . '/zircote/swagger-php/src'),
+    'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'),
     'League\\OAuth2\\Client\\' => array($vendorDir . '/league/oauth2-client/src'),
     'Lcobucci\\JWT\\' => array($vendorDir . '/lcobucci/jwt/src'),
     'Kryptonit3\\Sonarr\\' => array($vendorDir . '/kryptonit3/sonarr/src'),
     'Kryptonit3\\SickRage\\' => array($vendorDir . '/kryptonit3/sickrage/src'),
     'Kryptonit3\\CouchPotato\\' => array($vendorDir . '/kryptonit3/couchpotato/src'),
     'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'),
+    'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'),
+    'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'),
     'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
     'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
     'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),

+ 38 - 0
api/vendor/composer/autoload_static.php

@@ -52,16 +52,22 @@ class ComposerStaticInitcbdc783d76f8e7563dcce7d8af053ecb
             'Psr\\Log\\' => 8,
             'Psr\\Http\\Server\\' => 16,
             'Psr\\Http\\Message\\' => 17,
+            'Psr\\Http\\Client\\' => 16,
             'Psr\\Container\\' => 14,
             'PragmaRX\\Google2FA\\Tests\\' => 25,
             'PragmaRX\\Google2FA\\' => 19,
             'ParagonIE\\ConstantTime\\' => 23,
             'PHPMailer\\PHPMailer\\' => 20,
+            'PHPHtmlParser\\' => 14,
         ),
         'O' => 
         array (
             'OpenApi\\' => 8,
         ),
+        'M' => 
+        array (
+            'MyCLabs\\Enum\\' => 13,
+        ),
         'L' => 
         array (
             'League\\OAuth2\\Client\\' => 21,
@@ -77,6 +83,11 @@ class ComposerStaticInitcbdc783d76f8e7563dcce7d8af053ecb
         array (
             'Illuminate\\Contracts\\' => 21,
         ),
+        'H' => 
+        array (
+            'Http\\Promise\\' => 13,
+            'Http\\Client\\' => 12,
+        ),
         'G' => 
         array (
             'GuzzleHttp\\Psr7\\' => 16,
@@ -178,6 +189,10 @@ class ComposerStaticInitcbdc783d76f8e7563dcce7d8af053ecb
             0 => __DIR__ . '/..' . '/psr/http-factory/src',
             1 => __DIR__ . '/..' . '/psr/http-message/src',
         ),
+        'Psr\\Http\\Client\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/psr/http-client/src',
+        ),
         'Psr\\Container\\' => 
         array (
             0 => __DIR__ . '/..' . '/psr/container/src',
@@ -198,10 +213,18 @@ class ComposerStaticInitcbdc783d76f8e7563dcce7d8af053ecb
         array (
             0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
         ),
+        'PHPHtmlParser\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/paquettg/php-html-parser/src/PHPHtmlParser',
+        ),
         'OpenApi\\' => 
         array (
             0 => __DIR__ . '/..' . '/zircote/swagger-php/src',
         ),
+        'MyCLabs\\Enum\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/myclabs/php-enum/src',
+        ),
         'League\\OAuth2\\Client\\' => 
         array (
             0 => __DIR__ . '/..' . '/league/oauth2-client/src',
@@ -226,6 +249,14 @@ class ComposerStaticInitcbdc783d76f8e7563dcce7d8af053ecb
         array (
             0 => __DIR__ . '/..' . '/illuminate/contracts',
         ),
+        'Http\\Promise\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/php-http/promise/src',
+        ),
+        'Http\\Client\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/php-http/httplug/src',
+        ),
         'GuzzleHttp\\Psr7\\' => 
         array (
             0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
@@ -269,6 +300,13 @@ class ComposerStaticInitcbdc783d76f8e7563dcce7d8af053ecb
     );
 
     public static $prefixesPsr0 = array (
+        's' => 
+        array (
+            'stringEncode' => 
+            array (
+                0 => __DIR__ . '/..' . '/paquettg/string-encode/src',
+            ),
+        ),
         'R' => 
         array (
             'Requests' => 

+ 411 - 9
api/vendor/composer/installed.json

@@ -455,39 +455,45 @@
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "6.5.2",
-            "version_normalized": "6.5.2.0",
+            "version": "7.1.1",
+            "version_normalized": "7.1.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "43ece0e75098b7ecd8d13918293029e555a50f82"
+                "reference": "7427d6f99df41cc01f33cd59832f721c150ffdf3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82",
-                "reference": "43ece0e75098b7ecd8d13918293029e555a50f82",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7427d6f99df41cc01f33cd59832f721c150ffdf3",
+                "reference": "7427d6f99df41cc01f33cd59832f721c150ffdf3",
                 "shasum": ""
             },
             "require": {
                 "ext-json": "*",
                 "guzzlehttp/promises": "^1.0",
                 "guzzlehttp/psr7": "^1.6.1",
-                "php": ">=5.5"
+                "php": "^7.2.5",
+                "psr/http-client": "^1.0"
+            },
+            "provide": {
+                "psr/http-client-implementation": "1.0"
             },
             "require-dev": {
                 "ext-curl": "*",
-                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
+                "php-http/client-integration-tests": "dev-phpunit8",
+                "phpunit/phpunit": "^8.5.5",
                 "psr/log": "^1.1"
             },
             "suggest": {
+                "ext-curl": "Required for CURL handler support",
                 "ext-intl": "Required for Internationalized Domain Name (IDN) support",
                 "psr/log": "Required for using the Log middleware"
             },
-            "time": "2019-12-23T11:57:10+00:00",
+            "time": "2020-09-30T08:51:17+00:00",
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "6.5-dev"
+                    "dev-master": "7.1-dev"
                 }
             },
             "installation-source": "dist",
@@ -508,6 +514,11 @@
                     "name": "Michael Dowling",
                     "email": "mtdowling@gmail.com",
                     "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://sagikazarmark.hu"
                 }
             ],
             "description": "Guzzle is a PHP HTTP client library",
@@ -518,9 +529,33 @@
                 "framework",
                 "http",
                 "http client",
+                "psr-18",
+                "psr-7",
                 "rest",
                 "web service"
             ],
+            "support": {
+                "issues": "https://github.com/guzzle/guzzle/issues",
+                "source": "https://github.com/guzzle/guzzle/tree/7.1.1"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/GrahamCampbell",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/Nyholm",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/alexeyshockov",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/gmponos",
+                    "type": "github"
+                }
+            ],
             "install-path": "../guzzlehttp/guzzle"
         },
         {
@@ -946,6 +981,69 @@
             },
             "install-path": "../league/oauth2-client"
         },
+        {
+            "name": "myclabs/php-enum",
+            "version": "1.8.0",
+            "version_normalized": "1.8.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/myclabs/php-enum.git",
+                "reference": "46cf3d8498b095bd33727b13fd5707263af99421"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/myclabs/php-enum/zipball/46cf3d8498b095bd33727b13fd5707263af99421",
+                "reference": "46cf3d8498b095bd33727b13fd5707263af99421",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "php": "^7.3 || ^8.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^9.5",
+                "squizlabs/php_codesniffer": "1.*",
+                "vimeo/psalm": "^4.5.1"
+            },
+            "time": "2021-02-15T16:11:48+00:00",
+            "type": "library",
+            "installation-source": "dist",
+            "autoload": {
+                "psr-4": {
+                    "MyCLabs\\Enum\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP Enum contributors",
+                    "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
+                }
+            ],
+            "description": "PHP Enum implementation",
+            "homepage": "http://github.com/myclabs/php-enum",
+            "keywords": [
+                "enum"
+            ],
+            "support": {
+                "issues": "https://github.com/myclabs/php-enum/issues",
+                "source": "https://github.com/myclabs/php-enum/tree/1.8.0"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/mnapoli",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
+                    "type": "tidelift"
+                }
+            ],
+            "install-path": "../myclabs/php-enum"
+        },
         {
             "name": "nikic/fast-route",
             "version": "v1.3.0",
@@ -995,6 +1093,130 @@
             ],
             "install-path": "../nikic/fast-route"
         },
+        {
+            "name": "paquettg/php-html-parser",
+            "version": "3.1.1",
+            "version_normalized": "3.1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/paquettg/php-html-parser.git",
+                "reference": "4e01a438ad5961cc2d7427eb9798d213c8a12629"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/paquettg/php-html-parser/zipball/4e01a438ad5961cc2d7427eb9798d213c8a12629",
+                "reference": "4e01a438ad5961cc2d7427eb9798d213c8a12629",
+                "shasum": ""
+            },
+            "require": {
+                "ext-curl": "*",
+                "ext-mbstring": "*",
+                "ext-zlib": "*",
+                "guzzlehttp/guzzle": "^7.0",
+                "guzzlehttp/psr7": "^1.6",
+                "myclabs/php-enum": "^1.7",
+                "paquettg/string-encode": "~1.0.0",
+                "php": ">=7.2",
+                "php-http/httplug": "^2.1"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "^2.16",
+                "infection/infection": "^0.13.4",
+                "mockery/mockery": "^1.2",
+                "phan/phan": "^2.4",
+                "phpunit/phpunit": "^7.5.1"
+            },
+            "time": "2020-11-01T20:34:43+00:00",
+            "type": "library",
+            "installation-source": "dist",
+            "autoload": {
+                "psr-4": {
+                    "PHPHtmlParser\\": "src/PHPHtmlParser"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Gilles Paquette",
+                    "email": "paquettg@gmail.com",
+                    "homepage": "http://gillespaquette.ca"
+                }
+            ],
+            "description": "An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.",
+            "homepage": "https://github.com/paquettg/php-html-parser",
+            "keywords": [
+                "dom",
+                "html",
+                "parser"
+            ],
+            "support": {
+                "issues": "https://github.com/paquettg/php-html-parser/issues",
+                "source": "https://github.com/paquettg/php-html-parser/tree/3.1.1"
+            },
+            "funding": [
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/paquettg/php-html-parser",
+                    "type": "tidelift"
+                }
+            ],
+            "install-path": "../paquettg/php-html-parser"
+        },
+        {
+            "name": "paquettg/string-encode",
+            "version": "1.0.1",
+            "version_normalized": "1.0.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/paquettg/string-encoder.git",
+                "reference": "a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/paquettg/string-encoder/zipball/a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee",
+                "reference": "a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^7.5.1"
+            },
+            "time": "2018-12-21T02:25:09+00:00",
+            "type": "library",
+            "installation-source": "dist",
+            "autoload": {
+                "psr-0": {
+                    "stringEncode": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Gilles Paquette",
+                    "email": "paquettg@gmail.com",
+                    "homepage": "http://gillespaquette.ca"
+                }
+            ],
+            "description": "Facilitating the process of altering string encoding in PHP.",
+            "homepage": "https://github.com/paquettg/string-encoder",
+            "keywords": [
+                "charset",
+                "encoding",
+                "string"
+            ],
+            "support": {
+                "issues": "https://github.com/paquettg/string-encoder/issues",
+                "source": "https://github.com/paquettg/string-encoder/tree/1.0.1"
+            },
+            "install-path": "../paquettg/string-encode"
+        },
         {
             "name": "paragonie/constant_time_encoding",
             "version": "v2.2.2",
@@ -1193,6 +1415,131 @@
             ],
             "install-path": "../paragonie/sodium_compat"
         },
+        {
+            "name": "php-http/httplug",
+            "version": "2.2.0",
+            "version_normalized": "2.2.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-http/httplug.git",
+                "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-http/httplug/zipball/191a0a1b41ed026b717421931f8d3bd2514ffbf9",
+                "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1 || ^8.0",
+                "php-http/promise": "^1.1",
+                "psr/http-client": "^1.0",
+                "psr/http-message": "^1.0"
+            },
+            "require-dev": {
+                "friends-of-phpspec/phpspec-code-coverage": "^4.1",
+                "phpspec/phpspec": "^5.1 || ^6.0"
+            },
+            "time": "2020-07-13T15:43:23+00:00",
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.x-dev"
+                }
+            },
+            "installation-source": "dist",
+            "autoload": {
+                "psr-4": {
+                    "Http\\Client\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Eric GELOEN",
+                    "email": "geloen.eric@gmail.com"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com",
+                    "homepage": "https://sagikazarmark.hu"
+                }
+            ],
+            "description": "HTTPlug, the HTTP client abstraction for PHP",
+            "homepage": "http://httplug.io",
+            "keywords": [
+                "client",
+                "http"
+            ],
+            "support": {
+                "issues": "https://github.com/php-http/httplug/issues",
+                "source": "https://github.com/php-http/httplug/tree/master"
+            },
+            "install-path": "../php-http/httplug"
+        },
+        {
+            "name": "php-http/promise",
+            "version": "1.1.0",
+            "version_normalized": "1.1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-http/promise.git",
+                "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88",
+                "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.1 || ^8.0"
+            },
+            "require-dev": {
+                "friends-of-phpspec/phpspec-code-coverage": "^4.3.2",
+                "phpspec/phpspec": "^5.1.2 || ^6.2"
+            },
+            "time": "2020-07-07T09:29:14+00:00",
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1-dev"
+                }
+            },
+            "installation-source": "dist",
+            "autoload": {
+                "psr-4": {
+                    "Http\\Promise\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Joel Wurtz",
+                    "email": "joel.wurtz@gmail.com"
+                },
+                {
+                    "name": "Márk Sági-Kazár",
+                    "email": "mark.sagikazar@gmail.com"
+                }
+            ],
+            "description": "Promise used for asynchronous HTTP requests",
+            "homepage": "http://httplug.io",
+            "keywords": [
+                "promise"
+            ],
+            "support": {
+                "issues": "https://github.com/php-http/promise/issues",
+                "source": "https://github.com/php-http/promise/tree/1.1.0"
+            },
+            "install-path": "../php-http/promise"
+        },
         {
             "name": "phpmailer/phpmailer",
             "version": "v6.2.0",
@@ -1388,6 +1735,61 @@
             ],
             "install-path": "../psr/container"
         },
+        {
+            "name": "psr/http-client",
+            "version": "1.0.1",
+            "version_normalized": "1.0.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/http-client.git",
+                "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+                "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.0 || ^8.0",
+                "psr/http-message": "^1.0"
+            },
+            "time": "2020-06-29T06:28:15+00:00",
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "installation-source": "dist",
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Http\\Client\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for HTTP clients",
+            "homepage": "https://github.com/php-fig/http-client",
+            "keywords": [
+                "http",
+                "http-client",
+                "psr",
+                "psr-18"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/http-client/tree/master"
+            },
+            "install-path": "../psr/http-client"
+        },
         {
             "name": "psr/http-factory",
             "version": "1.0.1",

+ 66 - 5
api/vendor/composer/installed.php

@@ -6,7 +6,7 @@
     'aliases' => 
     array (
     ),
-    'reference' => '4e3765a9a4e63d1a4353ba100264632bad9e38ed',
+    'reference' => '178b03ea57831f8952256b9c0078e5784c0518a8',
     'name' => '__root__',
   ),
   'versions' => 
@@ -18,7 +18,7 @@
       'aliases' => 
       array (
       ),
-      'reference' => '4e3765a9a4e63d1a4353ba100264632bad9e38ed',
+      'reference' => '178b03ea57831f8952256b9c0078e5784c0518a8',
     ),
     'adldap2/adldap2' => 
     array (
@@ -92,12 +92,12 @@
     ),
     'guzzlehttp/guzzle' => 
     array (
-      'pretty_version' => '6.5.2',
-      'version' => '6.5.2.0',
+      'pretty_version' => '7.1.1',
+      'version' => '7.1.1.0',
       'aliases' => 
       array (
       ),
-      'reference' => '43ece0e75098b7ecd8d13918293029e555a50f82',
+      'reference' => '7427d6f99df41cc01f33cd59832f721c150ffdf3',
     ),
     'guzzlehttp/promises' => 
     array (
@@ -171,6 +171,15 @@
       ),
       'reference' => 'badb01e62383430706433191b82506b6df24ad98',
     ),
+    'myclabs/php-enum' => 
+    array (
+      'pretty_version' => '1.8.0',
+      'version' => '1.8.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '46cf3d8498b095bd33727b13fd5707263af99421',
+    ),
     'nikic/fast-route' => 
     array (
       'pretty_version' => 'v1.3.0',
@@ -180,6 +189,24 @@
       ),
       'reference' => '181d480e08d9476e61381e04a71b34dc0432e812',
     ),
+    'paquettg/php-html-parser' => 
+    array (
+      'pretty_version' => '3.1.1',
+      'version' => '3.1.1.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '4e01a438ad5961cc2d7427eb9798d213c8a12629',
+    ),
+    'paquettg/string-encode' => 
+    array (
+      'pretty_version' => '1.0.1',
+      'version' => '1.0.1.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => 'a8708e9fac9d5ddfc8fc2aac6004e2cd05d80fee',
+    ),
     'paragonie/constant_time_encoding' => 
     array (
       'pretty_version' => 'v2.2.2',
@@ -207,6 +234,24 @@
       ),
       'reference' => '3f2fd07977541b4d630ea0365ad0eceddee5179c',
     ),
+    'php-http/httplug' => 
+    array (
+      'pretty_version' => '2.2.0',
+      'version' => '2.2.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '191a0a1b41ed026b717421931f8d3bd2514ffbf9',
+    ),
+    'php-http/promise' => 
+    array (
+      'pretty_version' => '1.1.0',
+      'version' => '1.1.0.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '4c4c1f9b7289a2ec57cde7f1e9762a5789506f88',
+    ),
     'phpmailer/phpmailer' => 
     array (
       'pretty_version' => 'v6.2.0',
@@ -234,6 +279,22 @@
       ),
       'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f',
     ),
+    'psr/http-client' => 
+    array (
+      'pretty_version' => '1.0.1',
+      'version' => '1.0.1.0',
+      'aliases' => 
+      array (
+      ),
+      'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
+    ),
+    'psr/http-client-implementation' => 
+    array (
+      'provided' => 
+      array (
+        0 => '1.0',
+      ),
+    ),
     'psr/http-factory' => 
     array (
       'pretty_version' => '1.0.1',

+ 2 - 2
api/vendor/composer/platform_check.php

@@ -4,8 +4,8 @@
 
 $issues = array();
 
-if (!(PHP_VERSION_ID >= 70205)) {
-    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
+if (!(PHP_VERSION_ID >= 70300)) {
+    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
 }
 
 if ($issues) {

+ 0 - 23
api/vendor/guzzlehttp/guzzle/.php_cs

@@ -1,23 +0,0 @@
-<?php
-
-$config = PhpCsFixer\Config::create()
-    ->setRiskyAllowed(true)
-    ->setRules([
-        '@PSR2' => true,
-        'array_syntax' => ['syntax' => 'short'],
-        'declare_strict_types' => false,
-        'concat_space' => ['spacing'=>'one'],
-        'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
-        'ordered_imports' => true,
-        // 'phpdoc_align' => ['align'=>'vertical'],
-        // 'native_function_invocation' => true,
-    ])
-    ->setFinder(
-        PhpCsFixer\Finder::create()
-            ->in(__DIR__.'/src')
-            ->in(__DIR__.'/tests')
-            ->name('*.php')
-    )
-;
-
-return $config;

+ 114 - 6
api/vendor/guzzlehttp/guzzle/CHANGELOG.md

@@ -1,5 +1,115 @@
 # Change Log
 
+Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
+
+## UNRELEASED
+
+## 7.1.1 - 2020-09-30
+
+### Fixed
+
+- Incorrect EOF detection for response body streams on Windows.
+
+### Changed
+
+- We dont connect curl `sink` on HEAD requests.
+- Removed some PHP 5 workarounds
+
+## 7.1.0 - 2020-09-22
+
+### Added
+
+- `GuzzleHttp\MessageFormatterInterface`
+
+### Fixed
+
+- Fixed issue that caused cookies with no value not to be stored.
+- On redirects, we allow all safe methods like GET, HEAD and OPTIONS.
+- Fixed logging on empty responses.
+- Make sure MessageFormatter::format returns string
+
+### Deprecated
+
+- All functions in `GuzzleHttp` has been deprecated. Use static methods on `Utils` instead.
+- `ClientInterface::getConfig()`
+- `Client::getConfig()`
+- `Client::__call()`
+- `Utils::defaultCaBundle()`
+- `CurlFactory::LOW_CURL_VERSION_NUMBER`
+
+## 7.0.1 - 2020-06-27
+
+* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699)
+
+## 7.0.0 - 2020-06-27
+
+No changes since 7.0.0-rc1.
+
+## 7.0.0-rc1 - 2020-06-15
+
+### Changed
+
+* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629)
+* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675)
+
+## 7.0.0-beta2 - 2020-05-25
+
+### Added
+
+* Using `Utils` class instead of functions in the `GuzzleHttp` namespace. [#2546](https://github.com/guzzle/guzzle/pull/2546)
+* `ClientInterface::MAJOR_VERSION` [#2583](https://github.com/guzzle/guzzle/pull/2583)
+
+### Changed
+
+* Avoid the `getenv` function when unsafe [#2531](https://github.com/guzzle/guzzle/pull/2531)
+* Added real client methods [#2529](https://github.com/guzzle/guzzle/pull/2529)
+* Avoid functions due to global install conflicts [#2546](https://github.com/guzzle/guzzle/pull/2546)
+* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550)
+* Adding methods for HTTP verbs like `Client::get()`, `Client::head()`, `Client::patch()` etc [#2529](https://github.com/guzzle/guzzle/pull/2529)
+* `ConnectException` extends `TransferException` [#2541](https://github.com/guzzle/guzzle/pull/2541)
+* Updated the default User Agent to "GuzzleHttp/7" [#2654](https://github.com/guzzle/guzzle/pull/2654)
+
+### Fixed
+
+* Various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626)
+
+### Removed
+
+* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528)
+
+## 7.0.0-beta1 - 2019-12-30
+
+The diff might look very big but 95% of Guzzle users will be able to upgrade without modification.
+Please see [the upgrade document](UPGRADING.md) that describes all BC breaking changes.
+
+### Added
+
+* Implement PSR-18 and dropped PHP 5 support [#2421](https://github.com/guzzle/guzzle/pull/2421) [#2474](https://github.com/guzzle/guzzle/pull/2474)
+* PHP 7 types [#2442](https://github.com/guzzle/guzzle/pull/2442) [#2449](https://github.com/guzzle/guzzle/pull/2449) [#2466](https://github.com/guzzle/guzzle/pull/2466) [#2497](https://github.com/guzzle/guzzle/pull/2497) [#2499](https://github.com/guzzle/guzzle/pull/2499)
+* IDN support for redirects [2424](https://github.com/guzzle/guzzle/pull/2424)
+
+### Changed
+
+* Dont allow passing null as third argument to `BadResponseException::__construct()` [#2427](https://github.com/guzzle/guzzle/pull/2427)
+* Use SAPI constant instead of method call [#2450](https://github.com/guzzle/guzzle/pull/2450)
+* Use native function invocation [#2444](https://github.com/guzzle/guzzle/pull/2444)
+* Better defaults for PHP installations with old ICU lib [2454](https://github.com/guzzle/guzzle/pull/2454)
+* Added visibility to all constants [#2462](https://github.com/guzzle/guzzle/pull/2462)
+* Dont allow passing `null` as URI to `Client::request()` and `Client::requestAsync()` [#2461](https://github.com/guzzle/guzzle/pull/2461)
+* Widen the exception argument to throwable [#2495](https://github.com/guzzle/guzzle/pull/2495)
+
+### Fixed
+
+* Logging when Promise rejected with a string [#2311](https://github.com/guzzle/guzzle/pull/2311)
+
+### Removed
+
+* Class `SeekException` [#2162](https://github.com/guzzle/guzzle/pull/2162)
+* `RequestException::getResponseBodySummary()` [#2425](https://github.com/guzzle/guzzle/pull/2425)
+* `CookieJar::getCookieValue()` [#2433](https://github.com/guzzle/guzzle/pull/2433)
+* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440)
+* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464)
+
 ## 6.5.2 - 2019-12-23
 
 * idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489)
@@ -20,7 +130,7 @@
 
 ## 6.4.1 - 2019-10-23
 
-* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that 
+* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that
 * Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar`
 
 ## 6.4.0 - 2019-10-23
@@ -342,7 +452,7 @@ object).
   * Note: This has been changed in 5.0.3 to now encode query string values by
     default unless the `rawString` argument is provided when setting the query
     string on a URL: Now allowing many more characters to be present in the
-    query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A
+    query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A
 
 ## 5.0.1 - 2014-10-16
 
@@ -384,7 +494,7 @@ interfaces.
   responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`,
   `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and
   `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of
-  why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/.
+  why I did this: https://ocramius.github.io/blog/fluent-interfaces-are-evil/.
   This also makes the Guzzle message interfaces compatible with the current
   PSR-7 message proposal.
 * Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except
@@ -570,8 +680,6 @@ interfaces.
 
 ## 4.0.0 - 2014-03-29
 
-* For more information on the 4.0 transition, see:
-  http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/
 * For information on changes and upgrading, see:
   https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40
 * Added `GuzzleHttp\batch()` as a convenience function for sending requests in
@@ -880,7 +988,7 @@ interfaces.
 
 ## 3.4.0 - 2013-04-11
 
-* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289
+* Bug fix: URLs are now resolved correctly based on https://tools.ietf.org/html/rfc3986#section-5.2. #289
 * Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289
 * Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263
 * Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264.

+ 0 - 18
api/vendor/guzzlehttp/guzzle/Dockerfile

@@ -1,18 +0,0 @@
-FROM composer:latest as setup
-
-RUN mkdir /guzzle
-
-WORKDIR /guzzle
-
-RUN set -xe \
-    && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár <mark.sagikazar@gmail.com>" --no-interaction \
-    && composer require guzzlehttp/guzzle
-
-
-FROM php:7.3
-
-RUN mkdir /guzzle
-
-WORKDIR /guzzle
-
-COPY --from=setup /guzzle /guzzle

+ 1 - 1
api/vendor/guzzlehttp/guzzle/LICENSE

@@ -1,4 +1,4 @@
-Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
+Copyright (c) 2011 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 20 - 31
api/vendor/guzzlehttp/guzzle/README.md

@@ -1,8 +1,9 @@
-Guzzle, PHP HTTP client
-=======================
+![Guzzle](.github/logo.png?raw=true)
+
+# Guzzle, PHP HTTP client
 
 [![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases)
-[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle)
+[![Build Status](https://img.shields.io/github/workflow/status/guzzle/guzzle/CI?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI)
 [![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle)
 
 Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
@@ -14,6 +15,7 @@ trivial to integrate with web services.
 - Can send both synchronous and asynchronous requests using the same interface.
 - Uses PSR-7 interfaces for requests, responses, and streams. This allows you
   to utilize other PSR-7 compatible libraries with Guzzle.
+- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients.
 - Abstracts away the underlying HTTP transport, allowing you to write
   environment and transport agnostic code; i.e., no hard dependency on cURL,
   PHP streams, sockets, or non-blocking event loops.
@@ -23,11 +25,11 @@ trivial to integrate with web services.
 $client = new \GuzzleHttp\Client();
 $response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');
 
-echo $response->getStatusCode(); # 200
-echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8'
-echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}'
+echo $response->getStatusCode(); // 200
+echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
+echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}'
 
-# Send an asynchronous request.
+// Send an asynchronous request.
 $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
 $promise = $client->sendAsync($request)->then(function ($response) {
     echo 'I completed! ' . $response->getBody();
@@ -38,39 +40,23 @@ $promise->wait();
 
 ## Help and docs
 
+We use GitHub issues only to discuss bugs and new features. For support please refer to:
+
 - [Documentation](http://guzzlephp.org/)
 - [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle)
+- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](http://slack.httplug.io/)
 - [Gitter](https://gitter.im/guzzle/guzzle)
 
 
 ## Installing Guzzle
 
 The recommended way to install Guzzle is through
-[Composer](http://getcomposer.org).
-
-```bash
-# Install Composer
-curl -sS https://getcomposer.org/installer | php
-```
-
-Next, run the Composer command to install the latest stable version of Guzzle:
+[Composer](https://getcomposer.org/).
 
 ```bash
 composer require guzzlehttp/guzzle
 ```
 
-After installing, you need to require Composer's autoloader:
-
-```php
-require 'vendor/autoload.php';
-```
-
-You can then later update Guzzle using composer:
-
- ```bash
-composer update
- ```
-
 
 ## Version Guidance
 
@@ -79,12 +65,15 @@ composer update
 | 3.x     | EOL        | `guzzle/guzzle`     | `Guzzle`     | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No    | >= 5.3.3    |
 | 4.x     | EOL        | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A                 | No    | >= 5.4      |
 | 5.x     | EOL        | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No    | >= 5.4      |
-| 6.x     | Latest     | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes   | >= 5.5      |
+| 6.x     | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes   | >= 5.5      |
+| 7.x     | Latest     | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes   | >= 7.2      |
 
 [guzzle-3-repo]: https://github.com/guzzle/guzzle3
 [guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
 [guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
-[guzzle-6-repo]: https://github.com/guzzle/guzzle
+[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5
+[guzzle-7-repo]: https://github.com/guzzle/guzzle
 [guzzle-3-docs]: http://guzzle3.readthedocs.org
-[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/
-[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/
+[guzzle-5-docs]: http://docs.guzzlephp.org/en/5.3/
+[guzzle-6-docs]: http://docs.guzzlephp.org/en/6.5/
+[guzzle-7-docs]: http://docs.guzzlephp.org/en/latest/

+ 53 - 3
api/vendor/guzzlehttp/guzzle/UPGRADING.md

@@ -1,10 +1,60 @@
 Guzzle Upgrade Guide
 ====================
 
+6.0 to 7.0
+----------
+
+In order to take advantage of the new features of PHP, Guzzle dropped the support
+of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return
+types for functions and methods have been added wherever possible. 
+
+Please make sure:
+- You are calling a function or a method with the correct type.
+- If you extend a class of Guzzle; update all signatures on methods you override.
+
+#### Other backwards compatibility breaking changes
+
+- Class `GuzzleHttp\UriTemplate` is removed.
+- Class `GuzzleHttp\Exception\SeekException` is removed.
+- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`, 
+  `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty
+  Response as argument.
+- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException`
+  instead of `GuzzleHttp\Exception\RequestException`.
+- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed.
+- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed.
+- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead.
+- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed.
+  Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative.
+- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed.
+- Request option `exception` is removed. Please use `http_errors`.
+- Request option `save_to` is removed. Please use `sink`.
+- Pool option `pool_size` is removed. Please use `concurrency`.
+- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility.
+- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation.
+- The `log` middleware will log the errors with level `error` instead of `notice` 
+- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher).
+
+#### Native functions calls
+
+All internal native functions calls of Guzzle are now prefixed with a slash. This
+change makes it impossible for method overloading by other libraries or applications.
+Example:
+
+```php
+// Before:
+curl_version();
+
+// After:
+\curl_version();
+```
+
+For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master).
+
 5.0 to 6.0
 ----------
 
-Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages.
+Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages.
 Due to the fact that these messages are immutable, this prompted a refactoring
 of Guzzle to use a middleware based system rather than an event system. Any
 HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be
@@ -167,7 +217,7 @@ passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP
 
 ## Removed Fluent Interfaces
 
-[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil)
+[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/)
 from the following classes:
 
 - `GuzzleHttp\Collection`
@@ -820,7 +870,7 @@ HeaderInterface (e.g. toArray(), getAll(), etc.).
 3.3 to 3.4
 ----------
 
-Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
+Base URLs of a client now follow the rules of https://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
 
 3.2 to 3.3
 ----------

+ 20 - 7
api/vendor/guzzlehttp/guzzle/composer.json

@@ -9,7 +9,9 @@
         "web service",
         "curl",
         "client",
-        "HTTP client"
+        "HTTP client",
+        "PSR-7",
+        "PSR-18"
     ],
     "homepage": "http://guzzlephp.org/",
     "license": "MIT",
@@ -18,29 +20,40 @@
             "name": "Michael Dowling",
             "email": "mtdowling@gmail.com",
             "homepage": "https://github.com/mtdowling"
+        },
+        {
+            "name": "Márk Sági-Kazár",
+            "email": "mark.sagikazar@gmail.com",
+            "homepage": "https://sagikazarmark.hu"
         }
     ],
     "require": {
-        "php": ">=5.5",
+        "php": "^7.2.5",
         "ext-json": "*",
         "guzzlehttp/promises": "^1.0",
-        "guzzlehttp/psr7": "^1.6.1"
+        "guzzlehttp/psr7": "^1.6.1",
+        "psr/http-client": "^1.0"
+    },
+    "provide": {
+        "psr/http-client-implementation": "1.0"
     },
     "require-dev": {
         "ext-curl": "*",
-        "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
+        "php-http/client-integration-tests": "dev-phpunit8",
+        "phpunit/phpunit": "^8.5.5",
         "psr/log": "^1.1"
     },
     "suggest": {
-        "psr/log": "Required for using the Log middleware",
-        "ext-intl": "Required for Internationalized Domain Name (IDN) support"
+        "ext-curl": "Required for CURL handler support",
+        "ext-intl": "Required for Internationalized Domain Name (IDN) support",
+        "psr/log": "Required for using the Log middleware"
     },
     "config": {
         "sort-packages": true
     },
     "extra": {
         "branch-alias": {
-            "dev-master": "6.5-dev"
+            "dev-master": "7.1-dev"
         }
     },
     "autoload": {

+ 87 - 0
api/vendor/guzzlehttp/guzzle/psalm.baseline.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<files psalm-version="3.11.5@3c60609c218d4d4b3b257728b8089094e5c6c6c2">
+  <file src="src/Client.php">
+    <NullArgument occurrences="1">
+      <code>null</code>
+    </NullArgument>
+    <PossiblyUndefinedVariable occurrences="1">
+      <code>$options</code>
+    </PossiblyUndefinedVariable>
+    <UndefinedInterfaceMethod occurrences="1">
+      <code>getBoundary</code>
+    </UndefinedInterfaceMethod>
+  </file>
+  <file src="src/Cookie/CookieJar.php">
+    <PossiblyFalseOperand occurrences="1">
+      <code>$result</code>
+    </PossiblyFalseOperand>
+  </file>
+  <file src="src/Exception/RequestException.php">
+    <ImplicitToStringCast occurrences="1">
+      <code>$uri</code>
+    </ImplicitToStringCast>
+  </file>
+  <file src="src/Handler/CurlFactory.php">
+    <ImplicitToStringCast occurrences="1">
+      <code>$easy-&gt;request-&gt;getUri()</code>
+    </ImplicitToStringCast>
+    <TypeDoesNotContainType occurrences="1">
+      <code>$timeoutRequiresNoSignal &amp;&amp; \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN'</code>
+    </TypeDoesNotContainType>
+  </file>
+  <file src="src/Handler/CurlMultiHandler.php">
+    <InvalidArgument occurrences="1">
+      <code>$this-&gt;active</code>
+    </InvalidArgument>
+    <InvalidPropertyAssignmentValue occurrences="1">
+      <code>$this-&gt;active</code>
+    </InvalidPropertyAssignmentValue>
+    <UndefinedThisPropertyAssignment occurrences="1">
+      <code>$this-&gt;_mh</code>
+    </UndefinedThisPropertyAssignment>
+  </file>
+  <file src="src/Handler/MockHandler.php">
+    <InvalidScalarArgument occurrences="1">
+      <code>$options['delay'] * 1000</code>
+    </InvalidScalarArgument>
+  </file>
+  <file src="src/Handler/StreamHandler.php">
+    <ImplicitToStringCast occurrences="1">
+      <code>$uri</code>
+    </ImplicitToStringCast>
+  </file>
+  <file src="src/HandlerStack.php">
+    <PropertyTypeCoercion occurrences="4">
+      <code>$this-&gt;stack</code>
+      <code>$this-&gt;stack</code>
+      <code>$this-&gt;stack</code>
+      <code>$this-&gt;stack</code>
+    </PropertyTypeCoercion>
+  </file>
+  <file src="src/MessageFormatter.php">
+    <InvalidScalarArgument occurrences="1"/>
+  </file>
+  <file src="src/Middleware.php">
+    <InvalidArgument occurrences="1">
+      <code>$request</code>
+    </InvalidArgument>
+  </file>
+  <file src="src/RedirectMiddleware.php">
+    <ImplicitToStringCast occurrences="1">
+      <code>$location</code>
+    </ImplicitToStringCast>
+  </file>
+  <file src="src/RetryMiddleware.php">
+    <TooManyArguments occurrences="1">
+      <code>($this-&gt;delay)(++$options['retries'], $response)</code>
+    </TooManyArguments>
+  </file>
+  <file src="src/Utils.php">
+    <ForbiddenCode occurrences="1">
+      <code>\var_dump($input)</code>
+    </ForbiddenCode>
+    <PossiblyNullArgument occurrences="1">
+      <code>$info</code>
+    </PossiblyNullArgument>
+  </file>
+</files>

+ 16 - 0
api/vendor/guzzlehttp/guzzle/psalm.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<psalm
+    errorLevel="3"
+    resolveFromConfigFile="true"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns="https://getpsalm.org/schema/config"
+    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
+    errorBaseline="psalm.baseline.xml"
+>
+    <projectFiles>
+        <directory name="src" />
+        <ignoreFiles>
+            <directory name="vendor" />
+        </ignoreFiles>
+    </projectFiles>
+</psalm>

+ 93 - 131
api/vendor/guzzlehttp/guzzle/src/Client.php

@@ -1,31 +1,25 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Cookie\CookieJar;
+use GuzzleHttp\Exception\GuzzleException;
 use GuzzleHttp\Exception\InvalidArgumentException;
-use GuzzleHttp\Promise;
-use GuzzleHttp\Psr7;
+use GuzzleHttp\Promise\PromiseInterface;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\UriInterface;
 
 /**
- * @method ResponseInterface get(string|UriInterface $uri, array $options = [])
- * @method ResponseInterface head(string|UriInterface $uri, array $options = [])
- * @method ResponseInterface put(string|UriInterface $uri, array $options = [])
- * @method ResponseInterface post(string|UriInterface $uri, array $options = [])
- * @method ResponseInterface patch(string|UriInterface $uri, array $options = [])
- * @method ResponseInterface delete(string|UriInterface $uri, array $options = [])
- * @method Promise\PromiseInterface getAsync(string|UriInterface $uri, array $options = [])
- * @method Promise\PromiseInterface headAsync(string|UriInterface $uri, array $options = [])
- * @method Promise\PromiseInterface putAsync(string|UriInterface $uri, array $options = [])
- * @method Promise\PromiseInterface postAsync(string|UriInterface $uri, array $options = [])
- * @method Promise\PromiseInterface patchAsync(string|UriInterface $uri, array $options = [])
- * @method Promise\PromiseInterface deleteAsync(string|UriInterface $uri, array $options = [])
+ * @final
  */
-class Client implements ClientInterface
+class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
 {
-    /** @var array Default request options */
+    use ClientTrait;
+
+    /**
+     * @var array Default request options
+     */
     private $config;
 
     /**
@@ -47,9 +41,8 @@ class Client implements ClientInterface
      *   wire. The function is called with a Psr7\Http\Message\RequestInterface
      *   and array of transfer options, and must return a
      *   GuzzleHttp\Promise\PromiseInterface that is fulfilled with a
-     *   Psr7\Http\Message\ResponseInterface on success. "handler" is a
-     *   constructor only option that cannot be overridden in per/request
-     *   options. If no handler is provided, a default handler will be created
+     *   Psr7\Http\Message\ResponseInterface on success.
+     *   If no handler is provided, a default handler will be created
      *   that enables all of the request options below by attaching all of the
      *   default middleware to the handler.
      * - base_uri: (string|UriInterface) Base URI of the client that is merged
@@ -64,8 +57,8 @@ class Client implements ClientInterface
     {
         if (!isset($config['handler'])) {
             $config['handler'] = HandlerStack::create();
-        } elseif (!is_callable($config['handler'])) {
-            throw new \InvalidArgumentException('handler must be a callable');
+        } elseif (!\is_callable($config['handler'])) {
+            throw new InvalidArgumentException('handler must be a callable');
         }
 
         // Convert the base_uri to a UriInterface
@@ -80,19 +73,21 @@ class Client implements ClientInterface
      * @param string $method
      * @param array  $args
      *
-     * @return Promise\PromiseInterface
+     * @return PromiseInterface|ResponseInterface
+     *
+     * @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0.
      */
     public function __call($method, $args)
     {
-        if (count($args) < 1) {
-            throw new \InvalidArgumentException('Magic request methods require a URI and optional options array');
+        if (\count($args) < 1) {
+            throw new InvalidArgumentException('Magic request methods require a URI and optional options array');
         }
 
         $uri = $args[0];
-        $opts = isset($args[1]) ? $args[1] : [];
+        $opts = $args[1] ?? [];
 
-        return substr($method, -5) === 'Async'
-            ? $this->requestAsync(substr($method, 0, -5), $uri, $opts)
+        return \substr($method, -5) === 'Async'
+            ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts)
             : $this->request($method, $uri, $opts);
     }
 
@@ -101,10 +96,8 @@ class Client implements ClientInterface
      *
      * @param array $options Request options to apply to the given
      *                       request and to the transfer. See \GuzzleHttp\RequestOptions.
-     *
-     * @return Promise\PromiseInterface
      */
-    public function sendAsync(RequestInterface $request, array $options = [])
+    public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface
     {
         // Merge the base URI into the request URI if needed.
         $options = $this->prepareDefaults($options);
@@ -121,12 +114,25 @@ class Client implements ClientInterface
      * @param array $options Request options to apply to the given
      *                       request and to the transfer. See \GuzzleHttp\RequestOptions.
      *
-     * @return ResponseInterface
      * @throws GuzzleException
      */
-    public function send(RequestInterface $request, array $options = [])
+    public function send(RequestInterface $request, array $options = []): ResponseInterface
+    {
+        $options[RequestOptions::SYNCHRONOUS] = true;
+        return $this->sendAsync($request, $options)->wait();
+    }
+
+    /**
+     * The HttpClient PSR (PSR-18) specify this method.
+     *
+     * @inheritDoc
+     */
+    public function sendRequest(RequestInterface $request): ResponseInterface
     {
         $options[RequestOptions::SYNCHRONOUS] = true;
+        $options[RequestOptions::ALLOW_REDIRECTS] = false;
+        $options[RequestOptions::HTTP_ERRORS] = false;
+
         return $this->sendAsync($request, $options)->wait();
     }
 
@@ -141,20 +147,18 @@ class Client implements ClientInterface
      * @param string              $method  HTTP method
      * @param string|UriInterface $uri     URI object or string.
      * @param array               $options Request options to apply. See \GuzzleHttp\RequestOptions.
-     *
-     * @return Promise\PromiseInterface
      */
-    public function requestAsync($method, $uri = '', array $options = [])
+    public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface
     {
         $options = $this->prepareDefaults($options);
         // Remove request modifying parameter because it can be done up-front.
-        $headers = isset($options['headers']) ? $options['headers'] : [];
-        $body = isset($options['body']) ? $options['body'] : null;
-        $version = isset($options['version']) ? $options['version'] : '1.1';
+        $headers = $options['headers'] ?? [];
+        $body = $options['body'] ?? null;
+        $version = $options['version'] ?? '1.1';
         // Merge the URI into the base URI.
-        $uri = $this->buildUri($uri, $options);
-        if (is_array($body)) {
-            $this->invalidBody();
+        $uri = $this->buildUri(Psr7\uri_for($uri), $options);
+        if (\is_array($body)) {
+            throw $this->invalidBody();
         }
         $request = new Psr7\Request($method, $uri, $headers, $body, $version);
         // Remove the option so that they are not doubly-applied.
@@ -174,10 +178,9 @@ class Client implements ClientInterface
      * @param string|UriInterface $uri     URI object or string.
      * @param array               $options Request options to apply. See \GuzzleHttp\RequestOptions.
      *
-     * @return ResponseInterface
      * @throws GuzzleException
      */
-    public function request($method, $uri = '', array $options = [])
+    public function request(string $method, $uri = '', array $options = []): ResponseInterface
     {
         $options[RequestOptions::SYNCHRONOUS] = true;
         return $this->requestAsync($method, $uri, $options)->wait();
@@ -193,31 +196,25 @@ class Client implements ClientInterface
      * @param string|null $option The config option to retrieve.
      *
      * @return mixed
+     *
+     * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0.
      */
-    public function getConfig($option = null)
+    public function getConfig(?string $option = null)
     {
         return $option === null
             ? $this->config
             : (isset($this->config[$option]) ? $this->config[$option] : null);
     }
 
-    /**
-     * @param  string|null $uri
-     *
-     * @return UriInterface
-     */
-    private function buildUri($uri, array $config)
+    private function buildUri(UriInterface $uri, array $config): UriInterface
     {
-        // for BC we accept null which would otherwise fail in uri_for
-        $uri = Psr7\uri_for($uri === null ? '' : $uri);
-
         if (isset($config['base_uri'])) {
             $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
         }
 
         if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) {
-            $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion'];
-            $uri = _idn_uri_convert($uri, $idnOptions);
+            $idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion'];
+            $uri = Utils::idnUriConvert($uri, $idnOptions);
         }
 
         return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
@@ -225,46 +222,34 @@ class Client implements ClientInterface
 
     /**
      * Configures the default options for a client.
-     *
-     * @param array $config
-     * @return void
      */
-    private function configureDefaults(array $config)
+    private function configureDefaults(array $config): void
     {
         $defaults = [
             'allow_redirects' => RedirectMiddleware::$defaultSettings,
             'http_errors'     => true,
             'decode_content'  => true,
             'verify'          => true,
-            'cookies'         => false
+            'cookies'         => false,
+            'idn_conversion'  => false,
         ];
 
-        // idn_to_ascii() is a part of ext-intl and might be not available
-        $defaults['idn_conversion'] = function_exists('idn_to_ascii')
-            // Old ICU versions don't have this constant, so we are basically stuck (see https://github.com/guzzle/guzzle/pull/2424
-            // and https://github.com/guzzle/guzzle/issues/2448 for details)
-            && (
-                defined('INTL_IDNA_VARIANT_UTS46')
-                ||
-                PHP_VERSION_ID < 70200
-            );
-
         // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
 
         // We can only trust the HTTP_PROXY environment variable in a CLI
         // process due to the fact that PHP has no reliable mechanism to
         // get environment variables that start with "HTTP_".
-        if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) {
-            $defaults['proxy']['http'] = getenv('HTTP_PROXY');
+        if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) {
+            $defaults['proxy']['http'] = $proxy;
         }
 
-        if ($proxy = getenv('HTTPS_PROXY')) {
+        if ($proxy = Utils::getenv('HTTPS_PROXY')) {
             $defaults['proxy']['https'] = $proxy;
         }
 
-        if ($noProxy = getenv('NO_PROXY')) {
-            $cleanedNoProxy = str_replace(' ', '', $noProxy);
-            $defaults['proxy']['no'] = explode(',', $cleanedNoProxy);
+        if ($noProxy = Utils::getenv('NO_PROXY')) {
+            $cleanedNoProxy = \str_replace(' ', '', $noProxy);
+            $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy);
         }
 
         $this->config = $config + $defaults;
@@ -275,15 +260,15 @@ class Client implements ClientInterface
 
         // Add the default user-agent header.
         if (!isset($this->config['headers'])) {
-            $this->config['headers'] = ['User-Agent' => default_user_agent()];
+            $this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()];
         } else {
             // Add the User-Agent header if one was not already set.
-            foreach (array_keys($this->config['headers']) as $name) {
-                if (strtolower($name) === 'user-agent') {
+            foreach (\array_keys($this->config['headers']) as $name) {
+                if (\strtolower($name) === 'user-agent') {
                     return;
                 }
             }
-            $this->config['headers']['User-Agent'] = default_user_agent();
+            $this->config['headers']['User-Agent'] = Utils::defaultUserAgent();
         }
     }
 
@@ -291,10 +276,8 @@ class Client implements ClientInterface
      * Merges default options into the array.
      *
      * @param array $options Options to modify by reference
-     *
-     * @return array
      */
-    private function prepareDefaults(array $options)
+    private function prepareDefaults(array $options): array
     {
         $defaults = $this->config;
 
@@ -306,13 +289,13 @@ class Client implements ClientInterface
 
         // Special handling for headers is required as they are added as
         // conditional headers and as headers passed to a request ctor.
-        if (array_key_exists('headers', $options)) {
+        if (\array_key_exists('headers', $options)) {
             // Allows default headers to be unset.
             if ($options['headers'] === null) {
                 $defaults['_conditional'] = [];
                 unset($options['headers']);
-            } elseif (!is_array($options['headers'])) {
-                throw new \InvalidArgumentException('headers must be an array');
+            } elseif (!\is_array($options['headers'])) {
+                throw new InvalidArgumentException('headers must be an array');
             }
         }
 
@@ -336,23 +319,9 @@ class Client implements ClientInterface
      * as-is without merging in default options.
      *
      * @param array $options See \GuzzleHttp\RequestOptions.
-     *
-     * @return Promise\PromiseInterface
      */
-    private function transfer(RequestInterface $request, array $options)
+    private function transfer(RequestInterface $request, array $options): PromiseInterface
     {
-        // save_to -> sink
-        if (isset($options['save_to'])) {
-            $options['sink'] = $options['save_to'];
-            unset($options['save_to']);
-        }
-
-        // exceptions -> http_errors
-        if (isset($options['exceptions'])) {
-            $options['http_errors'] = $options['exceptions'];
-            unset($options['exceptions']);
-        }
-
         $request = $this->applyOptions($request, $options);
         /** @var HandlerStack $handler */
         $handler = $options['handler'];
@@ -366,13 +335,8 @@ class Client implements ClientInterface
 
     /**
      * Applies the array of request options to a request.
-     *
-     * @param RequestInterface $request
-     * @param array            $options
-     *
-     * @return RequestInterface
      */
-    private function applyOptions(RequestInterface $request, array &$options)
+    private function applyOptions(RequestInterface $request, array &$options): RequestInterface
     {
         $modify = [
             'set_headers' => [],
@@ -385,13 +349,13 @@ class Client implements ClientInterface
 
         if (isset($options['form_params'])) {
             if (isset($options['multipart'])) {
-                throw new \InvalidArgumentException('You cannot use '
+                throw new InvalidArgumentException('You cannot use '
                     . 'form_params and multipart at the same time. Use the '
                     . 'form_params option if you want to send application/'
                     . 'x-www-form-urlencoded requests, and the multipart '
                     . 'option to send multipart/form-data requests.');
             }
-            $options['body'] = http_build_query($options['form_params'], '', '&');
+            $options['body'] = \http_build_query($options['form_params'], '', '&');
             unset($options['form_params']);
             // Ensure that we don't have the header in different case and set the new value.
             $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
@@ -404,7 +368,7 @@ class Client implements ClientInterface
         }
 
         if (isset($options['json'])) {
-            $options['body'] = \GuzzleHttp\json_encode($options['json']);
+            $options['body'] = Utils::jsonEncode($options['json']);
             unset($options['json']);
             // Ensure that we don't have the header in different case and set the new value.
             $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
@@ -420,42 +384,42 @@ class Client implements ClientInterface
         }
 
         if (isset($options['body'])) {
-            if (is_array($options['body'])) {
-                $this->invalidBody();
+            if (\is_array($options['body'])) {
+                throw $this->invalidBody();
             }
             $modify['body'] = Psr7\stream_for($options['body']);
             unset($options['body']);
         }
 
-        if (!empty($options['auth']) && is_array($options['auth'])) {
+        if (!empty($options['auth']) && \is_array($options['auth'])) {
             $value = $options['auth'];
-            $type = isset($value[2]) ? strtolower($value[2]) : 'basic';
+            $type = isset($value[2]) ? \strtolower($value[2]) : 'basic';
             switch ($type) {
                 case 'basic':
                     // Ensure that we don't have the header in different case and set the new value.
                     $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']);
                     $modify['set_headers']['Authorization'] = 'Basic '
-                        . base64_encode("$value[0]:$value[1]");
+                        . \base64_encode("$value[0]:$value[1]");
                     break;
                 case 'digest':
                     // @todo: Do not rely on curl
-                    $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;
-                    $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
+                    $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST;
+                    $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
                     break;
                 case 'ntlm':
-                    $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM;
-                    $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
+                    $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM;
+                    $options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
                     break;
             }
         }
 
         if (isset($options['query'])) {
             $value = $options['query'];
-            if (is_array($value)) {
-                $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986);
+            if (\is_array($value)) {
+                $value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986);
             }
-            if (!is_string($value)) {
-                throw new \InvalidArgumentException('query must be a string or array');
+            if (!\is_string($value)) {
+                throw new InvalidArgumentException('query must be a string or array');
             }
             $modify['query'] = $value;
             unset($options['query']);
@@ -464,8 +428,8 @@ class Client implements ClientInterface
         // Ensure that sink is not an invalid value.
         if (isset($options['sink'])) {
             // TODO: Add more sink validation?
-            if (is_bool($options['sink'])) {
-                throw new \InvalidArgumentException('sink must not be a boolean');
+            if (\is_bool($options['sink'])) {
+                throw new InvalidArgumentException('sink must not be a boolean');
             }
         }
 
@@ -496,14 +460,12 @@ class Client implements ClientInterface
     }
 
     /**
-     * Throw Exception with pre-set message.
-     * @return void
-     * @throws InvalidArgumentException Invalid body.
+     * Return an InvalidArgumentException with pre-set message.
      */
-    private function invalidBody()
+    private function invalidBody(): InvalidArgumentException
     {
-        throw new \InvalidArgumentException('Passing in the "body" request '
-            . 'option as an array to send a POST request has been deprecated. '
+        return new InvalidArgumentException('Passing in the "body" request '
+            . 'option as an array to send a request is not supported. '
             . 'Please use the "form_params" request option to send a '
             . 'application/x-www-form-urlencoded request, or the "multipart" '
             . 'request option to send a multipart/form-data request.');

+ 10 - 13
api/vendor/guzzlehttp/guzzle/src/ClientInterface.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Exception\GuzzleException;
@@ -13,9 +14,9 @@ use Psr\Http\Message\UriInterface;
 interface ClientInterface
 {
     /**
-     * @deprecated Will be removed in Guzzle 7.0.0
+     * The Guzzle major version.
      */
-    const VERSION = '6.5.1';
+    const MAJOR_VERSION = 7;
 
     /**
      * Send an HTTP request.
@@ -24,10 +25,9 @@ interface ClientInterface
      * @param array            $options Request options to apply to the given
      *                                  request and to the transfer.
      *
-     * @return ResponseInterface
      * @throws GuzzleException
      */
-    public function send(RequestInterface $request, array $options = []);
+    public function send(RequestInterface $request, array $options = []): ResponseInterface;
 
     /**
      * Asynchronously send an HTTP request.
@@ -35,10 +35,8 @@ interface ClientInterface
      * @param RequestInterface $request Request to send
      * @param array            $options Request options to apply to the given
      *                                  request and to the transfer.
-     *
-     * @return PromiseInterface
      */
-    public function sendAsync(RequestInterface $request, array $options = []);
+    public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface;
 
     /**
      * Create and send an HTTP request.
@@ -51,10 +49,9 @@ interface ClientInterface
      * @param string|UriInterface $uri     URI object or string.
      * @param array               $options Request options to apply.
      *
-     * @return ResponseInterface
      * @throws GuzzleException
      */
-    public function request($method, $uri, array $options = []);
+    public function request(string $method, $uri, array $options = []): ResponseInterface;
 
     /**
      * Create and send an asynchronous HTTP request.
@@ -67,10 +64,8 @@ interface ClientInterface
      * @param string              $method  HTTP method
      * @param string|UriInterface $uri     URI object or string.
      * @param array               $options Request options to apply.
-     *
-     * @return PromiseInterface
      */
-    public function requestAsync($method, $uri, array $options = []);
+    public function requestAsync(string $method, $uri, array $options = []): PromiseInterface;
 
     /**
      * Get a client configuration option.
@@ -82,6 +77,8 @@ interface ClientInterface
      * @param string|null $option The config option to retrieve.
      *
      * @return mixed
+     *
+     * @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0.
      */
-    public function getConfig($option = null);
+    public function getConfig(?string $option = null);
 }

+ 241 - 0
api/vendor/guzzlehttp/guzzle/src/ClientTrait.php

@@ -0,0 +1,241 @@
+<?php
+
+namespace GuzzleHttp;
+
+use GuzzleHttp\Exception\GuzzleException;
+use GuzzleHttp\Promise\PromiseInterface;
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\UriInterface;
+
+/**
+ * Client interface for sending HTTP requests.
+ */
+trait ClientTrait
+{
+    /**
+     * Create and send an HTTP request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well.
+     *
+     * @param string              $method  HTTP method.
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     *
+     * @throws GuzzleException
+     */
+    abstract public function request(string $method, $uri, array $options = []): ResponseInterface;
+
+    /**
+     * Create and send an HTTP GET request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     *
+     * @throws GuzzleException
+     */
+    public function get($uri, array $options = []): ResponseInterface
+    {
+        return $this->request('GET', $uri, $options);
+    }
+
+    /**
+     * Create and send an HTTP HEAD request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     *
+     * @throws GuzzleException
+     */
+    public function head($uri, array $options = []): ResponseInterface
+    {
+        return $this->request('HEAD', $uri, $options);
+    }
+
+    /**
+     * Create and send an HTTP PUT request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     *
+     * @throws GuzzleException
+     */
+    public function put($uri, array $options = []): ResponseInterface
+    {
+        return $this->request('PUT', $uri, $options);
+    }
+
+    /**
+     * Create and send an HTTP POST request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     *
+     * @throws GuzzleException
+     */
+    public function post($uri, array $options = []): ResponseInterface
+    {
+        return $this->request('POST', $uri, $options);
+    }
+
+    /**
+     * Create and send an HTTP PATCH request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     *
+     * @throws GuzzleException
+     */
+    public function patch($uri, array $options = []): ResponseInterface
+    {
+        return $this->request('PATCH', $uri, $options);
+    }
+
+    /**
+     * Create and send an HTTP DELETE request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     *
+     * @throws GuzzleException
+     */
+    public function delete($uri, array $options = []): ResponseInterface
+    {
+        return $this->request('DELETE', $uri, $options);
+    }
+
+    /**
+     * Create and send an asynchronous HTTP request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well. Use an array to provide a URL
+     * template and additional variables to use in the URL template expansion.
+     *
+     * @param string              $method  HTTP method
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     */
+    abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface;
+
+    /**
+     * Create and send an asynchronous HTTP GET request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well. Use an array to provide a URL
+     * template and additional variables to use in the URL template expansion.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     */
+    public function getAsync($uri, array $options = []): PromiseInterface
+    {
+        return $this->requestAsync('GET', $uri, $options);
+    }
+
+    /**
+     * Create and send an asynchronous HTTP HEAD request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well. Use an array to provide a URL
+     * template and additional variables to use in the URL template expansion.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     */
+    public function headAsync($uri, array $options = []): PromiseInterface
+    {
+        return $this->requestAsync('HEAD', $uri, $options);
+    }
+
+    /**
+     * Create and send an asynchronous HTTP PUT request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well. Use an array to provide a URL
+     * template and additional variables to use in the URL template expansion.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     */
+    public function putAsync($uri, array $options = []): PromiseInterface
+    {
+        return $this->requestAsync('PUT', $uri, $options);
+    }
+
+    /**
+     * Create and send an asynchronous HTTP POST request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well. Use an array to provide a URL
+     * template and additional variables to use in the URL template expansion.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     */
+    public function postAsync($uri, array $options = []): PromiseInterface
+    {
+        return $this->requestAsync('POST', $uri, $options);
+    }
+
+    /**
+     * Create and send an asynchronous HTTP PATCH request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well. Use an array to provide a URL
+     * template and additional variables to use in the URL template expansion.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     */
+    public function patchAsync($uri, array $options = []): PromiseInterface
+    {
+        return $this->requestAsync('PATCH', $uri, $options);
+    }
+
+    /**
+     * Create and send an asynchronous HTTP DELETE request.
+     *
+     * Use an absolute path to override the base path of the client, or a
+     * relative path to append to the base path of the client. The URL can
+     * contain the query string as well. Use an array to provide a URL
+     * template and additional variables to use in the URL template expansion.
+     *
+     * @param string|UriInterface $uri     URI object or string.
+     * @param array               $options Request options to apply.
+     */
+    public function deleteAsync($uri, array $options = []): PromiseInterface
+    {
+        return $this->requestAsync('DELETE', $uri, $options);
+    }
+}

+ 63 - 66
api/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Cookie;
 
 use Psr\Http\Message\RequestInterface;
@@ -9,20 +10,24 @@ use Psr\Http\Message\ResponseInterface;
  */
 class CookieJar implements CookieJarInterface
 {
-    /** @var SetCookie[] Loaded cookie data */
+    /**
+     * @var SetCookie[] Loaded cookie data
+     */
     private $cookies = [];
 
-    /** @var bool */
+    /**
+     * @var bool
+     */
     private $strictMode;
 
     /**
-     * @param bool $strictMode   Set to true to throw exceptions when invalid
+     * @param bool  $strictMode  Set to true to throw exceptions when invalid
      *                           cookies are added to the cookie jar.
      * @param array $cookieArray Array of SetCookie objects or a hash of
      *                           arrays that can be used with the SetCookie
      *                           constructor
      */
-    public function __construct($strictMode = false, $cookieArray = [])
+    public function __construct(bool $strictMode = false, array $cookieArray = [])
     {
         $this->strictMode = $strictMode;
 
@@ -39,10 +44,8 @@ class CookieJar implements CookieJarInterface
      *
      * @param array  $cookies Cookies to create the jar from
      * @param string $domain  Domain to set the cookies to
-     *
-     * @return self
      */
-    public static function fromArray(array $cookies, $domain)
+    public static function fromArray(array $cookies, string $domain): self
     {
         $cookieJar = new self();
         foreach ($cookies as $name => $value) {
@@ -57,26 +60,15 @@ class CookieJar implements CookieJarInterface
         return $cookieJar;
     }
 
-    /**
-     * @deprecated
-     */
-    public static function getCookieValue($value)
-    {
-        return $value;
-    }
-
     /**
      * Evaluate if this cookie should be persisted to storage
      * that survives between requests.
      *
-     * @param SetCookie $cookie Being evaluated.
-     * @param bool $allowSessionCookies If we should persist session cookies
-     * @return bool
+     * @param SetCookie $cookie              Being evaluated.
+     * @param bool      $allowSessionCookies If we should persist session cookies
      */
-    public static function shouldPersist(
-        SetCookie $cookie,
-        $allowSessionCookies = false
-    ) {
+    public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool
+    {
         if ($cookie->getExpires() || $allowSessionCookies) {
             if (!$cookie->getDiscard()) {
                 return true;
@@ -90,16 +82,13 @@ class CookieJar implements CookieJarInterface
      * Finds and returns the cookie based on the name
      *
      * @param string $name cookie name to search for
+     *
      * @return SetCookie|null cookie that was found or null if not found
      */
-    public function getCookieByName($name)
+    public function getCookieByName(string $name): ?SetCookie
     {
-        // don't allow a non string name
-        if ($name === null || !is_scalar($name)) {
-            return null;
-        }
         foreach ($this->cookies as $cookie) {
-            if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) {
+            if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) {
                 return $cookie;
             }
         }
@@ -107,37 +96,43 @@ class CookieJar implements CookieJarInterface
         return null;
     }
 
-    public function toArray()
+    /**
+     * @inheritDoc
+     */
+    public function toArray(): array
     {
-        return array_map(function (SetCookie $cookie) {
+        return \array_map(static function (SetCookie $cookie): array {
             return $cookie->toArray();
         }, $this->getIterator()->getArrayCopy());
     }
 
-    public function clear($domain = null, $path = null, $name = null)
+    /**
+     * @inheritDoc
+     */
+    public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
     {
         if (!$domain) {
             $this->cookies = [];
             return;
         } elseif (!$path) {
-            $this->cookies = array_filter(
+            $this->cookies = \array_filter(
                 $this->cookies,
-                function (SetCookie $cookie) use ($domain) {
+                static function (SetCookie $cookie) use ($domain): bool {
                     return !$cookie->matchesDomain($domain);
                 }
             );
         } elseif (!$name) {
-            $this->cookies = array_filter(
+            $this->cookies = \array_filter(
                 $this->cookies,
-                function (SetCookie $cookie) use ($path, $domain) {
+                static function (SetCookie $cookie) use ($path, $domain): bool {
                     return !($cookie->matchesPath($path) &&
                         $cookie->matchesDomain($domain));
                 }
             );
         } else {
-            $this->cookies = array_filter(
+            $this->cookies = \array_filter(
                 $this->cookies,
-                function (SetCookie $cookie) use ($path, $domain, $name) {
+                static function (SetCookie $cookie) use ($path, $domain, $name) {
                     return !($cookie->getName() == $name &&
                         $cookie->matchesPath($path) &&
                         $cookie->matchesDomain($domain));
@@ -146,17 +141,23 @@ class CookieJar implements CookieJarInterface
         }
     }
 
-    public function clearSessionCookies()
+    /**
+     * @inheritDoc
+     */
+    public function clearSessionCookies(): void
     {
-        $this->cookies = array_filter(
+        $this->cookies = \array_filter(
             $this->cookies,
-            function (SetCookie $cookie) {
+            static function (SetCookie $cookie): bool {
                 return !$cookie->getDiscard() && $cookie->getExpires();
             }
         );
     }
 
-    public function setCookie(SetCookie $cookie)
+    /**
+     * @inheritDoc
+     */
+    public function setCookie(SetCookie $cookie): bool
     {
         // If the name string is empty (but not 0), ignore the set-cookie
         // string entirely.
@@ -170,10 +171,9 @@ class CookieJar implements CookieJarInterface
         if ($result !== true) {
             if ($this->strictMode) {
                 throw new \RuntimeException('Invalid cookie: ' . $result);
-            } else {
-                $this->removeCookieIfEmpty($cookie);
-                return false;
             }
+            $this->removeCookieIfEmpty($cookie);
+            return false;
         }
 
         // Resolve conflicts with previously set cookies
@@ -217,27 +217,28 @@ class CookieJar implements CookieJarInterface
         return true;
     }
 
-    public function count()
+    public function count(): int
     {
-        return count($this->cookies);
+        return \count($this->cookies);
     }
 
-    public function getIterator()
+    /**
+     * @return \ArrayIterator<int, SetCookie>
+     */
+    public function getIterator(): \ArrayIterator
     {
-        return new \ArrayIterator(array_values($this->cookies));
+        return new \ArrayIterator(\array_values($this->cookies));
     }
 
-    public function extractCookies(
-        RequestInterface $request,
-        ResponseInterface $response
-    ) {
+    public function extractCookies(RequestInterface $request, ResponseInterface $response): void
+    {
         if ($cookieHeader = $response->getHeader('Set-Cookie')) {
             foreach ($cookieHeader as $cookie) {
                 $sc = SetCookie::fromString($cookie);
                 if (!$sc->getDomain()) {
                     $sc->setDomain($request->getUri()->getHost());
                 }
-                if (0 !== strpos($sc->getPath(), '/')) {
+                if (0 !== \strpos($sc->getPath(), '/')) {
                     $sc->setPath($this->getCookiePathFromRequest($request));
                 }
                 $this->setCookie($sc);
@@ -249,30 +250,28 @@ class CookieJar implements CookieJarInterface
      * Computes cookie path following RFC 6265 section 5.1.4
      *
      * @link https://tools.ietf.org/html/rfc6265#section-5.1.4
-     *
-     * @param RequestInterface $request
-     * @return string
      */
-    private function getCookiePathFromRequest(RequestInterface $request)
+    private function getCookiePathFromRequest(RequestInterface $request): string
     {
         $uriPath = $request->getUri()->getPath();
-        if (''  === $uriPath) {
+        if ('' === $uriPath) {
             return '/';
         }
-        if (0 !== strpos($uriPath, '/')) {
+        if (0 !== \strpos($uriPath, '/')) {
             return '/';
         }
         if ('/' === $uriPath) {
             return '/';
         }
-        if (0 === $lastSlashPos = strrpos($uriPath, '/')) {
+        $lastSlashPos = \strrpos($uriPath, '/');
+        if (0 === $lastSlashPos || false === $lastSlashPos) {
             return '/';
         }
 
-        return substr($uriPath, 0, $lastSlashPos);
+        return \substr($uriPath, 0, $lastSlashPos);
     }
 
-    public function withCookieHeader(RequestInterface $request)
+    public function withCookieHeader(RequestInterface $request): RequestInterface
     {
         $values = [];
         $uri = $request->getUri();
@@ -292,17 +291,15 @@ class CookieJar implements CookieJarInterface
         }
 
         return $values
-            ? $request->withHeader('Cookie', implode('; ', $values))
+            ? $request->withHeader('Cookie', \implode('; ', $values))
             : $request;
     }
 
     /**
      * If a cookie already exists and the server asks to set it again with a
      * null value, the cookie must be deleted.
-     *
-     * @param SetCookie $cookie
      */
-    private function removeCookieIfEmpty(SetCookie $cookie)
+    private function removeCookieIfEmpty(SetCookie $cookie): void
     {
         $cookieValue = $cookie->getValue();
         if ($cookieValue === null || $cookieValue === '') {

+ 9 - 11
api/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Cookie;
 
 use Psr\Http\Message\RequestInterface;
@@ -12,7 +13,8 @@ use Psr\Http\Message\ResponseInterface;
  * necessary. Subclasses are also responsible for storing and retrieving
  * cookies from a file, database, etc.
  *
- * @link http://docs.python.org/2/library/cookielib.html Inspiration
+ * @link https://docs.python.org/2/library/cookielib.html Inspiration
+ * @extends \IteratorAggregate<SetCookie>
  */
 interface CookieJarInterface extends \Countable, \IteratorAggregate
 {
@@ -26,7 +28,7 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
      *
      * @return RequestInterface returns the modified request.
      */
-    public function withCookieHeader(RequestInterface $request);
+    public function withCookieHeader(RequestInterface $request): RequestInterface;
 
     /**
      * Extract cookies from an HTTP response and store them in the CookieJar.
@@ -37,7 +39,7 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
     public function extractCookies(
         RequestInterface $request,
         ResponseInterface $response
-    );
+    ): void;
 
     /**
      * Sets a cookie in the cookie jar.
@@ -46,7 +48,7 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
      *
      * @return bool Returns true on success or false on failure
      */
-    public function setCookie(SetCookie $cookie);
+    public function setCookie(SetCookie $cookie): bool;
 
     /**
      * Remove cookies currently held in the cookie jar.
@@ -61,10 +63,8 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
      * @param string|null $domain Clears cookies matching a domain
      * @param string|null $path   Clears cookies matching a domain and path
      * @param string|null $name   Clears cookies matching a domain, path, and name
-     *
-     * @return CookieJarInterface
      */
-    public function clear($domain = null, $path = null, $name = null);
+    public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void;
 
     /**
      * Discard all sessions cookies.
@@ -73,12 +73,10 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
      * field set to true. To be called when the user agent shuts down according
      * to RFC 2965.
      */
-    public function clearSessionCookies();
+    public function clearSessionCookies(): void;
 
     /**
      * Converts the cookie jar to an array.
-     *
-     * @return array
      */
-    public function toArray();
+    public function toArray(): array;
 }

+ 28 - 18
api/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php

@@ -1,33 +1,40 @@
 <?php
+
 namespace GuzzleHttp\Cookie;
 
+use GuzzleHttp\Utils;
+
 /**
  * Persists non-session cookies using a JSON formatted file
  */
 class FileCookieJar extends CookieJar
 {
-    /** @var string filename */
+    /**
+     * @var string filename
+     */
     private $filename;
 
-    /** @var bool Control whether to persist session cookies or not. */
+    /**
+     * @var bool Control whether to persist session cookies or not.
+     */
     private $storeSessionCookies;
 
     /**
      * Create a new FileCookieJar object
      *
-     * @param string $cookieFile        File to store the cookie data
-     * @param bool $storeSessionCookies Set to true to store session cookies
-     *                                  in the cookie jar.
+     * @param string $cookieFile          File to store the cookie data
+     * @param bool   $storeSessionCookies Set to true to store session cookies
+     *                                    in the cookie jar.
      *
      * @throws \RuntimeException if the file cannot be found or created
      */
-    public function __construct($cookieFile, $storeSessionCookies = false)
+    public function __construct(string $cookieFile, bool $storeSessionCookies = false)
     {
         parent::__construct();
         $this->filename = $cookieFile;
         $this->storeSessionCookies = $storeSessionCookies;
 
-        if (file_exists($cookieFile)) {
+        if (\file_exists($cookieFile)) {
             $this->load($cookieFile);
         }
     }
@@ -44,20 +51,21 @@ class FileCookieJar extends CookieJar
      * Saves the cookies to a file.
      *
      * @param string $filename File to save
+     *
      * @throws \RuntimeException if the file cannot be found or created
      */
-    public function save($filename)
+    public function save(string $filename): void
     {
         $json = [];
+        /** @var SetCookie $cookie */
         foreach ($this as $cookie) {
-            /** @var SetCookie $cookie */
             if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
                 $json[] = $cookie->toArray();
             }
         }
 
-        $jsonStr = \GuzzleHttp\json_encode($json);
-        if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) {
+        $jsonStr = Utils::jsonEncode($json);
+        if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) {
             throw new \RuntimeException("Unable to save file {$filename}");
         }
     }
@@ -68,23 +76,25 @@ class FileCookieJar extends CookieJar
      * Old cookies are kept unless overwritten by newly loaded ones.
      *
      * @param string $filename Cookie file to load.
+     *
      * @throws \RuntimeException if the file cannot be loaded.
      */
-    public function load($filename)
+    public function load(string $filename): void
     {
-        $json = file_get_contents($filename);
+        $json = \file_get_contents($filename);
         if (false === $json) {
             throw new \RuntimeException("Unable to load file {$filename}");
-        } elseif ($json === '') {
+        }
+        if ($json === '') {
             return;
         }
 
-        $data = \GuzzleHttp\json_decode($json, true);
-        if (is_array($data)) {
-            foreach (json_decode($json, true) as $cookie) {
+        $data = Utils::jsonDecode($json, true);
+        if (\is_array($data)) {
+            foreach ($data as $cookie) {
                 $this->setCookie(new SetCookie($cookie));
             }
-        } elseif (strlen($data)) {
+        } elseif (\is_scalar($data) && !empty($data)) {
             throw new \RuntimeException("Invalid cookie file: {$filename}");
         }
     }

+ 20 - 15
api/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Cookie;
 
 /**
@@ -6,21 +7,25 @@ namespace GuzzleHttp\Cookie;
  */
 class SessionCookieJar extends CookieJar
 {
-    /** @var string session key */
+    /**
+     * @var string session key
+     */
     private $sessionKey;
-    
-    /** @var bool Control whether to persist session cookies or not. */
+
+    /**
+     * @var bool Control whether to persist session cookies or not.
+     */
     private $storeSessionCookies;
 
     /**
      * Create a new SessionCookieJar object
      *
-     * @param string $sessionKey        Session key name to store the cookie
-     *                                  data in session
-     * @param bool $storeSessionCookies Set to true to store session cookies
-     *                                  in the cookie jar.
+     * @param string $sessionKey          Session key name to store the cookie
+     *                                    data in session
+     * @param bool   $storeSessionCookies Set to true to store session cookies
+     *                                    in the cookie jar.
      */
-    public function __construct($sessionKey, $storeSessionCookies = false)
+    public function __construct(string $sessionKey, bool $storeSessionCookies = false)
     {
         parent::__construct();
         $this->sessionKey = $sessionKey;
@@ -39,33 +44,33 @@ class SessionCookieJar extends CookieJar
     /**
      * Save cookies to the client session
      */
-    public function save()
+    public function save(): void
     {
         $json = [];
+        /** @var SetCookie $cookie */
         foreach ($this as $cookie) {
-            /** @var SetCookie $cookie */
             if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
                 $json[] = $cookie->toArray();
             }
         }
 
-        $_SESSION[$this->sessionKey] = json_encode($json);
+        $_SESSION[$this->sessionKey] = \json_encode($json);
     }
 
     /**
      * Load the contents of the client session into the data array
      */
-    protected function load()
+    protected function load(): void
     {
         if (!isset($_SESSION[$this->sessionKey])) {
             return;
         }
-        $data = json_decode($_SESSION[$this->sessionKey], true);
-        if (is_array($data)) {
+        $data = \json_decode($_SESSION[$this->sessionKey], true);
+        if (\is_array($data)) {
             foreach ($data as $cookie) {
                 $this->setCookie(new SetCookie($cookie));
             }
-        } elseif (strlen($data)) {
+        } elseif (\strlen($data)) {
             throw new \RuntimeException("Invalid cookie data");
         }
     }

+ 91 - 84
api/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Cookie;
 
 /**
@@ -6,7 +7,9 @@ namespace GuzzleHttp\Cookie;
  */
 class SetCookie
 {
-    /** @var array */
+    /**
+     * @var array
+     */
     private static $defaults = [
         'Name'     => null,
         'Value'    => null,
@@ -19,42 +22,42 @@ class SetCookie
         'HttpOnly' => false
     ];
 
-    /** @var array Cookie data */
+    /**
+     * @var array Cookie data
+     */
     private $data;
 
     /**
-     * Create a new SetCookie object from a string
+     * Create a new SetCookie object from a string.
      *
      * @param string $cookie Set-Cookie header string
-     *
-     * @return self
      */
-    public static function fromString($cookie)
+    public static function fromString(string $cookie): self
     {
         // Create the default return array
         $data = self::$defaults;
         // Explode the cookie string using a series of semicolons
-        $pieces = array_filter(array_map('trim', explode(';', $cookie)));
+        $pieces = \array_filter(\array_map('trim', \explode(';', $cookie)));
         // The name of the cookie (first kvp) must exist and include an equal sign.
-        if (empty($pieces[0]) || !strpos($pieces[0], '=')) {
+        if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) {
             return new self($data);
         }
 
         // Add the cookie pieces into the parsed data array
         foreach ($pieces as $part) {
-            $cookieParts = explode('=', $part, 2);
-            $key = trim($cookieParts[0]);
+            $cookieParts = \explode('=', $part, 2);
+            $key = \trim($cookieParts[0]);
             $value = isset($cookieParts[1])
-                ? trim($cookieParts[1], " \n\r\t\0\x0B")
+                ? \trim($cookieParts[1], " \n\r\t\0\x0B")
                 : true;
 
             // Only check for non-cookies when cookies have been found
-            if (empty($data['Name'])) {
+            if (!isset($data['Name'])) {
                 $data['Name'] = $key;
                 $data['Value'] = $value;
             } else {
-                foreach (array_keys(self::$defaults) as $search) {
-                    if (!strcasecmp($search, $key)) {
+                foreach (\array_keys(self::$defaults) as $search) {
+                    if (!\strcasecmp($search, $key)) {
                         $data[$search] = $value;
                         continue 2;
                     }
@@ -71,13 +74,19 @@ class SetCookie
      */
     public function __construct(array $data = [])
     {
-        $this->data = array_replace(self::$defaults, $data);
+        /** @var array|null $replaced will be null in case of replace error */
+        $replaced = \array_replace(self::$defaults, $data);
+        if ($replaced === null) {
+            throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
+        }
+
+        $this->data = $replaced;
         // Extract the Expires value and turn it into a UNIX timestamp if needed
         if (!$this->getExpires() && $this->getMaxAge()) {
             // Calculate the Expires date
-            $this->setExpires(time() + $this->getMaxAge());
-        } elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
-            $this->setExpires($this->getExpires());
+            $this->setExpires(\time() + $this->getMaxAge());
+        } elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) {
+            $this->setExpires($expires);
         }
     }
 
@@ -87,23 +96,23 @@ class SetCookie
         foreach ($this->data as $k => $v) {
             if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
                 if ($k === 'Expires') {
-                    $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
+                    $str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
                 } else {
                     $str .= ($v === true ? $k : "{$k}={$v}") . '; ';
                 }
             }
         }
 
-        return rtrim($str, '; ');
+        return \rtrim($str, '; ');
     }
 
-    public function toArray()
+    public function toArray(): array
     {
         return $this->data;
     }
 
     /**
-     * Get the cookie name
+     * Get the cookie name.
      *
      * @return string
      */
@@ -113,19 +122,19 @@ class SetCookie
     }
 
     /**
-     * Set the cookie name
+     * Set the cookie name.
      *
      * @param string $name Cookie name
      */
-    public function setName($name)
+    public function setName($name): void
     {
         $this->data['Name'] = $name;
     }
 
     /**
-     * Get the cookie value
+     * Get the cookie value.
      *
-     * @return string
+     * @return string|null
      */
     public function getValue()
     {
@@ -133,17 +142,17 @@ class SetCookie
     }
 
     /**
-     * Set the cookie value
+     * Set the cookie value.
      *
      * @param string $value Cookie value
      */
-    public function setValue($value)
+    public function setValue($value): void
     {
         $this->data['Value'] = $value;
     }
 
     /**
-     * Get the domain
+     * Get the domain.
      *
      * @return string|null
      */
@@ -153,17 +162,17 @@ class SetCookie
     }
 
     /**
-     * Set the domain of the cookie
+     * Set the domain of the cookie.
      *
      * @param string $domain
      */
-    public function setDomain($domain)
+    public function setDomain($domain): void
     {
         $this->data['Domain'] = $domain;
     }
 
     /**
-     * Get the path
+     * Get the path.
      *
      * @return string
      */
@@ -173,17 +182,17 @@ class SetCookie
     }
 
     /**
-     * Set the path of the cookie
+     * Set the path of the cookie.
      *
      * @param string $path Path of the cookie
      */
-    public function setPath($path)
+    public function setPath($path): void
     {
         $this->data['Path'] = $path;
     }
 
     /**
-     * Maximum lifetime of the cookie in seconds
+     * Maximum lifetime of the cookie in seconds.
      *
      * @return int|null
      */
@@ -193,19 +202,19 @@ class SetCookie
     }
 
     /**
-     * Set the max-age of the cookie
+     * Set the max-age of the cookie.
      *
      * @param int $maxAge Max age of the cookie in seconds
      */
-    public function setMaxAge($maxAge)
+    public function setMaxAge($maxAge): void
     {
         $this->data['Max-Age'] = $maxAge;
     }
 
     /**
-     * The UNIX timestamp when the cookie Expires
+     * The UNIX timestamp when the cookie Expires.
      *
-     * @return mixed
+     * @return string|int|null
      */
     public function getExpires()
     {
@@ -213,19 +222,19 @@ class SetCookie
     }
 
     /**
-     * Set the unix timestamp for which the cookie will expire
+     * Set the unix timestamp for which the cookie will expire.
      *
-     * @param int $timestamp Unix timestamp
+     * @param int|string $timestamp Unix timestamp or any English textual datetime description.
      */
-    public function setExpires($timestamp)
+    public function setExpires($timestamp): void
     {
-        $this->data['Expires'] = is_numeric($timestamp)
+        $this->data['Expires'] = \is_numeric($timestamp)
             ? (int) $timestamp
-            : strtotime($timestamp);
+            : \strtotime($timestamp);
     }
 
     /**
-     * Get whether or not this is a secure cookie
+     * Get whether or not this is a secure cookie.
      *
      * @return bool|null
      */
@@ -235,17 +244,17 @@ class SetCookie
     }
 
     /**
-     * Set whether or not the cookie is secure
+     * Set whether or not the cookie is secure.
      *
      * @param bool $secure Set to true or false if secure
      */
-    public function setSecure($secure)
+    public function setSecure($secure): void
     {
         $this->data['Secure'] = $secure;
     }
 
     /**
-     * Get whether or not this is a session cookie
+     * Get whether or not this is a session cookie.
      *
      * @return bool|null
      */
@@ -255,17 +264,17 @@ class SetCookie
     }
 
     /**
-     * Set whether or not this is a session cookie
+     * Set whether or not this is a session cookie.
      *
      * @param bool $discard Set to true or false if this is a session cookie
      */
-    public function setDiscard($discard)
+    public function setDiscard($discard): void
     {
         $this->data['Discard'] = $discard;
     }
 
     /**
-     * Get whether or not this is an HTTP only cookie
+     * Get whether or not this is an HTTP only cookie.
      *
      * @return bool
      */
@@ -275,11 +284,11 @@ class SetCookie
     }
 
     /**
-     * Set whether or not this is an HTTP only cookie
+     * Set whether or not this is an HTTP only cookie.
      *
      * @param bool $httpOnly Set to true or false if this is HTTP only
      */
-    public function setHttpOnly($httpOnly)
+    public function setHttpOnly($httpOnly): void
     {
         $this->data['HttpOnly'] = $httpOnly;
     }
@@ -298,10 +307,8 @@ class SetCookie
      *   path is a %x2F ("/") character.
      *
      * @param string $requestPath Path to check against
-     *
-     * @return bool
      */
-    public function matchesPath($requestPath)
+    public function matchesPath(string $requestPath): bool
     {
         $cookiePath = $this->getPath();
 
@@ -311,71 +318,71 @@ class SetCookie
         }
 
         // Ensure that the cookie-path is a prefix of the request path.
-        if (0 !== strpos($requestPath, $cookiePath)) {
+        if (0 !== \strpos($requestPath, $cookiePath)) {
             return false;
         }
 
         // Match if the last character of the cookie-path is "/"
-        if (substr($cookiePath, -1, 1) === '/') {
+        if (\substr($cookiePath, -1, 1) === '/') {
             return true;
         }
 
         // Match if the first character not included in cookie path is "/"
-        return substr($requestPath, strlen($cookiePath), 1) === '/';
+        return \substr($requestPath, \strlen($cookiePath), 1) === '/';
     }
 
     /**
-     * Check if the cookie matches a domain value
+     * Check if the cookie matches a domain value.
      *
      * @param string $domain Domain to check against
-     *
-     * @return bool
      */
-    public function matchesDomain($domain)
+    public function matchesDomain(string $domain): bool
     {
+        $cookieDomain = $this->getDomain();
+        if (null === $cookieDomain) {
+            return true;
+        }
+
         // Remove the leading '.' as per spec in RFC 6265.
-        // http://tools.ietf.org/html/rfc6265#section-5.2.3
-        $cookieDomain = ltrim($this->getDomain(), '.');
+        // https://tools.ietf.org/html/rfc6265#section-5.2.3
+        $cookieDomain = \ltrim($cookieDomain, '.');
 
         // Domain not set or exact match.
-        if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
+        if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) {
             return true;
         }
 
         // Matching the subdomain according to RFC 6265.
-        // http://tools.ietf.org/html/rfc6265#section-5.1.3
-        if (filter_var($domain, FILTER_VALIDATE_IP)) {
+        // https://tools.ietf.org/html/rfc6265#section-5.1.3
+        if (\filter_var($domain, \FILTER_VALIDATE_IP)) {
             return false;
         }
 
-        return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
+        return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
     }
 
     /**
-     * Check if the cookie is expired
-     *
-     * @return bool
+     * Check if the cookie is expired.
      */
-    public function isExpired()
+    public function isExpired(): bool
     {
-        return $this->getExpires() !== null && time() > $this->getExpires();
+        return $this->getExpires() !== null && \time() > $this->getExpires();
     }
 
     /**
-     * Check if the cookie is valid according to RFC 6265
+     * Check if the cookie is valid according to RFC 6265.
      *
      * @return bool|string Returns true if valid or an error message if invalid
      */
     public function validate()
     {
-        // Names must not be empty, but can be 0
         $name = $this->getName();
-        if (empty($name) && !is_numeric($name)) {
+        if ($name === '') {
             return 'The cookie name must not be empty';
         }
 
         // Check if any of the invalid characters are present in the cookie name
-        if (preg_match(
+        if (\preg_match(
             '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
             $name
         )) {
@@ -384,17 +391,17 @@ class SetCookie
                 . 'following characters: ()<>@,;:\"/?={}';
         }
 
-        // Value must not be empty, but can be 0
+        // Value must not be null. 0 and empty string are valid. Empty strings
+        // are technically against RFC 6265, but known to happen in the wild.
         $value = $this->getValue();
-        if (empty($value) && !is_numeric($value)) {
+        if ($value === null) {
             return 'The cookie value must not be empty';
         }
 
-        // Domains must not be empty, but can be 0
-        // A "0" is not a valid internet domain, but may be used as server name
-        // in a private network.
+        // Domains must not be empty, but can be 0. "0" is not a valid internet
+        // domain, but may be used as server name in a private network.
         $domain = $this->getDomain();
-        if (empty($domain) && !is_numeric($domain)) {
+        if ($domain === null || $domain === '') {
             return 'The cookie domain must not be empty';
         }
 

+ 21 - 9
api/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
 use Psr\Http\Message\RequestInterface;
@@ -10,18 +11,29 @@ use Psr\Http\Message\ResponseInterface;
 class BadResponseException extends RequestException
 {
     public function __construct(
-        $message,
+        string $message,
         RequestInterface $request,
-        ResponseInterface $response = null,
-        \Exception $previous = null,
+        ResponseInterface $response,
+        \Throwable $previous = null,
         array $handlerContext = []
     ) {
-        if (null === $response) {
-            @trigger_error(
-                'Instantiating the ' . __CLASS__ . ' class without a Response is deprecated since version 6.3 and will be removed in 7.0.',
-                E_USER_DEPRECATED
-            );
-        }
         parent::__construct($message, $request, $response, $previous, $handlerContext);
     }
+
+    /**
+     * Current exception and the ones that extend it will always have a response.
+     */
+    public function hasResponse(): bool
+    {
+        return true;
+    }
+
+    /**
+     * This function narrows the return type from the parent class and does not allow it to be nullable.
+     */
+    public function getResponse(): ResponseInterface
+    {
+        /** @var ResponseInterface */
+        return parent::getResponse();
+    }
 }

+ 1 - 0
api/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
 /**

+ 29 - 10
api/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php

@@ -1,6 +1,8 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
+use Psr\Http\Client\NetworkExceptionInterface;
 use Psr\Http\Message\RequestInterface;
 
 /**
@@ -8,30 +10,47 @@ use Psr\Http\Message\RequestInterface;
  *
  * Note that no response is present for a ConnectException
  */
-class ConnectException extends RequestException
+class ConnectException extends TransferException implements NetworkExceptionInterface
 {
+    /**
+     * @var RequestInterface
+     */
+    private $request;
+
+    /**
+     * @var array
+     */
+    private $handlerContext;
+
     public function __construct(
-        $message,
+        string $message,
         RequestInterface $request,
-        \Exception $previous = null,
+        \Throwable $previous = null,
         array $handlerContext = []
     ) {
-        parent::__construct($message, $request, null, $previous, $handlerContext);
+        parent::__construct($message, 0, $previous);
+        $this->request = $request;
+        $this->handlerContext = $handlerContext;
     }
 
     /**
-     * @return null
+     * Get the request that caused the exception
      */
-    public function getResponse()
+    public function getRequest(): RequestInterface
     {
-        return null;
+        return $this->request;
     }
 
     /**
-     * @return bool
+     * Get contextual information about the error from the underlying handler.
+     *
+     * The contents of this array will vary depending on which handler you are
+     * using. It may also be just an empty array. Relying on this data will
+     * couple you to a specific handler, but can give more debug information
+     * when needed.
      */
-    public function hasResponse()
+    public function getHandlerContext(): array
     {
-        return false;
+        return $this->handlerContext;
     }
 }

+ 4 - 18
api/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php

@@ -1,23 +1,9 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
-use Throwable;
+use Psr\Http\Client\ClientExceptionInterface;
 
-if (interface_exists(Throwable::class)) {
-    interface GuzzleException extends Throwable
-    {
-    }
-} else {
-    /**
-     * @method string getMessage()
-     * @method \Throwable|null getPrevious()
-     * @method mixed getCode()
-     * @method string getFile()
-     * @method int getLine()
-     * @method array getTrace()
-     * @method string getTraceAsString()
-     */
-    interface GuzzleException
-    {
-    }
+interface GuzzleException extends ClientExceptionInterface
+{
 }

+ 29 - 57
api/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php

@@ -1,7 +1,8 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
-use GuzzleHttp\Promise\PromiseInterface;
+use Psr\Http\Client\RequestExceptionInterface;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\UriInterface;
@@ -9,28 +10,32 @@ use Psr\Http\Message\UriInterface;
 /**
  * HTTP Request exception
  */
-class RequestException extends TransferException
+class RequestException extends TransferException implements RequestExceptionInterface
 {
-    /** @var RequestInterface */
+    /**
+     * @var RequestInterface
+     */
     private $request;
 
-    /** @var ResponseInterface|null */
+    /**
+     * @var ResponseInterface|null
+     */
     private $response;
 
-    /** @var array */
+    /**
+     * @var array
+     */
     private $handlerContext;
 
     public function __construct(
-        $message,
+        string $message,
         RequestInterface $request,
         ResponseInterface $response = null,
-        \Exception $previous = null,
+        \Throwable $previous = null,
         array $handlerContext = []
     ) {
         // Set the code of the exception if the response is set and not future.
-        $code = $response && !($response instanceof PromiseInterface)
-            ? $response->getStatusCode()
-            : 0;
+        $code = $response ? $response->getStatusCode() : 0;
         parent::__construct($message, $code, $previous);
         $this->request = $request;
         $this->response = $response;
@@ -39,13 +44,8 @@ class RequestException extends TransferException
 
     /**
      * Wrap non-RequestExceptions with a RequestException
-     *
-     * @param RequestInterface $request
-     * @param \Exception       $e
-     *
-     * @return RequestException
      */
-    public static function wrapException(RequestInterface $request, \Exception $e)
+    public static function wrapException(RequestInterface $request, \Throwable $e): RequestException
     {
         return $e instanceof RequestException
             ? $e
@@ -57,17 +57,15 @@ class RequestException extends TransferException
      *
      * @param RequestInterface  $request  Request
      * @param ResponseInterface $response Response received
-     * @param \Exception        $previous Previous exception
+     * @param \Throwable        $previous Previous exception
      * @param array             $ctx      Optional handler context.
-     *
-     * @return self
      */
     public static function create(
         RequestInterface $request,
         ResponseInterface $response = null,
-        \Exception $previous = null,
+        \Throwable $previous = null,
         array $ctx = []
-    ) {
+    ): self {
         if (!$response) {
             return new self(
                 'Error completing request',
@@ -78,7 +76,7 @@ class RequestException extends TransferException
             );
         }
 
-        $level = (int) floor($response->getStatusCode() / 100);
+        $level = (int) \floor($response->getStatusCode() / 100);
         if ($level === 4) {
             $label = 'Client error';
             $className = ClientException::class;
@@ -95,7 +93,7 @@ class RequestException extends TransferException
 
         // Client Error: `GET /` resulted in a `404 Not Found` response:
         // <html> ... (truncated)
-        $message = sprintf(
+        $message = \sprintf(
             '%s: `%s %s` resulted in a `%s %s` response',
             $label,
             $request->getMethod(),
@@ -104,7 +102,7 @@ class RequestException extends TransferException
             $response->getReasonPhrase()
         );
 
-        $summary = static::getResponseBodySummary($response);
+        $summary = \GuzzleHttp\Psr7\get_message_body_summary($response);
 
         if ($summary !== null) {
             $message .= ":\n{$summary}\n";
@@ -113,33 +111,15 @@ class RequestException extends TransferException
         return new $className($message, $request, $response, $previous, $ctx);
     }
 
-    /**
-     * Get a short summary of the response
-     *
-     * Will return `null` if the response is not printable.
-     *
-     * @param ResponseInterface $response
-     *
-     * @return string|null
-     */
-    public static function getResponseBodySummary(ResponseInterface $response)
-    {
-        return \GuzzleHttp\Psr7\get_message_body_summary($response);
-    }
-
     /**
      * Obfuscates URI if there is a username and a password present
-     *
-     * @param UriInterface $uri
-     *
-     * @return UriInterface
      */
-    private static function obfuscateUri(UriInterface $uri)
+    private static function obfuscateUri(UriInterface $uri): UriInterface
     {
         $userInfo = $uri->getUserInfo();
 
-        if (false !== ($pos = strpos($userInfo, ':'))) {
-            return $uri->withUserInfo(substr($userInfo, 0, $pos), '***');
+        if (false !== ($pos = \strpos($userInfo, ':'))) {
+            return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
         }
 
         return $uri;
@@ -147,30 +127,24 @@ class RequestException extends TransferException
 
     /**
      * Get the request that caused the exception
-     *
-     * @return RequestInterface
      */
-    public function getRequest()
+    public function getRequest(): RequestInterface
     {
         return $this->request;
     }
 
     /**
      * Get the associated response
-     *
-     * @return ResponseInterface|null
      */
-    public function getResponse()
+    public function getResponse(): ?ResponseInterface
     {
         return $this->response;
     }
 
     /**
      * Check if a response was received
-     *
-     * @return bool
      */
-    public function hasResponse()
+    public function hasResponse(): bool
     {
         return $this->response !== null;
     }
@@ -182,10 +156,8 @@ class RequestException extends TransferException
      * using. It may also be just an empty array. Relying on this data will
      * couple you to a specific handler, but can give more debug information
      * when needed.
-     *
-     * @return array
      */
-    public function getHandlerContext()
+    public function getHandlerContext(): array
     {
         return $this->handlerContext;
     }

+ 0 - 27
api/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php

@@ -1,27 +0,0 @@
-<?php
-namespace GuzzleHttp\Exception;
-
-use Psr\Http\Message\StreamInterface;
-
-/**
- * Exception thrown when a seek fails on a stream.
- */
-class SeekException extends \RuntimeException implements GuzzleException
-{
-    private $stream;
-
-    public function __construct(StreamInterface $stream, $pos = 0, $msg = '')
-    {
-        $this->stream = $stream;
-        $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
-        parent::__construct($msg);
-    }
-
-    /**
-     * @return StreamInterface
-     */
-    public function getStream()
-    {
-        return $this->stream;
-    }
-}

+ 1 - 0
api/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
 /**

+ 1 - 0
api/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
 class TooManyRedirectsException extends RequestException

+ 1 - 0
api/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Exception;
 
 class TransferException extends \RuntimeException implements GuzzleException

+ 167 - 152
api/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php

@@ -1,37 +1,49 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
 use GuzzleHttp\Exception\ConnectException;
 use GuzzleHttp\Exception\RequestException;
 use GuzzleHttp\Promise\FulfilledPromise;
-use GuzzleHttp\Psr7;
+use GuzzleHttp\Promise\PromiseInterface;
 use GuzzleHttp\Psr7\LazyOpenStream;
 use GuzzleHttp\TransferStats;
+use GuzzleHttp\Utils;
 use Psr\Http\Message\RequestInterface;
 
 /**
  * Creates curl resources from a request
+ *
+ * @final
  */
 class CurlFactory implements CurlFactoryInterface
 {
-    const CURL_VERSION_STR = 'curl_version';
-    const LOW_CURL_VERSION_NUMBER = '7.21.2';
+    public const CURL_VERSION_STR = 'curl_version';
+
+    /**
+     * @deprecated
+     */
+    public const LOW_CURL_VERSION_NUMBER = '7.21.2';
 
-    /** @var array */
+    /**
+     * @var resource[]
+     */
     private $handles = [];
 
-    /** @var int Total number of idle handles to keep in cache */
+    /**
+     * @var int Total number of idle handles to keep in cache
+     */
     private $maxHandles;
 
     /**
      * @param int $maxHandles Maximum number of idle handles.
      */
-    public function __construct($maxHandles)
+    public function __construct(int $maxHandles)
     {
         $this->maxHandles = $maxHandles;
     }
 
-    public function create(RequestInterface $request, array $options)
+    public function create(RequestInterface $request, array $options): EasyHandle
     {
         if (isset($options['curl']['body_as_string'])) {
             $options['_body_as_string'] = $options['curl']['body_as_string'];
@@ -49,35 +61,35 @@ class CurlFactory implements CurlFactoryInterface
 
         // Add handler options from the request configuration options
         if (isset($options['curl'])) {
-            $conf = array_replace($conf, $options['curl']);
+            $conf = \array_replace($conf, $options['curl']);
         }
 
-        $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
+        $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
         $easy->handle = $this->handles
-            ? array_pop($this->handles)
-            : curl_init();
+            ? \array_pop($this->handles)
+            : \curl_init();
         curl_setopt_array($easy->handle, $conf);
 
         return $easy;
     }
 
-    public function release(EasyHandle $easy)
+    public function release(EasyHandle $easy): void
     {
         $resource = $easy->handle;
         unset($easy->handle);
 
-        if (count($this->handles) >= $this->maxHandles) {
-            curl_close($resource);
+        if (\count($this->handles) >= $this->maxHandles) {
+            \curl_close($resource);
         } else {
             // Remove all callback functions as they can hold onto references
             // and are not cleaned up by curl_reset. Using curl_setopt_array
             // does not work for some reason, so removing each one
             // individually.
-            curl_setopt($resource, CURLOPT_HEADERFUNCTION, null);
-            curl_setopt($resource, CURLOPT_READFUNCTION, null);
-            curl_setopt($resource, CURLOPT_WRITEFUNCTION, null);
-            curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null);
-            curl_reset($resource);
+            \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null);
+            \curl_setopt($resource, \CURLOPT_READFUNCTION, null);
+            \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null);
+            \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null);
+            \curl_reset($resource);
             $this->handles[] = $resource;
         }
     }
@@ -86,17 +98,14 @@ class CurlFactory implements CurlFactoryInterface
      * Completes a cURL transaction, either returning a response promise or a
      * rejected promise.
      *
-     * @param callable             $handler
-     * @param EasyHandle           $easy
-     * @param CurlFactoryInterface $factory Dictates how the handle is released
-     *
-     * @return \GuzzleHttp\Promise\PromiseInterface
+     * @param callable(RequestInterface, array): PromiseInterface $handler
+     * @param CurlFactoryInterface                                $factory Dictates how the handle is released
      */
     public static function finish(
         callable $handler,
         EasyHandle $easy,
         CurlFactoryInterface $factory
-    ) {
+    ): PromiseInterface {
         if (isset($easy->options['on_stats'])) {
             self::invokeStats($easy);
         }
@@ -117,10 +126,10 @@ class CurlFactory implements CurlFactoryInterface
         return new FulfilledPromise($easy->response);
     }
 
-    private static function invokeStats(EasyHandle $easy)
+    private static function invokeStats(EasyHandle $easy): void
     {
-        $curlStats = curl_getinfo($easy->handle);
-        $curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME);
+        $curlStats = \curl_getinfo($easy->handle);
+        $curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME);
         $stats = new TransferStats(
             $easy->request,
             $easy->response,
@@ -128,21 +137,24 @@ class CurlFactory implements CurlFactoryInterface
             $easy->errno,
             $curlStats
         );
-        call_user_func($easy->options['on_stats'], $stats);
+        ($easy->options['on_stats'])($stats);
     }
 
+    /**
+     * @param callable(RequestInterface, array): PromiseInterface $handler
+     */
     private static function finishError(
         callable $handler,
         EasyHandle $easy,
         CurlFactoryInterface $factory
-    ) {
+    ): PromiseInterface {
         // Get error information and release the handle to the factory.
         $ctx = [
             'errno' => $easy->errno,
-            'error' => curl_error($easy->handle),
-            'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME),
-        ] + curl_getinfo($easy->handle);
-        $ctx[self::CURL_VERSION_STR] = curl_version()['version'];
+            'error' => \curl_error($easy->handle),
+            'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME),
+        ] + \curl_getinfo($easy->handle);
+        $ctx[self::CURL_VERSION_STR] = \curl_version()['version'];
         $factory->release($easy);
 
         // Retry when nothing is present or when curl failed to rewind.
@@ -155,14 +167,14 @@ class CurlFactory implements CurlFactoryInterface
         return self::createRejection($easy, $ctx);
     }
 
-    private static function createRejection(EasyHandle $easy, array $ctx)
+    private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
     {
         static $connectionErrors = [
-            CURLE_OPERATION_TIMEOUTED  => true,
-            CURLE_COULDNT_RESOLVE_HOST => true,
-            CURLE_COULDNT_CONNECT      => true,
-            CURLE_SSL_CONNECT_ERROR    => true,
-            CURLE_GOT_NOTHING          => true,
+            \CURLE_OPERATION_TIMEOUTED  => true,
+            \CURLE_COULDNT_RESOLVE_HOST => true,
+            \CURLE_COULDNT_CONNECT      => true,
+            \CURLE_SSL_CONNECT_ERROR    => true,
+            \CURLE_GOT_NOTHING          => true,
         ];
 
         // If an exception was encountered during the onHeaders event, then
@@ -178,21 +190,16 @@ class CurlFactory implements CurlFactoryInterface
                 )
             );
         }
-        if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) {
-            $message = sprintf(
-                'cURL error %s: %s (%s)',
-                $ctx['errno'],
-                $ctx['error'],
-                'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
-            );
-        } else {
-            $message = sprintf(
-                'cURL error %s: %s (%s) for %s',
-                $ctx['errno'],
-                $ctx['error'],
-                'see https://curl.haxx.se/libcurl/c/libcurl-errors.html',
-                $easy->request->getUri()
-            );
+
+        $message = \sprintf(
+            'cURL error %s: %s (%s)',
+            $ctx['errno'],
+            $ctx['error'],
+            'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
+        );
+        $uriString = (string) $easy->request->getUri();
+        if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) {
+            $message .= \sprintf(' for %s', $uriString);
         }
 
         // Create a connection exception if it was a specific error code.
@@ -203,34 +210,37 @@ class CurlFactory implements CurlFactoryInterface
         return \GuzzleHttp\Promise\rejection_for($error);
     }
 
-    private function getDefaultConf(EasyHandle $easy)
+    /**
+     * @return array<int|string, mixed>
+     */
+    private function getDefaultConf(EasyHandle $easy): array
     {
         $conf = [
-            '_headers'             => $easy->request->getHeaders(),
-            CURLOPT_CUSTOMREQUEST  => $easy->request->getMethod(),
-            CURLOPT_URL            => (string) $easy->request->getUri()->withFragment(''),
-            CURLOPT_RETURNTRANSFER => false,
-            CURLOPT_HEADER         => false,
-            CURLOPT_CONNECTTIMEOUT => 150,
+            '_headers'              => $easy->request->getHeaders(),
+            \CURLOPT_CUSTOMREQUEST  => $easy->request->getMethod(),
+            \CURLOPT_URL            => (string) $easy->request->getUri()->withFragment(''),
+            \CURLOPT_RETURNTRANSFER => false,
+            \CURLOPT_HEADER         => false,
+            \CURLOPT_CONNECTTIMEOUT => 150,
         ];
 
-        if (defined('CURLOPT_PROTOCOLS')) {
-            $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
+        if (\defined('CURLOPT_PROTOCOLS')) {
+            $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS;
         }
 
         $version = $easy->request->getProtocolVersion();
         if ($version == 1.1) {
-            $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
+            $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1;
         } elseif ($version == 2.0) {
-            $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
+            $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0;
         } else {
-            $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
+            $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0;
         }
 
         return $conf;
     }
 
-    private function applyMethod(EasyHandle $easy, array &$conf)
+    private function applyMethod(EasyHandle $easy, array &$conf): void
     {
         $body = $easy->request->getBody();
         $size = $body->getSize();
@@ -242,22 +252,22 @@ class CurlFactory implements CurlFactoryInterface
 
         $method = $easy->request->getMethod();
         if ($method === 'PUT' || $method === 'POST') {
-            // See http://tools.ietf.org/html/rfc7230#section-3.3.2
+            // See https://tools.ietf.org/html/rfc7230#section-3.3.2
             if (!$easy->request->hasHeader('Content-Length')) {
-                $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
+                $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
             }
         } elseif ($method === 'HEAD') {
-            $conf[CURLOPT_NOBODY] = true;
+            $conf[\CURLOPT_NOBODY] = true;
             unset(
-                $conf[CURLOPT_WRITEFUNCTION],
-                $conf[CURLOPT_READFUNCTION],
-                $conf[CURLOPT_FILE],
-                $conf[CURLOPT_INFILE]
+                $conf[\CURLOPT_WRITEFUNCTION],
+                $conf[\CURLOPT_READFUNCTION],
+                $conf[\CURLOPT_FILE],
+                $conf[\CURLOPT_INFILE]
             );
         }
     }
 
-    private function applyBody(RequestInterface $request, array $options, array &$conf)
+    private function applyBody(RequestInterface $request, array $options, array &$conf): void
     {
         $size = $request->hasHeader('Content-Length')
             ? (int) $request->getHeaderLine('Content-Length')
@@ -268,37 +278,37 @@ class CurlFactory implements CurlFactoryInterface
         if (($size !== null && $size < 1000000) ||
             !empty($options['_body_as_string'])
         ) {
-            $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody();
+            $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody();
             // Don't duplicate the Content-Length header
             $this->removeHeader('Content-Length', $conf);
             $this->removeHeader('Transfer-Encoding', $conf);
         } else {
-            $conf[CURLOPT_UPLOAD] = true;
+            $conf[\CURLOPT_UPLOAD] = true;
             if ($size !== null) {
-                $conf[CURLOPT_INFILESIZE] = $size;
+                $conf[\CURLOPT_INFILESIZE] = $size;
                 $this->removeHeader('Content-Length', $conf);
             }
             $body = $request->getBody();
             if ($body->isSeekable()) {
                 $body->rewind();
             }
-            $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) {
+            $conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) {
                 return $body->read($length);
             };
         }
 
         // If the Expect header is not present, prevent curl from adding it
         if (!$request->hasHeader('Expect')) {
-            $conf[CURLOPT_HTTPHEADER][] = 'Expect:';
+            $conf[\CURLOPT_HTTPHEADER][] = 'Expect:';
         }
 
         // cURL sometimes adds a content-type by default. Prevent this.
         if (!$request->hasHeader('Content-Type')) {
-            $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:';
+            $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:';
         }
     }
 
-    private function applyHeaders(EasyHandle $easy, array &$conf)
+    private function applyHeaders(EasyHandle $easy, array &$conf): void
     {
         foreach ($conf['_headers'] as $name => $values) {
             foreach ($values as $value) {
@@ -306,16 +316,16 @@ class CurlFactory implements CurlFactoryInterface
                 if ($value === '') {
                     // cURL requires a special format for empty headers.
                     // See https://github.com/guzzle/guzzle/issues/1882 for more details.
-                    $conf[CURLOPT_HTTPHEADER][] = "$name;";
+                    $conf[\CURLOPT_HTTPHEADER][] = "$name;";
                 } else {
-                    $conf[CURLOPT_HTTPHEADER][] = "$name: $value";
+                    $conf[\CURLOPT_HTTPHEADER][] = "$name: $value";
                 }
             }
         }
 
         // Remove the Accept header if one was not set
         if (!$easy->request->hasHeader('Accept')) {
-            $conf[CURLOPT_HTTPHEADER][] = 'Accept:';
+            $conf[\CURLOPT_HTTPHEADER][] = 'Accept:';
         }
     }
 
@@ -325,41 +335,47 @@ class CurlFactory implements CurlFactoryInterface
      * @param string $name    Case-insensitive header to remove
      * @param array  $options Array of options to modify
      */
-    private function removeHeader($name, array &$options)
+    private function removeHeader(string $name, array &$options): void
     {
-        foreach (array_keys($options['_headers']) as $key) {
-            if (!strcasecmp($key, $name)) {
+        foreach (\array_keys($options['_headers']) as $key) {
+            if (!\strcasecmp($key, $name)) {
                 unset($options['_headers'][$key]);
                 return;
             }
         }
     }
 
-    private function applyHandlerOptions(EasyHandle $easy, array &$conf)
+    private function applyHandlerOptions(EasyHandle $easy, array &$conf): void
     {
         $options = $easy->options;
         if (isset($options['verify'])) {
             if ($options['verify'] === false) {
-                unset($conf[CURLOPT_CAINFO]);
-                $conf[CURLOPT_SSL_VERIFYHOST] = 0;
-                $conf[CURLOPT_SSL_VERIFYPEER] = false;
+                unset($conf[\CURLOPT_CAINFO]);
+                $conf[\CURLOPT_SSL_VERIFYHOST] = 0;
+                $conf[\CURLOPT_SSL_VERIFYPEER] = false;
             } else {
-                $conf[CURLOPT_SSL_VERIFYHOST] = 2;
-                $conf[CURLOPT_SSL_VERIFYPEER] = true;
-                if (is_string($options['verify'])) {
+                $conf[\CURLOPT_SSL_VERIFYHOST] = 2;
+                $conf[\CURLOPT_SSL_VERIFYPEER] = true;
+                if (\is_string($options['verify'])) {
                     // Throw an error if the file/folder/link path is not valid or doesn't exist.
-                    if (!file_exists($options['verify'])) {
+                    if (!\file_exists($options['verify'])) {
                         throw new \InvalidArgumentException(
                             "SSL CA bundle not found: {$options['verify']}"
                         );
                     }
                     // If it's a directory or a link to a directory use CURLOPT_CAPATH.
                     // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
-                    if (is_dir($options['verify']) ||
-                        (is_link($options['verify']) && is_dir(readlink($options['verify'])))) {
-                        $conf[CURLOPT_CAPATH] = $options['verify'];
+                    if (
+                        \is_dir($options['verify']) ||
+                        (
+                            \is_link($options['verify']) === true &&
+                            ($verifyLink = \readlink($options['verify'])) !== false &&
+                            \is_dir($verifyLink)
+                        )
+                    ) {
+                        $conf[\CURLOPT_CAPATH] = $options['verify'];
                     } else {
-                        $conf[CURLOPT_CAINFO] = $options['verify'];
+                        $conf[\CURLOPT_CAINFO] = $options['verify'];
                     }
                 }
             }
@@ -368,72 +384,74 @@ class CurlFactory implements CurlFactoryInterface
         if (!empty($options['decode_content'])) {
             $accept = $easy->request->getHeaderLine('Accept-Encoding');
             if ($accept) {
-                $conf[CURLOPT_ENCODING] = $accept;
+                $conf[\CURLOPT_ENCODING] = $accept;
             } else {
-                $conf[CURLOPT_ENCODING] = '';
+                $conf[\CURLOPT_ENCODING] = '';
                 // Don't let curl send the header over the wire
-                $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
+                $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
             }
         }
 
-        if (isset($options['sink'])) {
+        // Do not connect a sink for HEAD requests.
+        if ($easy->request->getMethod() !== 'HEAD') {
+            if (!isset($options['sink'])) {
+                // Use a default temp stream if no sink was set.
+                $options['sink'] = \fopen('php://temp', 'w+');
+            }
             $sink = $options['sink'];
-            if (!is_string($sink)) {
+            if (!\is_string($sink)) {
                 $sink = \GuzzleHttp\Psr7\stream_for($sink);
-            } elseif (!is_dir(dirname($sink))) {
+            } elseif (!\is_dir(\dirname($sink))) {
                 // Ensure that the directory exists before failing in curl.
-                throw new \RuntimeException(sprintf(
+                throw new \RuntimeException(\sprintf(
                     'Directory %s does not exist for sink value of %s',
-                    dirname($sink),
+                    \dirname($sink),
                     $sink
                 ));
             } else {
                 $sink = new LazyOpenStream($sink, 'w+');
             }
             $easy->sink = $sink;
-            $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) {
+            $conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int {
                 return $sink->write($write);
             };
-        } else {
-            // Use a default temp stream if no sink was set.
-            $conf[CURLOPT_FILE] = fopen('php://temp', 'w+');
-            $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]);
         }
+
         $timeoutRequiresNoSignal = false;
         if (isset($options['timeout'])) {
             $timeoutRequiresNoSignal |= $options['timeout'] < 1;
-            $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
+            $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
         }
 
         // CURL default value is CURL_IPRESOLVE_WHATEVER
         if (isset($options['force_ip_resolve'])) {
             if ('v4' === $options['force_ip_resolve']) {
-                $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
+                $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4;
             } elseif ('v6' === $options['force_ip_resolve']) {
-                $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6;
+                $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6;
             }
         }
 
         if (isset($options['connect_timeout'])) {
             $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1;
-            $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
+            $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
         }
 
-        if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
-            $conf[CURLOPT_NOSIGNAL] = true;
+        if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') {
+            $conf[\CURLOPT_NOSIGNAL] = true;
         }
 
         if (isset($options['proxy'])) {
-            if (!is_array($options['proxy'])) {
-                $conf[CURLOPT_PROXY] = $options['proxy'];
+            if (!\is_array($options['proxy'])) {
+                $conf[\CURLOPT_PROXY] = $options['proxy'];
             } else {
                 $scheme = $easy->request->getUri()->getScheme();
                 if (isset($options['proxy'][$scheme])) {
                     $host = $easy->request->getUri()->getHost();
                     if (!isset($options['proxy']['no']) ||
-                        !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no'])
+                        !Utils::isHostInNoProxy($host, $options['proxy']['no'])
                     ) {
-                        $conf[CURLOPT_PROXY] = $options['proxy'][$scheme];
+                        $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
                     }
                 }
             }
@@ -441,58 +459,53 @@ class CurlFactory implements CurlFactoryInterface
 
         if (isset($options['cert'])) {
             $cert = $options['cert'];
-            if (is_array($cert)) {
-                $conf[CURLOPT_SSLCERTPASSWD] = $cert[1];
+            if (\is_array($cert)) {
+                $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1];
                 $cert = $cert[0];
             }
-            if (!file_exists($cert)) {
+            if (!\file_exists($cert)) {
                 throw new \InvalidArgumentException(
                     "SSL certificate not found: {$cert}"
                 );
             }
-            $conf[CURLOPT_SSLCERT] = $cert;
+            $conf[\CURLOPT_SSLCERT] = $cert;
         }
 
         if (isset($options['ssl_key'])) {
-            if (is_array($options['ssl_key'])) {
-                if (count($options['ssl_key']) === 2) {
-                    list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key'];
+            if (\is_array($options['ssl_key'])) {
+                if (\count($options['ssl_key']) === 2) {
+                    [$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key'];
                 } else {
-                    list($sslKey) = $options['ssl_key'];
+                    [$sslKey] = $options['ssl_key'];
                 }
             }
 
-            $sslKey = isset($sslKey) ? $sslKey: $options['ssl_key'];
+            $sslKey = $sslKey ?? $options['ssl_key'];
 
-            if (!file_exists($sslKey)) {
+            if (!\file_exists($sslKey)) {
                 throw new \InvalidArgumentException(
                     "SSL private key not found: {$sslKey}"
                 );
             }
-            $conf[CURLOPT_SSLKEY] = $sslKey;
+            $conf[\CURLOPT_SSLKEY] = $sslKey;
         }
 
         if (isset($options['progress'])) {
             $progress = $options['progress'];
-            if (!is_callable($progress)) {
+            if (!\is_callable($progress)) {
                 throw new \InvalidArgumentException(
                     'progress client option must be callable'
                 );
             }
-            $conf[CURLOPT_NOPROGRESS] = false;
-            $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) {
-                $args = func_get_args();
-                // PHP 5.5 pushed the handle onto the start of the args
-                if (is_resource($args[0])) {
-                    array_shift($args);
-                }
-                call_user_func_array($progress, $args);
+            $conf[\CURLOPT_NOPROGRESS] = false;
+            $conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) {
+                $progress($downloadSize, $downloaded, $uploadSize, $uploaded);
             };
         }
 
         if (!empty($options['debug'])) {
-            $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']);
-            $conf[CURLOPT_VERBOSE] = true;
+            $conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']);
+            $conf[\CURLOPT_VERBOSE] = true;
         }
     }
 
@@ -504,12 +517,14 @@ class CurlFactory implements CurlFactoryInterface
      * stream, and then encountered a "necessary data rewind wasn't possible"
      * error, causing the request to be sent through curl_multi_info_read()
      * without an error status.
+     *
+     * @param callable(RequestInterface, array): PromiseInterface $handler
      */
     private static function retryFailedRewind(
         callable $handler,
         EasyHandle $easy,
         array $ctx
-    ) {
+    ): PromiseInterface {
         try {
             // Only rewind if the body has been read from.
             $body = $easy->request->getBody();
@@ -542,24 +557,24 @@ class CurlFactory implements CurlFactoryInterface
         return $handler($easy->request, $easy->options);
     }
 
-    private function createHeaderFn(EasyHandle $easy)
+    private function createHeaderFn(EasyHandle $easy): callable
     {
         if (isset($easy->options['on_headers'])) {
             $onHeaders = $easy->options['on_headers'];
 
-            if (!is_callable($onHeaders)) {
+            if (!\is_callable($onHeaders)) {
                 throw new \InvalidArgumentException('on_headers must be callable');
             }
         } else {
             $onHeaders = null;
         }
 
-        return function ($ch, $h) use (
+        return static function ($ch, $h) use (
             $onHeaders,
             $easy,
             &$startingResponse
         ) {
-            $value = trim($h);
+            $value = \trim($h);
             if ($value === '') {
                 $startingResponse = true;
                 $easy->createResponse();
@@ -579,7 +594,7 @@ class CurlFactory implements CurlFactoryInterface
             } else {
                 $easy->headers[] = $value;
             }
-            return strlen($h);
+            return \strlen($h);
         };
     }
 }

+ 3 - 5
api/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
 use Psr\Http\Message\RequestInterface;
@@ -11,17 +12,14 @@ interface CurlFactoryInterface
      * @param RequestInterface $request Request
      * @param array            $options Transfer options
      *
-     * @return EasyHandle
      * @throws \RuntimeException when an option cannot be applied
      */
-    public function create(RequestInterface $request, array $options);
+    public function create(RequestInterface $request, array $options): EasyHandle;
 
     /**
      * Release an easy handle, allowing it to be reused or closed.
      *
      * This function must call unset on the easy handle's "handle" property.
-     *
-     * @param EasyHandle $easy
      */
-    public function release(EasyHandle $easy);
+    public function release(EasyHandle $easy): void;
 }

+ 13 - 9
api/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php

@@ -1,7 +1,8 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
-use GuzzleHttp\Psr7;
+use GuzzleHttp\Promise\PromiseInterface;
 use Psr\Http\Message\RequestInterface;
 
 /**
@@ -10,10 +11,14 @@ use Psr\Http\Message\RequestInterface;
  * When using the CurlHandler, custom curl options can be specified as an
  * associative array of curl option constants mapping to values in the
  * **curl** key of the "client" key of the request.
+ *
+ * @final
  */
 class CurlHandler
 {
-    /** @var CurlFactoryInterface */
+    /**
+     * @var CurlFactoryInterface
+     */
     private $factory;
 
     /**
@@ -25,20 +30,19 @@ class CurlHandler
      */
     public function __construct(array $options = [])
     {
-        $this->factory = isset($options['handle_factory'])
-            ? $options['handle_factory']
-            : new CurlFactory(3);
+        $this->factory = $options['handle_factory']
+            ?? new CurlFactory(3);
     }
 
-    public function __invoke(RequestInterface $request, array $options)
+    public function __invoke(RequestInterface $request, array $options): PromiseInterface
     {
         if (isset($options['delay'])) {
-            usleep($options['delay'] * 1000);
+            \usleep($options['delay'] * 1000);
         }
 
         $easy = $this->factory->create($request, $options);
-        curl_exec($easy->handle);
-        $easy->errno = curl_errno($easy->handle);
+        \curl_exec($easy->handle);
+        $easy->errno = \curl_errno($easy->handle);
 
         return CurlFactory::finish($this, $easy, $this->factory);
     }

+ 81 - 42
api/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php

@@ -1,9 +1,11 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
-use GuzzleHttp\Exception\InvalidArgumentException;
 use GuzzleHttp\Promise as P;
 use GuzzleHttp\Promise\Promise;
+use GuzzleHttp\Promise\PromiseInterface;
+use GuzzleHttp\Utils;
 use Psr\Http\Message\RequestInterface;
 
 /**
@@ -14,15 +16,43 @@ use Psr\Http\Message\RequestInterface;
  * **curl** key of the provided request options.
  *
  * @property resource $_mh Internal use only. Lazy loaded multi-handle.
+ *
+ * @final
  */
 class CurlMultiHandler
 {
-    /** @var CurlFactoryInterface */
+    /**
+     * @var CurlFactoryInterface
+     */
     private $factory;
+
+    /**
+     * @var int
+     */
     private $selectTimeout;
+
+    /**
+     * @var resource|null the currently executing resource in `curl_multi_exec`.
+     */
     private $active;
+
+    /**
+     * @var array Request entry handles, indexed by handle id in `addRequest`.
+     *
+     * @see CurlMultiHandler::addRequest
+     */
     private $handles = [];
+
+    /**
+     * @var array<int, float> An array of delay times, indexed by handle id in `addRequest`.
+     *
+     * @see CurlMultiHandler::addRequest
+     */
     private $delays = [];
+
+    /**
+     * @var array<mixed> An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt()
+     */
     private $options = [];
 
     /**
@@ -33,52 +63,61 @@ class CurlMultiHandler
      *   out while selecting curl handles. Defaults to 1 second.
      * - options: An associative array of CURLMOPT_* options and
      *   corresponding values for curl_multi_setopt()
-     *
-     * @param array $options
      */
     public function __construct(array $options = [])
     {
-        $this->factory = isset($options['handle_factory'])
-            ? $options['handle_factory'] : new CurlFactory(50);
+        $this->factory = $options['handle_factory'] ?? new CurlFactory(50);
 
         if (isset($options['select_timeout'])) {
             $this->selectTimeout = $options['select_timeout'];
-        } elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
-            $this->selectTimeout = $selectTimeout;
+        } elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
+            $this->selectTimeout = (int) $selectTimeout;
         } else {
             $this->selectTimeout = 1;
         }
 
-        $this->options = isset($options['options']) ? $options['options'] : [];
+        $this->options = $options['options'] ?? [];
     }
 
+    /**
+     * @param string $name
+     *
+     * @return resource
+     *
+     * @throws \BadMethodCallException when another field as `_mh` will be gotten
+     * @throws \RuntimeException       when curl can not initialize a multi handle
+     */
     public function __get($name)
     {
-        if ($name === '_mh') {
-            $this->_mh = curl_multi_init();
+        if ($name !== '_mh') {
+            throw new \BadMethodCallException("Can not get other property as '_mh'.");
+        }
 
-            foreach ($this->options as $option => $value) {
-                // A warning is raised in case of a wrong option.
-                curl_multi_setopt($this->_mh, $option, $value);
-            }
+        $multiHandle = \curl_multi_init();
+
+        if (false === $multiHandle) {
+            throw new \RuntimeException('Can not initialize curl multi handle.');
+        }
+
+        $this->_mh = $multiHandle;
 
-            // Further calls to _mh will return the value directly, without entering the
-            // __get() method at all.
-            return $this->_mh;
+        foreach ($this->options as $option => $value) {
+            // A warning is raised in case of a wrong option.
+            curl_multi_setopt($this->_mh, $option, $value);
         }
 
-        throw new \BadMethodCallException();
+        return $this->_mh;
     }
 
     public function __destruct()
     {
         if (isset($this->_mh)) {
-            curl_multi_close($this->_mh);
+            \curl_multi_close($this->_mh);
             unset($this->_mh);
         }
     }
 
-    public function __invoke(RequestInterface $request, array $options)
+    public function __invoke(RequestInterface $request, array $options): PromiseInterface
     {
         $easy = $this->factory->create($request, $options);
         $id = (int) $easy->handle;
@@ -98,15 +137,15 @@ class CurlMultiHandler
     /**
      * Ticks the curl event loop.
      */
-    public function tick()
+    public function tick(): void
     {
         // Add any delayed handles if needed.
         if ($this->delays) {
-            $currentTime = \GuzzleHttp\_current_time();
+            $currentTime = Utils::currentTime();
             foreach ($this->delays as $id => $delay) {
                 if ($currentTime >= $delay) {
                     unset($this->delays[$id]);
-                    curl_multi_add_handle(
+                    \curl_multi_add_handle(
                         $this->_mh,
                         $this->handles[$id]['easy']->handle
                     );
@@ -118,14 +157,14 @@ class CurlMultiHandler
         P\queue()->run();
 
         if ($this->active &&
-            curl_multi_select($this->_mh, $this->selectTimeout) === -1
+            \curl_multi_select($this->_mh, $this->selectTimeout) === -1
         ) {
             // Perform a usleep if a select returns -1.
             // See: https://bugs.php.net/bug.php?id=61141
-            usleep(250);
+            \usleep(250);
         }
 
-        while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
+        while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM);
 
         $this->processMessages();
     }
@@ -133,28 +172,28 @@ class CurlMultiHandler
     /**
      * Runs until all outstanding connections have completed.
      */
-    public function execute()
+    public function execute(): void
     {
         $queue = P\queue();
 
         while ($this->handles || !$queue->isEmpty()) {
             // If there are no transfers, then sleep for the next delay
             if (!$this->active && $this->delays) {
-                usleep($this->timeToNext());
+                \usleep($this->timeToNext());
             }
             $this->tick();
         }
     }
 
-    private function addRequest(array $entry)
+    private function addRequest(array $entry): void
     {
         $easy = $entry['easy'];
         $id = (int) $easy->handle;
         $this->handles[$id] = $entry;
         if (empty($easy->options['delay'])) {
-            curl_multi_add_handle($this->_mh, $easy->handle);
+            \curl_multi_add_handle($this->_mh, $easy->handle);
         } else {
-            $this->delays[$id] = \GuzzleHttp\_current_time() + ($easy->options['delay'] / 1000);
+            $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000);
         }
     }
 
@@ -165,7 +204,7 @@ class CurlMultiHandler
      *
      * @return bool True on success, false on failure.
      */
-    private function cancel($id)
+    private function cancel($id): bool
     {
         // Cannot cancel if it has been processed.
         if (!isset($this->handles[$id])) {
@@ -174,17 +213,17 @@ class CurlMultiHandler
 
         $handle = $this->handles[$id]['easy']->handle;
         unset($this->delays[$id], $this->handles[$id]);
-        curl_multi_remove_handle($this->_mh, $handle);
-        curl_close($handle);
+        \curl_multi_remove_handle($this->_mh, $handle);
+        \curl_close($handle);
 
         return true;
     }
 
-    private function processMessages()
+    private function processMessages(): void
     {
-        while ($done = curl_multi_info_read($this->_mh)) {
+        while ($done = \curl_multi_info_read($this->_mh)) {
             $id = (int) $done['handle'];
-            curl_multi_remove_handle($this->_mh, $done['handle']);
+            \curl_multi_remove_handle($this->_mh, $done['handle']);
 
             if (!isset($this->handles[$id])) {
                 // Probably was cancelled.
@@ -204,16 +243,16 @@ class CurlMultiHandler
         }
     }
 
-    private function timeToNext()
+    private function timeToNext(): int
     {
-        $currentTime = \GuzzleHttp\_current_time();
-        $nextTime = PHP_INT_MAX;
+        $currentTime = Utils::currentTime();
+        $nextTime = \PHP_INT_MAX;
         foreach ($this->delays as $time) {
             if ($time < $nextTime) {
                 $nextTime = $time;
             }
         }
 
-        return max(0, $nextTime - $currentTime) * 1000000;
+        return ((int) \max(0, $nextTime - $currentTime)) * 1000000;
     }
 }

+ 41 - 14
api/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php

@@ -1,7 +1,9 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
 use GuzzleHttp\Psr7\Response;
+use GuzzleHttp\Utils;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\StreamInterface;
@@ -13,28 +15,44 @@ use Psr\Http\Message\StreamInterface;
  */
 final class EasyHandle
 {
-    /** @var resource cURL resource */
+    /**
+     * @var resource cURL resource
+     */
     public $handle;
 
-    /** @var StreamInterface Where data is being written */
+    /**
+     * @var StreamInterface Where data is being written
+     */
     public $sink;
 
-    /** @var array Received HTTP headers so far */
+    /**
+     * @var array Received HTTP headers so far
+     */
     public $headers = [];
 
-    /** @var ResponseInterface Received response (if any) */
+    /**
+     * @var ResponseInterface|null Received response (if any)
+     */
     public $response;
 
-    /** @var RequestInterface Request being sent */
+    /**
+     * @var RequestInterface Request being sent
+     */
     public $request;
 
-    /** @var array Request options */
+    /**
+     * @var array Request options
+     */
     public $options = [];
 
-    /** @var int cURL error number (if any) */
+    /**
+     * @var int cURL error number (if any)
+     */
     public $errno = 0;
 
-    /** @var \Exception Exception during on_headers (if any) */
+    /**
+     * @var \Throwable|null Exception during on_headers (if any)
+     */
     public $onHeadersException;
 
     /**
@@ -42,16 +60,16 @@ final class EasyHandle
      *
      * @throws \RuntimeException if no headers have been received.
      */
-    public function createResponse()
+    public function createResponse(): void
     {
         if (empty($this->headers)) {
             throw new \RuntimeException('No headers have been received');
         }
 
         // HTTP-version SP status-code SP reason-phrase
-        $startLine = explode(' ', array_shift($this->headers), 3);
-        $headers = \GuzzleHttp\headers_from_lines($this->headers);
-        $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
+        $startLine = \explode(' ', \array_shift($this->headers), 3);
+        $headers = Utils::headersFromLines($this->headers);
+        $normalizedKeys = Utils::normalizeHeaderKeys($headers);
 
         if (!empty($this->options['decode_content'])
             && isset($normalizedKeys['content-encoding'])
@@ -72,16 +90,25 @@ final class EasyHandle
             }
         }
 
+        $statusCode = (int) $startLine[1];
+
         // Attach a response to the easy handle with the parsed headers.
         $this->response = new Response(
-            $startLine[1],
+            $statusCode,
             $headers,
             $this->sink,
-            substr($startLine[0], 5),
+            \substr($startLine[0], 5),
             isset($startLine[2]) ? (string) $startLine[2] : null
         );
     }
 
+    /**
+     * @param string $name
+     *
+     * @return void
+     *
+     * @throws \BadMethodCallException
+     */
     public function __get($name)
     {
         $msg = $name === 'handle'

+ 71 - 50
api/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php

@@ -1,51 +1,72 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
 use GuzzleHttp\Exception\RequestException;
 use GuzzleHttp\HandlerStack;
 use GuzzleHttp\Promise\PromiseInterface;
-use GuzzleHttp\Promise\RejectedPromise;
 use GuzzleHttp\TransferStats;
+use GuzzleHttp\Utils;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\StreamInterface;
 
 /**
  * Handler that returns responses or throw exceptions from a queue.
+ *
+ * @final
  */
 class MockHandler implements \Countable
 {
+    /**
+     * @var array
+     */
     private $queue = [];
+
+    /**
+     * @var RequestInterface|null
+     */
     private $lastRequest;
-    private $lastOptions;
+
+    /**
+     * @var array
+     */
+    private $lastOptions = [];
+
+    /**
+     * @var callable|null
+     */
     private $onFulfilled;
+
+    /**
+     * @var callable|null
+     */
     private $onRejected;
 
     /**
      * Creates a new MockHandler that uses the default handler stack list of
      * middlewares.
      *
-     * @param array $queue Array of responses, callables, or exceptions.
-     * @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
-     * @param callable $onRejected  Callback to invoke when the return value is rejected.
-     *
-     * @return HandlerStack
+     * @param array|null    $queue       Array of responses, callables, or exceptions.
+     * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
+     * @param callable|null $onRejected  Callback to invoke when the return value is rejected.
      */
     public static function createWithMiddleware(
         array $queue = null,
         callable $onFulfilled = null,
         callable $onRejected = null
-    ) {
+    ): HandlerStack {
         return HandlerStack::create(new self($queue, $onFulfilled, $onRejected));
     }
 
     /**
      * The passed in value must be an array of
-     * {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions,
+     * {@see \Psr\Http\Message\ResponseInterface} objects, Exceptions,
      * callables, or Promises.
      *
-     * @param array $queue
-     * @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
-     * @param callable $onRejected  Callback to invoke when the return value is rejected.
+     * @param array<int, mixed>|null $queue       The parameters to be passed to the append function, as an indexed array.
+     * @param callable|null          $onFulfilled Callback to invoke when the return value is fulfilled.
+     * @param callable|null          $onRejected  Callback to invoke when the return value is rejected.
      */
     public function __construct(
         array $queue = null,
@@ -56,26 +77,27 @@ class MockHandler implements \Countable
         $this->onRejected = $onRejected;
 
         if ($queue) {
-            call_user_func_array([$this, 'append'], $queue);
+            // array_values included for BC
+            $this->append(...array_values($queue));
         }
     }
 
-    public function __invoke(RequestInterface $request, array $options)
+    public function __invoke(RequestInterface $request, array $options): PromiseInterface
     {
         if (!$this->queue) {
             throw new \OutOfBoundsException('Mock queue is empty');
         }
 
-        if (isset($options['delay']) && is_numeric($options['delay'])) {
-            usleep($options['delay'] * 1000);
+        if (isset($options['delay']) && \is_numeric($options['delay'])) {
+            \usleep((int) $options['delay'] * 1000);
         }
 
         $this->lastRequest = $request;
         $this->lastOptions = $options;
-        $response = array_shift($this->queue);
+        $response = \array_shift($this->queue);
 
         if (isset($options['on_headers'])) {
-            if (!is_callable($options['on_headers'])) {
+            if (!\is_callable($options['on_headers'])) {
                 throw new \InvalidArgumentException('on_headers must be callable');
             }
             try {
@@ -86,29 +108,30 @@ class MockHandler implements \Countable
             }
         }
 
-        if (is_callable($response)) {
-            $response = call_user_func($response, $request, $options);
+        if (\is_callable($response)) {
+            $response = $response($request, $options);
         }
 
-        $response = $response instanceof \Exception
+        $response = $response instanceof \Throwable
             ? \GuzzleHttp\Promise\rejection_for($response)
             : \GuzzleHttp\Promise\promise_for($response);
 
         return $response->then(
-            function ($value) use ($request, $options) {
+            function (?ResponseInterface $value) use ($request, $options) {
                 $this->invokeStats($request, $options, $value);
                 if ($this->onFulfilled) {
-                    call_user_func($this->onFulfilled, $value);
+                    ($this->onFulfilled)($value);
                 }
-                if (isset($options['sink'])) {
+
+                if ($value !== null && isset($options['sink'])) {
                     $contents = (string) $value->getBody();
                     $sink = $options['sink'];
 
-                    if (is_resource($sink)) {
-                        fwrite($sink, $contents);
-                    } elseif (is_string($sink)) {
-                        file_put_contents($sink, $contents);
-                    } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) {
+                    if (\is_resource($sink)) {
+                        \fwrite($sink, $contents);
+                    } elseif (\is_string($sink)) {
+                        \file_put_contents($sink, $contents);
+                    } elseif ($sink instanceof StreamInterface) {
                         $sink->write($contents);
                     }
                 }
@@ -118,7 +141,7 @@ class MockHandler implements \Countable
             function ($reason) use ($request, $options) {
                 $this->invokeStats($request, $options, null, $reason);
                 if ($this->onRejected) {
-                    call_user_func($this->onRejected, $reason);
+                    ($this->onRejected)($reason);
                 }
                 return \GuzzleHttp\Promise\rejection_for($reason);
             }
@@ -128,68 +151,66 @@ class MockHandler implements \Countable
     /**
      * Adds one or more variadic requests, exceptions, callables, or promises
      * to the queue.
+     *
+     * @param mixed ...$values
      */
-    public function append()
+    public function append(...$values): void
     {
-        foreach (func_get_args() as $value) {
+        foreach ($values as $value) {
             if ($value instanceof ResponseInterface
-                || $value instanceof \Exception
+                || $value instanceof \Throwable
                 || $value instanceof PromiseInterface
-                || is_callable($value)
+                || \is_callable($value)
             ) {
                 $this->queue[] = $value;
             } else {
-                throw new \InvalidArgumentException('Expected a response or '
-                    . 'exception. Found ' . \GuzzleHttp\describe_type($value));
+                throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
             }
         }
     }
 
     /**
      * Get the last received request.
-     *
-     * @return RequestInterface
      */
-    public function getLastRequest()
+    public function getLastRequest(): ?RequestInterface
     {
         return $this->lastRequest;
     }
 
     /**
      * Get the last received request options.
-     *
-     * @return array
      */
-    public function getLastOptions()
+    public function getLastOptions(): array
     {
         return $this->lastOptions;
     }
 
     /**
      * Returns the number of remaining items in the queue.
-     *
-     * @return int
      */
-    public function count()
+    public function count(): int
     {
-        return count($this->queue);
+        return \count($this->queue);
     }
 
-    public function reset()
+    public function reset(): void
     {
         $this->queue = [];
     }
 
+    /**
+     * @param mixed $reason Promise or reason.
+     */
     private function invokeStats(
         RequestInterface $request,
         array $options,
         ResponseInterface $response = null,
         $reason = null
-    ) {
+    ): void {
         if (isset($options['on_stats'])) {
-            $transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0;
+            $transferTime = $options['transfer_time'] ?? 0;
             $stats = new TransferStats($request, $response, $transferTime, $reason);
-            call_user_func($options['on_stats'], $stats);
+            ($options['on_stats'])($stats);
         }
     }
 }

+ 14 - 10
api/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php

@@ -1,11 +1,15 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
+use GuzzleHttp\Promise\PromiseInterface;
 use GuzzleHttp\RequestOptions;
 use Psr\Http\Message\RequestInterface;
 
 /**
  * Provides basic proxies for handlers.
+ *
+ * @final
  */
 class Proxy
 {
@@ -13,16 +17,16 @@ class Proxy
      * Sends synchronous requests to a specific handler while sending all other
      * requests to another handler.
      *
-     * @param callable $default Handler used for normal responses
-     * @param callable $sync    Handler used for synchronous responses.
+     * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default Handler used for normal responses
+     * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $sync    Handler used for synchronous responses.
      *
-     * @return callable Returns the composed handler.
+     * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
      */
     public static function wrapSync(
         callable $default,
         callable $sync
-    ) {
-        return function (RequestInterface $request, array $options) use ($default, $sync) {
+    ): callable {
+        return static function (RequestInterface $request, array $options) use ($default, $sync): PromiseInterface {
             return empty($options[RequestOptions::SYNCHRONOUS])
                 ? $default($request, $options)
                 : $sync($request, $options);
@@ -37,16 +41,16 @@ class Proxy
      * performance benefits of curl while still supporting true streaming
      * through the StreamHandler.
      *
-     * @param callable $default   Handler used for non-streaming responses
-     * @param callable $streaming Handler used for streaming responses
+     * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default   Handler used for non-streaming responses
+     * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $streaming Handler used for streaming responses
      *
-     * @return callable Returns the composed handler.
+     * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
      */
     public static function wrapStreaming(
         callable $default,
         callable $streaming
-    ) {
-        return function (RequestInterface $request, array $options) use ($default, $streaming) {
+    ): callable {
+        return static function (RequestInterface $request, array $options) use ($default, $streaming): PromiseInterface {
             return empty($options['stream'])
                 ? $default($request, $options)
                 : $streaming($request, $options);

+ 154 - 123
api/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp\Handler;
 
 use GuzzleHttp\Exception\ConnectException;
@@ -7,15 +8,22 @@ use GuzzleHttp\Promise\FulfilledPromise;
 use GuzzleHttp\Promise\PromiseInterface;
 use GuzzleHttp\Psr7;
 use GuzzleHttp\TransferStats;
+use GuzzleHttp\Utils;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\StreamInterface;
+use Psr\Http\Message\UriInterface;
 
 /**
  * HTTP handler that uses PHP's HTTP stream wrapper.
+ *
+ * @final
  */
 class StreamHandler
 {
+    /**
+     * @var array
+     */
     private $lastHeaders = [];
 
     /**
@@ -23,17 +31,15 @@ class StreamHandler
      *
      * @param RequestInterface $request Request to send.
      * @param array            $options Request transfer options.
-     *
-     * @return PromiseInterface
      */
-    public function __invoke(RequestInterface $request, array $options)
+    public function __invoke(RequestInterface $request, array $options): PromiseInterface
     {
         // Sleep if there is a delay specified.
         if (isset($options['delay'])) {
-            usleep($options['delay'] * 1000);
+            \usleep($options['delay'] * 1000);
         }
 
-        $startTime = isset($options['on_stats']) ? \GuzzleHttp\_current_time() : null;
+        $startTime = isset($options['on_stats']) ? Utils::currentTime() : null;
 
         try {
             // Does not support the expect header.
@@ -57,14 +63,15 @@ class StreamHandler
             // Determine if the error was a networking error.
             $message = $e->getMessage();
             // This list can probably get more comprehensive.
-            if (strpos($message, 'getaddrinfo') // DNS lookup failed
-                || strpos($message, 'Connection refused')
-                || strpos($message, "couldn't connect to host") // error on HHVM
-                || strpos($message, "connection attempt failed")
+            if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
+                || false !== \strpos($message, 'Connection refused')
+                || false !== \strpos($message, "couldn't connect to host") // error on HHVM
+                || false !== \strpos($message, "connection attempt failed")
             ) {
                 $e = new ConnectException($e->getMessage(), $request, $e);
+            } else {
+                $e = RequestException::wrapException($request, $e);
             }
-            $e = RequestException::wrapException($request, $e);
             $this->invokeStats($options, $request, $startTime, null, $e);
 
             return \GuzzleHttp\Promise\rejection_for($e);
@@ -74,40 +81,43 @@ class StreamHandler
     private function invokeStats(
         array $options,
         RequestInterface $request,
-        $startTime,
+        ?float $startTime,
         ResponseInterface $response = null,
-        $error = null
-    ) {
+        \Throwable $error = null
+    ): void {
         if (isset($options['on_stats'])) {
             $stats = new TransferStats(
                 $request,
                 $response,
-                \GuzzleHttp\_current_time() - $startTime,
+                Utils::currentTime() - $startTime,
                 $error,
                 []
             );
-            call_user_func($options['on_stats'], $stats);
+            ($options['on_stats'])($stats);
         }
     }
 
+    /**
+     * @param resource $stream
+     */
     private function createResponse(
         RequestInterface $request,
         array $options,
         $stream,
-        $startTime
-    ) {
+        ?float $startTime
+    ): PromiseInterface {
         $hdrs = $this->lastHeaders;
         $this->lastHeaders = [];
-        $parts = explode(' ', array_shift($hdrs), 3);
-        $ver = explode('/', $parts[0])[1];
-        $status = $parts[1];
-        $reason = isset($parts[2]) ? $parts[2] : null;
-        $headers = \GuzzleHttp\headers_from_lines($hdrs);
-        list($stream, $headers) = $this->checkDecode($options, $headers, $stream);
+        $parts = \explode(' ', \array_shift($hdrs), 3);
+        $ver = \explode('/', $parts[0])[1];
+        $status = (int) $parts[1];
+        $reason = $parts[2] ?? null;
+        $headers = Utils::headersFromLines($hdrs);
+        [$stream, $headers] = $this->checkDecode($options, $headers, $stream);
         $stream = Psr7\stream_for($stream);
         $sink = $stream;
 
-        if (strcasecmp('HEAD', $request->getMethod())) {
+        if (\strcasecmp('HEAD', $request->getMethod())) {
             $sink = $this->createSink($stream, $options);
         }
 
@@ -138,26 +148,28 @@ class StreamHandler
         return new FulfilledPromise($response);
     }
 
-    private function createSink(StreamInterface $stream, array $options)
+    private function createSink(StreamInterface $stream, array $options): StreamInterface
     {
         if (!empty($options['stream'])) {
             return $stream;
         }
 
-        $sink = isset($options['sink'])
-            ? $options['sink']
-            : fopen('php://temp', 'r+');
+        $sink = $options['sink']
+            ?? \fopen('php://temp', 'r+');
 
-        return is_string($sink)
+        return \is_string($sink)
             ? new Psr7\LazyOpenStream($sink, 'w+')
             : Psr7\stream_for($sink);
     }
 
-    private function checkDecode(array $options, array $headers, $stream)
+    /**
+     * @param resource $stream
+     */
+    private function checkDecode(array $options, array $headers, $stream): array
     {
         // Automatically decode responses when instructed.
         if (!empty($options['decode_content'])) {
-            $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
+            $normalizedKeys = Utils::normalizeHeaderKeys($headers);
             if (isset($normalizedKeys['content-encoding'])) {
                 $encoding = $headers[$normalizedKeys['content-encoding']];
                 if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
@@ -190,19 +202,16 @@ class StreamHandler
     /**
      * Drains the source stream into the "sink" client option.
      *
-     * @param StreamInterface $source
-     * @param StreamInterface $sink
-     * @param string          $contentLength Header specifying the amount of
-     *                                       data to read.
+     * @param string $contentLength Header specifying the amount of
+     *                              data to read.
      *
-     * @return StreamInterface
      * @throws \RuntimeException when the sink option is invalid.
      */
     private function drain(
         StreamInterface $source,
         StreamInterface $sink,
-        $contentLength
-    ) {
+        string $contentLength
+    ): StreamInterface {
         // If a content-length header is provided, then stop reading once
         // that number of bytes has been read. This can prevent infinitely
         // reading from a stream when dealing with servers that do not honor
@@ -210,7 +219,7 @@ class StreamHandler
         Psr7\copy_to_stream(
             $source,
             $sink,
-            (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
+            (\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
         );
 
         $sink->seek(0);
@@ -225,12 +234,13 @@ class StreamHandler
      * @param callable $callback Callable that returns stream resource
      *
      * @return resource
+     *
      * @throws \RuntimeException on error
      */
     private function createResource(callable $callback)
     {
-        $errors = null;
-        set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
+        $errors = [];
+        \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
             $errors[] = [
                 'message' => $msg,
                 'file'    => $file,
@@ -240,26 +250,29 @@ class StreamHandler
         });
 
         $resource = $callback();
-        restore_error_handler();
+        \restore_error_handler();
 
         if (!$resource) {
             $message = 'Error creating resource: ';
             foreach ($errors as $err) {
                 foreach ($err as $key => $value) {
-                    $message .= "[$key] $value" . PHP_EOL;
+                    $message .= "[$key] $value" . \PHP_EOL;
                 }
             }
-            throw new \RuntimeException(trim($message));
+            throw new \RuntimeException(\trim($message));
         }
 
         return $resource;
     }
 
+    /**
+     * @return resource
+     */
     private function createStream(RequestInterface $request, array $options)
     {
         static $methods;
         if (!$methods) {
-            $methods = array_flip(get_class_methods(__CLASS__));
+            $methods = \array_flip(\get_class_methods(__CLASS__));
         }
 
         // HTTP/1.1 streams using the PHP stream wrapper require a
@@ -278,7 +291,7 @@ class StreamHandler
         $params = [];
         $context = $this->getDefaultContext($request);
 
-        if (isset($options['on_headers']) && !is_callable($options['on_headers'])) {
+        if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) {
             throw new \InvalidArgumentException('on_headers must be callable');
         }
 
@@ -292,42 +305,47 @@ class StreamHandler
         }
 
         if (isset($options['stream_context'])) {
-            if (!is_array($options['stream_context'])) {
+            if (!\is_array($options['stream_context'])) {
                 throw new \InvalidArgumentException('stream_context must be an array');
             }
-            $context = array_replace_recursive(
+            $context = \array_replace_recursive(
                 $context,
                 $options['stream_context']
             );
         }
 
         // Microsoft NTLM authentication only supported with curl handler
-        if (isset($options['auth'])
-            && is_array($options['auth'])
-            && isset($options['auth'][2])
-            && 'ntlm' == $options['auth'][2]
-        ) {
+        if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) {
             throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler');
         }
 
         $uri = $this->resolveHost($request, $options);
 
-        $context = $this->createResource(
-            function () use ($context, $params) {
-                return stream_context_create($context, $params);
+        $contextResource = $this->createResource(
+            static function () use ($context, $params) {
+                return \stream_context_create($context, $params);
             }
         );
 
         return $this->createResource(
-            function () use ($uri, &$http_response_header, $context, $options) {
-                $resource = fopen((string) $uri, 'r', null, $context);
+            function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
+                $resource = \fopen((string) $uri, 'r', false, $contextResource);
                 $this->lastHeaders = $http_response_header;
 
+                if (false === $resource) {
+                    throw new ConnectException(
+                        sprintf('Connection refused for URI %s', $uri),
+                        $request,
+                        null,
+                        $context
+                    );
+                }
+
                 if (isset($options['read_timeout'])) {
                     $readTimeout = $options['read_timeout'];
                     $sec = (int) $readTimeout;
                     $usec = ($readTimeout - $sec) * 100000;
-                    stream_set_timeout($resource, $sec, $usec);
+                    \stream_set_timeout($resource, $sec, $usec);
                 }
 
                 return $resource;
@@ -335,42 +353,43 @@ class StreamHandler
         );
     }
 
-    private function resolveHost(RequestInterface $request, array $options)
+    private function resolveHost(RequestInterface $request, array $options): UriInterface
     {
         $uri = $request->getUri();
 
-        if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) {
+        if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) {
             if ('v4' === $options['force_ip_resolve']) {
-                $records = dns_get_record($uri->getHost(), DNS_A);
-                if (!isset($records[0]['ip'])) {
+                $records = \dns_get_record($uri->getHost(), \DNS_A);
+                if (false === $records || !isset($records[0]['ip'])) {
                     throw new ConnectException(
-                        sprintf(
+                        \sprintf(
                             "Could not resolve IPv4 address for host '%s'",
                             $uri->getHost()
                         ),
                         $request
                     );
                 }
-                $uri = $uri->withHost($records[0]['ip']);
-            } elseif ('v6' === $options['force_ip_resolve']) {
-                $records = dns_get_record($uri->getHost(), DNS_AAAA);
-                if (!isset($records[0]['ipv6'])) {
+                return $uri->withHost($records[0]['ip']);
+            }
+            if ('v6' === $options['force_ip_resolve']) {
+                $records = \dns_get_record($uri->getHost(), \DNS_AAAA);
+                if (false === $records || !isset($records[0]['ipv6'])) {
                     throw new ConnectException(
-                        sprintf(
+                        \sprintf(
                             "Could not resolve IPv6 address for host '%s'",
                             $uri->getHost()
                         ),
                         $request
                     );
                 }
-                $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']');
+                return $uri->withHost('[' . $records[0]['ipv6'] . ']');
             }
         }
 
         return $uri;
     }
 
-    private function getDefaultContext(RequestInterface $request)
+    private function getDefaultContext(RequestInterface $request): array
     {
         $headers = '';
         foreach ($request->getHeaders() as $name => $value) {
@@ -399,20 +418,23 @@ class StreamHandler
             }
         }
 
-        $context['http']['header'] = rtrim($context['http']['header']);
+        $context['http']['header'] = \rtrim($context['http']['header']);
 
         return $context;
     }
 
-    private function add_proxy(RequestInterface $request, &$options, $value, &$params)
+    /**
+     * @param mixed $value as passed via Request transfer options.
+     */
+    private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void
     {
-        if (!is_array($value)) {
+        if (!\is_array($value)) {
             $options['http']['proxy'] = $value;
         } else {
             $scheme = $request->getUri()->getScheme();
             if (isset($value[$scheme])) {
                 if (!isset($value['no'])
-                    || !\GuzzleHttp\is_host_in_noproxy(
+                    || !Utils::isHostInNoProxy(
                         $request->getUri()->getHost(),
                         $value['no']
                     )
@@ -423,31 +445,34 @@ class StreamHandler
         }
     }
 
-    private function add_timeout(RequestInterface $request, &$options, $value, &$params)
+    /**
+     * @param mixed $value as passed via Request transfer options.
+     */
+    private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void
     {
         if ($value > 0) {
             $options['http']['timeout'] = $value;
         }
     }
 
-    private function add_verify(RequestInterface $request, &$options, $value, &$params)
+    /**
+     * @param mixed $value as passed via Request transfer options.
+     */
+    private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void
     {
-        if ($value === true) {
-            // PHP 5.6 or greater will find the system cert by default. When
-            // < 5.6, use the Guzzle bundled cacert.
-            if (PHP_VERSION_ID < 50600) {
-                $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle();
-            }
-        } elseif (is_string($value)) {
-            $options['ssl']['cafile'] = $value;
-            if (!file_exists($value)) {
-                throw new \RuntimeException("SSL CA bundle not found: $value");
-            }
-        } elseif ($value === false) {
+        if ($value === false) {
             $options['ssl']['verify_peer'] = false;
             $options['ssl']['verify_peer_name'] = false;
+
             return;
-        } else {
+        }
+
+        if (\is_string($value)) {
+            $options['ssl']['cafile'] = $value;
+            if (!\file_exists($value)) {
+                throw new \RuntimeException("SSL CA bundle not found: $value");
+            }
+        } elseif ($value !== true) {
             throw new \InvalidArgumentException('Invalid verify request option');
         }
 
@@ -456,88 +481,94 @@ class StreamHandler
         $options['ssl']['allow_self_signed'] = false;
     }
 
-    private function add_cert(RequestInterface $request, &$options, $value, &$params)
+    /**
+     * @param mixed $value as passed via Request transfer options.
+     */
+    private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void
     {
-        if (is_array($value)) {
+        if (\is_array($value)) {
             $options['ssl']['passphrase'] = $value[1];
             $value = $value[0];
         }
 
-        if (!file_exists($value)) {
+        if (!\file_exists($value)) {
             throw new \RuntimeException("SSL certificate not found: {$value}");
         }
 
         $options['ssl']['local_cert'] = $value;
     }
 
-    private function add_progress(RequestInterface $request, &$options, $value, &$params)
+    /**
+     * @param mixed $value as passed via Request transfer options.
+     */
+    private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void
     {
-        $this->addNotification(
+        self::addNotification(
             $params,
-            function ($code, $a, $b, $c, $transferred, $total) use ($value) {
-                if ($code == STREAM_NOTIFY_PROGRESS) {
+            static function ($code, $a, $b, $c, $transferred, $total) use ($value) {
+                if ($code == \STREAM_NOTIFY_PROGRESS) {
                     $value($total, $transferred, null, null);
                 }
             }
         );
     }
 
-    private function add_debug(RequestInterface $request, &$options, $value, &$params)
+    /**
+     * @param mixed $value as passed via Request transfer options.
+     */
+    private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void
     {
         if ($value === false) {
             return;
         }
 
         static $map = [
-            STREAM_NOTIFY_CONNECT       => 'CONNECT',
-            STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
-            STREAM_NOTIFY_AUTH_RESULT   => 'AUTH_RESULT',
-            STREAM_NOTIFY_MIME_TYPE_IS  => 'MIME_TYPE_IS',
-            STREAM_NOTIFY_FILE_SIZE_IS  => 'FILE_SIZE_IS',
-            STREAM_NOTIFY_REDIRECTED    => 'REDIRECTED',
-            STREAM_NOTIFY_PROGRESS      => 'PROGRESS',
-            STREAM_NOTIFY_FAILURE       => 'FAILURE',
-            STREAM_NOTIFY_COMPLETED     => 'COMPLETED',
-            STREAM_NOTIFY_RESOLVE       => 'RESOLVE',
+            \STREAM_NOTIFY_CONNECT       => 'CONNECT',
+            \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
+            \STREAM_NOTIFY_AUTH_RESULT   => 'AUTH_RESULT',
+            \STREAM_NOTIFY_MIME_TYPE_IS  => 'MIME_TYPE_IS',
+            \STREAM_NOTIFY_FILE_SIZE_IS  => 'FILE_SIZE_IS',
+            \STREAM_NOTIFY_REDIRECTED    => 'REDIRECTED',
+            \STREAM_NOTIFY_PROGRESS      => 'PROGRESS',
+            \STREAM_NOTIFY_FAILURE       => 'FAILURE',
+            \STREAM_NOTIFY_COMPLETED     => 'COMPLETED',
+            \STREAM_NOTIFY_RESOLVE       => 'RESOLVE',
         ];
         static $args = ['severity', 'message', 'message_code',
             'bytes_transferred', 'bytes_max'];
 
-        $value = \GuzzleHttp\debug_resource($value);
+        $value = Utils::debugResource($value);
         $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
-        $this->addNotification(
+        self::addNotification(
             $params,
-            function () use ($ident, $value, $map, $args) {
-                $passed = func_get_args();
-                $code = array_shift($passed);
-                fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
-                foreach (array_filter($passed) as $i => $v) {
-                    fwrite($value, $args[$i] . ': "' . $v . '" ');
+            static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
+                \fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
+                foreach (\array_filter($passed) as $i => $v) {
+                    \fwrite($value, $args[$i] . ': "' . $v . '" ');
                 }
-                fwrite($value, "\n");
+                \fwrite($value, "\n");
             }
         );
     }
 
-    private function addNotification(array &$params, callable $notify)
+    private static function addNotification(array &$params, callable $notify): void
     {
         // Wrap the existing function if needed.
         if (!isset($params['notification'])) {
             $params['notification'] = $notify;
         } else {
-            $params['notification'] = $this->callArray([
+            $params['notification'] = self::callArray([
                 $params['notification'],
                 $notify
             ]);
         }
     }
 
-    private function callArray(array $functions)
+    private static function callArray(array $functions): callable
     {
-        return function () use ($functions) {
-            $args = func_get_args();
+        return static function (...$args) use ($functions) {
             foreach ($functions as $fn) {
-                call_user_func_array($fn, $args);
+                $fn(...$args);
             }
         };
     }

+ 66 - 72
api/vendor/guzzlehttp/guzzle/src/HandlerStack.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Promise\PromiseInterface;
@@ -8,16 +9,24 @@ use Psr\Http\Message\ResponseInterface;
 /**
  * Creates a composed Guzzle handler function by stacking middlewares on top of
  * an HTTP handler function.
+ *
+ * @final
  */
 class HandlerStack
 {
-    /** @var callable|null */
+    /**
+     * @var null|callable(RequestInterface, array): PromiseInterface
+     */
     private $handler;
 
-    /** @var array */
+    /**
+     * @var array{(callable(callable(RequestInterface, array): PromiseInterface): callable), (string|null)}[]
+     */
     private $stack = [];
 
-    /** @var callable|null */
+    /**
+     * @var null|callable(RequestInterface, array): PromiseInterface
+     */
     private $cached;
 
     /**
@@ -31,15 +40,13 @@ class HandlerStack
      * The returned handler stack can be passed to a client in the "handler"
      * option.
      *
-     * @param callable $handler HTTP handler function to use with the stack. If no
-     *                          handler is provided, the best handler for your
-     *                          system will be utilized.
-     *
-     * @return HandlerStack
+     * @param null|callable(RequestInterface, array): PromiseInterface $handler HTTP handler function to use with the stack. If no
+     *                                                                          handler is provided, the best handler for your
+     *                                                                          system will be utilized.
      */
-    public static function create(callable $handler = null)
+    public static function create(?callable $handler = null): self
     {
-        $stack = new self($handler ?: choose_handler());
+        $stack = new self($handler ?: Utils::chooseHandler());
         $stack->push(Middleware::httpErrors(), 'http_errors');
         $stack->push(Middleware::redirect(), 'allow_redirects');
         $stack->push(Middleware::cookies(), 'cookies');
@@ -49,7 +56,7 @@ class HandlerStack
     }
 
     /**
-     * @param callable $handler Underlying HTTP handler.
+     * @param null|callable(RequestInterface, array): PromiseInterface $handler Underlying HTTP handler.
      */
     public function __construct(callable $handler = null)
     {
@@ -59,9 +66,6 @@ class HandlerStack
     /**
      * Invokes the handler stack as a composed handler
      *
-     * @param RequestInterface $request
-     * @param array            $options
-     *
      * @return ResponseInterface|PromiseInterface
      */
     public function __invoke(RequestInterface $request, array $options)
@@ -80,12 +84,13 @@ class HandlerStack
     {
         $depth = 0;
         $stack = [];
-        if ($this->handler) {
+
+        if ($this->handler !== null) {
             $stack[] = "0) Handler: " . $this->debugCallable($this->handler);
         }
 
         $result = '';
-        foreach (array_reverse($this->stack) as $tuple) {
+        foreach (\array_reverse($this->stack) as $tuple) {
             $depth++;
             $str = "{$depth}) Name: '{$tuple[1]}', ";
             $str .= "Function: " . $this->debugCallable($tuple[0]);
@@ -93,7 +98,7 @@ class HandlerStack
             $stack[] = $str;
         }
 
-        foreach (array_keys($stack) as $k) {
+        foreach (\array_keys($stack) as $k) {
             $result .= "< {$stack[$k]}\n";
         }
 
@@ -103,10 +108,10 @@ class HandlerStack
     /**
      * Set the HTTP handler that actually returns a promise.
      *
-     * @param callable $handler Accepts a request and array of options and
-     *                          returns a Promise.
+     * @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and
+     *                                                                     returns a Promise.
      */
-    public function setHandler(callable $handler)
+    public function setHandler(callable $handler): void
     {
         $this->handler = $handler;
         $this->cached = null;
@@ -114,33 +119,31 @@ class HandlerStack
 
     /**
      * Returns true if the builder has a handler.
-     *
-     * @return bool
      */
-    public function hasHandler()
+    public function hasHandler(): bool
     {
-        return (bool) $this->handler;
+        return $this->handler !== null ;
     }
 
     /**
      * Unshift a middleware to the bottom of the stack.
      *
-     * @param callable $middleware Middleware function
-     * @param string   $name       Name to register for this middleware.
+     * @param callable(callable): callable $middleware Middleware function
+     * @param string                       $name       Name to register for this middleware.
      */
-    public function unshift(callable $middleware, $name = null)
+    public function unshift(callable $middleware, ?string $name = null): void
     {
-        array_unshift($this->stack, [$middleware, $name]);
+        \array_unshift($this->stack, [$middleware, $name]);
         $this->cached = null;
     }
 
     /**
      * Push a middleware to the top of the stack.
      *
-     * @param callable $middleware Middleware function
-     * @param string   $name       Name to register for this middleware.
+     * @param callable(callable): callable $middleware Middleware function
+     * @param string                       $name       Name to register for this middleware.
      */
-    public function push(callable $middleware, $name = '')
+    public function push(callable $middleware, string $name = ''): void
     {
         $this->stack[] = [$middleware, $name];
         $this->cached = null;
@@ -149,11 +152,11 @@ class HandlerStack
     /**
      * Add a middleware before another middleware by name.
      *
-     * @param string   $findName   Middleware to find
-     * @param callable $middleware Middleware function
-     * @param string   $withName   Name to register for this middleware.
+     * @param string                       $findName   Middleware to find
+     * @param callable(callable): callable $middleware Middleware function
+     * @param string                       $withName   Name to register for this middleware.
      */
-    public function before($findName, callable $middleware, $withName = '')
+    public function before(string $findName, callable $middleware, string $withName = ''): void
     {
         $this->splice($findName, $withName, $middleware, true);
     }
@@ -161,11 +164,11 @@ class HandlerStack
     /**
      * Add a middleware after another middleware by name.
      *
-     * @param string   $findName   Middleware to find
-     * @param callable $middleware Middleware function
-     * @param string   $withName   Name to register for this middleware.
+     * @param string                       $findName   Middleware to find
+     * @param callable(callable): callable $middleware Middleware function
+     * @param string                       $withName   Name to register for this middleware.
      */
-    public function after($findName, callable $middleware, $withName = '')
+    public function after(string $findName, callable $middleware, string $withName = ''): void
     {
         $this->splice($findName, $withName, $middleware, false);
     }
@@ -175,13 +178,13 @@ class HandlerStack
      *
      * @param callable|string $remove Middleware to remove by instance or name.
      */
-    public function remove($remove)
+    public function remove($remove): void
     {
         $this->cached = null;
-        $idx = is_callable($remove) ? 0 : 1;
-        $this->stack = array_values(array_filter(
+        $idx = \is_callable($remove) ? 0 : 1;
+        $this->stack = \array_values(\array_filter(
             $this->stack,
-            function ($tuple) use ($idx, $remove) {
+            static function ($tuple) use ($idx, $remove) {
                 return $tuple[$idx] !== $remove;
             }
         ));
@@ -190,16 +193,17 @@ class HandlerStack
     /**
      * Compose the middleware and handler into a single callable function.
      *
-     * @return callable
+     * @return callable(RequestInterface, array): PromiseInterface
      */
-    public function resolve()
+    public function resolve(): callable
     {
-        if (!$this->cached) {
-            if (!($prev = $this->handler)) {
+        if ($this->cached === null) {
+            if (($prev = $this->handler) === null) {
                 throw new \LogicException('No handler has been specified');
             }
 
-            foreach (array_reverse($this->stack) as $fn) {
+            foreach (\array_reverse($this->stack) as $fn) {
+                /** @var callable(RequestInterface, array): PromiseInterface $prev */
                 $prev = $fn[0]($prev);
             }
 
@@ -209,11 +213,7 @@ class HandlerStack
         return $this->cached;
     }
 
-    /**
-     * @param string $name
-     * @return int
-     */
-    private function findByName($name)
+    private function findByName(string $name): int
     {
         foreach ($this->stack as $k => $v) {
             if ($v[1] === $name) {
@@ -226,13 +226,8 @@ class HandlerStack
 
     /**
      * Splices a function into the middleware list at a specific position.
-     *
-     * @param string   $findName
-     * @param string   $withName
-     * @param callable $middleware
-     * @param bool     $before
      */
-    private function splice($findName, $withName, callable $middleware, $before)
+    private function splice(string $findName, string $withName, callable $middleware, bool $before): void
     {
         $this->cached = null;
         $idx = $this->findByName($findName);
@@ -240,38 +235,37 @@ class HandlerStack
 
         if ($before) {
             if ($idx === 0) {
-                array_unshift($this->stack, $tuple);
+                \array_unshift($this->stack, $tuple);
             } else {
                 $replacement = [$tuple, $this->stack[$idx]];
-                array_splice($this->stack, $idx, 1, $replacement);
+                \array_splice($this->stack, $idx, 1, $replacement);
             }
-        } elseif ($idx === count($this->stack) - 1) {
+        } elseif ($idx === \count($this->stack) - 1) {
             $this->stack[] = $tuple;
         } else {
             $replacement = [$this->stack[$idx], $tuple];
-            array_splice($this->stack, $idx, 1, $replacement);
+            \array_splice($this->stack, $idx, 1, $replacement);
         }
     }
 
     /**
      * Provides a debug string for a given callable.
      *
-     * @param array|callable $fn Function to write as a string.
-     *
-     * @return string
+     * @param callable $fn Function to write as a string.
      */
-    private function debugCallable($fn)
+    private function debugCallable($fn): string
     {
-        if (is_string($fn)) {
+        if (\is_string($fn)) {
             return "callable({$fn})";
         }
 
-        if (is_array($fn)) {
-            return is_string($fn[0])
+        if (\is_array($fn)) {
+            return \is_string($fn[0])
                 ? "callable({$fn[0]}::{$fn[1]})"
-                : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])";
+                : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
         }
 
-        return 'callable(' . spl_object_hash($fn) . ')';
+        /** @var object $fn */
+        return 'callable(' . \spl_object_hash($fn) . ')';
     }
 }

+ 48 - 32
api/vendor/guzzlehttp/guzzle/src/MessageFormatter.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp;
 
 use Psr\Http\Message\MessageInterface;
@@ -31,25 +32,31 @@ use Psr\Http\Message\ResponseInterface;
  * - {res_headers}:    Response headers
  * - {req_body}:       Request body
  * - {res_body}:       Response body
+ *
+ * @final
  */
-class MessageFormatter
+class MessageFormatter implements MessageFormatterInterface
 {
     /**
      * Apache Common Log Format.
-     * @link http://httpd.apache.org/docs/2.4/logs.html#common
+     *
+     * @link https://httpd.apache.org/docs/2.4/logs.html#common
+     *
      * @var string
      */
-    const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
-    const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
-    const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
+    public const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
+    public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
+    public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
 
-    /** @var string Template used to format log messages */
+    /**
+     * @var string Template used to format log messages
+     */
     private $template;
 
     /**
      * @param string $template Log message template
      */
-    public function __construct($template = self::CLF)
+    public function __construct(?string $template = self::CLF)
     {
         $this->template = $template ?: self::CLF;
     }
@@ -57,20 +64,19 @@ class MessageFormatter
     /**
      * Returns a formatted message string.
      *
-     * @param RequestInterface  $request  Request that was sent
-     * @param ResponseInterface $response Response that was received
-     * @param \Exception        $error    Exception that was received
-     *
-     * @return string
+     * @param RequestInterface       $request  Request that was sent
+     * @param ResponseInterface|null $response Response that was received
+     * @param \Throwable|null        $error    Exception that was received
      */
     public function format(
         RequestInterface $request,
-        ResponseInterface $response = null,
-        \Exception $error = null
-    ) {
+        ?ResponseInterface $response = null,
+        ?\Throwable $error = null
+    ): string {
         $cache = [];
 
-        return preg_replace_callback(
+        /** @var string */
+        return \preg_replace_callback(
             '/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
             function (array $matches) use ($request, $response, $error, &$cache) {
                 if (isset($cache[$matches[1]])) {
@@ -86,14 +92,14 @@ class MessageFormatter
                         $result = $response ? Psr7\str($response) : '';
                         break;
                     case 'req_headers':
-                        $result = trim($request->getMethod()
+                        $result = \trim($request->getMethod()
                                 . ' ' . $request->getRequestTarget())
                             . ' HTTP/' . $request->getProtocolVersion() . "\r\n"
                             . $this->headers($request);
                         break;
                     case 'res_headers':
                         $result = $response ?
-                            sprintf(
+                            \sprintf(
                                 'HTTP/%s %d %s',
                                 $response->getProtocolVersion(),
                                 $response->getStatusCode(),
@@ -102,17 +108,29 @@ class MessageFormatter
                             : 'NULL';
                         break;
                     case 'req_body':
-                        $result = $request->getBody();
+                        $result = $request->getBody()->__toString();
                         break;
                     case 'res_body':
-                        $result = $response ? $response->getBody() : 'NULL';
+                        if (!$response instanceof ResponseInterface) {
+                            $result = 'NULL';
+                            break;
+                        }
+
+                        $body = $response->getBody();
+
+                        if (!$body->isSeekable()) {
+                            $result = 'RESPONSE_NOT_LOGGEABLE';
+                            break;
+                        }
+
+                        $result = $response->getBody()->__toString();
                         break;
                     case 'ts':
                     case 'date_iso_8601':
-                        $result = gmdate('c');
+                        $result = \gmdate('c');
                         break;
                     case 'date_common_log':
-                        $result = date('d/M/Y:H:i:s O');
+                        $result = \date('d/M/Y:H:i:s O');
                         break;
                     case 'method':
                         $result = $request->getMethod();
@@ -139,7 +157,7 @@ class MessageFormatter
                         $result = $request->getHeaderLine('Host');
                         break;
                     case 'hostname':
-                        $result = gethostname();
+                        $result = \gethostname();
                         break;
                     case 'code':
                         $result = $response ? $response->getStatusCode() : 'NULL';
@@ -152,11 +170,11 @@ class MessageFormatter
                         break;
                     default:
                         // handle prefixed dynamic headers
-                        if (strpos($matches[1], 'req_header_') === 0) {
-                            $result = $request->getHeaderLine(substr($matches[1], 11));
-                        } elseif (strpos($matches[1], 'res_header_') === 0) {
+                        if (\strpos($matches[1], 'req_header_') === 0) {
+                            $result = $request->getHeaderLine(\substr($matches[1], 11));
+                        } elseif (\strpos($matches[1], 'res_header_') === 0) {
                             $result = $response
-                                ? $response->getHeaderLine(substr($matches[1], 11))
+                                ? $response->getHeaderLine(\substr($matches[1], 11))
                                 : 'NULL';
                         }
                 }
@@ -170,16 +188,14 @@ class MessageFormatter
 
     /**
      * Get headers from message as string
-     *
-     * @return string
      */
-    private function headers(MessageInterface $message)
+    private function headers(MessageInterface $message): string
     {
         $result = '';
         foreach ($message->getHeaders() as $name => $values) {
-            $result .= $name . ': ' . implode(', ', $values) . "\r\n";
+            $result .= $name . ': ' . \implode(', ', $values) . "\r\n";
         }
 
-        return trim($result);
+        return \trim($result);
     }
 }

+ 22 - 0
api/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace GuzzleHttp;
+
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+
+interface MessageFormatterInterface
+{
+    /**
+     * Returns a formatted message string.
+     *
+     * @param RequestInterface       $request  Request that was sent
+     * @param ResponseInterface|null $response Response that was received
+     * @param \Throwable|null        $error    Exception that was received
+     */
+    public function format(
+        RequestInterface $request,
+        ?ResponseInterface $response = null,
+        ?\Throwable $error = null
+    ): string;
+}

+ 53 - 48
api/vendor/guzzlehttp/guzzle/src/Middleware.php

@@ -1,10 +1,11 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Cookie\CookieJarInterface;
 use GuzzleHttp\Exception\RequestException;
-use GuzzleHttp\Promise\RejectedPromise;
-use GuzzleHttp\Psr7;
+use GuzzleHttp\Promise\PromiseInterface;
+use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Log\LoggerInterface;
 
@@ -21,10 +22,10 @@ final class Middleware
      *
      * @return callable Returns a function that accepts the next handler.
      */
-    public static function cookies()
+    public static function cookies(): callable
     {
-        return function (callable $handler) {
-            return function ($request, array $options) use ($handler) {
+        return static function (callable $handler): callable {
+            return static function ($request, array $options) use ($handler) {
                 if (empty($options['cookies'])) {
                     return $handler($request, $options);
                 } elseif (!($options['cookies'] instanceof CookieJarInterface)) {
@@ -34,7 +35,7 @@ final class Middleware
                 $request = $cookieJar->withCookieHeader($request);
                 return $handler($request, $options)
                     ->then(
-                        function ($response) use ($cookieJar, $request) {
+                        static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
                             $cookieJar->extractCookies($request, $response);
                             return $response;
                         }
@@ -47,17 +48,17 @@ final class Middleware
      * Middleware that throws exceptions for 4xx or 5xx responses when the
      * "http_error" request option is set to true.
      *
-     * @return callable Returns a function that accepts the next handler.
+     * @return callable(callable): callable Returns a function that accepts the next handler.
      */
-    public static function httpErrors()
+    public static function httpErrors(): callable
     {
-        return function (callable $handler) {
-            return function ($request, array $options) use ($handler) {
+        return static function (callable $handler): callable {
+            return static function ($request, array $options) use ($handler) {
                 if (empty($options['http_errors'])) {
                     return $handler($request, $options);
                 }
                 return $handler($request, $options)->then(
-                    function (ResponseInterface $response) use ($request) {
+                    static function (ResponseInterface $response) use ($request) {
                         $code = $response->getStatusCode();
                         if ($code < 400) {
                             return $response;
@@ -72,21 +73,22 @@ final class Middleware
     /**
      * Middleware that pushes history data to an ArrayAccess container.
      *
-     * @param array|\ArrayAccess $container Container to hold the history (by reference).
+     * @param array|\ArrayAccess<int, array> $container Container to hold the history (by reference).
+     *
+     * @return callable(callable): callable Returns a function that accepts the next handler.
      *
-     * @return callable Returns a function that accepts the next handler.
      * @throws \InvalidArgumentException if container is not an array or ArrayAccess.
      */
-    public static function history(&$container)
+    public static function history(&$container): callable
     {
-        if (!is_array($container) && !$container instanceof \ArrayAccess) {
+        if (!\is_array($container) && !$container instanceof \ArrayAccess) {
             throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
         }
 
-        return function (callable $handler) use (&$container) {
-            return function ($request, array $options) use ($handler, &$container) {
+        return static function (callable $handler) use (&$container): callable {
+            return static function (RequestInterface $request, array $options) use ($handler, &$container) {
                 return $handler($request, $options)->then(
-                    function ($value) use ($request, &$container, $options) {
+                    static function ($value) use ($request, &$container, $options) {
                         $container[] = [
                             'request'  => $request,
                             'response' => $value,
@@ -95,7 +97,7 @@ final class Middleware
                         ];
                         return $value;
                     },
-                    function ($reason) use ($request, &$container, $options) {
+                    static function ($reason) use ($request, &$container, $options) {
                         $container[] = [
                             'request'  => $request,
                             'response' => null,
@@ -122,10 +124,10 @@ final class Middleware
      *
      * @return callable Returns a function that accepts the next handler.
      */
-    public static function tap(callable $before = null, callable $after = null)
+    public static function tap(callable $before = null, callable $after = null): callable
     {
-        return function (callable $handler) use ($before, $after) {
-            return function ($request, array $options) use ($handler, $before, $after) {
+        return static function (callable $handler) use ($before, $after): callable {
+            return static function (RequestInterface $request, array $options) use ($handler, $before, $after) {
                 if ($before) {
                     $before($request, $options);
                 }
@@ -143,9 +145,9 @@ final class Middleware
      *
      * @return callable Returns a function that accepts the next handler.
      */
-    public static function redirect()
+    public static function redirect(): callable
     {
-        return function (callable $handler) {
+        return static function (callable $handler): RedirectMiddleware {
             return new RedirectMiddleware($handler);
         };
     }
@@ -165,9 +167,9 @@ final class Middleware
      *
      * @return callable Returns a function that accepts the next handler.
      */
-    public static function retry(callable $decider, callable $delay = null)
+    public static function retry(callable $decider, callable $delay = null): callable
     {
-        return function (callable $handler) use ($decider, $delay) {
+        return static function (callable $handler) use ($decider, $delay): RetryMiddleware {
             return new RetryMiddleware($decider, $handler, $delay);
         };
     }
@@ -176,28 +178,35 @@ final class Middleware
      * Middleware that logs requests, responses, and errors using a message
      * formatter.
      *
-     * @param LoggerInterface  $logger Logs messages.
-     * @param MessageFormatter $formatter Formatter used to create message strings.
-     * @param string           $logLevel Level at which to log requests.
+     * @phpstan-param \Psr\Log\LogLevel::* $logLevel  Level at which to log requests.
+     *
+     * @param LoggerInterface                            $logger    Logs messages.
+     * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
+     * @param string                                     $logLevel  Level at which to log requests.
      *
      * @return callable Returns a function that accepts the next handler.
      */
-    public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */)
+    public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable
     {
-        return function (callable $handler) use ($logger, $formatter, $logLevel) {
-            return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
+        // To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter
+        if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) {
+            throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class));
+        }
+
+        return static function (callable $handler) use ($logger, $formatter, $logLevel): callable {
+            return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) {
                 return $handler($request, $options)->then(
-                    function ($response) use ($logger, $request, $formatter, $logLevel) {
+                    static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
                         $message = $formatter->format($request, $response);
                         $logger->log($logLevel, $message);
                         return $response;
                     },
-                    function ($reason) use ($logger, $request, $formatter) {
+                    static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
                         $response = $reason instanceof RequestException
                             ? $reason->getResponse()
                             : null;
-                        $message = $formatter->format($request, $response, $reason);
-                        $logger->notice($message);
+                        $message = $formatter->format($request, $response, \GuzzleHttp\Promise\exception_for($reason));
+                        $logger->error($message);
                         return \GuzzleHttp\Promise\rejection_for($reason);
                     }
                 );
@@ -208,12 +217,10 @@ final class Middleware
     /**
      * This middleware adds a default content-type if possible, a default
      * content-length or transfer-encoding header, and the expect header.
-     *
-     * @return callable
      */
-    public static function prepareBody()
+    public static function prepareBody(): callable
     {
-        return function (callable $handler) {
+        return static function (callable $handler): PrepareBodyMiddleware {
             return new PrepareBodyMiddleware($handler);
         };
     }
@@ -224,12 +231,11 @@ final class Middleware
      *
      * @param callable $fn Function that accepts a RequestInterface and returns
      *                     a RequestInterface.
-     * @return callable
      */
-    public static function mapRequest(callable $fn)
+    public static function mapRequest(callable $fn): callable
     {
-        return function (callable $handler) use ($fn) {
-            return function ($request, array $options) use ($handler, $fn) {
+        return static function (callable $handler) use ($fn): callable {
+            return static function (RequestInterface $request, array $options) use ($handler, $fn) {
                 return $handler($fn($request), $options);
             };
         };
@@ -241,12 +247,11 @@ final class Middleware
      *
      * @param callable $fn Function that accepts a ResponseInterface and
      *                     returns a ResponseInterface.
-     * @return callable
      */
-    public static function mapResponse(callable $fn)
+    public static function mapResponse(callable $fn): callable
     {
-        return function (callable $handler) use ($fn) {
-            return function ($request, array $options) use ($handler, $fn) {
+        return static function (callable $handler) use ($fn): callable {
+            return static function (RequestInterface $request, array $options) use ($handler, $fn) {
                 return $handler($request, $options)->then($fn);
             };
         };

+ 21 - 22
api/vendor/guzzlehttp/guzzle/src/Pool.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Promise\EachPromise;
@@ -16,10 +17,14 @@ use Psr\Http\Message\RequestInterface;
  * When a function is yielded by the iterator, the function is provided the
  * "request_options" array that should be merged on top of any existing
  * options, and the function MUST then return a wait-able promise.
+ *
+ * @final
  */
 class Pool implements PromisorInterface
 {
-    /** @var EachPromise */
+    /**
+     * @var EachPromise
+     */
     private $each;
 
     /**
@@ -27,20 +32,17 @@ class Pool implements PromisorInterface
      * @param array|\Iterator $requests Requests or functions that return
      *                                  requests to send concurrently.
      * @param array           $config   Associative array of options
-     *     - concurrency: (int) Maximum number of requests to send concurrently
-     *     - options: Array of request options to apply to each request.
-     *     - fulfilled: (callable) Function to invoke when a request completes.
-     *     - rejected: (callable) Function to invoke when a request is rejected.
+     *                                  - concurrency: (int) Maximum number of requests to send concurrently
+     *                                  - options: Array of request options to apply to each request.
+     *                                  - fulfilled: (callable) Function to invoke when a request completes.
+     *                                  - rejected: (callable) Function to invoke when a request is rejected.
      */
     public function __construct(
         ClientInterface $client,
         $requests,
         array $config = []
     ) {
-        // Backwards compatibility.
-        if (isset($config['pool_size'])) {
-            $config['concurrency'] = $config['pool_size'];
-        } elseif (!isset($config['concurrency'])) {
+        if (!isset($config['concurrency'])) {
             $config['concurrency'] = 25;
         }
 
@@ -52,11 +54,11 @@ class Pool implements PromisorInterface
         }
 
         $iterable = \GuzzleHttp\Promise\iter_for($requests);
-        $requests = function () use ($iterable, $client, $opts) {
+        $requests = static function () use ($iterable, $client, $opts) {
             foreach ($iterable as $key => $rfn) {
                 if ($rfn instanceof RequestInterface) {
                     yield $key => $client->sendAsync($rfn, $opts);
-                } elseif (is_callable($rfn)) {
+                } elseif (\is_callable($rfn)) {
                     yield $key => $rfn($opts);
                 } else {
                     throw new \InvalidArgumentException('Each value yielded by '
@@ -72,10 +74,8 @@ class Pool implements PromisorInterface
 
     /**
      * Get promise
-     *
-     * @return PromiseInterface
      */
-    public function promise()
+    public function promise(): PromiseInterface
     {
         return $this->each->promise();
     }
@@ -91,41 +91,40 @@ class Pool implements PromisorInterface
      * @param ClientInterface $client   Client used to send the requests
      * @param array|\Iterator $requests Requests to send concurrently.
      * @param array           $options  Passes through the options available in
-     *                                  {@see GuzzleHttp\Pool::__construct}
+     *                                  {@see \GuzzleHttp\Pool::__construct}
      *
      * @return array Returns an array containing the response or an exception
      *               in the same order that the requests were sent.
+     *
      * @throws \InvalidArgumentException if the event format is incorrect.
      */
     public static function batch(
         ClientInterface $client,
         $requests,
         array $options = []
-    ) {
+    ): array {
         $res = [];
         self::cmpCallback($options, 'fulfilled', $res);
         self::cmpCallback($options, 'rejected', $res);
         $pool = new static($client, $requests, $options);
         $pool->promise()->wait();
-        ksort($res);
+        \ksort($res);
 
         return $res;
     }
 
     /**
      * Execute callback(s)
-     *
-     * @return void
      */
-    private static function cmpCallback(array &$options, $name, array &$results)
+    private static function cmpCallback(array &$options, string $name, array &$results): void
     {
         if (!isset($options[$name])) {
-            $options[$name] = function ($v, $k) use (&$results) {
+            $options[$name] = static function ($v, $k) use (&$results) {
                 $results[$k] = $v;
             };
         } else {
             $currentFn = $options[$name];
-            $options[$name] = function ($v, $k) use (&$results, $currentFn) {
+            $options[$name] = static function ($v, $k) use (&$results, $currentFn) {
                 $currentFn($v, $k);
                 $results[$k] = $v;
             };

+ 11 - 15
api/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php

@@ -1,34 +1,32 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Promise\PromiseInterface;
-use GuzzleHttp\Psr7;
 use Psr\Http\Message\RequestInterface;
 
 /**
  * Prepares requests that contain a body, adding the Content-Length,
  * Content-Type, and Expect headers.
+ *
+ * @final
  */
 class PrepareBodyMiddleware
 {
-    /** @var callable  */
+    /**
+     * @var callable(RequestInterface, array): PromiseInterface
+     */
     private $nextHandler;
 
     /**
-     * @param callable $nextHandler Next handler to invoke.
+     * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
      */
     public function __construct(callable $nextHandler)
     {
         $this->nextHandler = $nextHandler;
     }
 
-    /**
-     * @param RequestInterface $request
-     * @param array            $options
-     *
-     * @return PromiseInterface
-     */
-    public function __invoke(RequestInterface $request, array $options)
+    public function __invoke(RequestInterface $request, array $options): PromiseInterface
     {
         $fn = $this->nextHandler;
 
@@ -42,7 +40,7 @@ class PrepareBodyMiddleware
         // Add a default content-type if possible.
         if (!$request->hasHeader('Content-Type')) {
             if ($uri = $request->getBody()->getMetadata('uri')) {
-                if ($type = Psr7\mimetype_from_filename($uri)) {
+                if (is_string($uri) && $type = Psr7\mimetype_from_filename($uri)) {
                     $modify['set_headers']['Content-Type'] = $type;
                 }
             }
@@ -68,20 +66,18 @@ class PrepareBodyMiddleware
 
     /**
      * Add expect header
-     *
-     * @return void
      */
     private function addExpectHeader(
         RequestInterface $request,
         array $options,
         array &$modify
-    ) {
+    ): void {
         // Determine if the Expect header should be used
         if ($request->hasHeader('Expect')) {
             return;
         }
 
-        $expect = isset($options['expect']) ? $options['expect'] : null;
+        $expect = $options['expect'] ?? null;
 
         // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
         if ($expect === false || $request->getProtocolVersion() < 1.1) {

+ 35 - 54
api/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php

@@ -1,10 +1,10 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Exception\BadResponseException;
 use GuzzleHttp\Exception\TooManyRedirectsException;
 use GuzzleHttp\Promise\PromiseInterface;
-use GuzzleHttp\Psr7;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\UriInterface;
@@ -14,13 +14,18 @@ use Psr\Http\Message\UriInterface;
  *
  * Apply this middleware like other middleware using
  * {@see \GuzzleHttp\Middleware::redirect()}.
+ *
+ * @final
  */
 class RedirectMiddleware
 {
-    const HISTORY_HEADER = 'X-Guzzle-Redirect-History';
+    public const HISTORY_HEADER = 'X-Guzzle-Redirect-History';
 
-    const STATUS_HISTORY_HEADER = 'X-Guzzle-Redirect-Status-History';
+    public const STATUS_HISTORY_HEADER = 'X-Guzzle-Redirect-Status-History';
 
+    /**
+     * @var array
+     */
     public static $defaultSettings = [
         'max'             => 5,
         'protocols'       => ['http', 'https'],
@@ -29,24 +34,20 @@ class RedirectMiddleware
         'track_redirects' => false,
     ];
 
-    /** @var callable  */
+    /**
+     * @var callable(RequestInterface, array): PromiseInterface
+     */
     private $nextHandler;
 
     /**
-     * @param callable $nextHandler Next handler to invoke.
+     * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
      */
     public function __construct(callable $nextHandler)
     {
         $this->nextHandler = $nextHandler;
     }
 
-    /**
-     * @param RequestInterface $request
-     * @param array            $options
-     *
-     * @return PromiseInterface
-     */
-    public function __invoke(RequestInterface $request, array $options)
+    public function __invoke(RequestInterface $request, array $options): PromiseInterface
     {
         $fn = $this->nextHandler;
 
@@ -56,7 +57,7 @@ class RedirectMiddleware
 
         if ($options['allow_redirects'] === true) {
             $options['allow_redirects'] = self::$defaultSettings;
-        } elseif (!is_array($options['allow_redirects'])) {
+        } elseif (!\is_array($options['allow_redirects'])) {
             throw new \InvalidArgumentException('allow_redirects must be true, false, or array');
         } else {
             // Merge the default settings with the provided settings
@@ -74,10 +75,6 @@ class RedirectMiddleware
     }
 
     /**
-     * @param RequestInterface  $request
-     * @param array             $options
-     * @param ResponseInterface $response
-     *
      * @return ResponseInterface|PromiseInterface
      */
     public function checkRedirect(
@@ -85,7 +82,7 @@ class RedirectMiddleware
         array $options,
         ResponseInterface $response
     ) {
-        if (substr($response->getStatusCode(), 0, 1) != '3'
+        if (\strpos((string) $response->getStatusCode(), '3') !== 0
             || !$response->hasHeader('Location')
         ) {
             return $response;
@@ -95,15 +92,13 @@ class RedirectMiddleware
         $nextRequest = $this->modifyRequest($request, $options, $response);
 
         if (isset($options['allow_redirects']['on_redirect'])) {
-            call_user_func(
-                $options['allow_redirects']['on_redirect'],
+            ($options['allow_redirects']['on_redirect'])(
                 $request,
                 $response,
                 $nextRequest->getUri()
             );
         }
 
-        /** @var PromiseInterface|ResponseInterface $promise */
         $promise = $this($nextRequest, $options);
 
         // Add headers to be able to track history of redirects.
@@ -120,20 +115,19 @@ class RedirectMiddleware
 
     /**
      * Enable tracking on promise.
-     *
-     * @return PromiseInterface
      */
-    private function withTracking(PromiseInterface $promise, $uri, $statusCode)
+    private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface
     {
         return $promise->then(
-            function (ResponseInterface $response) use ($uri, $statusCode) {
+            static function (ResponseInterface $response) use ($uri, $statusCode) {
                 // Note that we are pushing to the front of the list as this
                 // would be an earlier response than what is currently present
                 // in the history header.
                 $historyHeader = $response->getHeader(self::HISTORY_HEADER);
                 $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
-                array_unshift($historyHeader, $uri);
-                array_unshift($statusHeader, $statusCode);
+                \array_unshift($historyHeader, $uri);
+                \array_unshift($statusHeader, (string) $statusCode);
+
                 return $response->withHeader(self::HISTORY_HEADER, $historyHeader)
                                 ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
             }
@@ -143,15 +137,12 @@ class RedirectMiddleware
     /**
      * Check for too many redirects
      *
-     * @return void
-     *
      * @throws TooManyRedirectsException Too many redirects.
      */
-    private function guardMax(RequestInterface $request, array &$options)
+    private function guardMax(RequestInterface $request, array &$options): void
     {
-        $current = isset($options['__redirect_count'])
-            ? $options['__redirect_count']
-            : 0;
+        $current = $options['__redirect_count']
+            ?? 0;
         $options['__redirect_count'] = $current + 1;
         $max = $options['allow_redirects']['max'];
 
@@ -163,18 +154,11 @@ class RedirectMiddleware
         }
     }
 
-    /**
-     * @param RequestInterface  $request
-     * @param array             $options
-     * @param ResponseInterface $response
-     *
-     * @return RequestInterface
-     */
     public function modifyRequest(
         RequestInterface $request,
         array $options,
         ResponseInterface $response
-    ) {
+    ): RequestInterface {
         // Request modifications to apply.
         $modify = [];
         $protocols = $options['allow_redirects']['protocols'];
@@ -186,14 +170,17 @@ class RedirectMiddleware
         if ($statusCode == 303 ||
             ($statusCode <= 302 && !$options['allow_redirects']['strict'])
         ) {
-            $modify['method'] = 'GET';
+            $safeMethods = ['GET', 'HEAD', 'OPTIONS'];
+            $requestMethod = $request->getMethod();
+
+            $modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET';
             $modify['body'] = '';
         }
 
         $uri = $this->redirectUri($request, $response, $protocols);
         if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
-            $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion'];
-            $uri = _idn_uri_convert($uri, $idnOptions);
+            $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion'];
+            $uri = Utils::idnUriConvert($uri, $idnOptions);
         }
 
         $modify['uri'] = $uri;
@@ -220,30 +207,24 @@ class RedirectMiddleware
 
     /**
      * Set the appropriate URL on the request based on the location header
-     *
-     * @param RequestInterface  $request
-     * @param ResponseInterface $response
-     * @param array             $protocols
-     *
-     * @return UriInterface
      */
     private function redirectUri(
         RequestInterface $request,
         ResponseInterface $response,
         array $protocols
-    ) {
+    ): UriInterface {
         $location = Psr7\UriResolver::resolve(
             $request->getUri(),
             new Psr7\Uri($response->getHeaderLine('Location'))
         );
 
         // Ensure that the redirect URI is allowed based on the protocols.
-        if (!in_array($location->getScheme(), $protocols)) {
+        if (!\in_array($location->getScheme(), $protocols)) {
             throw new BadResponseException(
-                sprintf(
+                \sprintf(
                     'Redirect URI, %s, does not use one of the allowed redirect protocols: %s',
                     $location,
-                    implode(', ', $protocols)
+                    \implode(', ', $protocols)
                 ),
                 $request,
                 $response

+ 32 - 31
api/vendor/guzzlehttp/guzzle/src/RequestOptions.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp;
 
 /**
@@ -31,7 +32,7 @@ final class RequestOptions
      *   response that was received, and the effective URI. Any return value
      *   from the on_redirect function is ignored.
      */
-    const ALLOW_REDIRECTS = 'allow_redirects';
+    public const ALLOW_REDIRECTS = 'allow_redirects';
 
     /**
      * auth: (array) Pass an array of HTTP authentication parameters to use
@@ -40,13 +41,13 @@ final class RequestOptions
      * authentication type in index [2]. Pass null to disable authentication
      * for a request.
      */
-    const AUTH = 'auth';
+    public const AUTH = 'auth';
 
     /**
      * body: (resource|string|null|int|float|StreamInterface|callable|\Iterator)
      * Body to send in the request.
      */
-    const BODY = 'body';
+    public const BODY = 'body';
 
     /**
      * cert: (string|array) Set to a string to specify the path to a file
@@ -55,42 +56,42 @@ final class RequestOptions
      * file in the first array element followed by the certificate password
      * in the second array element.
      */
-    const CERT = 'cert';
+    public const CERT = 'cert';
 
     /**
      * cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false)
      * Specifies whether or not cookies are used in a request or what cookie
      * jar to use or what cookies to send. This option only works if your
      * handler has the `cookie` middleware. Valid values are `false` and
-     * an instance of {@see GuzzleHttp\Cookie\CookieJarInterface}.
+     * an instance of {@see \GuzzleHttp\Cookie\CookieJarInterface}.
      */
-    const COOKIES = 'cookies';
+    public const COOKIES = 'cookies';
 
     /**
      * connect_timeout: (float, default=0) Float describing the number of
      * seconds to wait while trying to connect to a server. Use 0 to wait
      * indefinitely (the default behavior).
      */
-    const CONNECT_TIMEOUT = 'connect_timeout';
+    public const CONNECT_TIMEOUT = 'connect_timeout';
 
     /**
      * debug: (bool|resource) Set to true or set to a PHP stream returned by
      * fopen()  enable debug output with the HTTP handler used to send a
      * request.
      */
-    const DEBUG = 'debug';
+    public const DEBUG = 'debug';
 
     /**
      * decode_content: (bool, default=true) Specify whether or not
      * Content-Encoding responses (gzip, deflate, etc.) are automatically
      * decoded.
      */
-    const DECODE_CONTENT = 'decode_content';
+    public const DECODE_CONTENT = 'decode_content';
 
     /**
      * delay: (int) The amount of time to delay before sending in milliseconds.
      */
-    const DELAY = 'delay';
+    public const DELAY = 'delay';
 
     /**
      * expect: (bool|integer) Controls the behavior of the
@@ -108,7 +109,7 @@ final class RequestOptions
      * size of the body of a request is greater than 1 MB and a request is
      * using HTTP/1.1.
      */
-    const EXPECT = 'expect';
+    public const EXPECT = 'expect';
 
     /**
      * form_params: (array) Associative array of form field names to values
@@ -116,13 +117,13 @@ final class RequestOptions
      * header to application/x-www-form-urlencoded when no Content-Type header
      * is already present.
      */
-    const FORM_PARAMS = 'form_params';
+    public const FORM_PARAMS = 'form_params';
 
     /**
      * headers: (array) Associative array of HTTP headers. Each value MUST be
      * a string or array of strings.
      */
-    const HEADERS = 'headers';
+    public const HEADERS = 'headers';
 
     /**
      * http_errors: (bool, default=true) Set to false to disable exceptions
@@ -130,7 +131,7 @@ final class RequestOptions
      * exceptions will be thrown for 4xx and 5xx responses. This option only
      * works if your handler has the `httpErrors` middleware.
      */
-    const HTTP_ERRORS = 'http_errors';
+    public const HTTP_ERRORS = 'http_errors';
 
     /**
      * idn: (bool|int, default=true) A combination of IDNA_* constants for
@@ -138,14 +139,14 @@ final class RequestOptions
      * disable IDN support completely, or to true to use the default
      * configuration (IDNA_DEFAULT constant).
      */
-    const IDN_CONVERSION = 'idn_conversion';
+    public const IDN_CONVERSION = 'idn_conversion';
 
     /**
      * json: (mixed) Adds JSON data to a request. The provided value is JSON
      * encoded and a Content-Type header of application/json will be added to
      * the request if no Content-Type header is already present.
      */
-    const JSON = 'json';
+    public const JSON = 'json';
 
     /**
      * multipart: (array) Array of associative arrays, each containing a
@@ -156,14 +157,14 @@ final class RequestOptions
      * the part. If no "filename" key is present, then no "filename" attribute
      * will be added to the part.
      */
-    const MULTIPART = 'multipart';
+    public const MULTIPART = 'multipart';
 
     /**
      * on_headers: (callable) A callable that is invoked when the HTTP headers
      * of the response have been received but the body has not yet begun to
      * download.
      */
-    const ON_HEADERS = 'on_headers';
+    public const ON_HEADERS = 'on_headers';
 
     /**
      * on_stats: (callable) allows you to get access to transfer statistics of
@@ -174,7 +175,7 @@ final class RequestOptions
      * the error encountered. Included in the data is the total amount of time
      * taken to send the request.
      */
-    const ON_STATS = 'on_stats';
+    public const ON_STATS = 'on_stats';
 
     /**
      * progress: (callable) Defines a function to invoke when transfer
@@ -183,14 +184,14 @@ final class RequestOptions
      * number of bytes downloaded so far, the number of bytes expected to be
      * uploaded, the number of bytes uploaded so far.
      */
-    const PROGRESS = 'progress';
+    public const PROGRESS = 'progress';
 
     /**
      * proxy: (string|array) Pass a string to specify an HTTP proxy, or an
      * array to specify different proxies for different protocols (where the
      * key is the protocol and the value is a proxy string).
      */
-    const PROXY = 'proxy';
+    public const PROXY = 'proxy';
 
     /**
      * query: (array|string) Associative array of query string values to add
@@ -198,14 +199,14 @@ final class RequestOptions
      * the string representation. Pass a string value if you need more
      * control than what this method provides
      */
-    const QUERY = 'query';
+    public const QUERY = 'query';
 
     /**
      * sink: (resource|string|StreamInterface) Where the data of the
      * response is written to. Defaults to a PHP temp stream. Providing a
      * string will write data to a file by the given name.
      */
-    const SINK = 'sink';
+    public const SINK = 'sink';
 
     /**
      * synchronous: (bool) Set to true to inform HTTP handlers that you intend
@@ -213,7 +214,7 @@ final class RequestOptions
      * that a promise is still returned if you are using one of the async
      * client methods.
      */
-    const SYNCHRONOUS = 'synchronous';
+    public const SYNCHRONOUS = 'synchronous';
 
     /**
      * ssl_key: (array|string) Specify the path to a file containing a private
@@ -221,13 +222,13 @@ final class RequestOptions
      * containing the path to the SSL key in the first array element followed
      * by the password required for the certificate in the second element.
      */
-    const SSL_KEY = 'ssl_key';
+    public const SSL_KEY = 'ssl_key';
 
     /**
      * stream: Set to true to attempt to stream a response rather than
      * download it all up-front.
      */
-    const STREAM = 'stream';
+    public const STREAM = 'stream';
 
     /**
      * verify: (bool|string, default=true) Describes the SSL certificate
@@ -237,27 +238,27 @@ final class RequestOptions
      * is insecure!). Set to a string to provide the path to a CA bundle on
      * disk to enable verification using a custom certificate.
      */
-    const VERIFY = 'verify';
+    public const VERIFY = 'verify';
 
     /**
      * timeout: (float, default=0) Float describing the timeout of the
      * request in seconds. Use 0 to wait indefinitely (the default behavior).
      */
-    const TIMEOUT = 'timeout';
+    public const TIMEOUT = 'timeout';
 
     /**
      * read_timeout: (float, default=default_socket_timeout ini setting) Float describing
      * the body read timeout, for stream requests.
      */
-    const READ_TIMEOUT = 'read_timeout';
+    public const READ_TIMEOUT = 'read_timeout';
 
     /**
      * version: (float) Specifies the HTTP protocol version to attempt to use.
      */
-    const VERSION = 'version';
+    public const VERSION = 'version';
 
     /**
      * force_ip_resolve: (bool) Force client to use only ipv4 or ipv6 protocol
      */
-    const FORCE_IP_RESOLVE = 'force_ip_resolve';
+    public const FORCE_IP_RESOLVE = 'force_ip_resolve';
 }

+ 32 - 42
api/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php

@@ -1,36 +1,43 @@
 <?php
+
 namespace GuzzleHttp;
 
 use GuzzleHttp\Promise\PromiseInterface;
-use GuzzleHttp\Promise\RejectedPromise;
-use GuzzleHttp\Psr7;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
 
 /**
  * Middleware that retries requests based on the boolean result of
  * invoking the provided "decider" function.
+ *
+ * @final
  */
 class RetryMiddleware
 {
-    /** @var callable  */
+    /**
+     * @var callable(RequestInterface, array): PromiseInterface
+     */
     private $nextHandler;
 
-    /** @var callable */
+    /**
+     * @var callable
+     */
     private $decider;
 
-    /** @var callable */
+    /**
+     * @var callable(int)
+     */
     private $delay;
 
     /**
-     * @param callable $decider     Function that accepts the number of retries,
-     *                              a request, [response], and [exception] and
-     *                              returns true if the request is to be
-     *                              retried.
-     * @param callable $nextHandler Next handler to invoke.
-     * @param callable $delay       Function that accepts the number of retries
-     *                              and [response] and returns the number of
-     *                              milliseconds to delay.
+     * @param callable                                            $decider     Function that accepts the number of retries,
+     *                                                                         a request, [response], and [exception] and
+     *                                                                         returns true if the request is to be
+     *                                                                         retried.
+     * @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
+     * @param null|callable(int): int                             $delay       Function that accepts the number of retries
+     *                                                                         and returns the number of
+     *                                                                         milliseconds to delay.
      */
     public function __construct(
         callable $decider,
@@ -45,22 +52,14 @@ class RetryMiddleware
     /**
      * Default exponential backoff delay function.
      *
-     * @param int $retries
-     *
      * @return int milliseconds.
      */
-    public static function exponentialDelay($retries)
+    public static function exponentialDelay(int $retries): int
     {
-        return (int) pow(2, $retries - 1) * 1000;
+        return (int) \pow(2, $retries - 1) * 1000;
     }
 
-    /**
-     * @param RequestInterface $request
-     * @param array            $options
-     *
-     * @return PromiseInterface
-     */
-    public function __invoke(RequestInterface $request, array $options)
+    public function __invoke(RequestInterface $request, array $options): PromiseInterface
     {
         if (!isset($options['retries'])) {
             $options['retries'] = 0;
@@ -76,35 +75,29 @@ class RetryMiddleware
 
     /**
      * Execute fulfilled closure
-     *
-     * @return mixed
      */
-    private function onFulfilled(RequestInterface $req, array $options)
+    private function onFulfilled(RequestInterface $request, array $options): callable
     {
-        return function ($value) use ($req, $options) {
-            if (!call_user_func(
-                $this->decider,
+        return function ($value) use ($request, $options) {
+            if (!($this->decider)(
                 $options['retries'],
-                $req,
+                $request,
                 $value,
                 null
             )) {
                 return $value;
             }
-            return $this->doRetry($req, $options, $value);
+            return $this->doRetry($request, $options, $value);
         };
     }
 
     /**
      * Execute rejected closure
-     *
-     * @return callable
      */
-    private function onRejected(RequestInterface $req, array $options)
+    private function onRejected(RequestInterface $req, array $options): callable
     {
         return function ($reason) use ($req, $options) {
-            if (!call_user_func(
-                $this->decider,
+            if (!($this->decider)(
                 $options['retries'],
                 $req,
                 null,
@@ -116,12 +109,9 @@ class RetryMiddleware
         };
     }
 
-    /**
-     * @return self
-     */
-    private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
+    private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
     {
-        $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response);
+        $options['delay'] = ($this->delay)(++$options['retries'], $response);
 
         return $this($request, $options);
     }

+ 30 - 21
api/vendor/guzzlehttp/guzzle/src/TransferStats.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace GuzzleHttp;
 
 use Psr\Http\Message\RequestInterface;
@@ -11,10 +12,29 @@ use Psr\Http\Message\UriInterface;
  */
 final class TransferStats
 {
+    /**
+     * @var RequestInterface
+     */
     private $request;
+
+    /**
+     * @var ResponseInterface|null
+     */
     private $response;
+
+    /**
+     * @var float|null
+     */
     private $transferTime;
+
+    /**
+     * @var array
+     */
     private $handlerStats;
+
+    /**
+     * @var mixed|null
+     */
     private $handlerErrorData;
 
     /**
@@ -26,10 +46,10 @@ final class TransferStats
      */
     public function __construct(
         RequestInterface $request,
-        ResponseInterface $response = null,
-        $transferTime = null,
+        ?ResponseInterface $response = null,
+        ?float $transferTime = null,
         $handlerErrorData = null,
-        $handlerStats = []
+        array $handlerStats = []
     ) {
         $this->request = $request;
         $this->response = $response;
@@ -38,30 +58,23 @@ final class TransferStats
         $this->handlerStats = $handlerStats;
     }
 
-    /**
-     * @return RequestInterface
-     */
-    public function getRequest()
+    public function getRequest(): RequestInterface
     {
         return $this->request;
     }
 
     /**
      * Returns the response that was received (if any).
-     *
-     * @return ResponseInterface|null
      */
-    public function getResponse()
+    public function getResponse(): ?ResponseInterface
     {
         return $this->response;
     }
 
     /**
      * Returns true if a response was received.
-     *
-     * @return bool
      */
-    public function hasResponse()
+    public function hasResponse(): bool
     {
         return $this->response !== null;
     }
@@ -82,10 +95,8 @@ final class TransferStats
 
     /**
      * Get the effective URI the request was sent to.
-     *
-     * @return UriInterface
      */
-    public function getEffectiveUri()
+    public function getEffectiveUri(): UriInterface
     {
         return $this->request->getUri();
     }
@@ -95,17 +106,15 @@ final class TransferStats
      *
      * @return float|null Time in seconds.
      */
-    public function getTransferTime()
+    public function getTransferTime(): ?float
     {
         return $this->transferTime;
     }
 
     /**
      * Gets an array of all of the handler specific transfer data.
-     *
-     * @return array
      */
-    public function getHandlerStats()
+    public function getHandlerStats(): array
     {
         return $this->handlerStats;
     }
@@ -117,7 +126,7 @@ final class TransferStats
      *
      * @return mixed|null
      */
-    public function getHandlerStat($stat)
+    public function getHandlerStat(string $stat)
     {
         return isset($this->handlerStats[$stat])
             ? $this->handlerStats[$stat]

+ 0 - 237
api/vendor/guzzlehttp/guzzle/src/UriTemplate.php

@@ -1,237 +0,0 @@
-<?php
-namespace GuzzleHttp;
-
-/**
- * Expands URI templates. Userland implementation of PECL uri_template.
- *
- * @link http://tools.ietf.org/html/rfc6570
- */
-class UriTemplate
-{
-    /** @var string URI template */
-    private $template;
-
-    /** @var array Variables to use in the template expansion */
-    private $variables;
-
-    /** @var array Hash for quick operator lookups */
-    private static $operatorHash = [
-        ''  => ['prefix' => '',  'joiner' => ',', 'query' => false],
-        '+' => ['prefix' => '',  'joiner' => ',', 'query' => false],
-        '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false],
-        '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false],
-        '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false],
-        ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true],
-        '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true],
-        '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true]
-    ];
-
-    /** @var array Delimiters */
-    private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$',
-        '&', '\'', '(', ')', '*', '+', ',', ';', '='];
-
-    /** @var array Percent encoded delimiters */
-    private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D',
-        '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
-        '%3B', '%3D'];
-
-    public function expand($template, array $variables)
-    {
-        if (false === strpos($template, '{')) {
-            return $template;
-        }
-
-        $this->template = $template;
-        $this->variables = $variables;
-
-        return preg_replace_callback(
-            '/\{([^\}]+)\}/',
-            [$this, 'expandMatch'],
-            $this->template
-        );
-    }
-
-    /**
-     * Parse an expression into parts
-     *
-     * @param string $expression Expression to parse
-     *
-     * @return array Returns an associative array of parts
-     */
-    private function parseExpression($expression)
-    {
-        $result = [];
-
-        if (isset(self::$operatorHash[$expression[0]])) {
-            $result['operator'] = $expression[0];
-            $expression = substr($expression, 1);
-        } else {
-            $result['operator'] = '';
-        }
-
-        foreach (explode(',', $expression) as $value) {
-            $value = trim($value);
-            $varspec = [];
-            if ($colonPos = strpos($value, ':')) {
-                $varspec['value'] = substr($value, 0, $colonPos);
-                $varspec['modifier'] = ':';
-                $varspec['position'] = (int) substr($value, $colonPos + 1);
-            } elseif (substr($value, -1) === '*') {
-                $varspec['modifier'] = '*';
-                $varspec['value'] = substr($value, 0, -1);
-            } else {
-                $varspec['value'] = (string) $value;
-                $varspec['modifier'] = '';
-            }
-            $result['values'][] = $varspec;
-        }
-
-        return $result;
-    }
-
-    /**
-     * Process an expansion
-     *
-     * @param array $matches Matches met in the preg_replace_callback
-     *
-     * @return string Returns the replacement string
-     */
-    private function expandMatch(array $matches)
-    {
-        static $rfc1738to3986 = ['+' => '%20', '%7e' => '~'];
-
-        $replacements = [];
-        $parsed = self::parseExpression($matches[1]);
-        $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
-        $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
-        $useQuery = self::$operatorHash[$parsed['operator']]['query'];
-
-        foreach ($parsed['values'] as $value) {
-            if (!isset($this->variables[$value['value']])) {
-                continue;
-            }
-
-            $variable = $this->variables[$value['value']];
-            $actuallyUseQuery = $useQuery;
-            $expanded = '';
-
-            if (is_array($variable)) {
-                $isAssoc = $this->isAssoc($variable);
-                $kvp = [];
-                foreach ($variable as $key => $var) {
-                    if ($isAssoc) {
-                        $key = rawurlencode($key);
-                        $isNestedArray = is_array($var);
-                    } else {
-                        $isNestedArray = false;
-                    }
-
-                    if (!$isNestedArray) {
-                        $var = rawurlencode($var);
-                        if ($parsed['operator'] === '+' ||
-                            $parsed['operator'] === '#'
-                        ) {
-                            $var = $this->decodeReserved($var);
-                        }
-                    }
-
-                    if ($value['modifier'] === '*') {
-                        if ($isAssoc) {
-                            if ($isNestedArray) {
-                                // Nested arrays must allow for deeply nested
-                                // structures.
-                                $var = strtr(
-                                    http_build_query([$key => $var]),
-                                    $rfc1738to3986
-                                );
-                            } else {
-                                $var = $key . '=' . $var;
-                            }
-                        } elseif ($key > 0 && $actuallyUseQuery) {
-                            $var = $value['value'] . '=' . $var;
-                        }
-                    }
-
-                    $kvp[$key] = $var;
-                }
-
-                if (empty($variable)) {
-                    $actuallyUseQuery = false;
-                } elseif ($value['modifier'] === '*') {
-                    $expanded = implode($joiner, $kvp);
-                    if ($isAssoc) {
-                        // Don't prepend the value name when using the explode
-                        // modifier with an associative array.
-                        $actuallyUseQuery = false;
-                    }
-                } else {
-                    if ($isAssoc) {
-                        // When an associative array is encountered and the
-                        // explode modifier is not set, then the result must be
-                        // a comma separated list of keys followed by their
-                        // respective values.
-                        foreach ($kvp as $k => &$v) {
-                            $v = $k . ',' . $v;
-                        }
-                    }
-                    $expanded = implode(',', $kvp);
-                }
-            } else {
-                if ($value['modifier'] === ':') {
-                    $variable = substr($variable, 0, $value['position']);
-                }
-                $expanded = rawurlencode($variable);
-                if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
-                    $expanded = $this->decodeReserved($expanded);
-                }
-            }
-
-            if ($actuallyUseQuery) {
-                if (!$expanded && $joiner !== '&') {
-                    $expanded = $value['value'];
-                } else {
-                    $expanded = $value['value'] . '=' . $expanded;
-                }
-            }
-
-            $replacements[] = $expanded;
-        }
-
-        $ret = implode($joiner, $replacements);
-        if ($ret && $prefix) {
-            return $prefix . $ret;
-        }
-
-        return $ret;
-    }
-
-    /**
-     * Determines if an array is associative.
-     *
-     * This makes the assumption that input arrays are sequences or hashes.
-     * This assumption is a tradeoff for accuracy in favor of speed, but it
-     * should work in almost every case where input is supplied for a URI
-     * template.
-     *
-     * @param array $array Array to check
-     *
-     * @return bool
-     */
-    private function isAssoc(array $array)
-    {
-        return $array && array_keys($array)[0] !== 0;
-    }
-
-    /**
-     * Removes percent encoding on reserved characters (used with + and #
-     * modifiers).
-     *
-     * @param string $string String to fix
-     *
-     * @return string
-     */
-    private function decodeReserved($string)
-    {
-        return str_replace(self::$delimsPct, self::$delims, $string);
-    }
-}

+ 394 - 0
api/vendor/guzzlehttp/guzzle/src/Utils.php

@@ -0,0 +1,394 @@
+<?php
+
+namespace GuzzleHttp;
+
+use GuzzleHttp\Exception\InvalidArgumentException;
+use GuzzleHttp\Handler\CurlHandler;
+use GuzzleHttp\Handler\CurlMultiHandler;
+use GuzzleHttp\Handler\Proxy;
+use GuzzleHttp\Handler\StreamHandler;
+use Psr\Http\Message\UriInterface;
+
+final class Utils
+{
+    /**
+     * Debug function used to describe the provided value type and class.
+     *
+     * @param mixed $input
+     *
+     * @return string Returns a string containing the type of the variable and
+     *                if a class is provided, the class name.
+     */
+    public static function describeType($input): string
+    {
+        switch (\gettype($input)) {
+            case 'object':
+                return 'object(' . \get_class($input) . ')';
+            case 'array':
+                return 'array(' . \count($input) . ')';
+            default:
+                \ob_start();
+                \var_dump($input);
+                // normalize float vs double
+                /** @var string $varDumpContent */
+                $varDumpContent = \ob_get_clean();
+
+                return \str_replace('double(', 'float(', \rtrim($varDumpContent));
+        }
+    }
+
+    /**
+     * Parses an array of header lines into an associative array of headers.
+     *
+     * @param iterable $lines Header lines array of strings in the following
+     *                        format: "Name: Value"
+     */
+    public static function headersFromLines(iterable $lines): array
+    {
+        $headers = [];
+
+        foreach ($lines as $line) {
+            $parts = \explode(':', $line, 2);
+            $headers[\trim($parts[0])][] = isset($parts[1])
+                ? \trim($parts[1])
+                : null;
+        }
+
+        return $headers;
+    }
+
+    /**
+     * Returns a debug stream based on the provided variable.
+     *
+     * @param mixed $value Optional value
+     *
+     * @return resource
+     */
+    public static function debugResource($value = null)
+    {
+        if (\is_resource($value)) {
+            return $value;
+        }
+        if (\defined('STDOUT')) {
+            return \STDOUT;
+        }
+
+        $resource = \fopen('php://output', 'w');
+        if (false === $resource) {
+            throw new \RuntimeException('Can not open php output for writing to debug the resource.');
+        }
+
+        return $resource;
+    }
+
+    /**
+     * Chooses and creates a default handler to use based on the environment.
+     *
+     * The returned handler is not wrapped by any default middlewares.
+     *
+     * @throws \RuntimeException if no viable Handler is available.
+     *
+     * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
+     */
+    public static function chooseHandler(): callable
+    {
+        $handler = null;
+        if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
+            $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
+        } elseif (\function_exists('curl_exec')) {
+            $handler = new CurlHandler();
+        } elseif (\function_exists('curl_multi_exec')) {
+            $handler = new CurlMultiHandler();
+        }
+
+        if (\ini_get('allow_url_fopen')) {
+            $handler = $handler
+                ? Proxy::wrapStreaming($handler, new StreamHandler())
+                : new StreamHandler();
+        } elseif (!$handler) {
+            throw new \RuntimeException('GuzzleHttp requires cURL, the '
+                . 'allow_url_fopen ini setting, or a custom HTTP handler.');
+        }
+
+        return $handler;
+    }
+
+    /**
+     * Get the default User-Agent string to use with Guzzle.
+     */
+    public static function defaultUserAgent(): string
+    {
+        return sprintf('GuzzleHttp/%d', ClientInterface::MAJOR_VERSION);
+    }
+
+    /**
+     * Returns the default cacert bundle for the current system.
+     *
+     * First, the openssl.cafile and curl.cainfo php.ini settings are checked.
+     * If those settings are not configured, then the common locations for
+     * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X
+     * and Windows are checked. If any of these file locations are found on
+     * disk, they will be utilized.
+     *
+     * Note: the result of this function is cached for subsequent calls.
+     *
+     * @throws \RuntimeException if no bundle can be found.
+     *
+     * @deprecated Utils::defaultCaBundle will be removed in guzzlehttp/guzzle:8.0. This method is not needed in PHP 5.6+.
+     */
+    public static function defaultCaBundle(): string
+    {
+        static $cached = null;
+        static $cafiles = [
+            // Red Hat, CentOS, Fedora (provided by the ca-certificates package)
+            '/etc/pki/tls/certs/ca-bundle.crt',
+            // Ubuntu, Debian (provided by the ca-certificates package)
+            '/etc/ssl/certs/ca-certificates.crt',
+            // FreeBSD (provided by the ca_root_nss package)
+            '/usr/local/share/certs/ca-root-nss.crt',
+            // SLES 12 (provided by the ca-certificates package)
+            '/var/lib/ca-certificates/ca-bundle.pem',
+            // OS X provided by homebrew (using the default path)
+            '/usr/local/etc/openssl/cert.pem',
+            // Google app engine
+            '/etc/ca-certificates.crt',
+            // Windows?
+            'C:\\windows\\system32\\curl-ca-bundle.crt',
+            'C:\\windows\\curl-ca-bundle.crt',
+        ];
+
+        if ($cached) {
+            return $cached;
+        }
+
+        if ($ca = \ini_get('openssl.cafile')) {
+            return $cached = $ca;
+        }
+
+        if ($ca = \ini_get('curl.cainfo')) {
+            return $cached = $ca;
+        }
+
+        foreach ($cafiles as $filename) {
+            if (\file_exists($filename)) {
+                return $cached = $filename;
+            }
+        }
+
+        throw new \RuntimeException(
+            <<< EOT
+No system CA bundle could be found in any of the the common system locations.
+PHP versions earlier than 5.6 are not properly configured to use the system's
+CA bundle by default. In order to verify peer certificates, you will need to
+supply the path on disk to a certificate bundle to the 'verify' request
+option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not
+need a specific certificate bundle, then Mozilla provides a commonly used CA
+bundle which can be downloaded here (provided by the maintainer of cURL):
+https://curl.haxx.se/ca/cacert.pem. Once
+you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP
+ini setting to point to the path to the file, allowing you to omit the 'verify'
+request option. See https://curl.haxx.se/docs/sslcerts.html for more
+information.
+EOT
+        );
+    }
+
+    /**
+     * Creates an associative array of lowercase header names to the actual
+     * header casing.
+     */
+    public static function normalizeHeaderKeys(array $headers): array
+    {
+        $result = [];
+        foreach (\array_keys($headers) as $key) {
+            $result[\strtolower($key)] = $key;
+        }
+
+        return $result;
+    }
+
+    /**
+     * Returns true if the provided host matches any of the no proxy areas.
+     *
+     * This method will strip a port from the host if it is present. Each pattern
+     * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a
+     * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" ==
+     * "baz.foo.com", but ".foo.com" != "foo.com").
+     *
+     * Areas are matched in the following cases:
+     * 1. "*" (without quotes) always matches any hosts.
+     * 2. An exact match.
+     * 3. The area starts with "." and the area is the last part of the host. e.g.
+     *    '.mit.edu' will match any host that ends with '.mit.edu'.
+     *
+     * @param string   $host         Host to check against the patterns.
+     * @param string[] $noProxyArray An array of host patterns.
+     *
+     * @throws InvalidArgumentException
+     */
+    public static function isHostInNoProxy(string $host, array $noProxyArray): bool
+    {
+        if (\strlen($host) === 0) {
+            throw new InvalidArgumentException('Empty host provided');
+        }
+
+        // Strip port if present.
+        if (\strpos($host, ':')) {
+            /** @var string[] $hostParts will never be false because of the checks above */
+            $hostParts = \explode($host, ':', 2);
+            $host = $hostParts[0];
+        }
+
+        foreach ($noProxyArray as $area) {
+            // Always match on wildcards.
+            if ($area === '*') {
+                return true;
+            } elseif (empty($area)) {
+                // Don't match on empty values.
+                continue;
+            } elseif ($area === $host) {
+                // Exact matches.
+                return true;
+            }
+            // Special match if the area when prefixed with ".". Remove any
+            // existing leading "." and add a new leading ".".
+            $area = '.' . \ltrim($area, '.');
+            if (\substr($host, -(\strlen($area))) === $area) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Wrapper for json_decode that throws when an error occurs.
+     *
+     * @param string $json    JSON data to parse
+     * @param bool   $assoc   When true, returned objects will be converted
+     *                        into associative arrays.
+     * @param int    $depth   User specified recursion depth.
+     * @param int    $options Bitmask of JSON decode options.
+     *
+     * @return object|array|string|int|float|bool|null
+     *
+     * @throws InvalidArgumentException if the JSON cannot be decoded.
+     *
+     * @link https://www.php.net/manual/en/function.json-decode.php
+     */
+    public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
+    {
+        $data = \json_decode($json, $assoc, $depth, $options);
+        if (\JSON_ERROR_NONE !== \json_last_error()) {
+            throw new InvalidArgumentException(
+                'json_decode error: ' . \json_last_error_msg()
+            );
+        }
+
+        return $data;
+    }
+
+    /**
+     * Wrapper for JSON encoding that throws when an error occurs.
+     *
+     * @param mixed $value   The value being encoded
+     * @param int   $options JSON encode option bitmask
+     * @param int   $depth   Set the maximum depth. Must be greater than zero.
+     *
+     * @throws InvalidArgumentException if the JSON cannot be encoded.
+     *
+     * @link https://www.php.net/manual/en/function.json-encode.php
+     */
+    public static function jsonEncode($value, int $options = 0, int $depth = 512): string
+    {
+        $json = \json_encode($value, $options, $depth);
+        if (\JSON_ERROR_NONE !== \json_last_error()) {
+            throw new InvalidArgumentException(
+                'json_encode error: ' . \json_last_error_msg()
+            );
+        }
+
+        /** @var string */
+        return $json;
+    }
+
+    /**
+     * Wrapper for the hrtime() or microtime() functions
+     * (depending on the PHP version, one of the two is used)
+     *
+     * @return float UNIX timestamp
+     *
+     * @internal
+     */
+    public static function currentTime(): float
+    {
+        return (float) \function_exists('hrtime') ? \hrtime(true) / 1e9 : \microtime(true);
+    }
+
+    /**
+     * @throws InvalidArgumentException
+     *
+     * @internal
+     */
+    public static function idnUriConvert(UriInterface $uri, int $options = 0): UriInterface
+    {
+        if ($uri->getHost()) {
+            $asciiHost = self::idnToAsci($uri->getHost(), $options, $info);
+            if ($asciiHost === false) {
+                $errorBitSet = $info['errors'] ?? 0;
+
+                $errorConstants = array_filter(array_keys(get_defined_constants()), static function ($name) {
+                    return substr($name, 0, 11) === 'IDNA_ERROR_';
+                });
+
+                $errors = [];
+                foreach ($errorConstants as $errorConstant) {
+                    if ($errorBitSet & constant($errorConstant)) {
+                        $errors[] = $errorConstant;
+                    }
+                }
+
+                $errorMessage = 'IDN conversion failed';
+                if ($errors) {
+                    $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
+                }
+
+                throw new InvalidArgumentException($errorMessage);
+            }
+            if ($uri->getHost() !== $asciiHost) {
+                // Replace URI only if the ASCII version is different
+                $uri = $uri->withHost($asciiHost);
+            }
+        }
+
+        return $uri;
+    }
+
+    /**
+     * @internal
+     */
+    public static function getenv(string $name): ?string
+    {
+        if (isset($_SERVER[$name])) {
+            return (string) $_SERVER[$name];
+        }
+
+        if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) {
+            return (string) $value;
+        }
+
+        return null;
+    }
+
+    /**
+     * @return string|false
+     */
+    private static function idnToAsci(string $domain, int $options, ?array &$info = [])
+    {
+        if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) {
+            return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info);
+        }
+
+        throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old');
+    }
+}

+ 53 - 280
api/vendor/guzzlehttp/guzzle/src/functions.php

@@ -1,79 +1,34 @@
 <?php
-namespace GuzzleHttp;
-
-use GuzzleHttp\Exception\InvalidArgumentException;
-use GuzzleHttp\Handler\CurlHandler;
-use GuzzleHttp\Handler\CurlMultiHandler;
-use GuzzleHttp\Handler\Proxy;
-use GuzzleHttp\Handler\StreamHandler;
-use Psr\Http\Message\UriInterface;
-
-/**
- * Expands a URI template
- *
- * @param string $template  URI template
- * @param array  $variables Template variables
- *
- * @return string
- */
-function uri_template($template, array $variables)
-{
-    if (extension_loaded('uri_template')) {
-        // @codeCoverageIgnoreStart
-        return \uri_template($template, $variables);
-        // @codeCoverageIgnoreEnd
-    }
 
-    static $uriTemplate;
-    if (!$uriTemplate) {
-        $uriTemplate = new UriTemplate();
-    }
-
-    return $uriTemplate->expand($template, $variables);
-}
+namespace GuzzleHttp;
 
 /**
  * Debug function used to describe the provided value type and class.
  *
- * @param mixed $input
+ * @param mixed $input Any type of variable to describe the type of. This
+ *                     parameter misses a typehint because of that.
  *
  * @return string Returns a string containing the type of the variable and
  *                if a class is provided, the class name.
+ *
+ * @deprecated describe_type will be removed in guzzlehttp/guzzle:8.0. Use Utils::describeType instead.
  */
-function describe_type($input)
+function describe_type($input): string
 {
-    switch (gettype($input)) {
-        case 'object':
-            return 'object(' . get_class($input) . ')';
-        case 'array':
-            return 'array(' . count($input) . ')';
-        default:
-            ob_start();
-            var_dump($input);
-            // normalize float vs double
-            return str_replace('double(', 'float(', rtrim(ob_get_clean()));
-    }
+    return Utils::describeType($input);
 }
 
 /**
  * Parses an array of header lines into an associative array of headers.
  *
  * @param iterable $lines Header lines array of strings in the following
- *                     format: "Name: Value"
- * @return array
+ *                        format: "Name: Value"
+ *
+ * @deprecated headers_from_lines will be removed in guzzlehttp/guzzle:8.0. Use Utils::headersFromLines instead.
  */
-function headers_from_lines($lines)
+function headers_from_lines(iterable $lines): array
 {
-    $headers = [];
-
-    foreach ($lines as $line) {
-        $parts = explode(':', $line, 2);
-        $headers[trim($parts[0])][] = isset($parts[1])
-            ? trim($parts[1])
-            : null;
-    }
-
-    return $headers;
+    return Utils::headersFromLines($lines);
 }
 
 /**
@@ -82,16 +37,12 @@ function headers_from_lines($lines)
  * @param mixed $value Optional value
  *
  * @return resource
+ *
+ * @deprecated debug_resource will be removed in guzzlehttp/guzzle:8.0. Use Utils::debugResource instead.
  */
 function debug_resource($value = null)
 {
-    if (is_resource($value)) {
-        return $value;
-    } elseif (defined('STDOUT')) {
-        return STDOUT;
-    }
-
-    return fopen('php://output', 'w');
+    return Utils::debugResource($value);
 }
 
 /**
@@ -100,49 +51,24 @@ function debug_resource($value = null)
  * The returned handler is not wrapped by any default middlewares.
  *
  * @throws \RuntimeException if no viable Handler is available.
- * @return callable Returns the best handler for the given system.
+ *
+ * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
+ *
+ * @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead.
  */
-function choose_handler()
+function choose_handler(): callable
 {
-    $handler = null;
-    if (function_exists('curl_multi_exec') && function_exists('curl_exec')) {
-        $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
-    } elseif (function_exists('curl_exec')) {
-        $handler = new CurlHandler();
-    } elseif (function_exists('curl_multi_exec')) {
-        $handler = new CurlMultiHandler();
-    }
-
-    if (ini_get('allow_url_fopen')) {
-        $handler = $handler
-            ? Proxy::wrapStreaming($handler, new StreamHandler())
-            : new StreamHandler();
-    } elseif (!$handler) {
-        throw new \RuntimeException('GuzzleHttp requires cURL, the '
-            . 'allow_url_fopen ini setting, or a custom HTTP handler.');
-    }
-
-    return $handler;
+    return Utils::chooseHandler();
 }
 
 /**
- * Get the default User-Agent string to use with Guzzle
+ * Get the default User-Agent string to use with Guzzle.
  *
- * @return string
+ * @deprecated default_user_agent will be removed in guzzlehttp/guzzle:8.0. Use Utils::defaultUserAgent instead.
  */
-function default_user_agent()
+function default_user_agent(): string
 {
-    static $defaultAgent = '';
-
-    if (!$defaultAgent) {
-        $defaultAgent = 'GuzzleHttp/' . Client::VERSION;
-        if (extension_loaded('curl') && function_exists('curl_version')) {
-            $defaultAgent .= ' curl/' . \curl_version()['version'];
-        }
-        $defaultAgent .= ' PHP/' . PHP_VERSION;
-    }
-
-    return $defaultAgent;
+    return Utils::defaultUserAgent();
 }
 
 /**
@@ -156,82 +82,24 @@ function default_user_agent()
  *
  * Note: the result of this function is cached for subsequent calls.
  *
- * @return string
  * @throws \RuntimeException if no bundle can be found.
+ *
+ * @deprecated default_ca_bundle will be removed in guzzlehttp/guzzle:8.0. This function is not needed in PHP 5.6+.
  */
-function default_ca_bundle()
+function default_ca_bundle(): string
 {
-    static $cached = null;
-    static $cafiles = [
-        // Red Hat, CentOS, Fedora (provided by the ca-certificates package)
-        '/etc/pki/tls/certs/ca-bundle.crt',
-        // Ubuntu, Debian (provided by the ca-certificates package)
-        '/etc/ssl/certs/ca-certificates.crt',
-        // FreeBSD (provided by the ca_root_nss package)
-        '/usr/local/share/certs/ca-root-nss.crt',
-        // SLES 12 (provided by the ca-certificates package)
-        '/var/lib/ca-certificates/ca-bundle.pem',
-        // OS X provided by homebrew (using the default path)
-        '/usr/local/etc/openssl/cert.pem',
-        // Google app engine
-        '/etc/ca-certificates.crt',
-        // Windows?
-        'C:\\windows\\system32\\curl-ca-bundle.crt',
-        'C:\\windows\\curl-ca-bundle.crt',
-    ];
-
-    if ($cached) {
-        return $cached;
-    }
-
-    if ($ca = ini_get('openssl.cafile')) {
-        return $cached = $ca;
-    }
-
-    if ($ca = ini_get('curl.cainfo')) {
-        return $cached = $ca;
-    }
-
-    foreach ($cafiles as $filename) {
-        if (file_exists($filename)) {
-            return $cached = $filename;
-        }
-    }
-
-    throw new \RuntimeException(
-        <<< EOT
-No system CA bundle could be found in any of the the common system locations.
-PHP versions earlier than 5.6 are not properly configured to use the system's
-CA bundle by default. In order to verify peer certificates, you will need to
-supply the path on disk to a certificate bundle to the 'verify' request
-option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not
-need a specific certificate bundle, then Mozilla provides a commonly used CA
-bundle which can be downloaded here (provided by the maintainer of cURL):
-https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once
-you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP
-ini setting to point to the path to the file, allowing you to omit the 'verify'
-request option. See http://curl.haxx.se/docs/sslcerts.html for more
-information.
-EOT
-    );
+    return Utils::defaultCaBundle();
 }
 
 /**
  * Creates an associative array of lowercase header names to the actual
  * header casing.
  *
- * @param array $headers
- *
- * @return array
+ * @deprecated normalize_header_keys will be removed in guzzlehttp/guzzle:8.0. Use Utils::normalizeHeaderKeys instead.
  */
-function normalize_header_keys(array $headers)
+function normalize_header_keys(array $headers): array
 {
-    $result = [];
-    foreach (array_keys($headers) as $key) {
-        $result[strtolower($key)] = $key;
-    }
-
-    return $result;
+    return Utils::normalizeHeaderKeys($headers);
 }
 
 /**
@@ -248,147 +116,52 @@ function normalize_header_keys(array $headers)
  * 3. The area starts with "." and the area is the last part of the host. e.g.
  *    '.mit.edu' will match any host that ends with '.mit.edu'.
  *
- * @param string $host         Host to check against the patterns.
- * @param array  $noProxyArray An array of host patterns.
+ * @param string   $host         Host to check against the patterns.
+ * @param string[] $noProxyArray An array of host patterns.
  *
- * @return bool
+ * @throws Exception\InvalidArgumentException
+ *
+ * @deprecated is_host_in_noproxy will be removed in guzzlehttp/guzzle:8.0. Use Utils::isHostInNoProxy instead.
  */
-function is_host_in_noproxy($host, array $noProxyArray)
+function is_host_in_noproxy(string $host, array $noProxyArray): bool
 {
-    if (strlen($host) === 0) {
-        throw new \InvalidArgumentException('Empty host provided');
-    }
-
-    // Strip port if present.
-    if (strpos($host, ':')) {
-        $host = explode($host, ':', 2)[0];
-    }
-
-    foreach ($noProxyArray as $area) {
-        // Always match on wildcards.
-        if ($area === '*') {
-            return true;
-        } elseif (empty($area)) {
-            // Don't match on empty values.
-            continue;
-        } elseif ($area === $host) {
-            // Exact matches.
-            return true;
-        } else {
-            // Special match if the area when prefixed with ".". Remove any
-            // existing leading "." and add a new leading ".".
-            $area = '.' . ltrim($area, '.');
-            if (substr($host, -(strlen($area))) === $area) {
-                return true;
-            }
-        }
-    }
-
-    return false;
+    return Utils::isHostInNoProxy($host, $noProxyArray);
 }
 
 /**
  * Wrapper for json_decode that throws when an error occurs.
  *
  * @param string $json    JSON data to parse
- * @param bool $assoc     When true, returned objects will be converted
+ * @param bool   $assoc   When true, returned objects will be converted
  *                        into associative arrays.
  * @param int    $depth   User specified recursion depth.
  * @param int    $options Bitmask of JSON decode options.
  *
- * @return mixed
+ * @return object|array|string|int|float|bool|null
+ *
  * @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
- * @link http://www.php.net/manual/en/function.json-decode.php
+ *
+ * @link https://www.php.net/manual/en/function.json-decode.php
+ * @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead.
  */
-function json_decode($json, $assoc = false, $depth = 512, $options = 0)
+function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
 {
-    $data = \json_decode($json, $assoc, $depth, $options);
-    if (JSON_ERROR_NONE !== json_last_error()) {
-        throw new Exception\InvalidArgumentException(
-            'json_decode error: ' . json_last_error_msg()
-        );
-    }
-
-    return $data;
+    return Utils::jsonDecode($json, $assoc, $depth, $options);
 }
 
 /**
  * Wrapper for JSON encoding that throws when an error occurs.
  *
  * @param mixed $value   The value being encoded
- * @param int    $options JSON encode option bitmask
- * @param int    $depth   Set the maximum depth. Must be greater than zero.
+ * @param int   $options JSON encode option bitmask
+ * @param int   $depth   Set the maximum depth. Must be greater than zero.
  *
- * @return string
  * @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
- * @link http://www.php.net/manual/en/function.json-encode.php
- */
-function json_encode($value, $options = 0, $depth = 512)
-{
-    $json = \json_encode($value, $options, $depth);
-    if (JSON_ERROR_NONE !== json_last_error()) {
-        throw new Exception\InvalidArgumentException(
-            'json_encode error: ' . json_last_error_msg()
-        );
-    }
-
-    return $json;
-}
-
-/**
- * Wrapper for the hrtime() or microtime() functions
- * (depending on the PHP version, one of the two is used)
- *
- * @return float|mixed UNIX timestamp
- * @internal
- */
-function _current_time()
-{
-    return function_exists('hrtime') ? hrtime(true) / 1e9 : microtime(true);
-}
-
-
-/**
- * @param int $options
- *
- * @return UriInterface
  *
- * @internal
+ * @link https://www.php.net/manual/en/function.json-encode.php
+ * @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead.
  */
-function _idn_uri_convert(UriInterface $uri, $options = 0)
+function json_encode($value, int $options = 0, int $depth = 512): string
 {
-    if ($uri->getHost()) {
-        $idnaVariant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : 0;
-        $asciiHost = $idnaVariant === 0
-            ? idn_to_ascii($uri->getHost(), $options)
-            : idn_to_ascii($uri->getHost(), $options, $idnaVariant, $info);
-        if ($asciiHost === false) {
-            $errorBitSet = isset($info['errors']) ? $info['errors'] : 0;
-
-            $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) {
-                return substr($name, 0, 11) === 'IDNA_ERROR_';
-            });
-
-            $errors = [];
-            foreach ($errorConstants as $errorConstant) {
-                if ($errorBitSet & constant($errorConstant)) {
-                    $errors[] = $errorConstant;
-                }
-            }
-
-            $errorMessage = 'IDN conversion failed';
-            if ($errors) {
-                $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
-            }
-
-            throw new InvalidArgumentException($errorMessage);
-        } else {
-            if ($uri->getHost() !== $asciiHost) {
-                // Replace URI only if the ASCII version is different
-                $uri = $uri->withHost($asciiHost);
-            }
-        }
-    }
-
-    return $uri;
+    return Utils::jsonEncode($value, $options, $depth);
 }

+ 1 - 1
api/vendor/guzzlehttp/guzzle/src/functions_include.php

@@ -1,6 +1,6 @@
 <?php
 
 // Don't redefine the functions if included multiple times.
-if (!function_exists('GuzzleHttp\uri_template')) {
+if (!\function_exists('GuzzleHttp\describe_type')) {
     require __DIR__ . '/functions.php';
 }

+ 18 - 0
api/vendor/myclabs/php-enum/LICENSE

@@ -0,0 +1,18 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 My C-Labs
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 138 - 0
api/vendor/myclabs/php-enum/README.md

@@ -0,0 +1,138 @@
+# PHP Enum implementation inspired from SplEnum
+
+[![Build Status](https://travis-ci.org/myclabs/php-enum.png?branch=master)](https://travis-ci.org/myclabs/php-enum)
+[![Latest Stable Version](https://poser.pugx.org/myclabs/php-enum/version.png)](https://packagist.org/packages/myclabs/php-enum)
+[![Total Downloads](https://poser.pugx.org/myclabs/php-enum/downloads.png)](https://packagist.org/packages/myclabs/php-enum)
+[![psalm](https://shepherd.dev/github/myclabs/php-enum/coverage.svg)](https://shepherd.dev/github/myclabs/php-enum)
+
+Maintenance for this project is [supported via Tidelift](https://tidelift.com/subscription/pkg/packagist-myclabs-php-enum?utm_source=packagist-myclabs-php-enum&utm_medium=referral&utm_campaign=readme).
+
+## Why?
+
+First, and mainly, `SplEnum` is not integrated to PHP, you have to install the extension separately.
+
+Using an enum instead of class constants provides the following advantages:
+
+- You can use an enum as a parameter type: `function setAction(Action $action) {`
+- You can use an enum as a return type: `function getAction() : Action {`
+- You can enrich the enum with methods (e.g. `format`, `parse`, …)
+- You can extend the enum to add new values (make your enum `final` to prevent it)
+- You can get a list of all the possible values (see below)
+
+This Enum class is not intended to replace class constants, but only to be used when it makes sense.
+
+## Installation
+
+```
+composer require myclabs/php-enum
+```
+
+## Declaration
+
+```php
+use MyCLabs\Enum\Enum;
+
+/**
+ * Action enum
+ */
+final class Action extends Enum
+{
+    private const VIEW = 'view';
+    private const EDIT = 'edit';
+}
+```
+
+## Usage
+
+```php
+$action = Action::VIEW();
+
+// or with a dynamic key:
+$action = Action::$key();
+// or with a dynamic value:
+$action = Action::from($value);
+// or
+$action = new Action($value);
+```
+
+As you can see, static methods are automatically implemented to provide quick access to an enum value.
+
+One advantage over using class constants is to be able to use an enum as a parameter type:
+
+```php
+function setAction(Action $action) {
+    // ...
+}
+```
+
+## Documentation
+
+- `__construct()` The constructor checks that the value exist in the enum
+- `__toString()` You can `echo $myValue`, it will display the enum value (value of the constant)
+- `getValue()` Returns the current value of the enum
+- `getKey()` Returns the key of the current value on Enum
+- `equals()` Tests whether enum instances are equal (returns `true` if enum values are equal, `false` otherwise)
+
+Static methods:
+
+- `from()` Creates an Enum instance, checking that the value exist in the enum
+- `toArray()` method Returns all possible values as an array (constant name in key, constant value in value)
+- `keys()` Returns the names (keys) of all constants in the Enum class
+- `values()` Returns instances of the Enum class of all Enum constants (constant name in key, Enum instance in value)
+- `isValid()` Check if tested value is valid on enum set
+- `isValidKey()` Check if tested key is valid on enum set
+- `assertValidValue()` Assert the value is valid on enum set, throwing exception otherwise
+- `search()` Return key for searched value
+
+### Static methods
+
+```php
+final class Action extends Enum
+{
+    private const VIEW = 'view';
+    private const EDIT = 'edit';
+}
+
+// Static method:
+$action = Action::VIEW();
+$action = Action::EDIT();
+```
+
+Static method helpers are implemented using [`__callStatic()`](http://www.php.net/manual/en/language.oop5.overloading.php#object.callstatic).
+
+If you care about IDE autocompletion, you can either implement the static methods yourself:
+
+```php
+final class Action extends Enum
+{
+    private const VIEW = 'view';
+
+    /**
+     * @return Action
+     */
+    public static function VIEW() {
+        return new Action(self::VIEW);
+    }
+}
+```
+
+or you can use phpdoc (this is supported in PhpStorm for example):
+
+```php
+/**
+ * @method static Action VIEW()
+ * @method static Action EDIT()
+ */
+final class Action extends Enum
+{
+    private const VIEW = 'view';
+    private const EDIT = 'edit';
+}
+```
+
+## Related projects
+
+- [Doctrine enum mapping](https://github.com/acelaya/doctrine-enum-type)
+- [Symfony ParamConverter integration](https://github.com/Ex3v/MyCLabsEnumParamConverter)
+- [PHPStan integration](https://github.com/timeweb/phpstan-enum)
+- [Yii2 enum mapping](https://github.com/KartaviK/yii2-enum)

+ 11 - 0
api/vendor/myclabs/php-enum/SECURITY.md

@@ -0,0 +1,11 @@
+# Security Policy
+
+## Supported Versions
+
+Only the latest stable release is supported.
+
+## Reporting a Vulnerability
+
+To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
+
+Tidelift will coordinate the fix and disclosure.

+ 33 - 0
api/vendor/myclabs/php-enum/composer.json

@@ -0,0 +1,33 @@
+{
+    "name": "myclabs/php-enum",
+    "type": "library",
+    "description": "PHP Enum implementation",
+    "keywords": ["enum"],
+    "homepage": "http://github.com/myclabs/php-enum",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "PHP Enum contributors",
+            "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
+        }
+    ],
+    "autoload": {
+        "psr-4": {
+            "MyCLabs\\Enum\\": "src/"
+        }
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "MyCLabs\\Tests\\Enum\\": "tests/"
+        }
+    },
+    "require": {
+        "php": "^7.3 || ^8.0",
+        "ext-json": "*"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "^9.5",
+        "squizlabs/php_codesniffer": "1.*",
+        "vimeo/psalm": "^4.5.1"
+    }
+}

+ 35 - 0
api/vendor/myclabs/php-enum/psalm.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<psalm
+    totallyTyped="true"
+    resolveFromConfigFile="true"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns="https://getpsalm.org/schema/config"
+    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
+>
+    <projectFiles>
+        <directory name="src" />
+        <directory name="static-analysis" />
+        <ignoreFiles>
+            <directory name="vendor" />
+            <directory name="src/PHPUnit" />
+        </ignoreFiles>
+    </projectFiles>
+
+    <issueHandlers>
+        <MixedAssignment errorLevel="info" />
+
+        <ImpureStaticProperty>
+            <!-- self::$... usages in Enum are used to populate an internal cache, and cause no side-effects -->
+            <errorLevel type="suppress">
+                <file name="src/Enum.php"/>
+            </errorLevel>
+        </ImpureStaticProperty>
+
+        <ImpureVariable>
+            <!-- $this usages in Enum point themselves to an immutable instance -->
+            <errorLevel type="suppress">
+                <file name="src/Enum.php"/>
+            </errorLevel>
+        </ImpureVariable>
+    </issueHandlers>
+</psalm>

+ 305 - 0
api/vendor/myclabs/php-enum/src/Enum.php

@@ -0,0 +1,305 @@
+<?php
+/**
+ * @link    http://github.com/myclabs/php-enum
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
+ */
+
+namespace MyCLabs\Enum;
+
+/**
+ * Base Enum class
+ *
+ * Create an enum by implementing this class and adding class constants.
+ *
+ * @author Matthieu Napoli <matthieu@mnapoli.fr>
+ * @author Daniel Costa <danielcosta@gmail.com>
+ * @author Mirosław Filip <mirfilip@gmail.com>
+ *
+ * @psalm-template T
+ * @psalm-immutable
+ * @psalm-consistent-constructor
+ */
+abstract class Enum implements \JsonSerializable
+{
+    /**
+     * Enum value
+     *
+     * @var mixed
+     * @psalm-var T
+     */
+    protected $value;
+
+    /**
+     * Enum key, the constant name
+     *
+     * @var string
+     */
+    private $key;
+
+    /**
+     * Store existing constants in a static cache per object.
+     *
+     *
+     * @var array
+     * @psalm-var array<class-string, array<string, mixed>>
+     */
+    protected static $cache = [];
+
+    /**
+     * Cache of instances of the Enum class
+     *
+     * @var array
+     * @psalm-var array<class-string, array<string, static>>
+     */
+    protected static $instances = [];
+
+    /**
+     * Creates a new value of some type
+     *
+     * @psalm-pure
+     * @param mixed $value
+     *
+     * @psalm-param T $value
+     * @throws \UnexpectedValueException if incompatible type is given.
+     */
+    public function __construct($value)
+    {
+        if ($value instanceof static) {
+           /** @psalm-var T */
+            $value = $value->getValue();
+        }
+
+        $this->key = static::assertValidValueReturningKey($value);
+
+        /** @psalm-var T */
+        $this->value = $value;
+    }
+
+    public function __wakeup()
+    {
+        if ($this->key === null) {
+            $this->key = static::search($this->value);
+        }
+    }
+
+    /**
+     * @param mixed $value
+     * @return static
+     * @psalm-return static<T>
+     */
+    public static function from($value): self
+    {
+        $key = static::assertValidValueReturningKey($value);
+
+        return self::__callStatic($key, []);
+    }
+
+    /**
+     * @psalm-pure
+     * @return mixed
+     * @psalm-return T
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    /**
+     * Returns the enum key (i.e. the constant name).
+     *
+     * @psalm-pure
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->key;
+    }
+
+    /**
+     * @psalm-pure
+     * @psalm-suppress InvalidCast
+     * @return string
+     */
+    public function __toString()
+    {
+        return (string)$this->value;
+    }
+
+    /**
+     * Determines if Enum should be considered equal with the variable passed as a parameter.
+     * Returns false if an argument is an object of different class or not an object.
+     *
+     * This method is final, for more information read https://github.com/myclabs/php-enum/issues/4
+     *
+     * @psalm-pure
+     * @psalm-param mixed $variable
+     * @return bool
+     */
+    final public function equals($variable = null): bool
+    {
+        return $variable instanceof self
+            && $this->getValue() === $variable->getValue()
+            && static::class === \get_class($variable);
+    }
+
+    /**
+     * Returns the names (keys) of all constants in the Enum class
+     *
+     * @psalm-pure
+     * @psalm-return list<string>
+     * @return array
+     */
+    public static function keys()
+    {
+        return \array_keys(static::toArray());
+    }
+
+    /**
+     * Returns instances of the Enum class of all Enum constants
+     *
+     * @psalm-pure
+     * @psalm-return array<string, static>
+     * @return static[] Constant name in key, Enum instance in value
+     */
+    public static function values()
+    {
+        $values = array();
+
+        /** @psalm-var T $value */
+        foreach (static::toArray() as $key => $value) {
+            $values[$key] = new static($value);
+        }
+
+        return $values;
+    }
+
+    /**
+     * Returns all possible values as an array
+     *
+     * @psalm-pure
+     * @psalm-suppress ImpureStaticProperty
+     *
+     * @psalm-return array<string, mixed>
+     * @return array Constant name in key, constant value in value
+     */
+    public static function toArray()
+    {
+        $class = static::class;
+
+        if (!isset(static::$cache[$class])) {
+            /** @psalm-suppress ImpureMethodCall this reflection API usage has no side-effects here */
+            $reflection            = new \ReflectionClass($class);
+            /** @psalm-suppress ImpureMethodCall this reflection API usage has no side-effects here */
+            static::$cache[$class] = $reflection->getConstants();
+        }
+
+        return static::$cache[$class];
+    }
+
+    /**
+     * Check if is valid enum value
+     *
+     * @param $value
+     * @psalm-param mixed $value
+     * @psalm-pure
+     * @psalm-assert-if-true T $value
+     * @return bool
+     */
+    public static function isValid($value)
+    {
+        return \in_array($value, static::toArray(), true);
+    }
+
+    /**
+     * Asserts valid enum value
+     *
+     * @psalm-pure
+     * @psalm-assert T $value
+     */
+    public static function assertValidValue($value): void
+    {
+        self::assertValidValueReturningKey($value);
+    }
+
+    /**
+     * Asserts valid enum value
+     *
+     * @psalm-pure
+     * @psalm-assert T $value
+     */
+    private static function assertValidValueReturningKey($value): string
+    {
+        if (false === ($key = static::search($value))) {
+            throw new \UnexpectedValueException("Value '$value' is not part of the enum " . static::class);
+        }
+
+        return $key;
+    }
+
+    /**
+     * Check if is valid enum key
+     *
+     * @param $key
+     * @psalm-param string $key
+     * @psalm-pure
+     * @return bool
+     */
+    public static function isValidKey($key)
+    {
+        $array = static::toArray();
+
+        return isset($array[$key]) || \array_key_exists($key, $array);
+    }
+
+    /**
+     * Return key for value
+     *
+     * @param mixed $value
+     *
+     * @psalm-param mixed $value
+     * @psalm-pure
+     * @return string|false
+     */
+    public static function search($value)
+    {
+        return \array_search($value, static::toArray(), true);
+    }
+
+    /**
+     * Returns a value when called statically like so: MyEnum::SOME_VALUE() given SOME_VALUE is a class constant
+     *
+     * @param string $name
+     * @param array  $arguments
+     *
+     * @return static
+     * @throws \BadMethodCallException
+     *
+     * @psalm-pure
+     */
+    public static function __callStatic($name, $arguments)
+    {
+        $class = static::class;
+        if (!isset(self::$instances[$class][$name])) {
+            $array = static::toArray();
+            if (!isset($array[$name]) && !\array_key_exists($name, $array)) {
+                $message = "No static method or enum constant '$name' in class " . static::class;
+                throw new \BadMethodCallException($message);
+            }
+            return self::$instances[$class][$name] = new static($array[$name]);
+        }
+        return clone self::$instances[$class][$name];
+    }
+
+    /**
+     * Specify data which should be serialized to JSON. This method returns data that can be serialized by json_encode()
+     * natively.
+     *
+     * @return mixed
+     * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
+     * @psalm-pure
+     */
+    public function jsonSerialize()
+    {
+        return $this->getValue();
+    }
+}

+ 54 - 0
api/vendor/myclabs/php-enum/src/PHPUnit/Comparator.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace MyCLabs\Enum\PHPUnit;
+
+use MyCLabs\Enum\Enum;
+use SebastianBergmann\Comparator\ComparisonFailure;
+
+/**
+ * Use this Comparator to get nice output when using PHPUnit assertEquals() with Enums.
+ *
+ * Add this to your PHPUnit bootstrap PHP file:
+ *
+ * \SebastianBergmann\Comparator\Factory::getInstance()->register(new \MyCLabs\Enum\PHPUnit\Comparator());
+ */
+final class Comparator extends \SebastianBergmann\Comparator\Comparator
+{
+    public function accepts($expected, $actual)
+    {
+        return $expected instanceof Enum && (
+                $actual instanceof Enum || $actual === null
+            );
+    }
+
+    /**
+     * @param Enum $expected
+     * @param Enum|null $actual
+     *
+     * @return void
+     */
+    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)
+    {
+        if ($expected->equals($actual)) {
+            return;
+        }
+
+        throw new ComparisonFailure(
+            $expected,
+            $actual,
+            $this->formatEnum($expected),
+            $this->formatEnum($actual),
+            false,
+            'Failed asserting that two Enums are equal.'
+        );
+    }
+
+    private function formatEnum(Enum $enum = null)
+    {
+        if ($enum === null) {
+            return "null";
+        }
+
+        return get_class($enum)."::{$enum->getKey()}()";
+    }
+}

+ 14 - 0
api/vendor/paquettg/php-html-parser/.gitattributes

@@ -0,0 +1,14 @@
+/tests               export-ignore
+/tests               linguist-documentation
+/.scrutinizar.yml    export-ignore
+/.travis.yml         export-ignore
+/.gitignore          export-ignore
+/CHANGELOG.md        export-ignore
+/CONTRIBUTING.md     export-ignore
+/LICENSE.md          export-ignore
+/README.md           export-ignore
+/phpunit.php         export-ignore
+/phpunit.xml         export-ignore
+/infection.json.dist export-ignore
+/.phan               export-ignore
+/.php_cs.dist        export-ignore

+ 12 - 0
api/vendor/paquettg/php-html-parser/.github/FUNDING.yml

@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+# patreon: # Replace with a single Patreon username
+# open_collective: # Replace with a single Open Collective username
+# ko_fi: # Replace with a single Ko-fi username
+tidelift: "packagist/paquettg/php-html-parser"
+# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+# liberapay: # Replace with a single Liberapay username
+# issuehunt: # Replace with a single IssueHunt username
+# otechie: # Replace with a single Otechie username
+# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

+ 41 - 0
api/vendor/paquettg/php-html-parser/.scrutinizer.yml

@@ -0,0 +1,41 @@
+filter:
+    paths: [src/*]
+    excluded_paths: [tests/*]
+checks:
+    php:
+        code_rating: true
+        remove_extra_empty_lines: true
+        remove_php_closing_tag: true
+        remove_trailing_whitespace: true
+        fix_use_statements:
+            remove_unused: true
+            preserve_multiple: false
+            preserve_blanklines: true
+            order_alphabetically: true
+        fix_php_opening_tag: true
+        fix_linefeed: true
+        fix_line_ending: true
+        fix_identation_4spaces: true
+        fix_doc_comments: true
+tools:
+    external_code_coverage:
+        timeout: 600
+        runs: 3
+    php_code_coverage: false
+    php_code_sniffer:
+        config:
+            standard: PSR2
+        filter:
+            paths: ['src']
+    php_loc:
+        enabled: true
+        excluded_dirs: [vendor, test]
+    php_cpd:
+        enabled: true
+        excluded_dirs: [vendor, test]
+build:
+    nodes:
+        analysis:
+            tests:
+                override:
+                    - php-scrutinizer-run

+ 11 - 0
api/vendor/paquettg/php-html-parser/SECURITY.md

@@ -0,0 +1,11 @@
+# Security Policy
+
+## Supported Versions
+
+We only support the most recent version with security fixes.
+
+## Reporting a Vulnerability
+
+If you have found any issues that might have security implications, please refer to https://tidelift.com/security
+
+Do not report security reports publicly.

+ 38 - 0
api/vendor/paquettg/php-html-parser/composer.json

@@ -0,0 +1,38 @@
+{
+    "name": "paquettg/php-html-parser",
+    "type": "library",
+    "description": "An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.",
+    "keywords": ["html", "dom", "parser"],
+    "homepage": "https://github.com/paquettg/php-html-parser",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Gilles Paquette",
+            "email": "paquettg@gmail.com",
+            "homepage": "http://gillespaquette.ca"
+        }
+    ],
+    "require": {
+        "php": ">=7.2",
+        "ext-mbstring": "*",
+        "ext-zlib": "*",
+        "ext-curl": "*",
+        "paquettg/string-encode": "~1.0.0",
+        "php-http/httplug": "^2.1",
+        "guzzlehttp/guzzle": "^7.0",
+        "guzzlehttp/psr7": "^1.6",
+        "myclabs/php-enum": "^1.7"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "^7.5.1",
+        "mockery/mockery": "^1.2",
+        "infection/infection": "^0.13.4",
+        "phan/phan": "^2.4",
+        "friendsofphp/php-cs-fixer": "^2.16"
+    },
+    "autoload": {
+        "psr-4": { 
+        	"PHPHtmlParser\\": "src/PHPHtmlParser"
+       	}
+    }
+}

+ 257 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Content.php

@@ -0,0 +1,257 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser;
+
+use PHPHtmlParser\Enum\StringToken;
+use PHPHtmlParser\Exceptions\ContentLengthException;
+use PHPHtmlParser\Exceptions\LogicalException;
+
+/**
+ * Class Content.
+ */
+class Content
+{
+    /**
+     * The content string.
+     *
+     * @var string
+     */
+    protected $content;
+
+    /**
+     * The size of the content.
+     *
+     * @var int
+     */
+    protected $size;
+
+    /**
+     * The current position we are in the content.
+     *
+     * @var int
+     */
+    protected $pos;
+
+    /**
+     * The following 4 strings are tags that are important to us.
+     *
+     * @var string
+     */
+    protected $blank = " \t\r\n";
+    protected $equal = ' =/>';
+    protected $slash = " />\r\n\t";
+    protected $attr = ' >';
+
+    /**
+     * Content constructor.
+     */
+    public function __construct(string $content = '')
+    {
+        $this->content = $content;
+        $this->size = \strlen($content);
+        $this->pos = 0;
+    }
+
+    /**
+     * Returns the current position of the content.
+     */
+    public function getPosition(): int
+    {
+        return $this->pos;
+    }
+
+    /**
+     * Gets the current character we are at.
+     *
+     * @param ?int $char
+     */
+    public function char(?int $char = null): string
+    {
+        return $this->content[$char ?? $this->pos] ?? '';
+    }
+
+    /**
+     * Gets a string from the current character position.
+     *
+     * @param int $length
+     * @return string
+     */
+    public function string(int $length = 1): string
+    {
+        $string = '';
+        $position = $this->pos;
+        do {
+            $string .= $this->char($position++);
+        } while ($position < $this->pos + $length);
+        return $string;
+    }
+
+    /**
+     * Moves the current position forward.
+     *
+     * @throws ContentLengthException
+     */
+    public function fastForward(int $count): Content
+    {
+        if (!$this->canFastForward($count)) {
+            // trying to go over the content length, throw exception
+            throw new ContentLengthException('Attempt to fastForward pass the length of the content.');
+        }
+        $this->pos += $count;
+
+        return $this;
+    }
+
+    /**
+     * Checks if we can move the position forward.
+     */
+    public function canFastForward(int $count): bool
+    {
+        return \strlen($this->content) >= $this->pos + $count;
+    }
+
+    /**
+     * Moves the current position backward.
+     */
+    public function rewind(int $count): Content
+    {
+        $this->pos -= $count;
+        if ($this->pos < 0) {
+            $this->pos = 0;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Copy the content until we find the given string.
+     */
+    public function copyUntil(string $string, bool $char = false, bool $escape = false): string
+    {
+        if ($this->pos >= $this->size) {
+            // nothing left
+            return '';
+        }
+
+        if ($escape) {
+            $position = $this->pos;
+            $found = false;
+            while (!$found) {
+                $position = \strpos($this->content, $string, $position);
+                if ($position === false) {
+                    // reached the end
+                    break;
+                }
+
+                if ($this->char($position - 1) == '\\') {
+                    // this character is escaped
+                    ++$position;
+                    continue;
+                }
+
+                $found = true;
+            }
+        } elseif ($char) {
+            $position = \strcspn($this->content, $string, $this->pos);
+            $position += $this->pos;
+        } else {
+            $position = \strpos($this->content, $string, $this->pos);
+        }
+
+        if ($position === false) {
+            // could not find character, just return the remaining of the content
+            $return = \substr($this->content, $this->pos, $this->size - $this->pos);
+            if ($return === false) {
+                throw new LogicalException('Substr returned false with position ' . $this->pos . '.');
+            }
+            $this->pos = $this->size;
+
+            return $return;
+        }
+
+        if ($position == $this->pos) {
+            // we are at the right place
+            return '';
+        }
+
+        $return = \substr($this->content, $this->pos, $position - $this->pos);
+        if ($return === false) {
+            throw new LogicalException('Substr returned false with position ' . $this->pos . '.');
+        }
+        // set the new position
+        $this->pos = $position;
+
+        return $return;
+    }
+
+    /**
+     * Copies the content until the string is found and return it
+     * unless the 'unless' is found in the substring.
+     */
+    public function copyUntilUnless(string $string, string $unless): string
+    {
+        $lastPos = $this->pos;
+        $this->fastForward(1);
+        $foundString = $this->copyUntil($string, true, true);
+
+        $position = \strcspn($foundString, $unless);
+        if ($position == \strlen($foundString)) {
+            return $string . $foundString;
+        }
+        // rewind changes and return nothing
+        $this->pos = $lastPos;
+
+        return '';
+    }
+
+    /**
+     * Copies the content until it reaches the token string.,.
+     *
+     * @uses $this->copyUntil()
+     */
+    public function copyByToken(StringToken $stringToken, bool $char = false, bool $escape = false): string
+    {
+        $string = $stringToken->getValue();
+
+        return $this->copyUntil($string, $char, $escape);
+    }
+
+    /**
+     * Skip a given set of characters.
+     *
+     * @throws LogicalException
+     */
+    public function skip(string $string, bool $copy = false): string
+    {
+        $len = \strspn($this->content, $string, $this->pos);
+        if ($len === false) {
+            throw new LogicalException('Strspn returned false with position ' . $this->pos . '.');
+        }
+        $return = '';
+        if ($copy) {
+            $return = \substr($this->content, $this->pos, $len);
+            if ($return === false) {
+                throw new LogicalException('Substr returned false with position ' . $this->pos . '.');
+            }
+        }
+
+        // update the position
+        $this->pos += $len;
+
+        return $return;
+    }
+
+    /**
+     * Skip a given token of pre-defined characters.
+     *
+     * @uses $this->skip()
+     */
+    public function skipByToken(StringToken $skipToken, bool $copy = false): string
+    {
+        $string = $skipToken->getValue();
+
+        return $this->skip($string, $copy);
+    }
+}

+ 16 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Dom/CleanerInterface.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace PHPHtmlParser\Contracts\Dom;
+
+use PHPHtmlParser\Exceptions\LogicalException;
+use PHPHtmlParser\Options;
+
+interface CleanerInterface
+{
+    /**
+     * Cleans the html of any none-html information.
+     *
+     * @throws LogicalException
+     */
+    public function clean(string $str, Options $options, string $defaultCharset): string;
+}

+ 33 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Dom/ParserInterface.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace PHPHtmlParser\Contracts\Dom;
+
+use PHPHtmlParser\Content;
+use PHPHtmlParser\Dom\Node\AbstractNode;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+use PHPHtmlParser\Exceptions\CircularException;
+use PHPHtmlParser\Exceptions\ContentLengthException;
+use PHPHtmlParser\Exceptions\LogicalException;
+use PHPHtmlParser\Exceptions\StrictException;
+use PHPHtmlParser\Options;
+
+interface ParserInterface
+{
+    /**
+     * Attempts to parse the html in content.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     * @throws ContentLengthException
+     * @throws LogicalException
+     * @throws StrictException
+     */
+    public function parse(Options $options, Content $content, int $size): AbstractNode;
+
+    /**
+     * Attempts to detect the charset that the html was sent in.
+     *
+     * @throws ChildNotFoundException
+     */
+    public function detectCharset(Options $options, string $defaultCharset, AbstractNode $root): bool;
+}

+ 23 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/DomInterface.php

@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Contracts;
+
+use PHPHtmlParser\Dom;
+use PHPHtmlParser\Options;
+use Psr\Http\Client\ClientInterface;
+use Psr\Http\Message\RequestInterface;
+
+interface DomInterface
+{
+    public function loadFromFile(string $file, ?Options $options = null): Dom;
+
+    public function loadFromUrl(string $url, ?Options $options, ?ClientInterface $client = null, ?RequestInterface $request = null): Dom;
+
+    public function loadStr(string $str, ?Options $options = null): Dom;
+
+    public function setOptions(Options $options): Dom;
+
+    public function find(string $selector, int $nth = null);
+}

+ 12 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Selector/ParserInterface.php

@@ -0,0 +1,12 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Contracts\Selector;
+
+use PHPHtmlParser\DTO\Selector\ParsedSelectorCollectionDTO;
+
+interface ParserInterface
+{
+    public function parseSelectorString(string $selector): ParsedSelectorCollectionDTO;
+}

+ 17 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Selector/SeekerInterface.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace PHPHtmlParser\Contracts\Selector;
+
+use PHPHtmlParser\DTO\Selector\RuleDTO;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+
+interface SeekerInterface
+{
+    /**
+     * Attempts to find all children that match the rule
+     * given.
+     *
+     * @throws ChildNotFoundException
+     */
+    public function seek(array $nodes, RuleDTO $rule, array $options): array;
+}

+ 31 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Contracts/Selector/SelectorInterface.php

@@ -0,0 +1,31 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Contracts\Selector;
+
+use PHPHtmlParser\Dom\Node\AbstractNode;
+use PHPHtmlParser\Dom\Node\Collection;
+use PHPHtmlParser\DTO\Selector\ParsedSelectorCollectionDTO;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+
+interface SelectorInterface
+{
+    /**
+     * Constructs with the selector string.
+     */
+    public function __construct(string $selector, ?ParserInterface $parser = null, ?SeekerInterface $seeker = null);
+
+    /**
+     * Returns the selectors that where found.
+     */
+    public function getParsedSelectorCollectionDTO(): ParsedSelectorCollectionDTO;
+
+    /**
+     * Attempts to find the selectors starting from the given
+     * node object.
+     *
+     * @throws ChildNotFoundException
+     */
+    public function find(AbstractNode $node): Collection;
+}

+ 41 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Selector/ParsedSelectorCollectionDTO.php

@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\DTO\Selector;
+
+final class ParsedSelectorCollectionDTO
+{
+    /**
+     * @var ParsedSelectorDTO[]
+     */
+    private $parsedSelectorDTO = [];
+
+    /**
+     * @param ParsedSelectorDTO[] $parsedSelectorDTOs
+     */
+    private function __construct(array $parsedSelectorDTOs)
+    {
+        foreach ($parsedSelectorDTOs as $parsedSelectorDTO) {
+            if ($parsedSelectorDTO instanceof ParsedSelectorDTO) {
+                $this->parsedSelectorDTO[] = $parsedSelectorDTO;
+            }
+        }
+    }
+
+    /**
+     * @param ParsedSelectorDTO[] $parsedSelectorDTOs
+     */
+    public static function makeCollection(array $parsedSelectorDTOs): ParsedSelectorCollectionDTO
+    {
+        return new ParsedSelectorCollectionDTO($parsedSelectorDTOs);
+    }
+
+    /**
+     * @return ParsedSelectorDTO[]
+     */
+    public function getParsedSelectorDTO(): array
+    {
+        return $this->parsedSelectorDTO;
+    }
+}

+ 41 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Selector/ParsedSelectorDTO.php

@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\DTO\Selector;
+
+final class ParsedSelectorDTO
+{
+    /**
+     * @var RuleDTO[]
+     */
+    private $rules = [];
+
+    /**
+     * @param RuleDTO[] $ruleDTOs
+     */
+    private function __construct(array $ruleDTOs)
+    {
+        foreach ($ruleDTOs as $ruleDTO) {
+            if ($ruleDTO instanceof RuleDTO) {
+                $this->rules[] = $ruleDTO;
+            }
+        }
+    }
+
+    /**
+     * @param RuleDTO[] $ruleDTOs
+     */
+    public static function makeFromRules(array $ruleDTOs): ParsedSelectorDTO
+    {
+        return new ParsedSelectorDTO($ruleDTOs);
+    }
+
+    /**
+     * @return RuleDTO[]
+     */
+    public function getRules(): array
+    {
+        return $this->rules;
+    }
+}

+ 100 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Selector/RuleDTO.php

@@ -0,0 +1,100 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\DTO\Selector;
+
+final class RuleDTO
+{
+    /**
+     * @var string
+     */
+    private $tag;
+
+    /**
+     * @var string
+     */
+    private $operator;
+
+    /**
+     * @var string|array|null
+     */
+    private $key;
+
+    /**
+     * @var string|array|null
+     */
+    private $value;
+
+    /**
+     * @var bool
+     */
+    private $noKey;
+
+    /**
+     * @var bool
+     */
+    private $alterNext;
+
+    private function __construct(array $values)
+    {
+        $this->tag = $values['tag'];
+        $this->operator = $values['operator'];
+        $this->key = $values['key'];
+        $this->value = $values['value'];
+        $this->noKey = $values['noKey'];
+        $this->alterNext = $values['alterNext'];
+    }
+
+    /**
+     * @param string|array|null $key
+     * @param string|array|null $value
+     */
+    public static function makeFromPrimitives(string $tag, string $operator, $key, $value, bool $noKey, bool $alterNext): RuleDTO
+    {
+        return new RuleDTO([
+            'tag'       => $tag,
+            'operator'  => $operator,
+            'key'       => $key,
+            'value'     => $value,
+            'noKey'     => $noKey,
+            'alterNext' => $alterNext,
+        ]);
+    }
+
+    public function getTag(): string
+    {
+        return $this->tag;
+    }
+
+    public function getOperator(): string
+    {
+        return $this->operator;
+    }
+
+    /**
+     * @return string|array|null
+     */
+    public function getKey()
+    {
+        return $this->key;
+    }
+
+    /**
+     * @return string|array|null
+     */
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    public function isNoKey(): bool
+    {
+        return $this->noKey;
+    }
+
+    public function isAlterNext(): bool
+    {
+        return $this->alterNext;
+    }
+}

+ 60 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/Tag/AttributeDTO.php

@@ -0,0 +1,60 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\DTO\Tag;
+
+use stringEncode\Encode;
+use stringEncode\Exception;
+
+final class AttributeDTO
+{
+    /**
+     * @var ?string
+     */
+    private $value;
+
+    /**
+     * @var bool
+     */
+    private $doubleQuote;
+
+    private function __construct(array $values)
+    {
+        $this->value = $values['value'];
+        $this->doubleQuote = $values['doubleQuote'] ?? true;
+    }
+
+    public static function makeFromPrimitives(?string $value, bool $doubleQuote = true): AttributeDTO
+    {
+        return new AttributeDTO([
+            'value'       => $value,
+            'doubleQuote' => $doubleQuote,
+        ]);
+    }
+
+    public function getValue(): ?string
+    {
+        return $this->value;
+    }
+
+    public function isDoubleQuote(): bool
+    {
+        return $this->doubleQuote;
+    }
+
+    public function htmlspecialcharsDecode(): void
+    {
+        if (!\is_null($this->value)) {
+            $this->value = \htmlspecialchars_decode($this->value);
+        }
+    }
+
+    /**
+     * @throws Exception
+     */
+    public function encodeValue(Encode $encode)
+    {
+        $this->value = $encode->convert($this->value);
+    }
+}

+ 74 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/DTO/TagDTO.php

@@ -0,0 +1,74 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\DTO;
+
+use PHPHtmlParser\Dom\Node\HtmlNode;
+
+final class TagDTO
+{
+    /**
+     * @var bool
+     */
+    private $status;
+
+    /**
+     * @var bool
+     */
+    private $closing;
+
+    /**
+     * @var ?HtmlNode
+     */
+    private $node;
+
+    /**
+     * @var ?string
+     */
+    private $tag;
+
+    private function __construct(array $values = [])
+    {
+        $this->status = $values['status'] ?? false;
+        $this->closing = $values['closing'] ?? false;
+        $this->node = $values['node'] ?? null;
+        $this->tag = $values['tag'] ?? null;
+    }
+
+    public static function makeFromPrimitives(bool $status = false, bool $closing = false, ?HtmlNode $node = null, ?string $tag = null): TagDTO
+    {
+        return new TagDTO([
+            'status'  => $status,
+            'closing' => $closing,
+            'node'    => $node,
+            'tag'     => $tag,
+        ]);
+    }
+
+    public function isStatus(): bool
+    {
+        return $this->status;
+    }
+
+    public function isClosing(): bool
+    {
+        return $this->closing;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getNode(): ?HtmlNode
+    {
+        return $this->node;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getTag(): ?string
+    {
+        return $this->tag;
+    }
+}

+ 25 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/CleanerDiscovery.php

@@ -0,0 +1,25 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Discovery;
+
+use PHPHtmlParser\Contracts\Dom\CleanerInterface;
+use PHPHtmlParser\Dom\Cleaner;
+
+class CleanerDiscovery
+{
+    /**
+     * @var Cleaner|null
+     */
+    private static $parser = null;
+
+    public static function find(): CleanerInterface
+    {
+        if (self::$parser == null) {
+            self::$parser = new Cleaner();
+        }
+
+        return self::$parser;
+    }
+}

+ 25 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/DomParserDiscovery.php

@@ -0,0 +1,25 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Discovery;
+
+use PHPHtmlParser\Contracts\Dom\ParserInterface;
+use PHPHtmlParser\Dom\Parser;
+
+class DomParserDiscovery
+{
+    /**
+     * @var ParserInterface|null
+     */
+    private static $parser = null;
+
+    public static function find(): ParserInterface
+    {
+        if (self::$parser == null) {
+            self::$parser = new Parser();
+        }
+
+        return self::$parser;
+    }
+}

+ 25 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/SeekerDiscovery.php

@@ -0,0 +1,25 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Discovery;
+
+use PHPHtmlParser\Contracts\Selector\SeekerInterface;
+use PHPHtmlParser\Selector\Seeker;
+
+class SeekerDiscovery
+{
+    /**
+     * @var SeekerInterface|null
+     */
+    private static $seeker = null;
+
+    public static function find(): SeekerInterface
+    {
+        if (self::$seeker == null) {
+            self::$seeker = new Seeker();
+        }
+
+        return self::$seeker;
+    }
+}

+ 25 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Discovery/SelectorParserDiscovery.php

@@ -0,0 +1,25 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Discovery;
+
+use PHPHtmlParser\Contracts\Selector\ParserInterface;
+use PHPHtmlParser\Selector\Parser;
+
+class SelectorParserDiscovery
+{
+    /**
+     * @var ParserInterface|null
+     */
+    private static $parser = null;
+
+    public static function find(): ParserInterface
+    {
+        if (self::$parser == null) {
+            self::$parser = new Parser();
+        }
+
+        return self::$parser;
+    }
+}

+ 251 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom.php

@@ -0,0 +1,251 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser;
+
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\Client;
+use PHPHtmlParser\Contracts\Dom\CleanerInterface;
+use PHPHtmlParser\Contracts\Dom\ParserInterface;
+use PHPHtmlParser\Contracts\DomInterface;
+use PHPHtmlParser\Discovery\CleanerDiscovery;
+use PHPHtmlParser\Discovery\DomParserDiscovery;
+use PHPHtmlParser\Dom\Node\Collection;
+use PHPHtmlParser\Dom\RootAccessTrait;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+use PHPHtmlParser\Exceptions\CircularException;
+use PHPHtmlParser\Exceptions\LogicalException;
+use PHPHtmlParser\Exceptions\NotLoadedException;
+use PHPHtmlParser\Exceptions\StrictException;
+use PHPHtmlParser\Exceptions\UnknownChildTypeException;
+use Psr\Http\Client\ClientExceptionInterface;
+use Psr\Http\Client\ClientInterface;
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Class Dom.
+ */
+class Dom implements DomInterface
+{
+    use RootAccessTrait;
+
+    /**
+     * The charset we would like the output to be in.
+     *
+     * @var string
+     */
+    private $defaultCharset = 'UTF-8';
+
+    /**
+     * The document string.
+     *
+     * @var Content
+     */
+    private $content;
+
+    /**
+     * A global options array to be used by all load calls.
+     *
+     * @var ?Options
+     */
+    private $globalOptions;
+
+    /**
+     * @var ParserInterface
+     */
+    private $domParser;
+    /**
+     * @var CleanerInterface
+     */
+    private $domCleaner;
+
+    public function __construct(?ParserInterface $domParser = null, ?CleanerInterface $domCleaner = null)
+    {
+        if ($domParser === null) {
+            $domParser = DomParserDiscovery::find();
+        }
+        if ($domCleaner === null) {
+            $domCleaner = CleanerDiscovery::find();
+        }
+
+        $this->domParser = $domParser;
+        $this->domCleaner = $domCleaner;
+    }
+
+    /**
+     * Returns the inner html of the root node.
+     *
+     * @throws ChildNotFoundException
+     * @throws UnknownChildTypeException
+     * @throws NotLoadedException
+     */
+    public function __toString(): string
+    {
+        $this->isLoaded();
+
+        return $this->root->innerHtml();
+    }
+
+    /**
+     * Loads the dom from a document file/url.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     * @throws Exceptions\ContentLengthException
+     * @throws LogicalException
+     * @throws StrictException
+     */
+    public function loadFromFile(string $file, ?Options $options = null): Dom
+    {
+        $content = @\file_get_contents($file);
+        if ($content === false) {
+            throw new LogicalException('file_get_contents failed and returned false when trying to read "' . $file . '".');
+        }
+
+        return $this->loadStr($content, $options);
+    }
+
+    /**
+     * Use a curl interface implementation to attempt to load
+     * the content from a url.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     * @throws Exceptions\ContentLengthException
+     * @throws LogicalException
+     * @throws StrictException
+     * @throws ClientExceptionInterface
+     */
+    public function loadFromUrl(string $url, ?Options $options = null, ?ClientInterface $client = null, ?RequestInterface $request = null): Dom
+    {
+        if ($client === null) {
+            $client = new Client();
+        }
+        if ($request === null) {
+            $request = new Request('GET', $url);
+        }
+
+        $response = $client->sendRequest($request);
+        $content = $response->getBody()->getContents();
+
+        return $this->loadStr($content, $options);
+    }
+
+    /**
+     * Parsers the html of the given string. Used for load(), loadFromFile(),
+     * and loadFromUrl().
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     * @throws Exceptions\ContentLengthException
+     * @throws LogicalException
+     * @throws StrictException
+     */
+    public function loadStr(string $str, ?Options $options = null): Dom
+    {
+        $localOptions = new Options();
+        if ($this->globalOptions !== null) {
+            $localOptions = $localOptions->setFromOptions($this->globalOptions);
+        }
+        if ($options !== null) {
+            $localOptions = $localOptions->setFromOptions($options);
+        }
+
+        $html = $this->domCleaner->clean($str, $localOptions, $this->defaultCharset);
+
+        $this->content = new Content($html);
+
+        $this->root = $this->domParser->parse($localOptions, $this->content, \strlen($str));
+        $this->domParser->detectCharset($localOptions, $this->defaultCharset, $this->root);
+
+        return $this;
+    }
+
+    /**
+     * Sets a global options array to be used by all load calls.
+     */
+    public function setOptions(Options $options): Dom
+    {
+        $this->globalOptions = $options;
+
+        return $this;
+    }
+
+    /**
+     * Find elements by css selector on the root node.
+     *
+     * @throws NotLoadedException
+     * @throws ChildNotFoundException
+     *
+     * @return mixed|Collection|null
+     */
+    public function find(string $selector, int $nth = null)
+    {
+        $this->isLoaded();
+
+        return $this->root->find($selector, $nth);
+    }
+
+    /**
+     * Simple wrapper function that returns an element by the
+     * id.
+     *
+     * @param $id
+     *
+     * @throws NotLoadedException
+     * @throws ChildNotFoundException
+     *
+     * @return mixed|Collection|null
+     */
+    public function getElementById($id)
+    {
+        $this->isLoaded();
+
+        return $this->find('#' . $id, 0);
+    }
+
+    /**
+     * Simple wrapper function that returns all elements by
+     * tag name.
+     *
+     * @throws NotLoadedException
+     * @throws ChildNotFoundException
+     *
+     * @return mixed|Collection|null
+     */
+    public function getElementsByTag(string $name)
+    {
+        $this->isLoaded();
+
+        return $this->find($name);
+    }
+
+    /**
+     * Simple wrapper function that returns all elements by
+     * class name.
+     *
+     * @throws NotLoadedException
+     * @throws ChildNotFoundException
+     *
+     * @return mixed|Collection|null
+     */
+    public function getElementsByClass(string $class)
+    {
+        $this->isLoaded();
+
+        return $this->find('.' . $class);
+    }
+
+    /**
+     * Checks if the load methods have been called.
+     *
+     * @throws NotLoadedException
+     */
+    private function isLoaded(): void
+    {
+        if (\is_null($this->content)) {
+            throw new NotLoadedException('Content is not loaded!');
+        }
+    }
+}

+ 130 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Cleaner.php

@@ -0,0 +1,130 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom;
+
+use PHPHtmlParser\Contracts\Dom\CleanerInterface;
+use PHPHtmlParser\Exceptions\LogicalException;
+use PHPHtmlParser\Options;
+
+class Cleaner implements CleanerInterface
+{
+    /**
+     * Cleans the html of any none-html information.
+     *
+     * @throws LogicalException
+     */
+    public function clean(string $str, Options $options, string $defaultCharset): string
+    {
+        if (!$options->isCleanupInput()) {
+            // skip entire cleanup step
+            return $str;
+        }
+
+        // check if the string is gziped
+        $is_gzip = 0 === \mb_strpos($str, "\x1f" . "\x8b" . "\x08", 0, 'US-ASCII');
+        if ($is_gzip) {
+            $str = \gzdecode($str);
+            if ($str === false) {
+                throw new LogicalException('gzdecode returned false. Error when trying to decode the string.');
+            }
+        }
+
+        // we must handle character encoding
+        $str = $this->setUpRegexEncoding($str, $options, $defaultCharset);
+
+        // remove white space before closing tags
+        $str = \mb_eregi_replace("'\s+>", "'>", $str);
+        if ($str === false) {
+            throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to clean single quotes.');
+        }
+        $str = \mb_eregi_replace('"\s+>', '">', $str);
+        if ($str === false) {
+            throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to clean double quotes.');
+        }
+
+        // clean out the \n\r
+        $replace = ' ';
+        if ($options->isPreserveLineBreaks()) {
+            $replace = '&#10;';
+        }
+        $str = \str_replace(["\r\n", "\r", "\n"], $replace, $str);
+        if ($str === false) {
+            throw new LogicalException('str_replace returned false instead of a string. Error when attempting to clean input string.');
+        }
+
+        // strip the doctype
+        $str = \mb_eregi_replace('<!doctype(.*?)>', '', $str);
+        if ($str === false) {
+            throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to strip the doctype.');
+        }
+
+        // strip out comments
+        $str = \mb_eregi_replace('<!--(.*?)-->', '', $str);
+        if ($str === false) {
+            throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to strip comments.');
+        }
+
+        // strip out cdata
+        $str = \mb_eregi_replace("<!\[CDATA\[(.*?)\]\]>", '', $str);
+        if ($str === false) {
+            throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to strip out cdata.');
+        }
+
+        // strip out <script> tags
+        if ($options->isRemoveScripts()) {
+            $str = \mb_eregi_replace("<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>", '', $str);
+            if ($str === false) {
+                throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to remove scripts 1.');
+            }
+            $str = \mb_eregi_replace("<\s*script\s*>(.*?)<\s*/\s*script\s*>", '', $str);
+            if ($str === false) {
+                throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to remove scripts 2.');
+            }
+        }
+
+        // strip out <style> tags
+        if ($options->isRemoveStyles()) {
+            $str = \mb_eregi_replace("<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>", '', $str);
+            if ($str === false) {
+                throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to strip out style tags 1.');
+            }
+            $str = \mb_eregi_replace("<\s*style\s*>(.*?)<\s*/\s*style\s*>", '', $str);
+            if ($str === false) {
+                throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to strip out style tags 2.');
+            }
+        }
+
+        // strip smarty scripts
+        if ($options->isRemoveSmartyScripts()) {
+            $str = \mb_eregi_replace("(\{\w)(.*?)(\})", '', $str);
+            if ($str === false) {
+                throw new LogicalException('mb_eregi_replace returned false instead of a string. Error when attempting to remove smarty scripts.');
+            }
+        }
+
+        return $str;
+    }
+
+    /**
+     * Sets up the mb_regex_encoding and converts the text to that encoding.
+     *
+     * @throws LogicalException
+     */
+    private function setUpRegexEncoding(string $str, Options $options, string $defaultCharset): string
+    {
+        $encoding = $defaultCharset;
+        $enforceEncoding = $options->getEnforceEncoding();
+        if ($enforceEncoding !== null) {
+            //  they want to enforce the given encoding
+            $encoding = $enforceEncoding;
+        }
+
+        if (!\mb_regex_encoding($encoding)) {
+            throw new LogicalException('Character encoding was not able to be changed to ' . $encoding . '.');
+        }
+
+        return \mb_convert_encoding($str, $encoding);
+    }
+}

+ 495 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/AbstractNode.php

@@ -0,0 +1,495 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom\Node;
+
+use PHPHtmlParser\Contracts\Selector\SelectorInterface;
+use PHPHtmlParser\Dom\Tag;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+use PHPHtmlParser\Exceptions\CircularException;
+use PHPHtmlParser\Exceptions\ParentNotFoundException;
+use PHPHtmlParser\Exceptions\Tag\AttributeNotFoundException;
+use PHPHtmlParser\Finder;
+use PHPHtmlParser\Selector\Selector;
+use stringEncode\Encode;
+
+/**
+ * Dom node object.
+ *
+ * @property-read string    $outerhtml
+ * @property-read string    $innerhtml
+ * @property-read string    $innerText
+ * @property-read string    $text
+ * @property-read Tag       $tag
+ * @property-read InnerNode $parent
+ */
+abstract class AbstractNode
+{
+    /**
+     * Contains the tag name/type.
+     *
+     * @var ?Tag
+     */
+    protected $tag;
+
+    /**
+     * Contains a list of attributes on this tag.
+     *
+     * @var array
+     */
+    protected $attr = [];
+
+    /**
+     * Contains the parent Node.
+     *
+     * @var ?InnerNode
+     */
+    protected $parent;
+
+    /**
+     * The unique id of the class. Given by PHP.
+     *
+     * @var int
+     */
+    protected $id;
+
+    /**
+     * The encoding class used to encode strings.
+     *
+     * @var mixed
+     */
+    protected $encode;
+
+    /**
+     * An array of all the children.
+     *
+     * @var array
+     */
+    protected $children = [];
+
+    /**
+     * @var bool
+     */
+    protected $htmlSpecialCharsDecode = false;
+    /**
+     * @var int
+     */
+    private static $count = 0;
+
+    /**
+     * Creates a unique id for this node.
+     */
+    public function __construct()
+    {
+        $this->id = self::$count;
+        ++self::$count;
+    }
+
+    /**
+     * Attempts to clear out any object references.
+     */
+    public function __destruct()
+    {
+        $this->tag = null;
+        $this->parent = null;
+        $this->attr = [];
+        $this->children = [];
+    }
+
+    /**
+     * Magic get method for attributes and certain methods.
+     *
+     * @return mixed
+     */
+    public function __get(string $key)
+    {
+        // check attribute first
+        if ($this->getAttribute($key) !== null) {
+            return $this->getAttribute($key);
+        }
+        switch (\strtolower($key)) {
+            case 'outerhtml':
+                return $this->outerHtml();
+            case 'innerhtml':
+                return $this->innerHtml();
+            case 'innertext':
+                return $this->innerText();
+            case 'text':
+                return $this->text();
+            case 'tag':
+                return $this->getTag();
+            case 'parent':
+                return $this->getParent();
+        }
+    }
+
+    /**
+     * Simply calls the outer text method.
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return $this->outerHtml();
+    }
+
+    /**
+     * @param bool $htmlSpecialCharsDecode
+     */
+    public function setHtmlSpecialCharsDecode($htmlSpecialCharsDecode = false): void
+    {
+        $this->htmlSpecialCharsDecode = $htmlSpecialCharsDecode;
+    }
+
+    /**
+     * Returns the id of this object.
+     */
+    public function id(): int
+    {
+        return $this->id;
+    }
+
+    /**
+     * Returns the parent of node.
+     *
+     * @return InnerNode
+     */
+    public function getParent(): ?InnerNode
+    {
+        return $this->parent;
+    }
+
+    /**
+     * Sets the parent node.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     */
+    public function setParent(InnerNode $parent): AbstractNode
+    {
+        // remove from old parent
+        if ($this->parent !== null) {
+            if ($this->parent->id() == $parent->id()) {
+                // already the parent
+                return $this;
+            }
+
+            $this->parent->removeChild($this->id);
+        }
+
+        $this->parent = $parent;
+
+        // assign child to parent
+        $this->parent->addChild($this);
+
+        return $this;
+    }
+
+    /**
+     * Removes this node and all its children from the
+     * DOM tree.
+     *
+     * @return void
+     */
+    public function delete()
+    {
+        if ($this->parent !== null) {
+            $this->parent->removeChild($this->id);
+        }
+        $this->parent->clear();
+        $this->clear();
+    }
+
+    /**
+     * Sets the encoding class to this node.
+     *
+     * @return void
+     */
+    public function propagateEncoding(Encode $encode)
+    {
+        $this->encode = $encode;
+        $this->tag->setEncoding($encode);
+    }
+
+    /**
+     * Checks if the given node id is an ancestor of
+     * the current node.
+     */
+    public function isAncestor(int $id): bool
+    {
+        if ($this->getAncestor($id) !== null) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Attempts to get an ancestor node by the given id.
+     *
+     * @return AbstractNode|null
+     */
+    public function getAncestor(int $id)
+    {
+        if ($this->parent !== null) {
+            if ($this->parent->id() == $id) {
+                return $this->parent;
+            }
+
+            return $this->parent->getAncestor($id);
+        }
+    }
+
+    /**
+     * Checks if the current node has a next sibling.
+     */
+    public function hasNextSibling(): bool
+    {
+        try {
+            $this->nextSibling();
+
+            // sibling found, return true;
+            return true;
+        } catch (ParentNotFoundException $e) {
+            // no parent, no next sibling
+            unset($e);
+
+            return false;
+        } catch (ChildNotFoundException $e) {
+            // no sibling found
+            unset($e);
+
+            return false;
+        }
+    }
+
+    /**
+     * Attempts to get the next sibling.
+     *
+     * @throws ChildNotFoundException
+     * @throws ParentNotFoundException
+     */
+    public function nextSibling(): AbstractNode
+    {
+        if ($this->parent === null) {
+            throw new ParentNotFoundException('Parent is not set for this node.');
+        }
+
+        return $this->parent->nextChild($this->id);
+    }
+
+    /**
+     * Attempts to get the previous sibling.
+     *
+     * @throws ChildNotFoundException
+     * @throws ParentNotFoundException
+     */
+    public function previousSibling(): AbstractNode
+    {
+        if ($this->parent === null) {
+            throw new ParentNotFoundException('Parent is not set for this node.');
+        }
+
+        return $this->parent->previousChild($this->id);
+    }
+
+    /**
+     * Gets the tag object of this node.
+     */
+    public function getTag(): Tag
+    {
+        return $this->tag;
+    }
+
+    /**
+     * Replaces the tag for this node.
+     *
+     * @param string|Tag $tag
+     */
+    public function setTag($tag): AbstractNode
+    {
+        if (\is_string($tag)) {
+            $tag = new Tag($tag);
+        }
+
+        $this->tag = $tag;
+
+        // clear any cache
+        $this->clear();
+
+        return $this;
+    }
+
+    /**
+     * A wrapper method that simply calls the getAttribute method
+     * on the tag of this node.
+     */
+    public function getAttributes(): array
+    {
+        $attributes = $this->tag->getAttributes();
+        foreach ($attributes as $name => $attributeDTO) {
+            $attributes[$name] = $attributeDTO->getValue();
+        }
+
+        return $attributes;
+    }
+
+    /**
+     * A wrapper method that simply calls the getAttribute method
+     * on the tag of this node.
+     */
+    public function getAttribute(string $key): ?string
+    {
+        try {
+            $attributeDTO = $this->tag->getAttribute($key);
+        } catch (AttributeNotFoundException $e) {
+            // no attribute with this key exists, returning null.
+            unset($e);
+
+            return null;
+        }
+
+        return $attributeDTO->getValue();
+    }
+
+    /**
+     * A wrapper method that simply calls the hasAttribute method
+     * on the tag of this node.
+     */
+    public function hasAttribute(string $key): bool
+    {
+        return $this->tag->hasAttribute($key);
+    }
+
+    /**
+     * A wrapper method that simply calls the setAttribute method
+     * on the tag of this node.
+     */
+    public function setAttribute(string $key, ?string $value, bool $doubleQuote = true): AbstractNode
+    {
+        $this->tag->setAttribute($key, $value, $doubleQuote);
+
+        //clear any cache
+        $this->clear();
+
+        return $this;
+    }
+
+    /**
+     * A wrapper method that simply calls the removeAttribute method
+     * on the tag of this node.
+     */
+    public function removeAttribute(string $key): void
+    {
+        $this->tag->removeAttribute($key);
+
+        //clear any cache
+        $this->clear();
+    }
+
+    /**
+     * A wrapper method that simply calls the removeAllAttributes
+     * method on the tag of this node.
+     */
+    public function removeAllAttributes(): void
+    {
+        $this->tag->removeAllAttributes();
+
+        //clear any cache
+        $this->clear();
+    }
+
+    /**
+     * Function to locate a specific ancestor tag in the path to the root.
+     *
+     * @throws ParentNotFoundException
+     */
+    public function ancestorByTag(string $tag): AbstractNode
+    {
+        // Start by including ourselves in the comparison.
+        $node = $this;
+
+        do {
+            if ($node->tag->name() == $tag) {
+                return $node;
+            }
+
+            $node = $node->getParent();
+        } while ($node !== null);
+
+        throw new ParentNotFoundException('Could not find an ancestor with "' . $tag . '" tag');
+    }
+
+    /**
+     * Find elements by css selector.
+     *
+     * @throws ChildNotFoundException
+     *
+     * @return mixed|Collection|null
+     */
+    public function find(string $selectorString, ?int $nth = null, ?SelectorInterface $selector = null)
+    {
+        if (\is_null($selector)) {
+            $selector = new Selector($selectorString);
+        }
+
+        $nodes = $selector->find($this);
+
+        if ($nth !== null) {
+            // return nth-element or array
+            if (isset($nodes[$nth])) {
+                return $nodes[$nth];
+            }
+
+            return;
+        }
+
+        return $nodes;
+    }
+
+    /**
+     * Find node by id.
+     *
+     * @throws ChildNotFoundException
+     * @throws ParentNotFoundException
+     *
+     * @return bool|AbstractNode
+     */
+    public function findById(int $id)
+    {
+        $finder = new Finder($id);
+
+        return $finder->find($this);
+    }
+
+    /**
+     * Gets the inner html of this node.
+     */
+    abstract public function innerHtml(): string;
+
+    /**
+     * Gets the html of this node, including it's own
+     * tag.
+     */
+    abstract public function outerHtml(): string;
+
+    /**
+     * Gets the text of this node (if there is any text).
+     */
+    abstract public function text(): string;
+
+    /**
+     * Check is node type textNode.
+     */
+    public function isTextNode(): bool
+    {
+        return false;
+    }
+
+    /**
+     * Call this when something in the node tree has changed. Like a child has been added
+     * or a parent has been changed.
+     */
+    abstract protected function clear(): void;
+}

+ 45 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/ArrayNode.php

@@ -0,0 +1,45 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom\Node;
+
+use ArrayIterator;
+use Countable;
+use IteratorAggregate;
+use PHPHtmlParser\Dom\Tag;
+
+/**
+ * Dom node object which will allow users to use it as
+ * an array.
+ *
+ * @property-read string    $outerhtml
+ * @property-read string    $innerhtml
+ * @property-read string    $innerText
+ * @property-read string    $text
+ * @property-read Tag       $tag
+ * @property-read InnerNode $parent
+ */
+abstract class ArrayNode extends AbstractNode implements IteratorAggregate, Countable
+{
+    /**
+     * Gets the iterator.
+     */
+    public function getIterator(): ArrayIterator
+    {
+        return new ArrayIterator($this->getIteratorArray());
+    }
+
+    /**
+     * Returns the count of the iterator array.
+     */
+    public function count(): int
+    {
+        return \count($this->getIteratorArray());
+    }
+
+    /**
+     * Returns the array to be used the the iterator.
+     */
+    abstract protected function getIteratorArray(): array;
+}

+ 156 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/Collection.php

@@ -0,0 +1,156 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom\Node;
+
+use ArrayAccess;
+use ArrayIterator;
+use Countable;
+use IteratorAggregate;
+use PHPHtmlParser\Exceptions\EmptyCollectionException;
+
+/**
+ * Class Collection.
+ */
+class Collection implements IteratorAggregate, ArrayAccess, Countable
+{
+    /**
+     * The collection of Nodes.
+     *
+     * @var array
+     */
+    protected $collection = [];
+
+    /**
+     * Attempts to call the method on the first node in
+     * the collection.
+     *
+     * @throws EmptyCollectionException
+     *
+     * @return mixed
+     */
+    public function __call(string $method, array $arguments)
+    {
+        $node = \reset($this->collection);
+        if ($node instanceof AbstractNode) {
+            return \call_user_func_array([$node, $method], $arguments);
+        }
+        throw new EmptyCollectionException('The collection does not contain any Nodes.');
+    }
+
+    /**
+     * Attempts to apply the magic get to the first node
+     * in the collection.
+     *
+     * @param mixed $key
+     *
+     * @throws EmptyCollectionException
+     *
+     * @return mixed
+     */
+    public function __get($key)
+    {
+        $node = \reset($this->collection);
+        if ($node instanceof AbstractNode) {
+            return $node->$key;
+        }
+        throw new EmptyCollectionException('The collection does not contain any Nodes.');
+    }
+
+    /**
+     * Applies the magic string method to the first node in
+     * the collection.
+     */
+    public function __toString(): string
+    {
+        $node = \reset($this->collection);
+        if ($node instanceof AbstractNode) {
+            return (string) $node;
+        }
+
+        return '';
+    }
+
+    /**
+     * Returns the count of the collection.
+     */
+    public function count(): int
+    {
+        return \count($this->collection);
+    }
+
+    /**
+     * Returns an iterator for the collection.
+     */
+    public function getIterator(): ArrayIterator
+    {
+        return new ArrayIterator($this->collection);
+    }
+
+    /**
+     * Set an attribute by the given offset.
+     *
+     * @param mixed $offset
+     * @param mixed $value
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (\is_null($offset)) {
+            $this->collection[] = $value;
+        } else {
+            $this->collection[$offset] = $value;
+        }
+    }
+
+    /**
+     * Checks if an offset exists.
+     *
+     * @param mixed $offset
+     */
+    public function offsetExists($offset): bool
+    {
+        return isset($this->collection[$offset]);
+    }
+
+    /**
+     * Unset a collection Node.
+     *
+     * @param mixed $offset
+     */
+    public function offsetUnset($offset): void
+    {
+        unset($this->collection[$offset]);
+    }
+
+    /**
+     * Gets a node at the given offset, or null.
+     *
+     * @param mixed $offset
+     *
+     * @return mixed
+     */
+    public function offsetGet($offset)
+    {
+        return $this->collection[$offset] ?? null;
+    }
+
+    /**
+     * Returns this collection as an array.
+     */
+    public function toArray(): array
+    {
+        return $this->collection;
+    }
+
+    /**
+     * Similar to jQuery "each" method. Calls the callback with each
+     * Node in this collection.
+     */
+    public function each(callable $callback)
+    {
+        foreach ($this->collection as $key => $value) {
+            $callback($value, $key);
+        }
+    }
+}

+ 244 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/HtmlNode.php

@@ -0,0 +1,244 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom\Node;
+
+use PHPHtmlParser\Dom\Tag;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+use PHPHtmlParser\Exceptions\UnknownChildTypeException;
+
+/**
+ * Class HtmlNode.
+ *
+ * @property-read string    $outerhtml
+ * @property-read string    $innerhtml
+ * @property-read string    $innerText
+ * @property-read string    $text
+ * @property-read Tag       $tag
+ * @property-read InnerNode $parent
+ */
+class HtmlNode extends InnerNode
+{
+    /**
+     * Remembers what the innerHtml was if it was scanned previously.
+     *
+     * @var ?string
+     */
+    protected $innerHtml;
+
+    /**
+     * Remembers what the outerHtml was if it was scanned previously.
+     *
+     * @var ?string
+     */
+    protected $outerHtml;
+
+    /**
+     * Remembers what the innerText was if it was scanned previously.
+     *
+     * @var ?string
+     */
+    protected $innerText;
+
+    /**
+     * Remembers what the text was if it was scanned previously.
+     *
+     * @var ?string
+     */
+    protected $text;
+
+    /**
+     * Remembers what the text was when we looked into all our
+     * children nodes.
+     *
+     * @var ?string
+     */
+    protected $textWithChildren;
+
+    /**
+     * Sets up the tag of this node.
+     *
+     * @param string|Tag $tag
+     */
+    public function __construct($tag)
+    {
+        if (!$tag instanceof Tag) {
+            $tag = new Tag($tag);
+        }
+        $this->tag = $tag;
+        parent::__construct();
+    }
+
+    /**
+     * @param bool $htmlSpecialCharsDecode
+     */
+    public function setHtmlSpecialCharsDecode($htmlSpecialCharsDecode = false): void
+    {
+        parent::setHtmlSpecialCharsDecode($htmlSpecialCharsDecode);
+        $this->tag->setHtmlSpecialCharsDecode($htmlSpecialCharsDecode);
+    }
+
+    /**
+     * Gets the inner html of this node.
+     *
+     * @throws ChildNotFoundException
+     * @throws UnknownChildTypeException
+     */
+    public function innerHtml(): string
+    {
+        if (!$this->hasChildren()) {
+            // no children
+            return '';
+        }
+
+        if ($this->innerHtml !== null) {
+            // we already know the result.
+            return $this->innerHtml;
+        }
+
+        $child = $this->firstChild();
+        $string = '';
+
+        // continue to loop until we are out of children
+        while ($child !== null) {
+            if ($child instanceof TextNode) {
+                $string .= $child->text();
+            } elseif ($child instanceof HtmlNode) {
+                $string .= $child->outerHtml();
+            } else {
+                throw new UnknownChildTypeException('Unknown child type "' . \get_class($child) . '" found in node');
+            }
+
+            try {
+                $child = $this->nextChild($child->id());
+            } catch (ChildNotFoundException $e) {
+                // no more children
+                unset($e);
+                $child = null;
+            }
+        }
+
+        // remember the results
+        $this->innerHtml = $string;
+
+        return $string;
+    }
+
+    /**
+     * Gets the inner text of this node.
+     *
+     * @throws ChildNotFoundException
+     * @throws UnknownChildTypeException
+     */
+    public function innerText(): string
+    {
+        if (\is_null($this->innerText)) {
+            $this->innerText = \strip_tags($this->innerHtml());
+        }
+
+        return $this->innerText;
+    }
+
+    /**
+     * Gets the html of this node, including it's own
+     * tag.
+     *
+     * @throws ChildNotFoundException
+     * @throws UnknownChildTypeException
+     */
+    public function outerHtml(): string
+    {
+        // special handling for root
+        if ($this->tag->name() == 'root') {
+            return $this->innerHtml();
+        }
+
+        if ($this->outerHtml !== null) {
+            // we already know the results.
+            return $this->outerHtml;
+        }
+
+        $return = $this->tag->makeOpeningTag();
+        if ($this->tag->isSelfClosing()) {
+            // ignore any children... there should not be any though
+            return $return;
+        }
+
+        // get the inner html
+        $return .= $this->innerHtml();
+
+        // add closing tag
+        $return .= $this->tag->makeClosingTag();
+
+        // remember the results
+        $this->outerHtml = $return;
+
+        return $return;
+    }
+
+    /**
+     * Gets the text of this node (if there is any text). Or get all the text
+     * in this node, including children.
+     */
+    public function text(bool $lookInChildren = false): string
+    {
+        if ($lookInChildren) {
+            if ($this->textWithChildren !== null) {
+                // we already know the results.
+                return $this->textWithChildren;
+            }
+        } elseif ($this->text !== null) {
+            // we already know the results.
+            return $this->text;
+        }
+
+        // find out if this node has any text children
+        $text = '';
+        foreach ($this->children as $child) {
+            /** @var AbstractNode $node */
+            $node = $child['node'];
+            if ($node instanceof TextNode) {
+                $text .= $child['node']->text;
+            } elseif (
+                $lookInChildren &&
+                $node instanceof HtmlNode
+            ) {
+                $text .= $node->text($lookInChildren);
+            }
+        }
+
+        // remember our result
+        if ($lookInChildren) {
+            $this->textWithChildren = $text;
+        } else {
+            $this->text = $text;
+        }
+
+        return $text;
+    }
+
+    /**
+     * Call this when something in the node tree has changed. Like a child has been added
+     * or a parent has been changed.
+     */
+    protected function clear(): void
+    {
+        $this->innerHtml = null;
+        $this->outerHtml = null;
+        $this->text = null;
+        $this->textWithChildren = null;
+
+        if ($this->parent !== null) {
+            $this->parent->clear();
+        }
+    }
+
+    /**
+     * Returns all children of this html node.
+     */
+    protected function getIteratorArray(): array
+    {
+        return $this->getChildren();
+    }
+}

+ 442 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/InnerNode.php

@@ -0,0 +1,442 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom\Node;
+
+use PHPHtmlParser\Dom\Tag;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+use PHPHtmlParser\Exceptions\CircularException;
+use PHPHtmlParser\Exceptions\LogicalException;
+use stringEncode\Encode;
+
+/**
+ * Inner node of the html tree, might have children.
+ *
+ * @property-read string    $outerhtml
+ * @property-read string    $innerhtml
+ * @property-read string    $innerText
+ * @property-read string    $text
+ * @property-read Tag       $tag
+ * @property-read InnerNode $parent
+ */
+abstract class InnerNode extends ArrayNode
+{
+    /**
+     * An array of all the children.
+     *
+     * @var array
+     */
+    protected $children = [];
+
+    /**
+     * Sets the encoding class to this node and propagates it
+     * to all its children.
+     */
+    public function propagateEncoding(Encode $encode): void
+    {
+        $this->encode = $encode;
+        $this->tag->setEncoding($encode);
+        // check children
+        foreach ($this->children as $child) {
+            /** @var AbstractNode $node */
+            $node = $child['node'];
+            $node->propagateEncoding($encode);
+        }
+    }
+
+    /**
+     * Checks if this node has children.
+     */
+    public function hasChildren(): bool
+    {
+        return !empty($this->children);
+    }
+
+    /**
+     * Returns the child by id.
+     *
+     * @throws ChildNotFoundException
+     */
+    public function getChild(int $id): AbstractNode
+    {
+        if (!isset($this->children[$id])) {
+            throw new ChildNotFoundException("Child '$id' not found in this node.");
+        }
+
+        return $this->children[$id]['node'];
+    }
+
+    /**
+     * Returns a new array of child nodes.
+     */
+    public function getChildren(): array
+    {
+        $nodes = [];
+        $childrenIds = [];
+        try {
+            $child = $this->firstChild();
+            do {
+                $nodes[] = $child;
+                $childrenIds[] = $child->id;
+                $child = $this->nextChild($child->id());
+                if (\in_array($child->id, $childrenIds, true)) {
+                    throw new CircularException('Circular sibling referance found. Child with id ' . $child->id() . ' found twice.');
+                }
+            } while (true);
+        } catch (ChildNotFoundException $e) {
+            // we are done looking for children
+            unset($e);
+        }
+
+        return $nodes;
+    }
+
+    /**
+     * Counts children.
+     */
+    public function countChildren(): int
+    {
+        return \count($this->children);
+    }
+
+    /**
+     * Adds a child node to this node and returns the id of the child for this
+     * parent.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     * @throws LogicalException
+     */
+    public function addChild(AbstractNode $child, int $before = -1): bool
+    {
+        $key = null;
+
+        // check integrity
+        if ($this->isAncestor($child->id())) {
+            throw new CircularException('Can not add child. It is my ancestor.');
+        }
+
+        // check if child is itself
+        if ($child->id() == $this->id) {
+            throw new CircularException('Can not set itself as a child.');
+        }
+
+        $next = null;
+
+        if ($this->hasChildren()) {
+            if (isset($this->children[$child->id()])) {
+                // we already have this child
+                return false;
+            }
+
+            if ($before >= 0) {
+                if (!isset($this->children[$before])) {
+                    return false;
+                }
+
+                $key = $this->children[$before]['prev'];
+
+                if ($key) {
+                    $this->children[$key]['next'] = $child->id();
+                }
+
+                $this->children[$before]['prev'] = $child->id();
+                $next = $before;
+            } else {
+                $sibling = $this->lastChild();
+                $key = $sibling->id();
+
+                $this->children[$key]['next'] = $child->id();
+            }
+        }
+
+        $keys = \array_keys($this->children);
+
+        $insert = [
+            'node' => $child,
+            'next' => $next,
+            'prev' => $key,
+        ];
+
+        $index = $key ? (int) (\array_search($key, $keys, true) + 1) : 0;
+        \array_splice($keys, $index, 0, (string) $child->id());
+
+        $children = \array_values($this->children);
+        \array_splice($children, $index, 0, [$insert]);
+
+        // add the child
+        $combination = \array_combine($keys, $children);
+        if ($combination === false) {
+            // The number of elements for each array isn't equal or if the arrays are empty.
+            throw new LogicalException('array combine failed during add child method call.');
+        }
+        $this->children = $combination;
+
+        // tell child I am the new parent
+        $child->setParent($this);
+
+        //clear any cache
+        $this->clear();
+
+        return true;
+    }
+
+    /**
+     * Insert element before child with provided id.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     */
+    public function insertBefore(AbstractNode $child, int $id): bool
+    {
+        return $this->addChild($child, $id);
+    }
+
+    /**
+     * Insert element before after with provided id.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     */
+    public function insertAfter(AbstractNode $child, int $id): bool
+    {
+        if (!isset($this->children[$id])) {
+            return false;
+        }
+
+        if (isset($this->children[$id]['next']) && \is_int($this->children[$id]['next'])) {
+            return $this->addChild($child, (int) $this->children[$id]['next']);
+        }
+
+        // clear cache
+        $this->clear();
+
+        return $this->addChild($child);
+    }
+
+    /**
+     * Removes the child by id.
+     */
+    public function removeChild(int $id): InnerNode
+    {
+        if (!isset($this->children[$id])) {
+            return $this;
+        }
+
+        // handle moving next and previous assignments.
+        $next = $this->children[$id]['next'];
+        $prev = $this->children[$id]['prev'];
+        if (!\is_null($next)) {
+            $this->children[$next]['prev'] = $prev;
+        }
+        if (!\is_null($prev)) {
+            $this->children[$prev]['next'] = $next;
+        }
+
+        // remove the child
+        unset($this->children[$id]);
+
+        //clear any cache
+        $this->clear();
+
+        return $this;
+    }
+
+    /**
+     * Check if has next Child.
+     *
+     * @throws ChildNotFoundException
+     *
+     * @return mixed
+     */
+    public function hasNextChild(int $id)
+    {
+        $child = $this->getChild($id);
+
+        return $this->children[$child->id()]['next'];
+    }
+
+    /**
+     * Attempts to get the next child.
+     *
+     * @throws ChildNotFoundException
+     *
+     * @uses $this->getChild()
+     */
+    public function nextChild(int $id): AbstractNode
+    {
+        $child = $this->getChild($id);
+        $next = $this->children[$child->id()]['next'];
+        if (\is_null($next) || !\is_int($next)) {
+            throw new ChildNotFoundException("Child '$id' next sibling not found in this node.");
+        }
+
+        return $this->getChild($next);
+    }
+
+    /**
+     * Attempts to get the previous child.
+     *
+     * @throws ChildNotFoundException
+     *
+     * @uses $this->getChild()
+     */
+    public function previousChild(int $id): AbstractNode
+    {
+        $child = $this->getchild($id);
+        $next = $this->children[$child->id()]['prev'];
+        if (\is_null($next) || !\is_int($next)) {
+            throw new ChildNotFoundException("Child '$id' previous not found in this node.");
+        }
+
+        return $this->getChild($next);
+    }
+
+    /**
+     * Checks if the given node id is a child of the
+     * current node.
+     */
+    public function isChild(int $id): bool
+    {
+        foreach (\array_keys($this->children) as $childId) {
+            if ($id == $childId) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Removes the child with id $childId and replace it with the new child
+     * $newChild.
+     *
+     * @throws LogicalException
+     */
+    public function replaceChild(int $childId, AbstractNode $newChild): void
+    {
+        $oldChild = $this->children[$childId];
+
+        $newChild->prev = (int) $oldChild['prev'];
+        $newChild->next = (int) $oldChild['next'];
+
+        $keys = \array_keys($this->children);
+        $index = \array_search($childId, $keys, true);
+        $keys[$index] = $newChild->id();
+        $combination = \array_combine($keys, $this->children);
+        if ($combination === false) {
+            // The number of elements for each array isn't equal or if the arrays are empty.
+            throw new LogicalException('array combine failed during replace child method call.');
+        }
+        $this->children = $combination;
+        $this->children[$newChild->id()] = [
+            'prev' => $oldChild['prev'],
+            'node' => $newChild,
+            'next' => $oldChild['next'],
+        ];
+
+        // change previous child id to new child
+        if ($oldChild['prev'] && isset($this->children[$newChild->prev])) {
+            $this->children[$oldChild['prev']]['next'] = $newChild->id();
+        }
+
+        // change next child id to new child
+        if ($oldChild['next'] && isset($this->children[$newChild->next])) {
+            $this->children[$oldChild['next']]['prev'] = $newChild->id();
+        }
+
+        // remove old child
+        unset($this->children[$childId]);
+
+        // clean out cache
+        $this->clear();
+    }
+
+    /**
+     * Shortcut to return the first child.
+     *
+     * @throws ChildNotFoundException
+     *
+     * @uses $this->getChild()
+     */
+    public function firstChild(): AbstractNode
+    {
+        if (\count($this->children) == 0) {
+            // no children
+            throw new ChildNotFoundException('No children found in node.');
+        }
+
+        \reset($this->children);
+        $key = (int) \key($this->children);
+
+        return $this->getChild($key);
+    }
+
+    /**
+     * Attempts to get the last child.
+     *
+     * @throws ChildNotFoundException
+     *
+     * @uses $this->getChild()
+     */
+    public function lastChild(): AbstractNode
+    {
+        if (\count($this->children) == 0) {
+            // no children
+            throw new ChildNotFoundException('No children found in node.');
+        }
+
+        \end($this->children);
+        $key = \key($this->children);
+
+        if (!\is_int($key)) {
+            throw new LogicalException('Children array contain child with a key that is not an int.');
+        }
+
+        return $this->getChild($key);
+    }
+
+    /**
+     * Checks if the given node id is a descendant of the
+     * current node.
+     */
+    public function isDescendant(int $id): bool
+    {
+        if ($this->isChild($id)) {
+            return true;
+        }
+
+        foreach ($this->children as $child) {
+            /** @var InnerNode $node */
+            $node = $child['node'];
+            if ($node instanceof InnerNode
+              && $node->hasChildren()
+              && $node->isDescendant($id)
+            ) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Sets the parent node.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     */
+    public function setParent(InnerNode $parent): AbstractNode
+    {
+        // check integrity
+        if ($this->isDescendant($parent->id())) {
+            throw new CircularException('Can not add descendant "' . $parent->id() . '" as my parent.');
+        }
+
+        // clear cache
+        $this->clear();
+
+        return parent::setParent($parent);
+    }
+}

+ 21 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/LeafNode.php

@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom\Node;
+
+use PHPHtmlParser\Dom\Tag;
+
+/**
+ * Class LeafNode.
+ *
+ * @property-read string    $outerhtml
+ * @property-read string    $innerhtml
+ * @property-read string    $innerText
+ * @property-read string    $text
+ * @property-read Tag       $tag
+ * @property-read InnerNode $parent
+ */
+abstract class LeafNode extends AbstractNode
+{
+}

+ 155 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Node/TextNode.php

@@ -0,0 +1,155 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom\Node;
+
+use PHPHtmlParser\Dom\Tag;
+use PHPHtmlParser\Exceptions\LogicalException;
+
+/**
+ * Class TextNode.
+ *
+ * @property-read string    $outerhtml
+ * @property-read string    $innerhtml
+ * @property-read string    $innerText
+ * @property-read string    $text
+ * @property-read Tag       $tag
+ * @property-read InnerNode $parent
+ */
+class TextNode extends LeafNode
+{
+    /**
+     * This is a text node.
+     *
+     * @var Tag
+     */
+    protected $tag;
+
+    /**
+     * This is the text in this node.
+     *
+     * @var string
+     */
+    protected $text;
+
+    /**
+     * This is the converted version of the text.
+     *
+     * @var ?string
+     */
+    protected $convertedText;
+
+    /**
+     * Sets the text for this node.
+     *
+     * @param bool $removeDoubleSpace
+     */
+    public function __construct(string $text, $removeDoubleSpace = true)
+    {
+        if ($removeDoubleSpace) {
+            // remove double spaces
+            $replacedText = \mb_ereg_replace('\s+', ' ', $text);
+            if ($replacedText === false) {
+                throw new LogicalException('mb_ereg_replace returns false when attempting to clean white space from "' . $text . '".');
+            }
+            $text = $replacedText;
+        }
+
+        // restore line breaks
+        $text = \str_replace('&#10;', "\n", $text);
+
+        $this->text = $text;
+        $this->tag = new Tag('text');
+        parent::__construct();
+    }
+
+    /**
+     * @param bool $htmlSpecialCharsDecode
+     */
+    public function setHtmlSpecialCharsDecode($htmlSpecialCharsDecode = false): void
+    {
+        parent::setHtmlSpecialCharsDecode($htmlSpecialCharsDecode);
+        $this->tag->setHtmlSpecialCharsDecode($htmlSpecialCharsDecode);
+    }
+
+    /**
+     * Returns the text of this node.
+     */
+    public function text(): string
+    {
+        if ($this->htmlSpecialCharsDecode) {
+            $text = \htmlspecialchars_decode($this->text);
+        } else {
+            $text = $this->text;
+        }
+        // convert charset
+        if (!\is_null($this->encode)) {
+            if (!\is_null($this->convertedText)) {
+                // we already know the converted value
+                return $this->convertedText;
+            }
+            $text = $this->encode->convert($text);
+
+            // remember the conversion
+            $this->convertedText = $text;
+
+            return $text;
+        }
+
+        return $text;
+    }
+
+    /**
+     * Sets the text for this node.
+     *
+     * @var string
+     */
+    public function setText(string $text): void
+    {
+        $this->text = $text;
+        if (!\is_null($this->encode)) {
+            $text = $this->encode->convert($text);
+
+            // remember the conversion
+            $this->convertedText = $text;
+        }
+    }
+
+    /**
+     * This node has no html, just return the text.
+     *
+     * @uses $this->text()
+     */
+    public function innerHtml(): string
+    {
+        return $this->text();
+    }
+
+    /**
+     * This node has no html, just return the text.
+     *
+     * @uses $this->text()
+     */
+    public function outerHtml(): string
+    {
+        return $this->text();
+    }
+
+    /**
+     * Checks if the current node is a text node.
+     */
+    public function isTextNode(): bool
+    {
+        return true;
+    }
+
+    /**
+     * Call this when something in the node tree has changed. Like a child has been added
+     * or a parent has been changed.
+     */
+    protected function clear(): void
+    {
+        $this->convertedText = null;
+    }
+}

+ 348 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Parser.php

@@ -0,0 +1,348 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom;
+
+use PHPHtmlParser\Content;
+use PHPHtmlParser\Contracts\Dom\ParserInterface;
+use PHPHtmlParser\Dom\Node\AbstractNode;
+use PHPHtmlParser\Dom\Node\HtmlNode;
+use PHPHtmlParser\Dom\Node\TextNode;
+use PHPHtmlParser\DTO\TagDTO;
+use PHPHtmlParser\Enum\StringToken;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+use PHPHtmlParser\Exceptions\CircularException;
+use PHPHtmlParser\Exceptions\ContentLengthException;
+use PHPHtmlParser\Exceptions\LogicalException;
+use PHPHtmlParser\Exceptions\StrictException;
+use PHPHtmlParser\Options;
+use stringEncode\Encode;
+
+class Parser implements ParserInterface
+{
+    /**
+     * Attempts to parse the html in content.
+     *
+     * @throws ChildNotFoundException
+     * @throws CircularException
+     * @throws ContentLengthException
+     * @throws LogicalException
+     * @throws StrictException
+     */
+    public function parse(Options $options, Content $content, int $size): AbstractNode
+    {
+        // add the root node
+        $root = new HtmlNode('root');
+        $root->setHtmlSpecialCharsDecode($options->isHtmlSpecialCharsDecode());
+        $activeNode = $root;
+        while ($activeNode !== null) {
+            if ($activeNode && $activeNode->tag->name() === 'script'
+                && $options->isCleanupInput() !== true
+            ) {
+                $str = $content->copyUntil('</');
+            } else {
+                $str = $content->copyUntil('<');
+            }
+            if ($str == '') {
+                $tagDTO = $this->parseTag($options, $content, $size);
+                if (!$tagDTO->isStatus()) {
+                    // we are done here
+                    $activeNode = null;
+                    continue;
+                }
+
+                // check if it was a closing tag
+                if ($tagDTO->isClosing()) {
+                    $foundOpeningTag = true;
+                    $originalNode = $activeNode;
+                    while ($activeNode->getTag()->name() != $tagDTO->getTag()) {
+                        $activeNode = $activeNode->getParent();
+                        if ($activeNode === null) {
+                            // we could not find opening tag
+                            $activeNode = $originalNode;
+                            $foundOpeningTag = false;
+                            break;
+                        }
+                    }
+                    if ($foundOpeningTag) {
+                        $activeNode = $activeNode->getParent();
+                    }
+                    continue;
+                }
+
+                if ($tagDTO->getNode() === null) {
+                    continue;
+                }
+
+                /** @var AbstractNode $node */
+                $node = $tagDTO->getNode();
+                $activeNode->addChild($node);
+
+                // check if node is self closing
+                if (!$node->getTag()->isSelfClosing()) {
+                    $activeNode = $node;
+                }
+            } elseif ($options->isWhitespaceTextNode() ||
+                \trim($str) != ''
+            ) {
+                // we found text we care about
+                $textNode = new TextNode($str, $options->isRemoveDoubleSpace());
+                $textNode->setHtmlSpecialCharsDecode($options->isHtmlSpecialCharsDecode());
+                $activeNode->addChild($textNode);
+            }
+        }
+
+        return $root;
+    }
+
+    /**
+     * Attempts to detect the charset that the html was sent in.
+     *
+     * @throws ChildNotFoundException
+     */
+    public function detectCharset(Options $options, string $defaultCharset, AbstractNode $root): bool
+    {
+        // set the default
+        $encode = new Encode();
+        $encode->from($defaultCharset);
+        $encode->to($defaultCharset);
+
+        $enforceEncoding = $options->getEnforceEncoding();
+        if ($enforceEncoding !== null) {
+            //  they want to enforce the given encoding
+            $encode->from($enforceEncoding);
+            $encode->to($enforceEncoding);
+
+            return false;
+        }
+
+        /** @var AbstractNode $meta */
+        $meta = $root->find('meta[http-equiv=Content-Type]', 0);
+        if ($meta == null) {
+            if (!$this->detectHTML5Charset($encode, $root)) {
+                // could not find meta tag
+                $root->propagateEncoding($encode);
+
+                return false;
+            }
+
+            return true;
+        }
+        $content = $meta->getAttribute('content');
+        if (\is_null($content)) {
+            // could not find content
+            $root->propagateEncoding($encode);
+
+            return false;
+        }
+        $matches = [];
+        if (\preg_match('/charset=([^;]+)/', $content, $matches)) {
+            $encode->from(\trim($matches[1]));
+            $root->propagateEncoding($encode);
+
+            return true;
+        }
+
+        // no charset found
+        $root->propagateEncoding($encode);
+
+        return false;
+    }
+
+    /**
+     * Attempt to parse a tag out of the content.
+     *
+     * @throws StrictException
+     * @throws ContentLengthException
+     * @throws LogicalException
+     * @throws StrictException
+     */
+    private function parseTag(Options $options, Content $content, int $size): TagDTO
+    {
+        if ($content->char() != '<') {
+            // we are not at the beginning of a tag
+            return TagDTO::makeFromPrimitives();
+        }
+
+        // check if this is a closing tag
+        try {
+            $content->fastForward(1);
+        } catch (ContentLengthException $exception) {
+            // we are at the end of the file
+            return TagDTO::makeFromPrimitives();
+        }
+        if ($content->char() == '/') {
+            return $this->makeEndTag($content, $options);
+        }
+        if ($content->char() == '?') {
+            // special setting tag
+            $tag = $content->fastForward(1)
+                ->copyByToken(StringToken::SLASH(), true);
+            $tag = (new Tag($tag))
+                ->setOpening('<?')
+                ->setClosing(' ?>')
+                ->selfClosing();
+        } elseif($content->string(3) == '!--') {
+            // comment tag
+            $tag = $content->fastForward(3)
+                ->copyByToken(StringToken::CLOSECOMMENT(), true);
+            $tag = (new Tag($tag))
+                ->setOpening('<!--')
+                ->setClosing('-->')
+                ->selfClosing();
+        } else {
+            $tag = \strtolower($content->copyByToken(StringToken::SLASH(), true));
+            if (\trim($tag) == '') {
+                // no tag found, invalid < found
+                return TagDTO::makeFromPrimitives();
+            }
+        }
+        $node = new HtmlNode($tag);
+        $node->setHtmlSpecialCharsDecode($options->isHtmlSpecialCharsDecode());
+        $this->setUpAttributes($content, $size, $node, $options, $tag);
+
+        $content->skipByToken(StringToken::BLANK());
+        if ($content->char() == '/') {
+            // self closing tag
+            $node->getTag()->selfClosing();
+            $content->fastForward(1);
+        } elseif (\in_array($node->getTag()->name(), $options->getSelfClosing(), true)) {
+            // Should be a self closing tag, check if we are strict
+            if ($options->isStrict()) {
+                $character = $content->getPosition();
+                throw new StrictException("Tag '" . $node->getTag()->name() . "' is not self closing! (character #$character)");
+            }
+
+            // We force self closing on this tag.
+            $node->getTag()->selfClosing();
+
+            // Should this tag use a trailing slash?
+            if (\in_array($node->getTag()->name(), $options->getNoSlash(), true)) {
+                $node->getTag()->noTrailingSlash();
+            }
+        }
+
+        if ($content->canFastForward(1)) {
+            $content->fastForward(1);
+        }
+
+        return TagDTO::makeFromPrimitives(true, false, $node);
+    }
+
+    /**
+     * @throws ChildNotFoundException
+     */
+    private function detectHTML5Charset(Encode $encode, AbstractNode $root): bool
+    {
+        /** @var AbstractNode|null $meta */
+        $meta = $root->find('meta[charset]', 0);
+        if ($meta == null) {
+            return false;
+        }
+
+        $encode->from(\trim($meta->getAttribute('charset')));
+        $root->propagateEncoding($encode);
+
+        return true;
+    }
+
+    /**
+     * @throws ContentLengthException
+     * @throws LogicalException
+     */
+    private function makeEndTag(Content $content, Options $options): TagDTO
+    {
+        $tag = $content->fastForward(1)
+            ->copyByToken(StringToken::SLASH(), true);
+        // move to end of tag
+        $content->copyUntil('>');
+        $content->fastForward(1);
+
+        // check if this closing tag counts
+        $tag = \strtolower($tag);
+        if (\in_array($tag, $options->getSelfClosing(), true)) {
+            return TagDTO::makeFromPrimitives(true);
+        }
+
+        return TagDTO::makeFromPrimitives(true, true, null, \strtolower($tag));
+    }
+
+    /**
+     * @param string|Tag $tag
+     *
+     * @throws ContentLengthException
+     * @throws LogicalException
+     * @throws StrictException
+     */
+    private function setUpAttributes(Content $content, int $size, HtmlNode $node, Options $options, $tag): void
+    {
+        while (
+            $content->char() != '>' &&
+            $content->char() != '/'
+        ) {
+            $space = $content->skipByToken(StringToken::BLANK(), true);
+            if (empty($space)) {
+                try {
+                    $content->fastForward(1);
+                } catch (ContentLengthException $exception) {
+                    // reached the end of the content
+                    break;
+                }
+                continue;
+            }
+
+            $name = $content->copyByToken(StringToken::EQUAL(), true);
+            if ($name == '/') {
+                break;
+            }
+
+            if (empty($name)) {
+                $content->skipByToken(StringToken::BLANK());
+                continue;
+            }
+
+            $content->skipByToken(StringToken::BLANK());
+            if ($content->char() == '=') {
+                $content->fastForward(1)
+                    ->skipByToken(StringToken::BLANK());
+                switch ($content->char()) {
+                    case '"':
+                        $content->fastForward(1);
+                        $string = $content->copyUntil('"', true);
+                        do {
+                            $moreString = $content->copyUntilUnless('"', '=>');
+                            $string .= $moreString;
+                        } while (\strlen($moreString) > 0 && $content->getPosition() < $size);
+                        $content->fastForward(1);
+                        $node->getTag()->setAttribute($name, $string);
+                        break;
+                    case "'":
+                        $content->fastForward(1);
+                        $string = $content->copyUntil("'", true);
+                        do {
+                            $moreString = $content->copyUntilUnless("'", '=>');
+                            $string .= $moreString;
+                        } while (\strlen($moreString) > 0 && $content->getPosition() < $size);
+                        $content->fastForward(1);
+                        $node->getTag()->setAttribute($name, $string, false);
+                        break;
+                    default:
+                        $node->getTag()->setAttribute($name, $content->copyByToken(StringToken::ATTR(), true));
+                        break;
+                }
+            } else {
+                // no value attribute
+                if ($options->isStrict()) {
+                    // can't have this in strict html
+                    $character = $content->getPosition();
+                    throw new StrictException("Tag '$tag' has an attribute '$name' with out a value! (character #$character)");
+                }
+                $node->getTag()->setAttribute($name, null);
+                if ($content->char() != '>') {
+                    $content->rewind(1);
+                }
+            }
+        }
+    }
+}

+ 100 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/RootAccessTrait.php

@@ -0,0 +1,100 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom;
+
+use PHPHtmlParser\Dom\Node\AbstractNode;
+use PHPHtmlParser\Dom\Node\HtmlNode;
+use PHPHtmlParser\Exceptions\ChildNotFoundException;
+use PHPHtmlParser\Exceptions\NotLoadedException;
+
+trait RootAccessTrait
+{
+    /**
+     * Contains the root node of this dom tree.
+     *
+     * @var HtmlNode
+     */
+    public $root;
+
+    /**
+     * A simple wrapper around the root node.
+     *
+     * @param string $name
+     *
+     * @throws NotLoadedException
+     *
+     * @return mixed
+     */
+    public function __get($name)
+    {
+        $this->isLoaded();
+
+        return $this->root->$name;
+    }
+
+    /**
+     * Simple wrapper function that returns the first child.
+     *
+     * @throws ChildNotFoundException
+     * @throws NotLoadedException
+     */
+    public function firstChild(): AbstractNode
+    {
+        $this->isLoaded();
+
+        return $this->root->firstChild();
+    }
+
+    /**
+     * Simple wrapper function that returns the last child.
+     *
+     * @throws ChildNotFoundException
+     * @throws NotLoadedException
+     */
+    public function lastChild(): AbstractNode
+    {
+        $this->isLoaded();
+
+        return $this->root->lastChild();
+    }
+
+    /**
+     * Simple wrapper function that returns count of child elements.
+     *
+     * @throws NotLoadedException
+     */
+    public function countChildren(): int
+    {
+        $this->isLoaded();
+
+        return $this->root->countChildren();
+    }
+
+    /**
+     * Get array of children.
+     *
+     * @throws NotLoadedException
+     */
+    public function getChildren(): array
+    {
+        $this->isLoaded();
+
+        return $this->root->getChildren();
+    }
+
+    /**
+     * Check if node have children nodes.
+     *
+     * @throws NotLoadedException
+     */
+    public function hasChildren(): bool
+    {
+        $this->isLoaded();
+
+        return $this->root->hasChildren();
+    }
+
+    abstract public function isLoaded(): void;
+}

+ 365 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Dom/Tag.php

@@ -0,0 +1,365 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Dom;
+
+use PHPHtmlParser\DTO\Tag\AttributeDTO;
+use PHPHtmlParser\Exceptions\Tag\AttributeNotFoundException;
+use stringEncode\Encode;
+
+/**
+ * Class Tag.
+ */
+class Tag
+{
+    /**
+     * The name of the tag.
+     *
+     * @var string
+     */
+    protected $name;
+
+    /**
+     * The attributes of the tag.
+     *
+     * @var AttributeDTO[]
+     */
+    protected $attr = [];
+
+    /**
+     * Is this tag self closing.
+     *
+     * @var bool
+     */
+    protected $selfClosing = false;
+
+    /**
+     * If self-closing, will this use a trailing slash. />.
+     *
+     * @var bool
+     */
+    protected $trailingSlash = true;
+
+    /**
+     * Tag noise.
+     */
+    protected $noise = '';
+
+    /**
+     * The encoding class to... encode the tags.
+     *
+     * @var Encode|null
+     */
+    protected $encode;
+
+    /**
+     * @var bool
+     */
+    private $HtmlSpecialCharsDecode = false;
+
+    /**
+     * What the opening of this tag will be.
+     *
+     * @var string
+     */
+    private $opening = '<';
+
+    /**
+     * What the closing tag for self-closing elements should be.
+     *
+     * @var string
+     */
+    private $closing = ' />';
+
+    /**
+     * Sets up the tag with a name.
+     *
+     * @param $name
+     */
+    public function __construct(string $name)
+    {
+        $this->name = $name;
+    }
+
+    /**
+     * Returns the name of this tag.
+     */
+    public function name(): string
+    {
+        return $this->name;
+    }
+
+    /**
+     * Sets the tag to be self closing.
+     */
+    public function selfClosing(): Tag
+    {
+        $this->selfClosing = true;
+
+        return clone $this;
+    }
+
+    public function setOpening(string $opening): Tag
+    {
+        $this->opening = $opening;
+
+        return clone $this;
+    }
+
+    public function setClosing(string $closing): Tag
+    {
+        $this->closing = $closing;
+
+        return clone $this;
+    }
+
+    /**
+     * Sets the tag to not use a trailing slash.
+     */
+    public function noTrailingSlash(): Tag
+    {
+        $this->trailingSlash = false;
+
+        return clone $this;
+    }
+
+    /**
+     * Checks if the tag is self closing.
+     */
+    public function isSelfClosing(): bool
+    {
+        return $this->selfClosing;
+    }
+
+    /**
+     * Sets the encoding type to be used.
+     */
+    public function setEncoding(Encode $encode): void
+    {
+        $this->encode = $encode;
+    }
+
+    /**
+     * @param bool $htmlSpecialCharsDecode
+     */
+    public function setHtmlSpecialCharsDecode($htmlSpecialCharsDecode = false): void
+    {
+        $this->HtmlSpecialCharsDecode = $htmlSpecialCharsDecode;
+    }
+
+    /**
+     * Sets the noise for this tag (if any).
+     */
+    public function noise(string $noise): Tag
+    {
+        $this->noise = $noise;
+
+        return clone $this;
+    }
+
+    /**
+     * Set an attribute for this tag.
+     */
+    public function setAttribute(string $key, ?string $attributeValue, bool $doubleQuote = true): Tag
+    {
+        $attributeDTO = AttributeDTO::makeFromPrimitives(
+            $attributeValue,
+            $doubleQuote
+        );
+        if ($this->HtmlSpecialCharsDecode) {
+            $attributeDTO->htmlspecialcharsDecode();
+        }
+        $this->attr[\strtolower($key)] = $attributeDTO;
+
+        return clone $this;
+    }
+
+    /**
+     * Set inline style attribute value.
+     *
+     * @param mixed $attr_key
+     * @param mixed $attr_value
+     */
+    public function setStyleAttributeValue($attr_key, $attr_value): void
+    {
+        $style_array = $this->getStyleAttributeArray();
+        $style_array[$attr_key] = $attr_value;
+
+        $style_string = '';
+        foreach ($style_array as $key => $value) {
+            $style_string .= $key . ':' . $value . ';';
+        }
+
+        $this->setAttribute('style', $style_string);
+    }
+
+    /**
+     * Get style attribute in array.
+     */
+    public function getStyleAttributeArray(): array
+    {
+        try {
+            $value = $this->getAttribute('style')->getValue();
+            if (\is_null($value)) {
+                return [];
+            }
+            $value = \explode(';', \substr(\trim($value), 0, -1));
+            $result = [];
+            foreach ($value as $attr) {
+                $attr = \explode(':', $attr);
+                $result[$attr[0]] = $attr[1];
+            }
+
+            return $result;
+        } catch (AttributeNotFoundException $e) {
+            unset($e);
+
+            return [];
+        }
+    }
+
+    /**
+     * Removes an attribute from this tag.
+     *
+     * @param mixed $key
+     *
+     * @return void
+     */
+    public function removeAttribute($key)
+    {
+        $key = \strtolower($key);
+        unset($this->attr[$key]);
+    }
+
+    /**
+     * Removes all attributes on this tag.
+     *
+     * @return void
+     */
+    public function removeAllAttributes()
+    {
+        $this->attr = [];
+    }
+
+    /**
+     * Sets the attributes for this tag.
+     *
+     * @return $this
+     */
+    public function setAttributes(array $attr)
+    {
+        foreach ($attr as $key => $info) {
+            if (\is_array($info)) {
+                $this->setAttribute($key, $info['value'], $info['doubleQuote']);
+            } else {
+                $this->setAttribute($key, $info);
+            }
+        }
+
+        return $this;
+    }
+
+    /**
+     * Returns all attributes of this tag.
+     *
+     * @throws \stringEncode\Exception
+     *
+     * @return AttributeDTO[]
+     */
+    public function getAttributes(): array
+    {
+        $return = [];
+        foreach (\array_keys($this->attr) as $attr) {
+            try {
+                $return[$attr] = $this->getAttribute($attr);
+            } catch (AttributeNotFoundException $e) {
+                // attribute that was in the array was not found in the array....
+                unset($e);
+            }
+        }
+
+        return $return;
+    }
+
+    /**
+     * Returns an attribute by the key.
+     *
+     * @throws AttributeNotFoundException
+     * @throws \stringEncode\Exception
+     */
+    public function getAttribute(string $key): AttributeDTO
+    {
+        $key = \strtolower($key);
+        if (!isset($this->attr[$key])) {
+            throw new AttributeNotFoundException('Attribute with key "' . $key . '" not found.');
+        }
+        $attributeDTO = $this->attr[$key];
+        if (!\is_null($this->encode)) {
+            // convert charset
+            $attributeDTO->encodeValue($this->encode);
+        }
+
+        return $attributeDTO;
+    }
+
+    /**
+     * Returns TRUE if node has attribute.
+     *
+     * @return bool
+     */
+    public function hasAttribute(string $key)
+    {
+        return isset($this->attr[$key]);
+    }
+
+    /**
+     * Generates the opening tag for this object.
+     *
+     * @return string
+     */
+    public function makeOpeningTag()
+    {
+        $return = $this->opening . $this->name;
+
+        // add the attributes
+        foreach (\array_keys($this->attr) as $key) {
+            try {
+                $attributeDTO = $this->getAttribute($key);
+            } catch (AttributeNotFoundException $e) {
+                // attribute that was in the array not found in the array... let's continue.
+                continue;
+            } catch (\TypeError $e) {
+              $val = null;
+            }
+            $val = $attributeDTO->getValue();
+            if (\is_null($val)) {
+                $return .= ' ' . $key;
+            } elseif ($attributeDTO->isDoubleQuote()) {
+                $return .= ' ' . $key . '="' . $val . '"';
+            } else {
+                $return .= ' ' . $key . '=\'' . $val . '\'';
+            }
+        }
+
+        if ($this->selfClosing && $this->trailingSlash) {
+            return $return . $this->closing;
+        }
+
+        return $return . '>';
+    }
+
+    /**
+     * Generates the closing tag for this object.
+     *
+     * @return string
+     */
+    public function makeClosingTag()
+    {
+        if ($this->selfClosing) {
+            return '';
+        }
+
+        return '</' . $this->name . '>';
+    }
+}

+ 23 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Enum/StringToken.php

@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Enum;
+
+use MyCLabs\Enum\Enum;
+
+/**
+ * @method static StringToken BLANK()
+ * @method static StringToken EQUAL()
+ * @method static StringToken SLASH()
+ * @method static StringToken ATTR()
+ * @method static StringToken CLOSECOMMENT()
+ */
+class StringToken extends Enum
+{
+    private const BLANK = " \t\r\n";
+    private const EQUAL = ' =/>';
+    private const SLASH = " />\r\n\t";
+    private const ATTR = ' >';
+    private const CLOSECOMMENT = '-->';
+}

+ 14 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Exceptions/ChildNotFoundException.php

@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Exceptions;
+
+use Exception;
+
+/**
+ * Class ChildNotFoundException.
+ */
+final class ChildNotFoundException extends Exception
+{
+}

+ 14 - 0
api/vendor/paquettg/php-html-parser/src/PHPHtmlParser/Exceptions/CircularException.php

@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace PHPHtmlParser\Exceptions;
+
+use Exception;
+
+/**
+ * Class CircularException.
+ */
+final class CircularException extends Exception
+{
+}

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است