diff options
author | Léo Colombaro <git@colombaro.fr> | 2022-04-28 22:41:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 22:41:10 +0300 |
commit | e05ee2aefb5b8c021da2b3a23aa488109315b1a1 (patch) | |
tree | f02d5ec6c81a523a056f63a028ec3327c5ab398e | |
parent | 59464102ee27cb5c808625c92448a48cebefda6f (diff) |
Bump dependencies and remove (#3309)
Updates :
- aura/sql (3.0.0 => 3.1.0)
- maxmind/web-service-common (v0.8.1 => v0.9.0)
- rmccue/requests (v2.0.1 => 2.0.2)
- symfony/polyfill-intl-idn (v1.24.0 => v1.25.0)
- symfony/polyfill-intl-normalizer (v1.24.0 => v1.25.0)
- symfony/polyfill-mbstring (v1.24.0 => v1.25.0)
- symfony/polyfill-php72 (v1.24.0 => v1.25.0)
22 files changed, 840 insertions, 739 deletions
diff --git a/composer.lock b/composer.lock index 54d2fff5..afb86a78 100644 --- a/composer.lock +++ b/composer.lock @@ -8,25 +8,25 @@ "packages": [ { "name": "aura/sql", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/auraphp/Aura.Sql.git", - "reference": "2be02d5dfd9fdee6df199de1a19572aa490bb744" + "reference": "88d8b8ed1bcfd588a649fdc7e7ac89ec047abbca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/auraphp/Aura.Sql/zipball/2be02d5dfd9fdee6df199de1a19572aa490bb744", - "reference": "2be02d5dfd9fdee6df199de1a19572aa490bb744", + "url": "https://api.github.com/repos/auraphp/Aura.Sql/zipball/88d8b8ed1bcfd588a649fdc7e7ac89ec047abbca", + "reference": "88d8b8ed1bcfd588a649fdc7e7ac89ec047abbca", "shasum": "" }, "require": { "php": ">=5.6.0", - "psr/log": "^1.0" + "psr/log": "^1.0 || ^2.0" }, "require-dev": { "pds/skeleton": "~1.0", - "phpunit/phpunit": "~5.0" + "yoast/phpunit-polyfills": "~1.0" }, "type": "library", "autoload": { @@ -59,9 +59,9 @@ ], "support": { "issues": "https://github.com/auraphp/Aura.Sql/issues", - "source": "https://github.com/auraphp/Aura.Sql/tree/3.x" + "source": "https://github.com/auraphp/Aura.Sql/tree/3.1.0" }, - "time": "2018-06-11T12:57:42+00:00" + "time": "2022-04-28T05:11:23+00:00" }, { "name": "composer/ca-bundle", @@ -301,16 +301,16 @@ }, { "name": "maxmind/web-service-common", - "version": "v0.8.1", + "version": "v0.9.0", "source": { "type": "git", "url": "https://github.com/maxmind/web-service-common-php.git", - "reference": "32f274051c543fc865e5a84d3a2c703913641ea8" + "reference": "4dc5a3e8df38aea4ca3b1096cee3a038094e9b53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/32f274051c543fc865e5a84d3a2c703913641ea8", - "reference": "32f274051c543fc865e5a84d3a2c703913641ea8", + "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/4dc5a3e8df38aea4ca3b1096cee3a038094e9b53", + "reference": "4dc5a3e8df38aea4ca3b1096cee3a038094e9b53", "shasum": "" }, "require": { @@ -320,7 +320,8 @@ "php": ">=7.2" }, "require-dev": { - "friendsofphp/php-cs-fixer": "2.*", + "friendsofphp/php-cs-fixer": "3.*", + "phpstan/phpstan": "*", "phpunit/phpunit": "^8.0 || ^9.0", "squizlabs/php_codesniffer": "3.*" }, @@ -345,9 +346,9 @@ "homepage": "https://github.com/maxmind/web-service-common-php", "support": { "issues": "https://github.com/maxmind/web-service-common-php/issues", - "source": "https://github.com/maxmind/web-service-common-php/tree/v0.8.1" + "source": "https://github.com/maxmind/web-service-common-php/tree/v0.9.0" }, - "time": "2020-11-02T17:00:53+00:00" + "time": "2022-03-28T17:43:20+00:00" }, { "name": "ozh/bookmarkletgen", @@ -504,16 +505,16 @@ }, { "name": "rmccue/requests", - "version": "v2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/WordPress/Requests.git", - "reference": "294ec523096241433ffea3fcf3127d16b1b7af4c" + "reference": "b01ce7c91657d604f298751686d7f5eec87b9493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/Requests/zipball/294ec523096241433ffea3fcf3127d16b1b7af4c", - "reference": "294ec523096241433ffea3fcf3127d16b1b7af4c", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/b01ce7c91657d604f298751686d7f5eec87b9493", + "reference": "b01ce7c91657d604f298751686d7f5eec87b9493", "shasum": "" }, "require": { @@ -581,7 +582,7 @@ "issues": "https://github.com/WordPress/Requests/issues", "source": "https://github.com/WordPress/Requests" }, - "time": "2022-02-07T18:15:26+00:00" + "time": "2022-03-28T15:37:07+00:00" }, { "name": "spatie/array-to-xml", @@ -649,7 +650,7 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", @@ -716,7 +717,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" }, "funding": [ { @@ -736,7 +737,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -800,7 +801,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -820,7 +821,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -883,7 +884,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -903,7 +904,7 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -959,7 +960,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" }, "funding": [ { @@ -992,5 +993,5 @@ "platform-overrides": { "php": "7.4.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } diff --git a/includes/vendor/aura/sql/src/AbstractExtendedPdo.php b/includes/vendor/aura/sql/src/AbstractExtendedPdo.php index 483740bb..604d0c29 100644 --- a/includes/vendor/aura/sql/src/AbstractExtendedPdo.php +++ b/includes/vendor/aura/sql/src/AbstractExtendedPdo.php @@ -125,6 +125,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @see http://php.net/manual/en/pdo.begintransaction.php * */ + #[\ReturnTypeWillChange] public function beginTransaction() { $this->connect(); @@ -143,6 +144,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @see http://php.net/manual/en/pdo.commit.php * */ + #[\ReturnTypeWillChange] public function commit() { $this->connect(); @@ -174,9 +176,10 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * * Gets the most recent error code. * - * @return mixed + * @return string * */ + #[\ReturnTypeWillChange] public function errorCode() { $this->connect(); @@ -190,6 +193,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @return array * */ + #[\ReturnTypeWillChange] public function errorInfo() { $this->connect(); @@ -202,11 +206,12 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * * @param string $statement The SQL statement to prepare and execute. * - * @return int The number of affected rows. + * @return int|false The number of affected rows. * * @see http://php.net/manual/en/pdo.exec.php * */ + #[\ReturnTypeWillChange] public function exec($statement) { $this->connect(); @@ -338,7 +343,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * * @param array $args Arguments to pass to the object constructor. * - * @return object + * @return object|false * */ public function fetchObject( @@ -493,6 +498,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @see http://php.net/manual/en/pdo.intransaction.php * */ + #[\ReturnTypeWillChange] public function inTransaction() { $this->connect(); @@ -521,11 +527,12 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @param string $name The name of the sequence to check; typically needed * only for PostgreSQL, where it takes the form of `<table>_<column>_seq`. * - * @return string + * @return string|false * * @see http://php.net/manual/en/pdo.lastinsertid.php * */ + #[\ReturnTypeWillChange] public function lastInsertId($name = null) { $this->connect(); @@ -569,11 +576,12 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @param array $options Set these attributes on the returned * PDOStatement. * - * @return PDOStatement + * @return PDOStatement|false * * @see http://php.net/manual/en/pdo.prepare.php * */ + #[\ReturnTypeWillChange] public function prepare($statement, $options = []) { $this->connect(); @@ -598,7 +606,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * * @param array $values The values to bind to the statement, if any. * - * @return PDOStatement + * @return PDOStatement|false * * @see http://php.net/manual/en/pdo.prepare.php * @@ -637,11 +645,12 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * * @param mixed ...$fetch Optional fetch-related parameters. * - * @return PDOStatement + * @return PDOStatement|false * * @see http://php.net/manual/en/pdo.query.php * */ + #[\ReturnTypeWillChange] public function query($statement, ...$fetch) { $this->connect(); @@ -662,18 +671,19 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * * @param int $type A data type hint for the database driver. * - * @return string The quoted value. + * @return string|false The quoted value. * * @see http://php.net/manual/en/pdo.quote.php * */ + #[\ReturnTypeWillChange] public function quote($value, $type = self::PARAM_STR) { $this->connect(); // non-array quoting if (! is_array($value)) { - return $this->pdo->quote($value, $type); + return $this->pdo->quote((string) $value, $type); } // quote array values, not keys, then combine with commas @@ -737,6 +747,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @see http://php.net/manual/en/pdo.rollback.php * */ + #[\ReturnTypeWillChange] public function rollBack() { $this->connect(); @@ -987,6 +998,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @param int $attribute * @return mixed */ + #[\ReturnTypeWillChange] public function getAttribute($attribute) { $this->connect(); @@ -1001,6 +1013,7 @@ abstract class AbstractExtendedPdo extends PDO implements ExtendedPdoInterface * @param mixed $value * @return bool */ + #[\ReturnTypeWillChange] public function setAttribute($attribute, $value) { $this->connect(); diff --git a/includes/vendor/aura/sql/src/Parser/AbstractParser.php b/includes/vendor/aura/sql/src/Parser/AbstractParser.php index d69b3d90..4405dfff 100644 --- a/includes/vendor/aura/sql/src/Parser/AbstractParser.php +++ b/includes/vendor/aura/sql/src/Parser/AbstractParser.php @@ -182,7 +182,7 @@ abstract class AbstractParser implements ParserInterface foreach ($subs as $i => $sub) { $char = substr($sub, 0, 1); if ($char == '?') { - $str .= $this->prepareNumberedPlaceholder($sub); + $str .= $this->prepareNumberedPlaceholder(); } elseif ($char == ':') { $str .= $this->prepareNamedPlaceholder($sub); } else { @@ -196,13 +196,11 @@ abstract class AbstractParser implements ParserInterface * * Bind or quote a numbered placeholder in a query subpart. * - * @param string $sub The query subpart. - * * @return string The prepared query subpart. * * @throws MissingParameter */ - protected function prepareNumberedPlaceholder($sub) + protected function prepareNumberedPlaceholder() { $this->num ++; if (array_key_exists($this->num, $this->values) === false) { diff --git a/includes/vendor/aura/sql/src/Parser/SqliteParser.php b/includes/vendor/aura/sql/src/Parser/SqliteParser.php index 61bf9bf7..ac43b50c 100644 --- a/includes/vendor/aura/sql/src/Parser/SqliteParser.php +++ b/includes/vendor/aura/sql/src/Parser/SqliteParser.php @@ -17,4 +17,20 @@ namespace Aura\Sql\Parser; */ class SqliteParser extends AbstractParser { + /** + * {@inheritDoc} + */ + protected $split = [ + // single-quoted string + "'(?:[^'\\\\]|\\\\'?)*'", + // double-quoted string + '"(?:[^"\\\\]|\\\\"?)*"', + // backticked column names + '`(?:[^`\\\\]|\\\\`?)*`', + ]; + + /** + * {@inheritDoc} + */ + protected $skip = '/^(\'|"|`|\:[^a-zA-Z_])/um'; } diff --git a/includes/vendor/autoload.php b/includes/vendor/autoload.php index 4a65e6f8..5659614d 100644 --- a/includes/vendor/autoload.php +++ b/includes/vendor/autoload.php @@ -2,6 +2,11 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + exit(1); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit2d6d15a8f6cc4bfbfd4a2943a6c4df59::getLoader(); diff --git a/includes/vendor/composer/ClassLoader.php b/includes/vendor/composer/ClassLoader.php index 4d989a21..afef3fa2 100644 --- a/includes/vendor/composer/ClassLoader.php +++ b/includes/vendor/composer/ClassLoader.php @@ -42,30 +42,75 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var ?string */ private $vendorDir; // PSR-4 + /** + * @var array[] + * @psalm-var array<string, array<string, int>> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array<string, array<int, string>> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array<string, string> + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array<string, array<string, string[]>> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array<string, string> + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array<string, string> + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array<string, bool> + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ private static $registeredLoaders = array(); + /** + * @param ?string $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +120,47 @@ class ClassLoader return array(); } + /** + * @return array[] + * @psalm-return array<string, array<int, string>> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array<string, string> + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array<string, string> + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array<string, string> + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array<string, string> $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,9 +175,11 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -156,11 +222,13 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -204,8 +272,10 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +290,12 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +315,8 @@ class ClassLoader * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +339,8 @@ class ClassLoader * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +361,8 @@ class ClassLoader * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -305,14 +383,18 @@ class ClassLoader * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { - //no-op - } elseif ($prepend) { + return; + } + + if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); @@ -322,6 +404,8 @@ class ClassLoader /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -336,7 +420,7 @@ class ClassLoader * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { @@ -345,6 +429,8 @@ class ClassLoader return true; } + + return null; } /** @@ -399,6 +485,11 @@ class ClassLoader return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -470,6 +561,10 @@ class ClassLoader * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/includes/vendor/composer/InstalledVersions.php b/includes/vendor/composer/InstalledVersions.php index 2ff5f207..41bc143c 100644 --- a/includes/vendor/composer/InstalledVersions.php +++ b/includes/vendor/composer/InstalledVersions.php @@ -1,419 +1,352 @@ <?php - - - - - - - - - +/* + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@naderman.de> + * Jordi Boggiano <j.boggiano@seld.be> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; - - - - - +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ class InstalledVersions { -private static $installed = array ( - 'root' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => '03df13ac34d2f5a148146aa4ebe6bce177c6ac4d', - 'name' => 'yourls/yourls', - ), - 'versions' => - array ( - 'aura/sql' => - array ( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'aliases' => - array ( - ), - 'reference' => '2be02d5dfd9fdee6df199de1a19572aa490bb744', - ), - 'composer/ca-bundle' => - array ( - 'pretty_version' => '1.3.1', - 'version' => '1.3.1.0', - 'aliases' => - array ( - ), - 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', - ), - 'geoip2/geoip2' => - array ( - 'pretty_version' => 'v2.12.2', - 'version' => '2.12.2.0', - 'aliases' => - array ( - ), - 'reference' => '83adb44ac4b9553d36b579a14673ed124583082f', - ), - 'jakeasmith/http_build_url' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '93c273e77cb1edead0cf8bcf8cd2003428e74e37', - ), - 'maxmind-db/reader' => - array ( - 'pretty_version' => 'v1.11.0', - 'version' => '1.11.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b1f3c0699525336d09cc5161a2861268d9f2ae5b', - ), - 'maxmind/web-service-common' => - array ( - 'pretty_version' => 'v0.8.1', - 'version' => '0.8.1.0', - 'aliases' => - array ( - ), - 'reference' => '32f274051c543fc865e5a84d3a2c703913641ea8', - ), - 'ozh/bookmarkletgen' => - array ( - 'pretty_version' => '1.2', - 'version' => '1.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '3319b53c493a1474a03d1cc4e087617652284c20', - ), - 'pomo/pomo' => - array ( - 'pretty_version' => 'v1.4.1', - 'version' => '1.4.1.0', - 'aliases' => - array ( - ), - 'reference' => '1594bd1f90c89a45ffc3da2ee6d5d582bfac7542', - ), - 'psr/log' => - array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'aliases' => - array ( - ), - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', - ), - 'rmccue/requests' => - array ( - 'pretty_version' => 'v2.0.1', - 'version' => '2.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '294ec523096241433ffea3fcf3127d16b1b7af4c', - ), - 'spatie/array-to-xml' => - array ( - 'pretty_version' => '2.16.0', - 'version' => '2.16.0.0', - 'aliases' => - array ( - ), - 'reference' => 'db39308c5236b69b89cadc3f44f191704814eae2', - ), - 'symfony/polyfill-intl-idn' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44', - ), - 'symfony/polyfill-intl-normalizer' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', - ), - 'symfony/polyfill-mbstring' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', - ), - 'symfony/polyfill-php72' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', - ), - 'yourls/yourls' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => '03df13ac34d2f5a148146aa4ebe6bce177c6ac4d', - ), - ), -); -private static $canGetVendors; -private static $installedByVendor = array(); - - - - - - - -public static function getInstalledPackages() -{ -$packages = array(); -foreach (self::getInstalled() as $installed) { -$packages[] = array_keys($installed['versions']); -} - - -if (1 === \count($packages)) { -return $packages[0]; -} - -return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); -} - - - - - - - - - -public static function isInstalled($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (isset($installed['versions'][$packageName])) { -return true; -} -} - -return false; -} - - - - - - - - - - - - - - -public static function satisfies(VersionParser $parser, $packageName, $constraint) -{ -$constraint = $parser->parseConstraints($constraint); -$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - -return $provided->matches($constraint); -} - - - - - - - - - - -public static function getVersionRanges($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -$ranges = array(); -if (isset($installed['versions'][$packageName]['pretty_version'])) { -$ranges[] = $installed['versions'][$packageName]['pretty_version']; -} -if (array_key_exists('aliases', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); -} -if (array_key_exists('replaced', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); -} -if (array_key_exists('provided', $installed['versions'][$packageName])) { -$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); -} - -return implode(' || ', $ranges); -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getVersion($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['version'])) { -return null; -} - -return $installed['versions'][$packageName]['version']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getPrettyVersion($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['pretty_version'])) { -return null; -} - -return $installed['versions'][$packageName]['pretty_version']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getReference($packageName) -{ -foreach (self::getInstalled() as $installed) { -if (!isset($installed['versions'][$packageName])) { -continue; -} - -if (!isset($installed['versions'][$packageName]['reference'])) { -return null; -} - -return $installed['versions'][$packageName]['reference']; -} - -throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); -} - - - - - -public static function getRootPackage() -{ -$installed = self::getInstalled(); - -return $installed[0]['root']; -} - - - - - - - -public static function getRawData() -{ -return self::$installed; -} - - - - - - - - - - - - - - - - - - - -public static function reload($data) -{ -self::$installed = $data; -self::$installedByVendor = array(); -} - - - - -private static function getInstalled() -{ -if (null === self::$canGetVendors) { -self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); -} - -$installed = array(); - -if (self::$canGetVendors) { - -foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { -if (isset(self::$installedByVendor[$vendorDir])) { -$installed[] = self::$installedByVendor[$vendorDir]; -} elseif (is_file($vendorDir.'/composer/installed.php')) { -$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; -} -} -} - -$installed[] = self::$installed; - -return $installed; -} + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list<string> + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list<string> + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } } diff --git a/includes/vendor/composer/autoload_classmap.php b/includes/vendor/composer/autoload_classmap.php index 0f454c12..b501e4f2 100644 --- a/includes/vendor/composer/autoload_classmap.php +++ b/includes/vendor/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname(dirname($vendorDir)); return array( diff --git a/includes/vendor/composer/autoload_files.php b/includes/vendor/composer/autoload_files.php index 31f2e605..74d0a74d 100644 --- a/includes/vendor/composer/autoload_files.php +++ b/includes/vendor/composer/autoload_files.php @@ -2,7 +2,7 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname(dirname($vendorDir)); return array( diff --git a/includes/vendor/composer/autoload_namespaces.php b/includes/vendor/composer/autoload_namespaces.php index 9baf5379..52e8e79f 100644 --- a/includes/vendor/composer/autoload_namespaces.php +++ b/includes/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname(dirname($vendorDir)); return array( diff --git a/includes/vendor/composer/autoload_psr4.php b/includes/vendor/composer/autoload_psr4.php index 933b7f09..2a301dd0 100644 --- a/includes/vendor/composer/autoload_psr4.php +++ b/includes/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname(dirname($vendorDir)); return array( diff --git a/includes/vendor/composer/autoload_real.php b/includes/vendor/composer/autoload_real.php index 50a2b3a2..a4a77b5a 100644 --- a/includes/vendor/composer/autoload_real.php +++ b/includes/vendor/composer/autoload_real.php @@ -25,38 +25,15 @@ class ComposerAutoloaderInit2d6d15a8f6cc4bfbfd4a2943a6c4df59 require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit2d6d15a8f6cc4bfbfd4a2943a6c4df59', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit2d6d15a8f6cc4bfbfd4a2943a6c4df59', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit2d6d15a8f6cc4bfbfd4a2943a6c4df59::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit2d6d15a8f6cc4bfbfd4a2943a6c4df59::getInitializer($loader)); $loader->register(true); - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit2d6d15a8f6cc4bfbfd4a2943a6c4df59::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } + $includeFiles = \Composer\Autoload\ComposerStaticInit2d6d15a8f6cc4bfbfd4a2943a6c4df59::$files; foreach ($includeFiles as $fileIdentifier => $file) { composerRequire2d6d15a8f6cc4bfbfd4a2943a6c4df59($fileIdentifier, $file); } @@ -65,11 +42,16 @@ class ComposerAutoloaderInit2d6d15a8f6cc4bfbfd4a2943a6c4df59 } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire2d6d15a8f6cc4bfbfd4a2943a6c4df59($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/includes/vendor/composer/installed.json b/includes/vendor/composer/installed.json index 2d142ad3..88a7e872 100644 --- a/includes/vendor/composer/installed.json +++ b/includes/vendor/composer/installed.json @@ -2,28 +2,28 @@ "packages": [ { "name": "aura/sql", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.1.0", + "version_normalized": "3.1.0.0", "source": { "type": "git", "url": "https://github.com/auraphp/Aura.Sql.git", - "reference": "2be02d5dfd9fdee6df199de1a19572aa490bb744" + "reference": "88d8b8ed1bcfd588a649fdc7e7ac89ec047abbca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/auraphp/Aura.Sql/zipball/2be02d5dfd9fdee6df199de1a19572aa490bb744", - "reference": "2be02d5dfd9fdee6df199de1a19572aa490bb744", + "url": "https://api.github.com/repos/auraphp/Aura.Sql/zipball/88d8b8ed1bcfd588a649fdc7e7ac89ec047abbca", + "reference": "88d8b8ed1bcfd588a649fdc7e7ac89ec047abbca", "shasum": "" }, "require": { "php": ">=5.6.0", - "psr/log": "^1.0" + "psr/log": "^1.0 || ^2.0" }, "require-dev": { "pds/skeleton": "~1.0", - "phpunit/phpunit": "~5.0" + "yoast/phpunit-polyfills": "~1.0" }, - "time": "2018-06-11T12:57:42+00:00", + "time": "2022-04-28T05:11:23+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -56,7 +56,7 @@ ], "support": { "issues": "https://github.com/auraphp/Aura.Sql/issues", - "source": "https://github.com/auraphp/Aura.Sql/tree/3.x" + "source": "https://github.com/auraphp/Aura.Sql/tree/3.1.0" }, "install-path": "../aura/sql" }, @@ -306,17 +306,17 @@ }, { "name": "maxmind/web-service-common", - "version": "v0.8.1", - "version_normalized": "0.8.1.0", + "version": "v0.9.0", + "version_normalized": "0.9.0.0", "source": { "type": "git", "url": "https://github.com/maxmind/web-service-common-php.git", - "reference": "32f274051c543fc865e5a84d3a2c703913641ea8" + "reference": "4dc5a3e8df38aea4ca3b1096cee3a038094e9b53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/32f274051c543fc865e5a84d3a2c703913641ea8", - "reference": "32f274051c543fc865e5a84d3a2c703913641ea8", + "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/4dc5a3e8df38aea4ca3b1096cee3a038094e9b53", + "reference": "4dc5a3e8df38aea4ca3b1096cee3a038094e9b53", "shasum": "" }, "require": { @@ -326,11 +326,12 @@ "php": ">=7.2" }, "require-dev": { - "friendsofphp/php-cs-fixer": "2.*", + "friendsofphp/php-cs-fixer": "3.*", + "phpstan/phpstan": "*", "phpunit/phpunit": "^8.0 || ^9.0", "squizlabs/php_codesniffer": "3.*" }, - "time": "2020-11-02T17:00:53+00:00", + "time": "2022-03-28T17:43:20+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -353,7 +354,7 @@ "homepage": "https://github.com/maxmind/web-service-common-php", "support": { "issues": "https://github.com/maxmind/web-service-common-php/issues", - "source": "https://github.com/maxmind/web-service-common-php/tree/v0.8.1" + "source": "https://github.com/maxmind/web-service-common-php/tree/v0.9.0" }, "install-path": "../maxmind/web-service-common" }, @@ -513,17 +514,17 @@ }, { "name": "rmccue/requests", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/WordPress/Requests.git", - "reference": "294ec523096241433ffea3fcf3127d16b1b7af4c" + "reference": "b01ce7c91657d604f298751686d7f5eec87b9493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/Requests/zipball/294ec523096241433ffea3fcf3127d16b1b7af4c", - "reference": "294ec523096241433ffea3fcf3127d16b1b7af4c", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/b01ce7c91657d604f298751686d7f5eec87b9493", + "reference": "b01ce7c91657d604f298751686d7f5eec87b9493", "shasum": "" }, "require": { @@ -541,7 +542,7 @@ "wp-coding-standards/wpcs": "^2.0", "yoast/phpunit-polyfills": "^1.0.0" }, - "time": "2022-02-07T18:15:26+00:00", + "time": "2022-03-28T15:37:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -664,8 +665,8 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.24.0", - "version_normalized": "1.24.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", @@ -734,7 +735,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" }, "funding": [ { @@ -754,8 +755,8 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.24.0", - "version_normalized": "1.24.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -821,7 +822,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -841,8 +842,8 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.24.0", - "version_normalized": "1.24.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -907,7 +908,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -927,8 +928,8 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.24.0", - "version_normalized": "1.24.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -986,7 +987,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" }, "funding": [ { diff --git a/includes/vendor/composer/installed.php b/includes/vendor/composer/installed.php index 8118e7fc..bbfbb2a5 100644 --- a/includes/vendor/composer/installed.php +++ b/includes/vendor/composer/installed.php @@ -1,159 +1,158 @@ -<?php return array ( - 'root' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( +<?php return array( + 'root' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../../', + 'aliases' => array(), + 'reference' => '59464102ee27cb5c808625c92448a48cebefda6f', + 'name' => 'yourls/yourls', + 'dev' => true, + ), + 'versions' => array( + 'aura/sql' => array( + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../aura/sql', + 'aliases' => array(), + 'reference' => '88d8b8ed1bcfd588a649fdc7e7ac89ec047abbca', + 'dev_requirement' => false, + ), + 'composer/ca-bundle' => array( + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/./ca-bundle', + 'aliases' => array(), + 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', + 'dev_requirement' => false, + ), + 'geoip2/geoip2' => array( + 'pretty_version' => 'v2.12.2', + 'version' => '2.12.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../geoip2/geoip2', + 'aliases' => array(), + 'reference' => '83adb44ac4b9553d36b579a14673ed124583082f', + 'dev_requirement' => false, + ), + 'jakeasmith/http_build_url' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../jakeasmith/http_build_url', + 'aliases' => array(), + 'reference' => '93c273e77cb1edead0cf8bcf8cd2003428e74e37', + 'dev_requirement' => false, + ), + 'maxmind-db/reader' => array( + 'pretty_version' => 'v1.11.0', + 'version' => '1.11.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../maxmind-db/reader', + 'aliases' => array(), + 'reference' => 'b1f3c0699525336d09cc5161a2861268d9f2ae5b', + 'dev_requirement' => false, + ), + 'maxmind/web-service-common' => array( + 'pretty_version' => 'v0.9.0', + 'version' => '0.9.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../maxmind/web-service-common', + 'aliases' => array(), + 'reference' => '4dc5a3e8df38aea4ca3b1096cee3a038094e9b53', + 'dev_requirement' => false, + ), + 'ozh/bookmarkletgen' => array( + 'pretty_version' => '1.2', + 'version' => '1.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ozh/bookmarkletgen', + 'aliases' => array(), + 'reference' => '3319b53c493a1474a03d1cc4e087617652284c20', + 'dev_requirement' => false, + ), + 'pomo/pomo' => array( + 'pretty_version' => 'v1.4.1', + 'version' => '1.4.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../pomo/pomo', + 'aliases' => array(), + 'reference' => '1594bd1f90c89a45ffc3da2ee6d5d582bfac7542', + 'dev_requirement' => false, + ), + 'psr/log' => array( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/log', + 'aliases' => array(), + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + 'dev_requirement' => false, + ), + 'rmccue/requests' => array( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../rmccue/requests', + 'aliases' => array(), + 'reference' => 'b01ce7c91657d604f298751686d7f5eec87b9493', + 'dev_requirement' => false, + ), + 'spatie/array-to-xml' => array( + 'pretty_version' => '2.16.0', + 'version' => '2.16.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../spatie/array-to-xml', + 'aliases' => array(), + 'reference' => 'db39308c5236b69b89cadc3f44f191704814eae2', + 'dev_requirement' => false, + ), + 'symfony/polyfill-intl-idn' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', + 'aliases' => array(), + 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44', + 'dev_requirement' => false, + ), + 'symfony/polyfill-intl-normalizer' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', + 'aliases' => array(), + 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php72' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php72', + 'aliases' => array(), + 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', + 'dev_requirement' => false, + ), + 'yourls/yourls' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../../', + 'aliases' => array(), + 'reference' => '59464102ee27cb5c808625c92448a48cebefda6f', + 'dev_requirement' => false, + ), ), - 'reference' => '03df13ac34d2f5a148146aa4ebe6bce177c6ac4d', - 'name' => 'yourls/yourls', - ), - 'versions' => - array ( - 'aura/sql' => - array ( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'aliases' => - array ( - ), - 'reference' => '2be02d5dfd9fdee6df199de1a19572aa490bb744', - ), - 'composer/ca-bundle' => - array ( - 'pretty_version' => '1.3.1', - 'version' => '1.3.1.0', - 'aliases' => - array ( - ), - 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', - ), - 'geoip2/geoip2' => - array ( - 'pretty_version' => 'v2.12.2', - 'version' => '2.12.2.0', - 'aliases' => - array ( - ), - 'reference' => '83adb44ac4b9553d36b579a14673ed124583082f', - ), - 'jakeasmith/http_build_url' => - array ( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '93c273e77cb1edead0cf8bcf8cd2003428e74e37', - ), - 'maxmind-db/reader' => - array ( - 'pretty_version' => 'v1.11.0', - 'version' => '1.11.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b1f3c0699525336d09cc5161a2861268d9f2ae5b', - ), - 'maxmind/web-service-common' => - array ( - 'pretty_version' => 'v0.8.1', - 'version' => '0.8.1.0', - 'aliases' => - array ( - ), - 'reference' => '32f274051c543fc865e5a84d3a2c703913641ea8', - ), - 'ozh/bookmarkletgen' => - array ( - 'pretty_version' => '1.2', - 'version' => '1.2.0.0', - 'aliases' => - array ( - ), - 'reference' => '3319b53c493a1474a03d1cc4e087617652284c20', - ), - 'pomo/pomo' => - array ( - 'pretty_version' => 'v1.4.1', - 'version' => '1.4.1.0', - 'aliases' => - array ( - ), - 'reference' => '1594bd1f90c89a45ffc3da2ee6d5d582bfac7542', - ), - 'psr/log' => - array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'aliases' => - array ( - ), - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', - ), - 'rmccue/requests' => - array ( - 'pretty_version' => 'v2.0.1', - 'version' => '2.0.1.0', - 'aliases' => - array ( - ), - 'reference' => '294ec523096241433ffea3fcf3127d16b1b7af4c', - ), - 'spatie/array-to-xml' => - array ( - 'pretty_version' => '2.16.0', - 'version' => '2.16.0.0', - 'aliases' => - array ( - ), - 'reference' => 'db39308c5236b69b89cadc3f44f191704814eae2', - ), - 'symfony/polyfill-intl-idn' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44', - ), - 'symfony/polyfill-intl-normalizer' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', - ), - 'symfony/polyfill-mbstring' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', - ), - 'symfony/polyfill-php72' => - array ( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', - 'aliases' => - array ( - ), - 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', - ), - 'yourls/yourls' => - array ( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'aliases' => - array ( - ), - 'reference' => '03df13ac34d2f5a148146aa4ebe6bce177c6ac4d', - ), - ), ); diff --git a/includes/vendor/maxmind/web-service-common/src/Exception/HttpException.php b/includes/vendor/maxmind/web-service-common/src/Exception/HttpException.php index 318baa81..2bb302ac 100644 --- a/includes/vendor/maxmind/web-service-common/src/Exception/HttpException.php +++ b/includes/vendor/maxmind/web-service-common/src/Exception/HttpException.php @@ -11,6 +11,8 @@ class HttpException extends WebServiceException { /** * The URI queried. + * + * @var string */ private $uri; diff --git a/includes/vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php b/includes/vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php index dd8e5eb3..95fd7dbf 100644 --- a/includes/vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php +++ b/includes/vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php @@ -11,6 +11,8 @@ class InvalidRequestException extends HttpException { /** * The code returned by the MaxMind web service. + * + * @var string */ private $error; diff --git a/includes/vendor/maxmind/web-service-common/src/WebService/Client.php b/includes/vendor/maxmind/web-service-common/src/WebService/Client.php index 4a4ad3ab..2f2744ea 100644 --- a/includes/vendor/maxmind/web-service-common/src/WebService/Client.php +++ b/includes/vendor/maxmind/web-service-common/src/WebService/Client.php @@ -24,16 +24,56 @@ use MaxMind\WebService\Http\RequestFactory; */ class Client { - const VERSION = '0.2.0'; + public const VERSION = '0.2.0'; + /** + * @var string|null + */ private $caBundle; + + /** + * @var float|null + */ private $connectTimeout; + + /** + * @var string + */ private $host = 'api.maxmind.com'; + + /** + * @var bool + */ + private $useHttps = true; + + /** + * @var RequestFactory + */ private $httpRequestFactory; + + /** + * @var string + */ private $licenseKey; + + /** + * @var string|null + */ private $proxy; + + /** + * @var float|null + */ private $timeout; + + /** + * @var string + */ private $userAgentPrefix; + + /** + * @var int + */ private $accountId; /** @@ -41,6 +81,7 @@ class Client * @param string $licenseKey your MaxMind license key * @param array $options an array of options. Possible keys: * * `host` - The host to use when connecting to the web service. + * * `useHttps` - A boolean flag for sending the request via https.(True by default) * * `userAgent` - The prefix of the User-Agent to use in the request. * * `caBundle` - The bundle of CA root certificates to use in the request. * * `connectTimeout` - The connect timeout to use for the request. @@ -63,6 +104,9 @@ class Client if (isset($options['host'])) { $this->host = $options['host']; } + if (isset($options['useHttps'])) { + $this->useHttps = $options['useHttps']; + } if (isset($options['userAgent'])) { $this->userAgentPrefix = $options['userAgent'] . ' '; } @@ -115,7 +159,7 @@ class Client ['Content-Type: application/json'] ); - list($statusCode, $contentType, $responseBody) = $request->post($requestBody); + [$statusCode, $contentType, $responseBody] = $request->post($requestBody); return $this->handleResponse( $statusCode, @@ -128,9 +172,11 @@ class Client public function get(string $service, string $path): ?array { - $request = $this->createRequest($path); + $request = $this->createRequest( + $path + ); - list($statusCode, $contentType, $responseBody) = $request->get(); + [$statusCode, $contentType, $responseBody] = $request->get(); return $this->handleResponse( $statusCode, @@ -145,11 +191,11 @@ class Client { $curlVersion = curl_version(); - return $this->userAgentPrefix . 'MaxMind-WS-API/' . self::VERSION . ' PHP/' . PHP_VERSION . + return $this->userAgentPrefix . 'MaxMind-WS-API/' . self::VERSION . ' PHP/' . \PHP_VERSION . ' curl/' . $curlVersion['version']; } - private function createRequest(string $path, array $headers = []): \MaxMind\WebService\Http\Request + private function createRequest(string $path, array $headers = []): Http\Request { array_push( $headers, @@ -213,17 +259,23 @@ class Client private function jsonErrorDescription(): string { $errno = json_last_error(); + switch ($errno) { - case JSON_ERROR_DEPTH: + case \JSON_ERROR_DEPTH: return 'The maximum stack depth has been exceeded.'; - case JSON_ERROR_STATE_MISMATCH: + + case \JSON_ERROR_STATE_MISMATCH: return 'Invalid or malformed JSON.'; - case JSON_ERROR_CTRL_CHAR: + + case \JSON_ERROR_CTRL_CHAR: return 'Control character error.'; - case JSON_ERROR_SYNTAX: + + case \JSON_ERROR_SYNTAX: return 'Syntax error.'; - case JSON_ERROR_UTF8: + + case \JSON_ERROR_UTF8: return 'Malformed UTF-8 characters.'; + default: return "Other JSON error ($errno)."; } @@ -236,7 +288,7 @@ class Client */ private function urlFor(string $path): string { - return 'https://' . $this->host . $path; + return ($this->useHttps ? 'https://' : 'http://') . $this->host . $path; } /** @@ -327,6 +379,7 @@ class Client $statusCode, $this->urlFor($path) ); + case 'ACCOUNT_ID_REQUIRED': case 'ACCOUNT_ID_UNKNOWN': case 'AUTHORIZATION_INVALID': @@ -339,6 +392,7 @@ class Client $statusCode, $this->urlFor($path) ); + case 'OUT_OF_QUERIES': case 'INSUFFICIENT_FUNDS': throw new InsufficientFundsException( @@ -347,6 +401,7 @@ class Client $statusCode, $this->urlFor($path) ); + case 'PERMISSION_REQUIRED': throw new PermissionRequiredException( $message, @@ -354,6 +409,7 @@ class Client $statusCode, $this->urlFor($path) ); + default: throw new InvalidRequestException( $message, @@ -443,7 +499,7 @@ class Client return $decodedContent; } - private function getCaBundle() + private function getCaBundle(): ?string { $curlVersion = curl_version(); diff --git a/includes/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php b/includes/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php index 14d6bbe9..64db29f6 100644 --- a/includes/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php +++ b/includes/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php @@ -14,7 +14,7 @@ use MaxMind\Exception\HttpException; class CurlRequest implements Request { /** - * @var resource + * @var \CurlHandle */ private $ch; @@ -42,8 +42,8 @@ class CurlRequest implements Request { $curl = $this->createCurl(); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $body); + curl_setopt($curl, \CURLOPT_POST, true); + curl_setopt($curl, \CURLOPT_POSTFIELDS, $body); return $this->execute($curl); } @@ -52,49 +52,49 @@ class CurlRequest implements Request { $curl = $this->createCurl(); - curl_setopt($curl, CURLOPT_HTTPGET, true); + curl_setopt($curl, \CURLOPT_HTTPGET, true); return $this->execute($curl); } /** - * @return resource + * @return \CurlHandle */ private function createCurl() { curl_reset($this->ch); $opts = []; - $opts[CURLOPT_URL] = $this->url; + $opts[\CURLOPT_URL] = $this->url; if (!empty($this->options['caBundle'])) { - $opts[CURLOPT_CAINFO] = $this->options['caBundle']; + $opts[\CURLOPT_CAINFO] = $this->options['caBundle']; } - $opts[CURLOPT_ENCODING] = ''; - $opts[CURLOPT_SSL_VERIFYHOST] = 2; - $opts[CURLOPT_FOLLOWLOCATION] = false; - $opts[CURLOPT_SSL_VERIFYPEER] = true; - $opts[CURLOPT_RETURNTRANSFER] = true; + $opts[\CURLOPT_ENCODING] = ''; + $opts[\CURLOPT_SSL_VERIFYHOST] = 2; + $opts[\CURLOPT_FOLLOWLOCATION] = false; + $opts[\CURLOPT_SSL_VERIFYPEER] = true; + $opts[\CURLOPT_RETURNTRANSFER] = true; - $opts[CURLOPT_HTTPHEADER] = $this->options['headers']; - $opts[CURLOPT_USERAGENT] = $this->options['userAgent']; - $opts[CURLOPT_PROXY] = $this->options['proxy']; + $opts[\CURLOPT_HTTPHEADER] = $this->options['headers']; + $opts[\CURLOPT_USERAGENT] = $this->options['userAgent']; + $opts[\CURLOPT_PROXY] = $this->options['proxy']; // The defined()s are here as the *_MS opts are not available on older // cURL versions $connectTimeout = $this->options['connectTimeout']; if (\defined('CURLOPT_CONNECTTIMEOUT_MS')) { - $opts[CURLOPT_CONNECTTIMEOUT_MS] = ceil($connectTimeout * 1000); + $opts[\CURLOPT_CONNECTTIMEOUT_MS] = ceil($connectTimeout * 1000); } else { - $opts[CURLOPT_CONNECTTIMEOUT] = ceil($connectTimeout); + $opts[\CURLOPT_CONNECTTIMEOUT] = ceil($connectTimeout); } $timeout = $this->options['timeout']; if (\defined('CURLOPT_TIMEOUT_MS')) { - $opts[CURLOPT_TIMEOUT_MS] = ceil($timeout * 1000); + $opts[\CURLOPT_TIMEOUT_MS] = ceil($timeout * 1000); } else { - $opts[CURLOPT_TIMEOUT] = ceil($timeout); + $opts[\CURLOPT_TIMEOUT] = ceil($timeout); } curl_setopt_array($this->ch, $opts); @@ -103,7 +103,7 @@ class CurlRequest implements Request } /** - * @param resource $curl + * @param \CurlHandle $curl * * @throws HttpException */ @@ -120,17 +120,17 @@ class CurlRequest implements Request ); } - $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - $contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE); + $statusCode = curl_getinfo($curl, \CURLINFO_HTTP_CODE); + $contentType = curl_getinfo($curl, \CURLINFO_CONTENT_TYPE); return [ - $statusCode, - // The PHP docs say "Content-Type: of the requested document. NULL - // indicates server did not send valid Content-Type: header" for - // CURLINFO_CONTENT_TYPE. However, it will return FALSE if no header - // is set. To keep our types simple, we return null in this case. - ($contentType === false ? null : $contentType), - $body, + $statusCode, + // The PHP docs say "Content-Type: of the requested document. NULL + // indicates server did not send valid Content-Type: header" for + // CURLINFO_CONTENT_TYPE. However, it will return FALSE if no header + // is set. To keep our types simple, we return null in this case. + ($contentType === false ? null : $contentType), + $body, ]; } } diff --git a/includes/vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php b/includes/vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php index 059f277b..9d03fb20 100644 --- a/includes/vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php +++ b/includes/vendor/maxmind/web-service-common/src/WebService/Http/RequestFactory.php @@ -16,7 +16,7 @@ class RequestFactory * done the connection is kept alive, SSL resumption can be used * etcetera. * - * @var resource + * @var \CurlHandle|null */ private $ch; @@ -27,6 +27,9 @@ class RequestFactory } } + /** + * @return \CurlHandle + */ private function getCurlHandle() { if (empty($this->ch)) { @@ -36,10 +39,7 @@ class RequestFactory return $this->ch; } - /** - * @return Request - */ - public function request(string $url, array $options) + public function request(string $url, array $options): Request { $options['curlHandle'] = $this->getCurlHandle(); diff --git a/includes/vendor/rmccue/requests/certificates/etag-cert.txt b/includes/vendor/rmccue/requests/certificates/etag-cert.txt deleted file mode 100644 index 3108bfaf..00000000 --- a/includes/vendor/rmccue/requests/certificates/etag-cert.txt +++ /dev/null @@ -1 +0,0 @@ -338e2-5db52cb225723 diff --git a/includes/vendor/rmccue/requests/certificates/etag-sha.txt b/includes/vendor/rmccue/requests/certificates/etag-sha.txt deleted file mode 100644 index de62b6d2..00000000 --- a/includes/vendor/rmccue/requests/certificates/etag-sha.txt +++ /dev/null @@ -1 +0,0 @@ -4d-5db52cb22b4e4 diff --git a/includes/vendor/rmccue/requests/src/Requests.php b/includes/vendor/rmccue/requests/src/Requests.php index 9c1f0c05..4ac06b67 100644 --- a/includes/vendor/rmccue/requests/src/Requests.php +++ b/includes/vendor/rmccue/requests/src/Requests.php @@ -148,7 +148,7 @@ class Requests { * * @var string */ - const VERSION = '2.0.1'; + const VERSION = '2.0.2'; /** * Selected transport name |