diff --git a/niucloud/vendor/composer/InstalledVersions.php b/niucloud/vendor/composer/InstalledVersions.php index c6b54af7b..51e734a77 100644 --- a/niucloud/vendor/composer/InstalledVersions.php +++ b/niucloud/vendor/composer/InstalledVersions.php @@ -98,7 +98,7 @@ class InstalledVersions { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +119,7 @@ class InstalledVersions */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -328,7 +328,9 @@ class InstalledVersions 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'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -340,12 +342,17 @@ class InstalledVersions // 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'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/niucloud/vendor/composer/autoload_classmap.php b/niucloud/vendor/composer/autoload_classmap.php index 55abb6eb8..4ff1152f1 100644 --- a/niucloud/vendor/composer/autoload_classmap.php +++ b/niucloud/vendor/composer/autoload_classmap.php @@ -12,7 +12,7 @@ return array( 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'QcloudApi' => $vendorDir . '/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/QcloudApi.php', 'Requests' => $vendorDir . '/rmccue/requests/library/Requests.php', - 'Stringable' => $vendorDir . '/myclabs/php-enum/stubs/Stringable.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/niucloud/vendor/composer/autoload_psr4.php b/niucloud/vendor/composer/autoload_psr4.php index 006b7460b..b7663ed79 100644 --- a/niucloud/vendor/composer/autoload_psr4.php +++ b/niucloud/vendor/composer/autoload_psr4.php @@ -12,10 +12,11 @@ return array( 'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'), 'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'), 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-image/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-queue/src', $vendorDir . '/topthink/think-template/src'), - 'extend\\' => array($baseDir . '/extend'), 'dh2y\\qrcode\\' => array($vendorDir . '/dh2y/think-qrcode/src'), + 'core\\' => array($baseDir . '/core'), 'clagiordano\\weblibs\\configmanager\\' => array($vendorDir . '/clagiordano/weblibs-configmanager/src'), 'app\\' => array($baseDir . '/app'), + 'addon\\' => array($baseDir . '/addon'), 'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'), 'Yansongda\\Supports\\' => array($vendorDir . '/yansongda/supports/src'), 'Yansongda\\Pay\\' => array($vendorDir . '/yansongda/pay/src'), @@ -57,6 +58,7 @@ return array( 'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'), 'JmesPath\\' => array($vendorDir . '/mtdowling/jmespath.php/src'), 'Invoker\\' => array($vendorDir . '/php-di/invoker/src'), + 'Intervention\\Image\\' => array($vendorDir . '/intervention/image/src/Intervention/Image'), 'GuzzleHttp\\UriTemplate\\' => array($vendorDir . '/guzzlehttp/uri-template/src'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), @@ -64,6 +66,7 @@ return array( 'GuzzleHttp\\Command\\' => array($vendorDir . '/guzzlehttp/command/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), + 'Fastknife\\' => array($vendorDir . '/fastknife/ajcaptcha/src'), 'EasyWeChat\\' => array($vendorDir . '/overtrue/wechat/src'), 'EasyWeChatComposer\\' => array($vendorDir . '/easywechat-composer/easywechat-composer/src'), 'DI\\' => array($vendorDir . '/php-di/php-di/src'), diff --git a/niucloud/vendor/composer/autoload_static.php b/niucloud/vendor/composer/autoload_static.php index 1c1ca0049..b6eaa7f9f 100644 --- a/niucloud/vendor/composer/autoload_static.php +++ b/niucloud/vendor/composer/autoload_static.php @@ -51,21 +51,19 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e 'think\\app\\' => 10, 'think\\' => 6, ), - 'e' => - array ( - 'extend\\' => 7, - ), 'd' => array ( 'dh2y\\qrcode\\' => 12, ), 'c' => array ( + 'core\\' => 5, 'clagiordano\\weblibs\\configmanager\\' => 34, ), 'a' => array ( 'app\\' => 4, + 'addon\\' => 6, ), 'Z' => array ( @@ -143,6 +141,7 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e 'I' => array ( 'Invoker\\' => 8, + 'Intervention\\Image\\' => 19, ), 'G' => array ( @@ -156,6 +155,7 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e 'F' => array ( 'Firebase\\JWT\\' => 13, + 'Fastknife\\' => 10, ), 'E' => array ( @@ -209,14 +209,14 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e 4 => __DIR__ . '/..' . '/topthink/think-queue/src', 5 => __DIR__ . '/..' . '/topthink/think-template/src', ), - 'extend\\' => - array ( - 0 => __DIR__ . '/../..' . '/extend', - ), 'dh2y\\qrcode\\' => array ( 0 => __DIR__ . '/..' . '/dh2y/think-qrcode/src', ), + 'core\\' => + array ( + 0 => __DIR__ . '/../..' . '/core', + ), 'clagiordano\\weblibs\\configmanager\\' => array ( 0 => __DIR__ . '/..' . '/clagiordano/weblibs-configmanager/src', @@ -225,6 +225,10 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e array ( 0 => __DIR__ . '/../..' . '/app', ), + 'addon\\' => + array ( + 0 => __DIR__ . '/../..' . '/addon', + ), 'ZipStream\\' => array ( 0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src', @@ -390,6 +394,10 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e array ( 0 => __DIR__ . '/..' . '/php-di/invoker/src', ), + 'Intervention\\Image\\' => + array ( + 0 => __DIR__ . '/..' . '/intervention/image/src/Intervention/Image', + ), 'GuzzleHttp\\UriTemplate\\' => array ( 0 => __DIR__ . '/..' . '/guzzlehttp/uri-template/src', @@ -418,6 +426,10 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e array ( 0 => __DIR__ . '/..' . '/firebase/php-jwt/src', ), + 'Fastknife\\' => + array ( + 0 => __DIR__ . '/..' . '/fastknife/ajcaptcha/src', + ), 'EasyWeChat\\' => array ( 0 => __DIR__ . '/..' . '/overtrue/wechat/src', @@ -480,7 +492,7 @@ class ComposerStaticInitf082efa3600aae2b847c3e8b4e641a4e 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'QcloudApi' => __DIR__ . '/..' . '/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/QcloudApi.php', 'Requests' => __DIR__ . '/..' . '/rmccue/requests/library/Requests.php', - 'Stringable' => __DIR__ . '/..' . '/myclabs/php-enum/stubs/Stringable.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/niucloud/vendor/composer/installed.json b/niucloud/vendor/composer/installed.json index cd3eb04b6..b2349d363 100644 --- a/niucloud/vendor/composer/installed.json +++ b/niucloud/vendor/composer/installed.json @@ -4,11 +4,22 @@ "name": "adbario/php-dot-notation", "version": "2.5.0", "version_normalized": "2.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/adbario/php-dot-notation.git", + "reference": "081e2cca50c84bfeeea2e3ef9b2c8d206d80ccae" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/adbario/php-dot-notation/2.5.0/adbario-php-dot-notation-2.5.0.zip", + "url": "https://api.github.com/repos/adbario/php-dot-notation/zipball/081e2cca50c84bfeeea2e3ef9b2c8d206d80ccae", "reference": "081e2cca50c84bfeeea2e3ef9b2c8d206d80ccae", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -29,6 +40,7 @@ "Adbar\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -44,17 +56,32 @@ "ArrayAccess", "dotnotation" ], + "support": { + "issues": "https://github.com/adbario/php-dot-notation/issues", + "source": "https://github.com/adbario/php-dot-notation/tree/2.5.0" + }, "install-path": "../adbario/php-dot-notation" }, { "name": "alibabacloud/client", "version": "1.5.32", "version_normalized": "1.5.32.0", + "source": { + "type": "git", + "url": "https://github.com/aliyun/openapi-sdk-php-client.git", + "reference": "5bc6f6d660797dcee2c3aef29700ab41ee764f4d" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/alibabacloud/client/1.5.32/alibabacloud-client-1.5.32.zip", + "url": "https://api.github.com/repos/aliyun/openapi-sdk-php-client/zipball/5bc6f6d660797dcee2c3aef29700ab41ee764f4d", "reference": "5bc6f6d660797dcee2c3aef29700ab41ee764f4d", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "adbario/php-dot-notation": "^2.4.1", @@ -99,6 +126,7 @@ "AlibabaCloud\\Client\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -121,17 +149,32 @@ "sdk", "tool" ], + "support": { + "issues": "https://github.com/aliyun/openapi-sdk-php-client/issues", + "source": "https://github.com/aliyun/openapi-sdk-php-client" + }, "install-path": "../alibabacloud/client" }, { "name": "aliyuncs/oss-sdk-php", "version": "v2.6.0", "version_normalized": "2.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/aliyun/aliyun-oss-php-sdk.git", + "reference": "572d0f8e099e8630ae7139ed3fdedb926c7a760f" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/aliyuncs/oss-sdk-php/v2.6.0/aliyuncs-oss-sdk-php-v2.6.0.zip", + "url": "https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/zipball/572d0f8e099e8630ae7139ed3fdedb926c7a760f", "reference": "572d0f8e099e8630ae7139ed3fdedb926c7a760f", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3" @@ -148,6 +191,7 @@ "OSS\\": "src/OSS" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -159,17 +203,32 @@ ], "description": "Aliyun OSS SDK for PHP", "homepage": "http://www.aliyun.com/product/oss/", + "support": { + "issues": "https://github.com/aliyun/aliyun-oss-php-sdk/issues", + "source": "https://github.com/aliyun/aliyun-oss-php-sdk/tree/v2.6.0" + }, "install-path": "../aliyuncs/oss-sdk-php" }, { "name": "clagiordano/weblibs-configmanager", "version": "v1.2.0", "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/clagiordano/weblibs-configmanager.git", + "reference": "5c8ebcc62782313b1278afe802b120d18c07a059" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/clagiordano/weblibs-configmanager/v1.2.0/clagiordano-weblibs-configmanager-v1.2.0.zip", + "url": "https://api.github.com/repos/clagiordano/weblibs-configmanager/zipball/5c8ebcc62782313b1278afe802b120d18c07a059", "reference": "5c8ebcc62782313b1278afe802b120d18c07a059", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.4" @@ -186,6 +245,7 @@ "clagiordano\\weblibs\\configmanager\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], @@ -204,17 +264,32 @@ "tool", "weblibs" ], + "support": { + "issues": "https://github.com/clagiordano/weblibs-configmanager/issues", + "source": "https://github.com/clagiordano/weblibs-configmanager/tree/v1.2.0" + }, "install-path": "../clagiordano/weblibs-configmanager" }, { "name": "dh2y/think-qrcode", "version": "2.0", "version_normalized": "2.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/cinaofdai/think-qrcode.git", + "reference": "977d032afa27b1852f5fc5441fad2497f6db7ff5" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/dh2y/think-qrcode/2.0/dh2y-think-qrcode-2.0.zip", + "url": "https://api.github.com/repos/cinaofdai/think-qrcode/zipball/977d032afa27b1852f5fc5441fad2497f6db7ff5", "reference": "977d032afa27b1852f5fc5441fad2497f6db7ff5", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.4.0" @@ -227,6 +302,7 @@ "dh2y\\qrcode\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -238,17 +314,32 @@ ], "description": "qrcode for thinkphp5", "homepage": "https://github.com/cinaofdai/think-qrcode", + "support": { + "issues": "https://github.com/cinaofdai/think-qrcode/issues", + "source": "https://github.com/cinaofdai/think-qrcode/tree/2.0" + }, "install-path": "../dh2y/think-qrcode" }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", - "version_normalized": "3.3.2.0", + "version": "v3.3.1", + "version_normalized": "3.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/dragonmantank/cron-expression/v3.3.2/dragonmantank-cron-expression-v3.3.2.zip", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", - "shasum": "" + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/be85b3f05b46c39bbc0d95f6c071ddff669510fa", + "reference": "be85b3f05b46c39bbc0d95f6c071ddff669510fa", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.2|^8.0", @@ -263,7 +354,7 @@ "phpstan/phpstan-webmozart-assert": "^1.0", "phpunit/phpunit": "^7.0|^8.0|^9.0" }, - "time": "2022-09-10T18:51:20+00:00", + "time": "2022-01-18T15:43:28+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -271,6 +362,7 @@ "Cron\\": "src/Cron/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -286,17 +378,38 @@ "cron", "schedule" ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.1" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], "install-path": "../dragonmantank/cron-expression" }, { "name": "easywechat-composer/easywechat-composer", "version": "1.4.1", "version_normalized": "1.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/mingyoung/easywechat-composer.git", + "reference": "3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/easywechat-composer/easywechat-composer/1.4.1/easywechat-composer-easywechat-composer-1.4.1.zip", + "url": "https://api.github.com/repos/mingyoung/easywechat-composer/zipball/3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd", "reference": "3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "composer-plugin-api": "^1.0 || ^2.0", @@ -317,6 +430,7 @@ "EasyWeChatComposer\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -327,17 +441,32 @@ } ], "description": "The composer plugin for EasyWeChat", + "support": { + "issues": "https://github.com/mingyoung/easywechat-composer/issues", + "source": "https://github.com/mingyoung/easywechat-composer/tree/1.4.1" + }, "install-path": "../easywechat-composer/easywechat-composer" }, { "name": "ezyang/htmlpurifier", "version": "v4.16.0", "version_normalized": "4.16.0.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/ezyang/htmlpurifier/v4.16.0/ezyang-htmlpurifier-v4.16.0.zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8", "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0" @@ -366,6 +495,7 @@ "/library/HTMLPurifier/Language/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-2.1-or-later" ], @@ -381,17 +511,70 @@ "keywords": [ "html" ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.16.0" + }, "install-path": "../ezyang/htmlpurifier" }, + { + "name": "fastknife/ajcaptcha", + "version": "v1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://gitee.com/fastknife/aj-captcha.git", + "reference": "836c5a3177bc622a245734aef421085955d0b2cb" + }, + "require": { + "ext-gd": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-openssl": "*", + "intervention/image": "^2.5", + "php": ">=7.1" + }, + "time": "2023-01-03T06:08:28+00:00", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-4": { + "Fastknife\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "bruce", + "email": "2777314125@qq.com" + } + ], + "description": "This is a behavior verification code PHP back-end implementation package", + "install-path": "../fastknife/ajcaptcha" + }, { "name": "firebase/php-jwt", "version": "v5.5.1", "version_normalized": "5.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "83b609028194aa042ea33b5af2d41a7427de80e6" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/firebase/php-jwt/v5.5.1/firebase-php-jwt-v5.5.1.zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/83b609028194aa042ea33b5af2d41a7427de80e6", "reference": "83b609028194aa042ea33b5af2d41a7427de80e6", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -410,6 +593,7 @@ "Firebase\\JWT\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -431,17 +615,32 @@ "jwt", "php" ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v5.5.1" + }, "install-path": "../firebase/php-jwt" }, { "name": "guzzlehttp/command", "version": "1.2.2", "version_normalized": "1.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/command.git", + "reference": "7883359e0ecab8a8f7c43aad2fc36360a35d21e8" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/command/1.2.2/guzzlehttp-command-1.2.2.zip", + "url": "https://api.github.com/repos/guzzle/command/zipball/7883359e0ecab8a8f7c43aad2fc36360a35d21e8", "reference": "7883359e0ecab8a8f7c43aad2fc36360a35d21e8", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "guzzlehttp/guzzle": "^7.4.1", @@ -465,6 +664,7 @@ "GuzzleHttp\\Command\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -491,6 +691,24 @@ } ], "description": "Provides the foundation for building command-based web service clients", + "support": { + "issues": "https://github.com/guzzle/command/issues", + "source": "https://github.com/guzzle/command/tree/1.2.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/command", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/command" }, { @@ -634,11 +852,22 @@ "name": "guzzlehttp/guzzle-services", "version": "1.3.2", "version_normalized": "1.3.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle-services.git", + "reference": "4989d902dd4e0411b320e851c46f3c94d652d891" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/guzzle-services/1.3.2/guzzlehttp-guzzle-services-1.3.2.zip", + "url": "https://api.github.com/repos/guzzle/guzzle-services/zipball/4989d902dd4e0411b320e851c46f3c94d652d891", "reference": "4989d902dd4e0411b320e851c46f3c94d652d891", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "guzzlehttp/command": "^1.2.2", @@ -666,6 +895,7 @@ "GuzzleHttp\\Command\\Guzzle\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -692,17 +922,46 @@ } ], "description": "Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.", + "support": { + "issues": "https://github.com/guzzle/guzzle-services/issues", + "source": "https://github.com/guzzle/guzzle-services/tree/1.3.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle-services", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/guzzle-services" }, { "name": "guzzlehttp/promises", "version": "1.5.2", "version_normalized": "1.5.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "b94b2807d85443f9719887892882d0329d1e2598" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/promises/1.5.2/guzzlehttp-promises-1.5.2.zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", "reference": "b94b2807d85443f9719887892882d0329d1e2598", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.5" @@ -726,6 +985,7 @@ "GuzzleHttp\\Promise\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -755,22 +1015,51 @@ "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/promises" }, { "name": "guzzlehttp/psr7", - "version": "2.4.3", - "version_normalized": "2.4.3.0", + "version": "2.5.0", + "version_normalized": "2.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/psr7/2.4.3/guzzlehttp-psr7-2.4.3.zip", - "reference": "67c26b443f348a51926030c83481b85718457d3d", - "shasum": "" + "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", + "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "ralouphie/getallheaders": "^3.0" }, "provide": { @@ -785,15 +1074,12 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2022-10-26T14:07:24+00:00", + "time": "2023-04-17T16:11:26+00:00", "type": "library", "extra": { "bamarni-bin": { "bin-links": true, "forward-command": false - }, - "branch-alias": { - "dev-master": "2.4-dev" } }, "installation-source": "dist", @@ -802,6 +1088,7 @@ "GuzzleHttp\\Psr7\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -853,17 +1140,46 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.5.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/psr7" }, { "name": "guzzlehttp/uri-template", "version": "v1.0.1", "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/uri-template.git", + "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/uri-template/v1.0.1/guzzlehttp-uri-template-v1.0.1.zip", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/b945d74a55a25a949158444f09ec0d3c120d69e2", "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.2.5 || ^8.0", @@ -886,6 +1202,7 @@ "GuzzleHttp\\UriTemplate\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -916,8 +1233,119 @@ "guzzlehttp", "uri-template" ], + "support": { + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v1.0.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/uri-template" }, + { + "name": "intervention/image", + "version": "2.7.2", + "version_normalized": "2.7.2.0", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "04be355f8d6734c826045d02a1079ad658322dad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad", + "reference": "04be355f8d6734c826045d02a1079ad658322dad", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1 || ^2.0", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "time": "2022-05-21T17:30:32+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "https://intervention.io/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/2.7.2" + }, + "funding": [ + { + "url": "https://paypal.me/interventionio", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "install-path": "../intervention/image" + }, { "name": "laravel/serializable-closure", "version": "v1.2.2", @@ -991,11 +1419,22 @@ "name": "maennchen/zipstream-php", "version": "v2.4.0", "version_normalized": "2.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/maennchen/zipstream-php/v2.4.0/maennchen-zipstream-php-v2.4.0.zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3", "reference": "3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-mbstring": "*", @@ -1020,6 +1459,7 @@ "ZipStream\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1046,17 +1486,42 @@ "stream", "zip" ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + }, + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], "install-path": "../maennchen/zipstream-php" }, { "name": "markbaker/complex", "version": "3.0.2", "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/markbaker/complex/3.0.2/markbaker-complex-3.0.2.zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9", "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.2 || ^8.0" @@ -1075,6 +1540,7 @@ "Complex\\": "classes/src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1090,17 +1556,32 @@ "complex", "mathematics" ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2" + }, "install-path": "../markbaker/complex" }, { "name": "markbaker/matrix", "version": "3.0.1", "version_normalized": "3.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/markbaker/matrix/3.0.1/markbaker-matrix-3.0.1.zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c", "reference": "728434227fe21be27ff6d86621a1b13107a2562c", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.1 || ^8.0" @@ -1123,6 +1604,7 @@ "Matrix\\": "classes/src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1139,17 +1621,32 @@ "matrix", "vector" ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1" + }, "install-path": "../markbaker/matrix" }, { "name": "monolog/monolog", - "version": "2.9.1", - "version_normalized": "2.9.1.0", + "version": "2.9.0", + "version_normalized": "2.9.0.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "e1c0ae1528ce313a450e5e1ad782765c4a8dd3cb" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/monolog/monolog/2.9.1/monolog-monolog-2.9.1.zip", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1", - "shasum": "" + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/e1c0ae1528ce313a450e5e1ad782765c4a8dd3cb", + "reference": "e1c0ae1528ce313a450e5e1ad782765c4a8dd3cb", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.2", @@ -1194,7 +1691,7 @@ "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2023-02-06T13:44:46+00:00", + "time": "2023-02-05T13:07:32+00:00", "type": "library", "extra": { "branch-alias": { @@ -1207,6 +1704,7 @@ "Monolog\\": "src/Monolog" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1224,17 +1722,42 @@ "logging", "psr-3" ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.9.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], "install-path": "../monolog/monolog" }, { "name": "mtdowling/jmespath.php", "version": "2.6.1", "version_normalized": "2.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/mtdowling/jmespath.php/2.6.1/mtdowling-jmespath.php-2.6.1.zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb", "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^5.4 || ^7.0 || ^8.0", @@ -1263,6 +1786,7 @@ "JmesPath\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1278,17 +1802,32 @@ "json", "jsonpath" ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1" + }, "install-path": "../mtdowling/jmespath.php" }, { "name": "myclabs/php-enum", - "version": "1.8.4", - "version_normalized": "1.8.4.0", + "version": "1.8.3", + "version_normalized": "1.8.3.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "b942d263c641ddb5190929ff840c68f78713e937" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/myclabs/php-enum/1.8.4/myclabs-php-enum-1.8.4.zip", - "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", - "shasum": "" + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/b942d263c641ddb5190929ff840c68f78713e937", + "reference": "b942d263c641ddb5190929ff840c68f78713e937", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -1299,17 +1838,15 @@ "squizlabs/php_codesniffer": "1.*", "vimeo/psalm": "^4.6.2" }, - "time": "2022-08-04T09:53:51+00:00", + "time": "2021-07-05T08:18:36+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { "MyCLabs\\Enum\\": "src/" - }, - "classmap": [ - "stubs/Stringable.php" - ] + } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1324,17 +1861,42 @@ "keywords": [ "enum" ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.8.3" + }, + "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": "nesbot/carbon", "version": "2.66.0", "version_normalized": "2.66.0.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "496712849902241f04902033b0441b269effe001" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/nesbot/carbon/2.66.0/nesbot-carbon-2.66.0.zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/496712849902241f04902033b0441b269effe001", "reference": "496712849902241f04902033b0441b269effe001", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -1383,6 +1945,7 @@ "Carbon\\": "src/Carbon/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1404,17 +1967,47 @@ "datetime", "time" ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], "install-path": "../nesbot/carbon" }, { "name": "overtrue/socialite", "version": "4.8.0", "version_normalized": "4.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/overtrue/socialite.git", + "reference": "e55fdf50f8003be8f03a85a7e5a5b7c5716f4c9a" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/overtrue/socialite/4.8.0/overtrue-socialite-4.8.0.zip", + "url": "https://api.github.com/repos/overtrue/socialite/zipball/e55fdf50f8003be8f03a85a7e5a5b7c5716f4c9a", "reference": "e55fdf50f8003be8f03a85a7e5a5b7c5716f4c9a", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -1444,6 +2037,7 @@ "Overtrue\\Socialite\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1464,17 +2058,38 @@ "wechat", "weibo" ], + "support": { + "issues": "https://github.com/overtrue/socialite/issues", + "source": "https://github.com/overtrue/socialite/tree/4.8.0" + }, + "funding": [ + { + "url": "https://github.com/overtrue", + "type": "github" + } + ], "install-path": "../overtrue/socialite" }, { "name": "overtrue/wechat", - "version": "5.32.0", - "version_normalized": "5.32.0.0", + "version": "5.30.0", + "version_normalized": "5.30.0.0", + "source": { + "type": "git", + "url": "https://github.com/w7corp/easywechat.git", + "reference": "245d1e821bc5a4609625c3244b111f570692cfc2" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/overtrue/wechat/5.32.0/overtrue-wechat-5.32.0.zip", - "reference": "379de8a3e80d57a1e75f8e03540d0c7e5fe4c7d5", - "shasum": "" + "url": "https://api.github.com/repos/w7corp/easywechat/zipball/245d1e821bc5a4609625c3244b111f570692cfc2", + "reference": "245d1e821bc5a4609625c3244b111f570692cfc2", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "easywechat-composer/easywechat-composer": "^1.1", @@ -1502,7 +2117,7 @@ "phpstan/phpstan": "^0.12.0", "phpunit/phpunit": "^9.3" }, - "time": "2022-12-30T06:52:54+00:00", + "time": "2022-09-05T08:22:34+00:00", "type": "library", "extra": { "hooks": { @@ -1526,6 +2141,7 @@ "EasyWeChat\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1543,6 +2159,17 @@ "weixin", "weixin-sdk" ], + "support": { + "issues": "https://github.com/w7corp/easywechat/issues", + "source": "https://github.com/w7corp/easywechat/tree/5.30.0" + }, + "funding": [ + { + "url": "https://github.com/overtrue", + "type": "github" + } + ], + "abandoned": "w7corp/easywechat", "install-path": "../overtrue/wechat" }, { @@ -1693,13 +2320,24 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.27.1", - "version_normalized": "1.27.1.0", + "version": "1.28.0", + "version_normalized": "1.28.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "6e81cf39bbd93ebc3a4e8150444c41e8aa9b769a" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/phpoffice/phpspreadsheet/1.27.1/phpoffice-phpspreadsheet-1.27.1.zip", - "reference": "ef4e6ef74990239946d3983451a9bbed5ef1be5d", - "shasum": "" + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/6e81cf39bbd93ebc3a4e8150444c41e8aa9b769a", + "reference": "6e81cf39bbd93ebc3a4e8150444c41e8aa9b769a", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-ctype": "*", @@ -1744,7 +2382,7 @@ "mpdf/mpdf": "Option for rendering PDF with PDF Writer", "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" }, - "time": "2023-02-08T07:02:13+00:00", + "time": "2023-02-25T12:24:49+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1752,6 +2390,7 @@ "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1787,17 +2426,32 @@ "xls", "xlsx" ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.28.0" + }, "install-path": "../phpoffice/phpspreadsheet" }, { "name": "pimple/pimple", "version": "v3.5.0", "version_normalized": "3.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/pimple/pimple/v3.5.0/pimple-pimple-v3.5.0.zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed", "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.2.5", @@ -1819,6 +2473,7 @@ "Pimple": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1834,17 +2489,31 @@ "container", "dependency injection" ], + "support": { + "source": "https://github.com/silexphp/Pimple/tree/v3.5.0" + }, "install-path": "../pimple/pimple" }, { "name": "psr/cache", "version": "2.0.0", "version_normalized": "2.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/psr/cache/2.0.0/psr-cache-2.0.0.zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.0" @@ -1862,6 +2531,7 @@ "Psr\\Cache\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1877,17 +2547,31 @@ "psr", "psr-6" ], + "support": { + "source": "https://github.com/php-fig/cache/tree/2.0.0" + }, "install-path": "../psr/cache" }, { "name": "psr/container", "version": "1.1.2", "version_normalized": "1.1.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/psr/container/1.1.2/psr-container-1.1.2.zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.4.0" @@ -1900,6 +2584,7 @@ "Psr\\Container\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1918,17 +2603,32 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, "install-path": "../psr/container" }, { "name": "psr/event-dispatcher", "version": "1.0.0", "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/psr/event-dispatcher/1.0.0/psr-event-dispatcher-1.0.0.zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.2.0" @@ -1946,6 +2646,7 @@ "Psr\\EventDispatcher\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1961,17 +2662,32 @@ "psr", "psr-14" ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, "install-path": "../psr/event-dispatcher" }, { "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://mirrors.cloud.tencent.com/repository/composer/psr/http-client/1.0.1/psr-http-client-1.0.1.zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.0 || ^8.0", @@ -1990,6 +2706,7 @@ "Psr\\Http\\Client\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2007,23 +2724,37 @@ "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", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/psr/http-factory/1.0.1/psr-http-factory-1.0.1.zip", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2019-04-30T12:38:16+00:00", + "time": "2023-04-10T20:10:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -2036,13 +2767,14 @@ "Psr\\Http\\Message\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -2056,26 +2788,40 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, "install-path": "../psr/http-factory" }, { "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.1", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/psr/http-message/1.0.1/psr-http-message-1.0.1.zip", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, - "time": "2016-08-06T14:39:51+00:00", + "time": "2023-04-04T09:50:52+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "installation-source": "dist", @@ -2084,6 +2830,7 @@ "Psr\\Http\\Message\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2103,17 +2850,31 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/1.1" + }, "install-path": "../psr/http-message" }, { "name": "psr/log", "version": "1.1.4", "version_normalized": "1.1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/psr/log/1.1.4/psr-log-1.1.4.zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -2131,6 +2892,7 @@ "Psr\\Log\\": "Psr/Log/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2147,17 +2909,31 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, "install-path": "../psr/log" }, { "name": "psr/simple-cache", "version": "1.0.1", "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/psr/simple-cache/1.0.1/psr-simple-cache-1.0.1.zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -2175,6 +2951,7 @@ "Psr\\SimpleCache\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2192,28 +2969,43 @@ "psr-16", "simple-cache" ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, "install-path": "../psr/simple-cache" }, { "name": "qcloud/cos-sdk-v5", - "version": "v2.6.1", - "version_normalized": "2.6.1.0", + "version": "v2.6.2", + "version_normalized": "2.6.2.0", + "source": { + "type": "git", + "url": "https://github.com/tencentyun/cos-php-sdk-v5.git", + "reference": "92a1ee62b85ed4e7bf6836a684df5d7e3158d0ed" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/qcloud/cos-sdk-v5/v2.6.1/qcloud-cos-sdk-v5-v2.6.1.zip", - "reference": "d367ba8d0305b83364b64055594a0ac22b1cefd8", - "shasum": "" + "url": "https://api.github.com/repos/tencentyun/cos-php-sdk-v5/zipball/92a1ee62b85ed4e7bf6836a684df5d7e3158d0ed", + "reference": "92a1ee62b85ed4e7bf6836a684df5d7e3158d0ed", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-curl": "*", "ext-json": "*", + "ext-mbstring": "*", "ext-simplexml": "*", "guzzlehttp/guzzle": "^6.2.1 || ^7.0", "guzzlehttp/guzzle-services": "^1.1", "guzzlehttp/psr7": "^1.3.1 || ^2.0", "php": ">=5.6" }, - "time": "2023-02-07T09:49:12+00:00", + "time": "2023-04-07T07:38:24+00:00", "type": "library", "extra": { "branch-alias": { @@ -2229,6 +3021,7 @@ "Qcloud\\Cos\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2252,17 +3045,32 @@ "php", "qcloud" ], + "support": { + "issues": "https://github.com/tencentyun/cos-php-sdk-v5/issues", + "source": "https://github.com/tencentyun/cos-php-sdk-v5/tree/v2.6.2" + }, "install-path": "../qcloud/cos-sdk-v5" }, { "name": "qiniu/php-sdk", "version": "v7.4.0", "version_normalized": "7.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/qiniu/php-sdk.git", + "reference": "1c6bc89166e524a40ee42bf516fb99ffc6401c82" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/qiniu/php-sdk/v7.4.0/qiniu-php-sdk-v7.4.0.zip", + "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/1c6bc89166e524a40ee42bf516fb99ffc6401c82", "reference": "1c6bc89166e524a40ee42bf516fb99ffc6401c82", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.3" @@ -2282,6 +3090,7 @@ "Qiniu\\": "src/Qiniu" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2300,17 +3109,32 @@ "sdk", "storage" ], + "support": { + "issues": "https://github.com/qiniu/php-sdk/issues", + "source": "https://github.com/qiniu/php-sdk/tree/v7.4.0" + }, "install-path": "../qiniu/php-sdk" }, { "name": "ralouphie/getallheaders", "version": "3.0.3", "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/ralouphie/getallheaders/3.0.3/ralouphie-getallheaders-3.0.3.zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.6" @@ -2327,6 +3151,7 @@ "src/getallheaders.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2337,17 +3162,32 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "install-path": "../ralouphie/getallheaders" }, { "name": "rmccue/requests", "version": "v2.0.5", "version_normalized": "2.0.5.0", + "source": { + "type": "git", + "url": "https://github.com/WordPress/Requests.git", + "reference": "b717f1d2f4ef7992ec0c127747ed8b7e170c2f49" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/rmccue/requests/v2.0.5/rmccue-requests-v2.0.5.zip", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/b717f1d2f4ef7992ec0c127747ed8b7e170c2f49", "reference": "b717f1d2f4ef7992ec0c127747ed8b7e170c2f49", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -2378,6 +3218,7 @@ "library/Requests.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "ISC" ], @@ -2410,17 +3251,33 @@ "iri", "sockets" ], + "support": { + "docs": "https://requests.ryanmccue.info/", + "issues": "https://github.com/WordPress/Requests/issues", + "source": "https://github.com/WordPress/Requests" + }, "install-path": "../rmccue/requests" }, { "name": "spatie/macroable", "version": "1.0.1", "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/macroable.git", + "reference": "7a99549fc001c925714b329220dea680c04bfa48" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/spatie/macroable/1.0.1/spatie-macroable-1.0.1.zip", + "url": "https://api.github.com/repos/spatie/macroable/zipball/7a99549fc001c925714b329220dea680c04bfa48", "reference": "7a99549fc001c925714b329220dea680c04bfa48", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.2|^8.0" @@ -2436,6 +3293,7 @@ "Spatie\\Macroable\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2453,17 +3311,32 @@ "macroable", "spatie" ], + "support": { + "issues": "https://github.com/spatie/macroable/issues", + "source": "https://github.com/spatie/macroable/tree/1.0.1" + }, "install-path": "../spatie/macroable" }, { "name": "symfony/cache", - "version": "v5.4.19", - "version_normalized": "5.4.19.0", + "version": "v5.4.23", + "version_normalized": "5.4.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "983c79ff28612cdfd66d8e44e1a06e5afc87e107" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/cache/v5.4.19/symfony-cache-v5.4.19.zip", - "reference": "e9147c89fdfdc5d5ef798bb7193f23726ad609f5", - "shasum": "" + "url": "https://api.github.com/repos/symfony/cache/zipball/983c79ff28612cdfd66d8e44e1a06e5afc87e107", + "reference": "983c79ff28612cdfd66d8e44e1a06e5afc87e107", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.2.5", @@ -2500,7 +3373,7 @@ "symfony/messenger": "^4.4|^5.0|^6.0", "symfony/var-dumper": "^4.4|^5.0|^6.0" }, - "time": "2023-01-19T09:49:58+00:00", + "time": "2023-04-21T15:38:51+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2511,6 +3384,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2530,17 +3404,45 @@ "caching", "psr6" ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.4.23" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/cache" }, { "name": "symfony/cache-contracts", "version": "v2.5.2", "version_normalized": "2.5.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/cache-contracts/v2.5.2/symfony-cache-contracts-v2.5.2.zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.2.5", @@ -2566,6 +3468,7 @@ "Symfony\\Contracts\\Cache\\": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2589,17 +3492,45 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/cache-contracts" }, { "name": "symfony/deprecation-contracts", "version": "v3.0.2", "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/deprecation-contracts/v3.0.2/symfony-deprecation-contracts-v3.0.2.zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.2" @@ -2621,6 +3552,7 @@ "function.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2636,17 +3568,45 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/deprecation-contracts" }, { "name": "symfony/event-dispatcher", "version": "v6.0.19", "version_normalized": "6.0.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/event-dispatcher/v6.0.19/symfony-event-dispatcher-v6.0.19.zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.2", @@ -2684,6 +3644,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2699,17 +3660,45 @@ ], "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/event-dispatcher" }, { "name": "symfony/event-dispatcher-contracts", "version": "v3.0.2", "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/event-dispatcher-contracts/v3.0.2/symfony-event-dispatcher-contracts-v3.0.2.zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.2", @@ -2735,6 +3724,7 @@ "Symfony\\Contracts\\EventDispatcher\\": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2758,17 +3748,45 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/event-dispatcher-contracts" }, { "name": "symfony/http-foundation", "version": "v6.0.20", "version_normalized": "6.0.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "e16b2676a4b3b1fa12378a20b29c364feda2a8d6" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/http-foundation/v6.0.20/symfony-http-foundation-v6.0.20.zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e16b2676a4b3b1fa12378a20b29c364feda2a8d6", "reference": "e16b2676a4b3b1fa12378a20b29c364feda2a8d6", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.2", @@ -2798,6 +3816,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2813,17 +3832,45 @@ ], "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v6.0.20" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/http-foundation" }, { "name": "symfony/polyfill-mbstring", "version": "v1.27.0", "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/polyfill-mbstring/v1.27.0/symfony-polyfill-mbstring-v1.27.0.zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1" @@ -2854,6 +3901,7 @@ "Symfony\\Polyfill\\Mbstring\\": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2876,17 +3924,45 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/polyfill-mbstring" }, { "name": "symfony/polyfill-php72", "version": "v1.27.0", "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/polyfill-php72/v1.27.0/symfony-polyfill-php72-v1.27.0.zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1" @@ -2911,6 +3987,7 @@ "Symfony\\Polyfill\\Php72\\": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2932,17 +4009,45 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/polyfill-php72" }, { "name": "symfony/polyfill-php73", "version": "v1.27.0", "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/polyfill-php73/v1.27.0/symfony-polyfill-php73-v1.27.0.zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1" @@ -2970,6 +4075,7 @@ "Resources/stubs" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2991,17 +4097,45 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/polyfill-php73" }, { "name": "symfony/polyfill-php80", "version": "v1.27.0", "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/polyfill-php80/v1.27.0/symfony-polyfill-php80-v1.27.0.zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1" @@ -3029,6 +4163,7 @@ "Resources/stubs" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3054,17 +4189,45 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/polyfill-php80" }, { "name": "symfony/process", "version": "v4.4.44", "version_normalized": "4.4.44.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/process/v4.4.44/symfony-process-v4.4.44.zip", + "url": "https://api.github.com/repos/symfony/process/zipball/5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1.3", @@ -3081,6 +4244,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3096,21 +4260,38 @@ ], "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v4.4.44" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/process" }, { "name": "symfony/psr-http-message-bridge", - "version": "v2.1.3", - "version_normalized": "2.1.3.0", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "d444f85dddf65c7e57c58d8e5b3a4dbb593b1840" + "reference": "28a732c05bbad801304ad5a5c674cf2970508993" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/d444f85dddf65c7e57c58d8e5b3a4dbb593b1840", - "reference": "d444f85dddf65c7e57c58d8e5b3a4dbb593b1840", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/28a732c05bbad801304ad5a5c674cf2970508993", + "reference": "28a732c05bbad801304ad5a5c674cf2970508993", "shasum": "", "mirrors": [ { @@ -3120,28 +4301,28 @@ ] }, "require": { - "php": ">=7.1", - "psr/http-message": "^1.0", - "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0" + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0", + "symfony/http-foundation": "^5.4 || ^6.0" }, "require-dev": { "nyholm/psr7": "^1.1", "psr/log": "^1.1 || ^2 || ^3", - "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.4@dev || ^6.0" + "symfony/browser-kit": "^5.4 || ^6.0", + "symfony/config": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/http-kernel": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^6.2" }, "suggest": { "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" }, - "time": "2022-09-05T10:34:54+00:00", + "time": "2023-04-21T08:40:19+00:00", "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-main": "2.1-dev" + "dev-main": "2.2-dev" } }, "installation-source": "dist", @@ -3177,7 +4358,7 @@ ], "support": { "issues": "https://github.com/symfony/psr-http-message-bridge/issues", - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.3" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.2.0" }, "funding": [ { @@ -3199,11 +4380,22 @@ "name": "symfony/service-contracts", "version": "v2.5.2", "version_normalized": "2.5.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/service-contracts/v2.5.2/symfony-service-contracts-v2.5.2.zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.2.5", @@ -3233,6 +4425,7 @@ "Symfony\\Contracts\\Service\\": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3256,17 +4449,45 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/service-contracts" }, { "name": "symfony/translation", "version": "v6.0.19", "version_normalized": "6.0.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/translation/v6.0.19/symfony-translation-v6.0.19.zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.2", @@ -3316,6 +4537,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3331,17 +4553,45 @@ ], "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/translation" }, { "name": "symfony/translation-contracts", "version": "v3.0.2", "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/translation-contracts/v3.0.2/symfony-translation-contracts-v3.0.2.zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282", "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.2" @@ -3366,6 +4616,7 @@ "Symfony\\Contracts\\Translation\\": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3389,17 +4640,45 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/translation-contracts" }, { "name": "symfony/var-dumper", "version": "v4.4.47", "version_normalized": "4.4.47.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "1069c7a3fca74578022fab6f81643248d02f8e63" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/var-dumper/v4.4.47/symfony-var-dumper-v4.4.47.zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63", "reference": "1069c7a3fca74578022fab6f81643248d02f8e63", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1.3", @@ -3439,6 +4718,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3458,17 +4738,45 @@ "debug", "dump" ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v4.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/var-dumper" }, { "name": "symfony/var-exporter", "version": "v6.0.19", "version_normalized": "6.0.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/symfony/var-exporter/v6.0.19/symfony-var-exporter-v6.0.19.zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=8.0.2" @@ -3487,6 +4795,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3510,23 +4819,54 @@ "instantiate", "serialize" ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v6.0.19" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/var-exporter" }, { "name": "tencentcloud/tencentcloud-sdk-php", - "version": "3.0.831", - "version_normalized": "3.0.831.0", + "version": "3.0.885", + "version_normalized": "3.0.885.0", + "source": { + "type": "git", + "url": "https://github.com/TencentCloud/tencentcloud-sdk-php.git", + "reference": "0e7905b882c574e1eb305105c4307847d78a0464" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/tencentcloud/tencentcloud-sdk-php/3.0.831/tencentcloud-tencentcloud-sdk-php-3.0.831.zip", - "reference": "b8a774522788b3b380e449f9acf927b83291a2ae", - "shasum": "" + "url": "https://api.github.com/repos/TencentCloud/tencentcloud-sdk-php/zipball/0e7905b882c574e1eb305105c4307847d78a0464", + "reference": "0e7905b882c574e1eb305105c4307847d78a0464", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "guzzlehttp/guzzle": "^6.3 || ^7.0", "php": ">=5.6.0" }, - "time": "2023-02-24T00:05:17+00:00", + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "time": "2023-05-16T00:05:17+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3537,6 +4877,7 @@ "src/QcloudApi/QcloudApi.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3550,17 +4891,32 @@ ], "description": "TencentCloudApi php sdk", "homepage": "https://github.com/TencentCloud/tencentcloud-sdk-php", + "support": { + "issues": "https://github.com/TencentCloud/tencentcloud-sdk-php/issues", + "source": "https://github.com/TencentCloud/tencentcloud-sdk-php/tree/3.0.885" + }, "install-path": "../tencentcloud/tencentcloud-sdk-php" }, { "name": "topthink/framework", "version": "v6.1.2", "version_normalized": "6.1.2.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/framework.git", + "reference": "67235be5b919aaaf1de5aed9839f65d8e766aca3" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/framework/v6.1.2/topthink-framework-v6.1.2.zip", + "url": "https://api.github.com/repos/top-think/framework/zipball/67235be5b919aaaf1de5aed9839f65d8e766aca3", "reference": "67235be5b919aaaf1de5aed9839f65d8e766aca3", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -3588,6 +4944,7 @@ "think\\": "src/think/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3608,22 +4965,37 @@ "orm", "thinkphp" ], + "support": { + "issues": "https://github.com/top-think/framework/issues", + "source": "https://github.com/top-think/framework/tree/v6.1.2" + }, "install-path": "../topthink/framework" }, { "name": "topthink/think-captcha", - "version": "v3.0.8", - "version_normalized": "3.0.8.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-captcha.git", + "reference": "b1ef360670578214edeebcf824aaf6ab7ee0528b" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-captcha/v3.0.8/topthink-think-captcha-v3.0.8.zip", - "reference": "52fba122c953995bec3013c635025172491ae299", - "shasum": "" + "url": "https://api.github.com/repos/top-think/think-captcha/zipball/b1ef360670578214edeebcf824aaf6ab7ee0528b", + "reference": "b1ef360670578214edeebcf824aaf6ab7ee0528b", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { - "topthink/framework": "^6.0" + "topthink/framework": "^6.0|^8.0" }, - "time": "2022-10-26T07:59:42+00:00", + "time": "2023-04-27T07:18:40+00:00", "type": "library", "extra": { "think": { @@ -3644,6 +5016,7 @@ "think\\captcha\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3654,17 +5027,32 @@ } ], "description": "captcha package for thinkphp", + "support": { + "issues": "https://github.com/top-think/think-captcha/issues", + "source": "https://github.com/top-think/think-captcha/tree/v3.0.9" + }, "install-path": "../topthink/think-captcha" }, { "name": "topthink/think-helper", "version": "v3.1.6", "version_normalized": "3.1.6.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-helper.git", + "reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-helper/v3.1.6/topthink-think-helper-v3.1.6.zip", + "url": "https://api.github.com/repos/top-think/think-helper/zipball/769acbe50a4274327162f9c68ec2e89a38eb2aff", "reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1.0" @@ -3683,6 +5071,7 @@ "think\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3693,17 +5082,32 @@ } ], "description": "The ThinkPHP6 Helper Package", + "support": { + "issues": "https://github.com/top-think/think-helper/issues", + "source": "https://github.com/top-think/think-helper/tree/v3.1.6" + }, "install-path": "../topthink/think-helper" }, { "name": "topthink/think-image", "version": "v1.0.7", "version_normalized": "1.0.7.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-image.git", + "reference": "8586cf47f117481c6d415b20f7dedf62e79d5512" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-image/v1.0.7/topthink-think-image-v1.0.7.zip", + "url": "https://api.github.com/repos/top-think/think-image/zipball/8586cf47f117481c6d415b20f7dedf62e79d5512", "reference": "8586cf47f117481c6d415b20f7dedf62e79d5512", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-gd": "*" @@ -3720,6 +5124,7 @@ "think\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3730,17 +5135,32 @@ } ], "description": "The ThinkPHP5 Image Package", + "support": { + "issues": "https://github.com/top-think/think-image/issues", + "source": "https://github.com/top-think/think-image/tree/master" + }, "install-path": "../topthink/think-image" }, { "name": "topthink/think-multi-app", "version": "v1.0.16", "version_normalized": "1.0.16.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-multi-app.git", + "reference": "07b9183855150455e1f76f8cbe9d77d6d1bc399f" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-multi-app/v1.0.16/topthink-think-multi-app-v1.0.16.zip", + "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/07b9183855150455e1f76f8cbe9d77d6d1bc399f", "reference": "07b9183855150455e1f76f8cbe9d77d6d1bc399f", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1.0", @@ -3761,6 +5181,7 @@ "think\\app\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3771,17 +5192,32 @@ } ], "description": "thinkphp6 multi app support", + "support": { + "issues": "https://github.com/top-think/think-multi-app/issues", + "source": "https://github.com/top-think/think-multi-app/tree/v1.0.16" + }, "install-path": "../topthink/think-multi-app" }, { "name": "topthink/think-orm", - "version": "v2.0.58", - "version_normalized": "2.0.58.0", + "version": "v2.0.61", + "version_normalized": "2.0.61.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-orm.git", + "reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-orm/v2.0.58/topthink-think-orm-v2.0.58.zip", - "reference": "fae96ca60891ae82df5d8050af959711354898a5", - "shasum": "" + "url": "https://api.github.com/repos/top-think/think-orm/zipball/10528ebf4a5106b19c3bac9c6deae7a67ff49de6", + "reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -3794,7 +5230,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2023-02-11T10:07:03+00:00", + "time": "2023-04-20T14:27:51+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3805,6 +5241,7 @@ "think\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3819,17 +5256,32 @@ "database", "orm" ], + "support": { + "issues": "https://github.com/top-think/think-orm/issues", + "source": "https://github.com/top-think/think-orm/tree/v2.0.61" + }, "install-path": "../topthink/think-orm" }, { "name": "topthink/think-queue", "version": "v3.0.7", "version_normalized": "3.0.7.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-queue.git", + "reference": "cded7616e313f9daa55c0ad0de5791f0d1fb3066" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-queue/v3.0.7/topthink-think-queue-v3.0.7.zip", + "url": "https://api.github.com/repos/top-think/think-queue/zipball/cded7616e313f9daa55c0ad0de5791f0d1fb3066", "reference": "cded7616e313f9daa55c0ad0de5791f0d1fb3066", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-json": "*", @@ -3863,6 +5315,7 @@ "think\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3873,17 +5326,32 @@ } ], "description": "The ThinkPHP6 Queue Package", + "support": { + "issues": "https://github.com/top-think/think-queue/issues", + "source": "https://github.com/top-think/think-queue/tree/v3.0.7" + }, "install-path": "../topthink/think-queue" }, { "name": "topthink/think-template", "version": "v2.0.9", "version_normalized": "2.0.9.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-template.git", + "reference": "6d25642ae0e306166742fd7073dc7a159e18073c" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-template/v2.0.9/topthink-think-template-v2.0.9.zip", + "url": "https://api.github.com/repos/top-think/think-template/zipball/6d25642ae0e306166742fd7073dc7a159e18073c", "reference": "6d25642ae0e306166742fd7073dc7a159e18073c", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1.0", @@ -3897,6 +5365,7 @@ "think\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3907,17 +5376,32 @@ } ], "description": "the php template engine", + "support": { + "issues": "https://github.com/top-think/think-template/issues", + "source": "https://github.com/top-think/think-template/tree/v2.0.9" + }, "install-path": "../topthink/think-template" }, { "name": "topthink/think-trace", "version": "v1.6", "version_normalized": "1.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-trace.git", + "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-trace/v1.6/topthink-think-trace-v1.6.zip", + "url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1.0", @@ -3941,6 +5425,7 @@ "think\\trace\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3951,17 +5436,32 @@ } ], "description": "thinkphp debug trace", + "support": { + "issues": "https://github.com/top-think/think-trace/issues", + "source": "https://github.com/top-think/think-trace/tree/v1.6" + }, "install-path": "../topthink/think-trace" }, { "name": "topthink/think-view", "version": "v1.0.14", "version_normalized": "1.0.14.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-view.git", + "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/topthink/think-view/v1.0.14/topthink-think-view-v1.0.14.zip", + "url": "https://api.github.com/repos/top-think/think-view/zipball/edce0ae2c9551ab65f9e94a222604b0dead3576d", "reference": "edce0ae2c9551ab65f9e94a222604b0dead3576d", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1.0", @@ -3975,6 +5475,7 @@ "think\\view\\driver\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -3985,17 +5486,32 @@ } ], "description": "thinkphp template driver", + "support": { + "issues": "https://github.com/top-think/think-view/issues", + "source": "https://github.com/top-think/think-view/tree/v1.0.14" + }, "install-path": "../topthink/think-view" }, { "name": "webmozart/assert", "version": "1.11.0", "version_normalized": "1.11.0.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/webmozart/assert/1.11.0/webmozart-assert-1.11.0.zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-ctype": "*", @@ -4021,6 +5537,7 @@ "Webmozart\\Assert\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4036,6 +5553,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, "install-path": "../webmozart/assert" }, { @@ -4198,11 +5719,22 @@ "name": "yunwuxin/think-cron", "version": "v3.0.5", "version_normalized": "3.0.5.0", + "source": { + "type": "git", + "url": "https://github.com/yunwuxin/think-cron.git", + "reference": "a5e5c679b7f5daedab9fb4bb00b641b6c4a054ca" + }, "dist": { "type": "zip", - "url": "https://mirrors.cloud.tencent.com/repository/composer/yunwuxin/think-cron/v3.0.5/yunwuxin-think-cron-v3.0.5.zip", + "url": "https://api.github.com/repos/yunwuxin/think-cron/zipball/a5e5c679b7f5daedab9fb4bb00b641b6c4a054ca", "reference": "a5e5c679b7f5daedab9fb4bb00b641b6c4a054ca", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "dragonmantank/cron-expression": "^3.0", @@ -4231,6 +5763,7 @@ "yunwuxin\\cron\\": "src/cron" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -4241,6 +5774,10 @@ } ], "description": "计划任务", + "support": { + "issues": "https://github.com/yunwuxin/think-cron/issues", + "source": "https://github.com/yunwuxin/think-cron/tree/v3.0.5" + }, "install-path": "../yunwuxin/think-cron" } ], diff --git a/niucloud/vendor/composer/installed.php b/niucloud/vendor/composer/installed.php index 2dfcb9e70..51bd46cee 100644 --- a/niucloud/vendor/composer/installed.php +++ b/niucloud/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'topthink/think', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '79f3e3ee8c4e2653ed013397a10712a24eae2565', + 'reference' => '7939a59b413ebc73af2f7f44540d15df3ad38d1a', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -56,9 +56,9 @@ 'dev_requirement' => false, ), 'dragonmantank/cron-expression' => array( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', - 'reference' => '782ca5968ab8b954773518e9e49a6f892a34b2a8', + 'pretty_version' => 'v3.3.1', + 'version' => '3.3.1.0', + 'reference' => 'be85b3f05b46c39bbc0d95f6c071ddff669510fa', 'type' => 'library', 'install_path' => __DIR__ . '/../dragonmantank/cron-expression', 'aliases' => array(), @@ -82,6 +82,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'fastknife/ajcaptcha' => array( + 'pretty_version' => 'v1.2.1', + 'version' => '1.2.1.0', + 'reference' => '836c5a3177bc622a245734aef421085955d0b2cb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../fastknife/ajcaptcha', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'firebase/php-jwt' => array( 'pretty_version' => 'v5.5.1', 'version' => '5.5.1.0', @@ -128,9 +137,9 @@ 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.4.3', - 'version' => '2.4.3.0', - 'reference' => '67c26b443f348a51926030c83481b85718457d3d', + 'pretty_version' => '2.5.0', + 'version' => '2.5.0.0', + 'reference' => 'b635f279edd83fc275f822a1188157ffea568ff6', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), @@ -145,6 +154,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'intervention/image' => array( + 'pretty_version' => '2.7.2', + 'version' => '2.7.2.0', + 'reference' => '04be355f8d6734c826045d02a1079ad658322dad', + 'type' => 'library', + 'install_path' => __DIR__ . '/../intervention/image', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'laravel/serializable-closure' => array( 'pretty_version' => 'v1.2.2', 'version' => '1.2.2.0', @@ -182,9 +200,9 @@ 'dev_requirement' => false, ), 'monolog/monolog' => array( - 'pretty_version' => '2.9.1', - 'version' => '2.9.1.0', - 'reference' => 'f259e2b15fb95494c83f52d3caad003bbf5ffaa1', + 'pretty_version' => '2.9.0', + 'version' => '2.9.0.0', + 'reference' => 'e1c0ae1528ce313a450e5e1ad782765c4a8dd3cb', 'type' => 'library', 'install_path' => __DIR__ . '/../monolog/monolog', 'aliases' => array(), @@ -206,9 +224,9 @@ 'dev_requirement' => false, ), 'myclabs/php-enum' => array( - 'pretty_version' => '1.8.4', - 'version' => '1.8.4.0', - 'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483', + 'pretty_version' => '1.8.3', + 'version' => '1.8.3.0', + 'reference' => 'b942d263c641ddb5190929ff840c68f78713e937', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/php-enum', 'aliases' => array(), @@ -233,9 +251,9 @@ 'dev_requirement' => false, ), 'overtrue/wechat' => array( - 'pretty_version' => '5.32.0', - 'version' => '5.32.0.0', - 'reference' => '379de8a3e80d57a1e75f8e03540d0c7e5fe4c7d5', + 'pretty_version' => '5.30.0', + 'version' => '5.30.0.0', + 'reference' => '245d1e821bc5a4609625c3244b111f570692cfc2', 'type' => 'library', 'install_path' => __DIR__ . '/../overtrue/wechat', 'aliases' => array(), @@ -260,9 +278,9 @@ 'dev_requirement' => false, ), 'phpoffice/phpspreadsheet' => array( - 'pretty_version' => '1.27.1', - 'version' => '1.27.1.0', - 'reference' => 'ef4e6ef74990239946d3983451a9bbed5ef1be5d', + 'pretty_version' => '1.28.0', + 'version' => '1.28.0.0', + 'reference' => '6e81cf39bbd93ebc3a4e8150444c41e8aa9b769a', 'type' => 'library', 'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet', 'aliases' => array(), @@ -338,9 +356,9 @@ ), ), 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), @@ -353,9 +371,9 @@ ), ), 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + 'pretty_version' => '1.1', + 'version' => '1.1.0.0', + 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), @@ -398,9 +416,9 @@ ), ), 'qcloud/cos-sdk-v5' => array( - 'pretty_version' => 'v2.6.1', - 'version' => '2.6.1.0', - 'reference' => 'd367ba8d0305b83364b64055594a0ac22b1cefd8', + 'pretty_version' => 'v2.6.2', + 'version' => '2.6.2.0', + 'reference' => '92a1ee62b85ed4e7bf6836a684df5d7e3158d0ed', 'type' => 'library', 'install_path' => __DIR__ . '/../qcloud/cos-sdk-v5', 'aliases' => array(), @@ -443,9 +461,9 @@ 'dev_requirement' => false, ), 'symfony/cache' => array( - 'pretty_version' => 'v5.4.19', - 'version' => '5.4.19.0', - 'reference' => 'e9147c89fdfdc5d5ef798bb7193f23726ad609f5', + 'pretty_version' => 'v5.4.23', + 'version' => '5.4.23.0', + 'reference' => '983c79ff28612cdfd66d8e44e1a06e5afc87e107', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/cache', 'aliases' => array(), @@ -554,9 +572,9 @@ 'dev_requirement' => false, ), 'symfony/psr-http-message-bridge' => array( - 'pretty_version' => 'v2.1.3', - 'version' => '2.1.3.0', - 'reference' => 'd444f85dddf65c7e57c58d8e5b3a4dbb593b1840', + 'pretty_version' => 'v2.2.0', + 'version' => '2.2.0.0', + 'reference' => '28a732c05bbad801304ad5a5c674cf2970508993', 'type' => 'symfony-bridge', 'install_path' => __DIR__ . '/../symfony/psr-http-message-bridge', 'aliases' => array(), @@ -614,9 +632,9 @@ 'dev_requirement' => false, ), 'tencentcloud/tencentcloud-sdk-php' => array( - 'pretty_version' => '3.0.831', - 'version' => '3.0.831.0', - 'reference' => 'b8a774522788b3b380e449f9acf927b83291a2ae', + 'pretty_version' => '3.0.885', + 'version' => '3.0.885.0', + 'reference' => '0e7905b882c574e1eb305105c4307847d78a0464', 'type' => 'library', 'install_path' => __DIR__ . '/../tencentcloud/tencentcloud-sdk-php', 'aliases' => array(), @@ -634,16 +652,16 @@ 'topthink/think' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '79f3e3ee8c4e2653ed013397a10712a24eae2565', + 'reference' => '7939a59b413ebc73af2f7f44540d15df3ad38d1a', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'topthink/think-captcha' => array( - 'pretty_version' => 'v3.0.8', - 'version' => '3.0.8.0', - 'reference' => '52fba122c953995bec3013c635025172491ae299', + 'pretty_version' => 'v3.0.9', + 'version' => '3.0.9.0', + 'reference' => 'b1ef360670578214edeebcf824aaf6ab7ee0528b', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-captcha', 'aliases' => array(), @@ -677,9 +695,9 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.58', - 'version' => '2.0.58.0', - 'reference' => 'fae96ca60891ae82df5d8050af959711354898a5', + 'pretty_version' => 'v2.0.61', + 'version' => '2.0.61.0', + 'reference' => '10528ebf4a5106b19c3bac9c6deae7a67ff49de6', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), diff --git a/niucloud/vendor/composer/tmp-01ca609e1a64fdec17aa3d7dd7bc03bb b/niucloud/vendor/composer/tmp-01ca609e1a64fdec17aa3d7dd7bc03bb deleted file mode 100644 index 9d7b34b05..000000000 Binary files a/niucloud/vendor/composer/tmp-01ca609e1a64fdec17aa3d7dd7bc03bb and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-2cf95be4c36f8242cfa416166016c512 b/niucloud/vendor/composer/tmp-2cf95be4c36f8242cfa416166016c512 deleted file mode 100644 index 70d1964e2..000000000 Binary files a/niucloud/vendor/composer/tmp-2cf95be4c36f8242cfa416166016c512 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-2ee10c8f653cfe04b0bbd53d9c191c3e b/niucloud/vendor/composer/tmp-2ee10c8f653cfe04b0bbd53d9c191c3e deleted file mode 100644 index aceaae286..000000000 Binary files a/niucloud/vendor/composer/tmp-2ee10c8f653cfe04b0bbd53d9c191c3e and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-32dcb0e355498bb0c763f586beee936a b/niucloud/vendor/composer/tmp-32dcb0e355498bb0c763f586beee936a deleted file mode 100644 index c2e7fe3d0..000000000 Binary files a/niucloud/vendor/composer/tmp-32dcb0e355498bb0c763f586beee936a and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-37c732076e320e7fd4c707e088002118~ b/niucloud/vendor/composer/tmp-37c732076e320e7fd4c707e088002118~ deleted file mode 100644 index a7d232e36..000000000 Binary files a/niucloud/vendor/composer/tmp-37c732076e320e7fd4c707e088002118~ and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-37eb042dcdcc88392a30c4183eb09879 b/niucloud/vendor/composer/tmp-37eb042dcdcc88392a30c4183eb09879 deleted file mode 100644 index 4833cf981..000000000 Binary files a/niucloud/vendor/composer/tmp-37eb042dcdcc88392a30c4183eb09879 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-3a76a1cfd31eb6e99d81d09b13b2bc9e b/niucloud/vendor/composer/tmp-3a76a1cfd31eb6e99d81d09b13b2bc9e deleted file mode 100644 index a7e0f6d78..000000000 Binary files a/niucloud/vendor/composer/tmp-3a76a1cfd31eb6e99d81d09b13b2bc9e and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-3db4268749aba6689704cda0b54b4fc3 b/niucloud/vendor/composer/tmp-3db4268749aba6689704cda0b54b4fc3 deleted file mode 100644 index f8062a367..000000000 Binary files a/niucloud/vendor/composer/tmp-3db4268749aba6689704cda0b54b4fc3 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-5b5bddd0ecd29884bf407d4c75c126f6 b/niucloud/vendor/composer/tmp-5b5bddd0ecd29884bf407d4c75c126f6 deleted file mode 100644 index db7e2e37c..000000000 Binary files a/niucloud/vendor/composer/tmp-5b5bddd0ecd29884bf407d4c75c126f6 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-5e86f3514c20186abb23afe5555cc043 b/niucloud/vendor/composer/tmp-5e86f3514c20186abb23afe5555cc043 deleted file mode 100644 index eaa4496de..000000000 Binary files a/niucloud/vendor/composer/tmp-5e86f3514c20186abb23afe5555cc043 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-6da19cabc0ddfff1f5f3d26cb1676787 b/niucloud/vendor/composer/tmp-6da19cabc0ddfff1f5f3d26cb1676787 deleted file mode 100644 index 0fab4b60f..000000000 Binary files a/niucloud/vendor/composer/tmp-6da19cabc0ddfff1f5f3d26cb1676787 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-7401c99de0e294e4e3719c74e97f2175 b/niucloud/vendor/composer/tmp-7401c99de0e294e4e3719c74e97f2175 deleted file mode 100644 index 0fab4b60f..000000000 Binary files a/niucloud/vendor/composer/tmp-7401c99de0e294e4e3719c74e97f2175 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-814bc7f594f5b396baf0316582f4b617 b/niucloud/vendor/composer/tmp-814bc7f594f5b396baf0316582f4b617 deleted file mode 100644 index fee8d2cae..000000000 Binary files a/niucloud/vendor/composer/tmp-814bc7f594f5b396baf0316582f4b617 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-87ff5c224327a00ee23384c77751f43f b/niucloud/vendor/composer/tmp-87ff5c224327a00ee23384c77751f43f deleted file mode 100644 index 9d7b34b05..000000000 Binary files a/niucloud/vendor/composer/tmp-87ff5c224327a00ee23384c77751f43f and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-8d95375dd275d29118a988c790bbdc8b b/niucloud/vendor/composer/tmp-8d95375dd275d29118a988c790bbdc8b deleted file mode 100644 index 0fab4b60f..000000000 Binary files a/niucloud/vendor/composer/tmp-8d95375dd275d29118a988c790bbdc8b and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-92f9dca33a097e9c70eadc6d8123c6ac b/niucloud/vendor/composer/tmp-92f9dca33a097e9c70eadc6d8123c6ac deleted file mode 100644 index 6d56cb2ec..000000000 Binary files a/niucloud/vendor/composer/tmp-92f9dca33a097e9c70eadc6d8123c6ac and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-9315585ea1740bfbf046b091563db31f b/niucloud/vendor/composer/tmp-9315585ea1740bfbf046b091563db31f deleted file mode 100644 index a6d2324bb..000000000 Binary files a/niucloud/vendor/composer/tmp-9315585ea1740bfbf046b091563db31f and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-9eb8d513d829924da34300a9d67e2893 b/niucloud/vendor/composer/tmp-9eb8d513d829924da34300a9d67e2893 deleted file mode 100644 index 03bebae6f..000000000 Binary files a/niucloud/vendor/composer/tmp-9eb8d513d829924da34300a9d67e2893 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-a1cd7873ccc8b25d0138bf87537babf1 b/niucloud/vendor/composer/tmp-a1cd7873ccc8b25d0138bf87537babf1 deleted file mode 100644 index eeed6b61e..000000000 Binary files a/niucloud/vendor/composer/tmp-a1cd7873ccc8b25d0138bf87537babf1 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-b69cf66515e13e20664f7a4597a59156 b/niucloud/vendor/composer/tmp-b69cf66515e13e20664f7a4597a59156 deleted file mode 100644 index 5268a0342..000000000 Binary files a/niucloud/vendor/composer/tmp-b69cf66515e13e20664f7a4597a59156 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-eaa4df93784bb4e1f40f68f0c12995ef~ b/niucloud/vendor/composer/tmp-eaa4df93784bb4e1f40f68f0c12995ef~ deleted file mode 100644 index 73e1f45de..000000000 Binary files a/niucloud/vendor/composer/tmp-eaa4df93784bb4e1f40f68f0c12995ef~ and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-ee503f161c50bd97519744bdd4aa532d b/niucloud/vendor/composer/tmp-ee503f161c50bd97519744bdd4aa532d deleted file mode 100644 index 9d7b34b05..000000000 Binary files a/niucloud/vendor/composer/tmp-ee503f161c50bd97519744bdd4aa532d and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-f4a36335786eed2f17e9b42e7fd50636 b/niucloud/vendor/composer/tmp-f4a36335786eed2f17e9b42e7fd50636 deleted file mode 100644 index 76a0a0e29..000000000 Binary files a/niucloud/vendor/composer/tmp-f4a36335786eed2f17e9b42e7fd50636 and /dev/null differ diff --git a/niucloud/vendor/composer/tmp-ffe3be97b41878cc949f85e305a21adb b/niucloud/vendor/composer/tmp-ffe3be97b41878cc949f85e305a21adb deleted file mode 100644 index 058a67a6a..000000000 Binary files a/niucloud/vendor/composer/tmp-ffe3be97b41878cc949f85e305a21adb and /dev/null differ diff --git a/niucloud/vendor/dragonmantank/cron-expression/CHANGELOG.md b/niucloud/vendor/dragonmantank/cron-expression/CHANGELOG.md index 7b6df4b1c..99b587be1 100644 --- a/niucloud/vendor/dragonmantank/cron-expression/CHANGELOG.md +++ b/niucloud/vendor/dragonmantank/cron-expression/CHANGELOG.md @@ -1,16 +1,5 @@ # Change Log -## [3.3.2] - 2022-09-19 - -### Added -- N/A - -### Changed -- Skip some daylight savings time tests for PHP 8.1 daylight savings time weirdness (#146) - -### Fixed -- Changed string interpolations to work better with PHP 8.2 (#142) - ## [3.3.1] - 2022-01-18 ### Added diff --git a/niucloud/vendor/dragonmantank/cron-expression/composer.json b/niucloud/vendor/dragonmantank/cron-expression/composer.json index 657a5b47c..e512446d1 100644 --- a/niucloud/vendor/dragonmantank/cron-expression/composer.json +++ b/niucloud/vendor/dragonmantank/cron-expression/composer.json @@ -37,11 +37,5 @@ "scripts": { "phpstan": "./vendor/bin/phpstan analyze", "test": "phpunit" - }, - "config": { - "allow-plugins": { - "ocramius/package-versions": true, - "phpstan/extension-installer": true - } } } diff --git a/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php b/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php index 39ff59783..e08f62ead 100644 --- a/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php +++ b/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php @@ -49,7 +49,7 @@ class DayOfMonthField extends AbstractField private static function getNearestWeekday(int $currentYear, int $currentMonth, int $targetDay): ?DateTime { $tday = str_pad((string) $targetDay, 2, '0', STR_PAD_LEFT); - $target = DateTime::createFromFormat('Y-m-d', "{$currentYear}-{$currentMonth}-{$tday}"); + $target = DateTime::createFromFormat('Y-m-d', "${currentYear}-${currentMonth}-${tday}"); if ($target === false) { return null; @@ -94,9 +94,9 @@ class DayOfMonthField extends AbstractField } // Check to see if this is the nearest weekday to a particular value - if ($wPosition = strpos($value, 'W')) { + if (strpos($value, 'W')) { // Parse the target day - $targetDay = (int) substr($value, 0, $wPosition); + $targetDay = (int) substr($value, 0, strpos($value, 'W')); // Find out if the current day is the nearest day of the week $nearest = self::getNearestWeekday( (int) $date->format('Y'), diff --git a/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php b/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php index b9bbf48b6..5ac003da9 100644 --- a/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php +++ b/niucloud/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php @@ -68,8 +68,8 @@ class DayOfWeekField extends AbstractField $lastDayOfMonth = (int) $date->format('t'); // Find out if this is the last specific weekday of the month - if ($lPosition = strpos($value, 'L')) { - $weekday = $this->convertLiterals(substr($value, 0, $lPosition)); + if (strpos($value, 'L')) { + $weekday = $this->convertLiterals(substr($value, 0, strpos($value, 'L'))); $weekday %= 7; $daysInMonth = (int) $date->format('t'); diff --git a/niucloud/vendor/dragonmantank/cron-expression/src/Cron/HoursField.php b/niucloud/vendor/dragonmantank/cron-expression/src/Cron/HoursField.php index 413d138be..a7f8f33c4 100644 --- a/niucloud/vendor/dragonmantank/cron-expression/src/Cron/HoursField.php +++ b/niucloud/vendor/dragonmantank/cron-expression/src/Cron/HoursField.php @@ -25,7 +25,7 @@ class HoursField extends AbstractField /** * @var array|null Transitions returned by DateTimeZone::getTransitions() */ - protected $transitions = []; + protected $transitions = null; /** * @var int|null Timestamp of the start of the transitions range @@ -92,7 +92,7 @@ class HoursField extends AbstractField $dtLimitStart->getTimestamp(), $dtLimitEnd->getTimestamp() ); - if (empty($this->transitions)) { + if ($this->transitions === false) { return null; } $this->transitionsStart = $dtLimitStart->getTimestamp(); diff --git a/niucloud/vendor/fastknife/ajcaptcha/.gitignore b/niucloud/vendor/fastknife/ajcaptcha/.gitignore new file mode 100644 index 000000000..9cad9f986 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/.gitignore @@ -0,0 +1,16 @@ +.env +.git +.svn +.idea +.vscode +.htaccess +*.log +nginx.htaccess +vendor/* +runtime/* +composer.lock +test/html +test/nginx.htaccess +test/.htaccess +test/runtime + diff --git a/niucloud/vendor/fastknife/ajcaptcha/LICENSE b/niucloud/vendor/fastknife/ajcaptcha/LICENSE new file mode 100644 index 000000000..94a9ed024 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/niucloud/vendor/fastknife/ajcaptcha/changelog.md b/niucloud/vendor/fastknife/ajcaptcha/changelog.md new file mode 100644 index 000000000..b705626c8 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/changelog.md @@ -0,0 +1,26 @@ +# aj-captcha迭代文档 +## v1.1.2 2021-12-15 +* server 增加`verificationByEncryptCode` 方法,兼容前端二次验证`captchaVerification`值 + +## v1.1.1 2021-12-13 +* 去除多余代码、注释 + +## v1.1.0 2021-12-9 +* 重构工厂类与领域层 +* 永久缓存图片像素值,增加响应性能 + +## v1.0.7 2021-11-24 +* 增强缓存冗错 +* 自定义缓存配置 + +## v1.0.3 2021-10-11 +* 新增二次验证 + + +## v1.0.0 2021-7-16 +* 初步实现滑动验证码与文字点选验证码 + + + + + diff --git a/niucloud/vendor/fastknife/ajcaptcha/composer.json b/niucloud/vendor/fastknife/ajcaptcha/composer.json new file mode 100644 index 000000000..5b66e8a05 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/composer.json @@ -0,0 +1,26 @@ +{ + "name": "fastknife/ajcaptcha", + "description": "This is a behavior verification code PHP back-end implementation package", + "type": "library", + "authors": [ + { + "name": "bruce", + "email": "2777314125@qq.com" + } + ], + "require": { + "php": ">=7.1", + "ext-gd": "*", + "ext-openssl": "*", + "intervention/image": "^2.5", + "ext-iconv": "*", + "ext-json": "*" + }, + "minimum-stability": "stable", + "license": "GPL-3.0-only", + "autoload": { + "psr-4": { + "Fastknife\\": "src" + } + } +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/demo.md b/niucloud/vendor/fastknife/ajcaptcha/demo.md new file mode 100644 index 000000000..b40a0393a --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/demo.md @@ -0,0 +1,239 @@ +### 范例 + +详情请查看test目录的PHP源码 + +#### 配置说明 + +```php +return [ + 'font_file' => '', //自定义字体包路径, 不填使用默认值 + //文字验证码 + 'click_world' => [ + 'backgrounds' => [] + ], + //滑动验证码 + 'block_puzzle' => [ + 'backgrounds' => [], //背景图片路径, 不填使用默认值 + 'templates' => [], //模板图 + + 'offset' => 10, //容错偏移量 + + 'is_cache_pixel' => true, //是否开启缓存图片像素值,开启后能提升服务端响应性能(但要注意更换图片时,需要清除缓存) + ], + //水印 + 'watermark' => [ + 'fontsize' => 12, + 'color' => '#ffffff', + 'text' => '我的水印' + ], + 'cache' => [ + 'constructor' => \Fastknife\Utils\CacheUtils::class,//若您使用了框架,并且想使用类似于redis这样的缓存驱动,则应换成框架的中的缓存驱动 + 'method' => [ + // 遵守PSR-16规范不需要设置此项(tp6, laravel,hyperf)。如tp5就不支持(tp5缓存方法是rm,所以要配置为"delete" => "rm"), + 'get' => 'get', //获取 + 'set' => 'set', //设置 + 'delete' => 'delete',//删除 + 'has' => 'has' //key是否存在 + ], + 'options' => [ + //如果您依然使用\Fastknife\Utils\CacheUtils做为您的缓存驱动,那么您可以自定义缓存配置。 + 'expire' => 300,//缓存有效期 (默认为0 表示永久缓存) + 'prefix' => '', //缓存前缀 + 'path' => '', //缓存目录 + 'serialize' => [], //缓存序列化和反序列化方法 + ] + ] +]; +``` +##### 缓存配置 + +> config.cache.constructor类型为string|array|function 使用以访问回调的方式获得缓存实例; + ++ laravel 配置: + + ``` + 'constructor' => [Illuminate\Support\Facades\Cache::class, 'store'] +``` + ++ tp6(tp5.1) 配置 + +```php + 'constructor' => [think\Facade\Cache::class, 'instance'] +``` + +> 无论配置写成`[think\Facade\Cache::class, 'instance']` 还是写成 `[think\Facade\Cache::class, 'store']` 目的都是为了获取缓存实例,具体情况视框架而定 + + + ++ 灵活自定义: +1. 如果您的需要使用类似以下命令打包配置文件(ThinkPHP,Laravel 命令) + - php think optimize:config + - php artisan optimize + 则需要写成下面这样: +```php + $instance = \think\facade\Cache::store();//获取缓存想实例 + //省略分部代码 + 'constructor' => serialize($instance); +``` + +因为在执行optimize打包命令时,会尝试将对象进行序列化。 + +2. 如果您不需要使用打包压缩命令,或者使用了像hyperf这样的框架,除了上述的写法,还可以写成这样: + +```php + 'constructor' => function () { + $container = \Hyperf\Utils\ApplicationContext::getContainer(); + //在构造函数中传入自已的配置 + return $container->get(\Psr\SimpleCache\CacheInterface::class); + }, +``` + +除此之处,您传入的缓存实例应遵守psr-16规范 + +##### 背景图与滑动图 +> 配置中的backgrounds与templates项均支持,Array, String两种格式 ++ 使用Array(索引数组)格式时,表明它每一项都是一张图片。可以是本地图片路径,也可以是网络图片路径。 +示例: +```php + 'backgrounds' => [ + '/public/images/xxx.jpg', + 'http://www.image.xx.jpg' + ] +``` ++ 使用String格式时,表明它是一个图片所在位置的目录 +示例: +```php + 'backgrounds' => ROOT_PATH . '/resources/defaultImages/jigsaw/original/' +``` +当配置中的backgrounds与templates项为空时,会将`/resources/defaultImages/`目录内所有图片做为默认图片。 + +下面是社区人员一起维护的图片库,这些图片可以与本程序无缝衔接。 +https://gitee.com/anji-plus/AJ-Captcha-Images + +##### 字体配置 +字体配置在水印与文字点击验证功能中使用,其配置格式化String, 指向字体库。为空时会以`/resources/fonts`下的字体文件为默认值。 +示例: +```php +'font_file' => ROOT_PATH . '/resources/fonts/WenQuanZhengHei.ttf' +``` + +#### 获取滑动验证码 + +```php +public function get(){ + $config = require '../src/config.php'; + $service = new BlockPuzzleCaptchaService($config); + $data = $service->get(); + echo json_encode([ + 'error' => false, + 'repCode' => '0000', + 'repData' => $data, + 'repMsg' => null, + 'success' => true, + ]); +} +``` + +#### 滑动验证 + +```php + public function check() + { + $config = require '../src/config.php'; + $service = new BlockPuzzleCaptchaService($config); + $data = $_REQUEST; + $msg = null; + $error = false; + $repCode = '0000'; + try { + $service->check($data['token'], $data['pointJson']); + } catch (\Exception $e) { + $msg = $e->getMessage(); + $error = true; + $repCode = '6111'; + } + echo json_encode([ + 'error' => $error, + 'repCode' => $repCode, + 'repData' => null, + 'repMsg' => $msg, + 'success' => ! $error, + ]); + } +``` + +#### 获取文字验证码 + +```php + public function get() + { + $config = require '../src/config.php'; + $service = new ClickWordCaptchaService($config); + $data = $service->get(); + echo json_encode([ + 'error' => false, + 'repCode' => '0000', + 'repData' => $data, + 'repMsg' => null, + 'success' => true, + ]); + } +``` + +#### 文字验证 + +```php + public function check() + { + $config = require '../src/config.php'; + $service = new ClickWordCaptchaService($config); + $data = $_REQUEST; + $msg = null; + $error = false; + $repCode = '0000'; + try { + $service->check($data['token'], $data['pointJson']); + } catch (\Exception $e) { + $msg = $e->getMessage(); + $error = true; + $repCode = '6111'; + } + echo json_encode([ + 'error' => $error, + 'repCode' => $repCode, + 'repData' => null, + 'repMsg' => $msg, + 'success' => ! $error, + ]); + } +``` + +#### 前端请求头修改示例 + +```javascript +import axios from 'axios'; +import qs from 'qs'; + +axios.defaults.baseURL = 'https://captcha.anji-plus.com/captcha-api'; + +const service = axios.create({ + timeout: 40000, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' + }, +}) +service.interceptors.request.use( + config => { + if (config.hasOwnProperty('data')) { + config.data = qs.stringify(config.data) + } + return config + }, + error => { + Promise.reject(error) + } +) +``` + +本包后续更新 ThinkPHP、Hyperf 等框架的demo,请持续关注 +https://gitee.com/fastknife/aj-captcha \ No newline at end of file diff --git a/niucloud/vendor/fastknife/ajcaptcha/readme.md b/niucloud/vendor/fastknife/ajcaptcha/readme.md new file mode 100644 index 000000000..aa799323f --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/readme.md @@ -0,0 +1,69 @@ +AJ-Captcha · php +---- + +#### 介绍 + +这个类库使用 PHP实现了行为验证码。基于gd扩展生成滑动验证码和文字验证码。允许 phper定制验证码规则,并且不再使用 curl来请求第三方验证。 + +Java实现: https://gitee.com/anji-plus/captcha + +PHP实现: https://gitee.com/fastknife/aj-captcha + +##### 官方预览效果 + +![block](https://gitee.com/anji-plus/captcha/raw/master/images/%E6%BB%91%E5%8A%A8%E6%8B%BC%E5%9B%BE.gif)   ![click](https://gitee.com/anji-plus/captcha/raw/master/images/%E7%82%B9%E9%80%89%E6%96%87%E5%AD%97.gif) + +#### 注意事项 +* 你需要打开 gd、 openssl扩展 +* PHP版本至少需要7.1 +* 此软件包自带缓存,如有需要请自行更换 +* anji-plus/captcha前端默认请求头是 application/json 需替换为 application/x-www-form-urlencode + +* 滑动验证图响应时间慢? + > 性能慢的主要原因是受php GD库的imagecolorat函数与imagesetpixel函数性能的影响 + 1. 您可以尝试将修改内存`ini_set('memory_limit', '256M')` + 2. 将本包升级到1.1.x版本,开启像素缓存`block_puzzle.is_cache_pixel = true`, 若还是性能还是慢,则将干扰图片关闭`block_puzzle.is_interfere => false` +#### 如何使用 +test 目录下示例了三种使用方式,phper可以参考使用。[查看demo](./demo.md) +> 本软件包需要配合composer一起使用 +1. 非框架使用的场景,直接使用git下载这个软件包。然后执行composer命令`composer install`安装本软件包依赖,接着手动引入对应的 service层文件即可(同test目录里的原生引用方式)。 + +2. 基于框架使用的场景,输入安装命令`composer require fastknife/ajcaptcha`(稳定版) 或者`composer require fastknife/ajcaptcha dev-master`(最新版) ,建议使用composer阿里源(`https://mirrors.aliyun.com/composer`) + * 支持各种前沿框架(ThinkPHP, YII, Laravel, Hyperf,IMI,Swoft,EasySwoole) + * 本软件包内,未使用单例、注册树(容器)模式,不含任何全局变量,基于swoole开发的同学不用担心内存泄露。 + +#### 项目结构 +> 本软件包基于整洁架构理念,设计了下文的目录结构。Domain(领域层)作为内层同心圆承担所有业务逻辑功能,Service(服务层)并向最外层Controller(需自行实现)提供粗颗粒度服务。 + 区别于DDD(领域驱动设计),本软件包的领域层不含Entity(实体),以Logic(逻辑层)实现单元逻辑,为了方便管理作者将逻辑层的数据处理与图形处理分隔,以达到整洁效果。 +``` +AJ-Captcha for php +│ +├─resources 资源 +│ │ +│ ├─defaultImages 图片资源 +│ │ +│ └─fonts 字体 +│ +├─src 源码 +│ │ +│ ├─Domian 领域层 +│ │ +│ ├─Exception 异常 +│ │ +│ ├─Service 服务层 +│ │ +│ ├─ Utils工具类 +│ │ +│ └─ config.php 配置参考 +└─test 测试实例 + │ + ├─thinkphp thinkphp框架测试示例 + │ + ├─laravel laravel框架测试示例 + │ + └─*.php 原生测试文件 配置文件 +``` + +#### [更新日志](./changelog.md) + +若此软件对您有所帮助,您可以点右上角 💘Star💘支持 diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/1.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/1.png new file mode 100644 index 000000000..022aabf93 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/1.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/2.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/2.png new file mode 100644 index 000000000..914908e89 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/2.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/3.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/3.png new file mode 100644 index 000000000..f0f3ce581 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/3.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/4.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/4.png new file mode 100644 index 000000000..c5697f3cb Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/4.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/5.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/5.png new file mode 100644 index 000000000..e29e7a3c1 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/5.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/6.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/6.png new file mode 100644 index 000000000..2425f412d Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/6.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/bg8.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/bg8.png new file mode 100644 index 000000000..5ea54d482 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/original/bg8.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/1.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/1.png new file mode 100644 index 000000000..190502660 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/1.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/2.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/2.png new file mode 100644 index 000000000..b1482d48b Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/2.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/3.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/3.png new file mode 100644 index 000000000..cdbb0b18c Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/3.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/4.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/4.png new file mode 100644 index 000000000..bc69c9622 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/4.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/5.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/5.png new file mode 100644 index 000000000..0080a5465 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/5.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/6.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/6.png new file mode 100644 index 000000000..b07c3b404 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/jigsaw/slidingBlock/6.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/1.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/1.png new file mode 100644 index 000000000..50dfe28ef Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/1.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/2.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/2.png new file mode 100644 index 000000000..15b38ad27 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/2.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/3.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/3.png new file mode 100644 index 000000000..e2e487bd4 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/3.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/4.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/4.png new file mode 100644 index 000000000..c34baa404 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/4.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/5.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/5.png new file mode 100644 index 000000000..0b3d11a27 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/5.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/6.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/6.png new file mode 100644 index 000000000..67797a11d Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/6.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg10.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg10.png new file mode 100644 index 000000000..c99fbcb03 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg10.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg11.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg11.png new file mode 100644 index 000000000..6a951d326 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg11.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg12.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg12.png new file mode 100644 index 000000000..a38ada504 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg12.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg13.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg13.png new file mode 100644 index 000000000..07af86a86 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg13.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg14.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg14.png new file mode 100644 index 000000000..95593759d Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg14.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg15.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg15.png new file mode 100644 index 000000000..cb1ebb63e Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg15.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg16.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg16.png new file mode 100644 index 000000000..106b4562b Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg16.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg17.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg17.png new file mode 100644 index 000000000..bcdbe7655 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg17.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg18.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg18.png new file mode 100644 index 000000000..ae94e09cf Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg18.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg19.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg19.png new file mode 100644 index 000000000..bef9318b5 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg19.png differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg20.png b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg20.png new file mode 100644 index 000000000..36cfbdec6 Binary files /dev/null and b/niucloud/vendor/fastknife/ajcaptcha/resources/defaultImages/pic-click/bg20.png differ diff --git a/niucloud/vendor/composer/tmp-47b329e1b33d4607d238f8711f6f7bd4~ b/niucloud/vendor/fastknife/ajcaptcha/resources/fonts/WenQuanZhengHei.ttf similarity index 52% rename from niucloud/vendor/composer/tmp-47b329e1b33d4607d238f8711f6f7bd4~ rename to niucloud/vendor/fastknife/ajcaptcha/resources/fonts/WenQuanZhengHei.ttf index aa58315bb..f84e9feb3 100644 Binary files a/niucloud/vendor/composer/tmp-47b329e1b33d4607d238f8711f6f7bd4~ and b/niucloud/vendor/fastknife/ajcaptcha/resources/fonts/WenQuanZhengHei.ttf differ diff --git a/niucloud/vendor/fastknife/ajcaptcha/resources/fonts/license.txt b/niucloud/vendor/fastknife/ajcaptcha/resources/fonts/license.txt new file mode 100644 index 000000000..719f68f0b --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/resources/fonts/license.txt @@ -0,0 +1,55 @@ +文泉驿是一个开源汉字字体项目 + +由旅美学者房骞骞(FangQ) + +于2004年10月创建 + +集中力量解决GNU/Linux + +高质量中文字体匮乏的状况 + +目前,文泉驿已经开发并发布了 + +第一个完整覆盖GB18030汉字 + +(包含27000多个汉字) + +的多规格点阵汉字字型文件 + +第一个覆盖GBK字符集的 + +开源矢量字型文件(文泉驿正黑) + +并提供了目前包含字符数目最多的 + +开源字体——GNU Unifont——中 + +绝大多数中日韩文相关的符号 + +这些字型文件已经逐渐成为 + +主流Linux/Unix发行版 + +中文桌面的首选中文字体 + +目前Ubuntu、Fedora、Slackware + +Magic Linux、CDLinux + +使用文泉驿作为默认中文字体 + +Debian、Gentoo、Mandriva + +ArchLinux、Frugalware + +则提供了官方源支持 + +而FreeBSD则在其ports中有提供 + +所以,今天我们所要分享的就是 + +文泉驿正黑体 + +可在Linux/UNIX,Windows + +Mac OS和嵌入式操作系统中使用 \ No newline at end of file diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Factory.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Factory.php new file mode 100644 index 000000000..14ef44736 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Factory.php @@ -0,0 +1,179 @@ +config = $config; + } + + /** + * @return BlockImage + */ + public function makeBlockImage(): BlockImage + { + $data = new BlockData(); + $image = new BlockImage(); + $this->setCommon($image, $data); + $this->setBlock($image, $data); + return $image; + } + + /** + * @return WordImage + */ + public function makeWordImage(): WordImage + { + $data = new WordData(); + $image = new WordImage(); + $this->setCommon($image, $data); + $this->setWord($image, $data); + return $image; + } + + + /** + * 设置公共配置 + * @param BaseImage $image + * @param BaseData $data + */ + protected function setCommon(BaseImage $image, BaseData $data) + { + //固定驱动,少量图片处理场景gd性能远远大于imagick + ImageManagerStatic::configure(['driver' => 'gd']); + + //获得字体数据 + $fontFile = $data->getFontFile($this->config['font_file']); + $image + ->setFontFile($fontFile) + ->setWatermark($this->config['watermark']); + } + + /** + * 设置滑动验证码的配置 + * @param BlockImage $image + * @param BlockData $data + */ + protected function setBlock(BlockImage $image, BlockData $data) + { + //设置背景 + $backgroundVo = $data->getBackgroundVo($this->config['block_puzzle']['backgrounds']); + $image->setBackgroundVo($backgroundVo); + + $templateVo = $data->getTemplateVo($backgroundVo, $this->config['block_puzzle']['templates']); + + $image->setTemplateVo($templateVo); + + $pixelMaps = [$backgroundVo, $templateVo]; + if ( + isset($this->config['block_puzzle']['is_interfere']) && + $this->config['block_puzzle']['is_interfere'] == true + ) { + $interfereVo = $data->getInterfereVo($backgroundVo, $templateVo, $this->config['block_puzzle']['templates']); + $image->setInterfereVo($interfereVo); + $pixelMaps[] = $interfereVo; + } + + if ( + isset($this->config['block_puzzle']['is_cache_pixel']) && + $this->config['block_puzzle']['is_cache_pixel'] === true + ) { + $cache = $this->getCacheInstance(); + foreach ($pixelMaps as $vo) { + /**@var ImageVo $vo * */ + $key = 'image_pixel_map_' . $vo->src; + $result = $cache->get($key); + if (!empty($result) && is_array($result)) { + $vo->setPickMaps($result); + } else { + $vo->preparePickMaps(); + $vo->setFinishCallback(function (ImageVo $imageVo) use ($cache, $key) { + $cache->set($key, $imageVo->getPickMaps(), 0); + }); + } + } + } + + + } + + /** + * 设置文字验证码的配置 + * @param WordImage $image + * @param WordData $data + */ + protected function setWord(WordImage $image, WordData $data) + { + //设置背景 + $backgroundVo = $data->getBackgroundVo($this->config['click_world']['backgrounds']); + $image->setBackgroundVo($backgroundVo); + + $wordNum = $this->config['click_world']['word_num'] ?? 3; + if($wordNum > 5){ + // 最多只能写5个字 + $wordNum = 5; + } + if($wordNum < 2){ + // 最少要写2个字 + $wordNum = 2; + } + //随机文字坐标 + $pointList = $data->getPointList( + $image->getBackgroundVo()->image->getWidth(), + $image->getBackgroundVo()->image->getHeight(), + $wordNum + ); + $worldList = $data->getWordList(count($pointList)); + $image + ->setWordList($worldList) + ->setWordList($worldList) + ->setPoint($pointList); + } + + /** + * 创建缓存实体 + */ + public function getCacheInstance(): Cache + { + if (empty($this->cacheInstance)) { + $this->cacheInstance = new Cache($this->config['cache']); + } + return $this->cacheInstance; + } + + public function makeWordData(): WordData + { + return new WordData(); + } + + public function makeBlockData(): BlockData + { + return (new BlockData())->setFaultOffset($this->config['block_puzzle']['offset']); + } + + /** + * @return array + */ + public function getConfig(): array + { + return $this->config; + } + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BaseData.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BaseData.php new file mode 100644 index 000000000..43c83de49 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BaseData.php @@ -0,0 +1,73 @@ +defaultFontPath; + } + + /** + * 获得随机图片 + * @param $images + * @return string + */ + protected function getRandImage($images): string + { + $index = RandomUtils::getRandomInt(0, count($images) - 1); + return $images[$index]; + } + + /** + * 获取默认图片 + * @param $dir + * @param array|string $images + * @return array|false + */ + protected function getDefaultImage($dir, $images) + { + if (!empty($images)) { + if (is_array($images)) { + return $images; + } + if (is_string($images)) { + $dir = $images; + } + } + return glob($dir . '*.png'); + } + + /** + * 获取一张背景图地址 + * @param null $backgrounds 背景图库 + * @return BackgroundVo + */ + public function getBackgroundVo($backgrounds = null): BackgroundVo + { + $dir = dirname(__DIR__, 3). $this->defaultBackgroundPath; + $backgrounds = $this->getDefaultImage($dir, $backgrounds); + $src = $this->getRandImage($backgrounds); + return new BackgroundVo($src); + } +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BaseImage.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BaseImage.php new file mode 100644 index 000000000..d20581588 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BaseImage.php @@ -0,0 +1,106 @@ +point; + } + + /** + * @param $point + * @return WordImage + */ + public function setPoint($point):self + { + $this->point = $point; + return $this; + } + + + protected function makeWatermark(Image $image) + { + if (! empty($this->watermark)) { + $info = imagettfbbox($this->watermark['fontsize'], 0, $this->fontFile, $this->watermark['text']); + $minX = min($info[0], $info[2], $info[4], $info[6]); + $minY = min($info[1], $info[3], $info[5], $info[7]); + $maxY = max($info[1], $info[3], $info[5], $info[7]); + $x = $minX; + $y = abs($minY); + /* 计算文字初始坐标和尺寸 */ + $h = $maxY - $minY; + $x += $image->getWidth() - $this->watermark['fontsize']/2; //留出半个单位字体像素的余白,不至于水印紧贴着右边 + $y += $image->getHeight() - $h; + $image->text($this->watermark['text'], $x, $y, function (Font $font) { + $font->file($this->fontFile); + $font->size($this->watermark['fontsize']); + $font->color($this->watermark['color']); + $font->align('right'); + $font->valign('bottom'); + }); + } + } + + + /** + * @param mixed $watermark + * @return self + */ + public function setWatermark($watermark): self + { + $this->watermark = $watermark; + return $this; + } + + + /** + * @param BackgroundVo $backgroundVo + * @return $this + */ + public function setBackgroundVo(BackgroundVo $backgroundVo):self + { + $this->backgroundVo = $backgroundVo; + return $this; + } + + /** + * @return BackgroundVo + */ + public function getBackgroundVo(): BackgroundVo + { + return $this->backgroundVo; + } + + /** + * @param $file + * @return static + */ + public function setFontFile($file): self + { + $this->fontFile = $file; + return $this; + } + + public abstract function run(); +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BlockData.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BlockData.php new file mode 100644 index 000000000..be5d36ebf --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BlockData.php @@ -0,0 +1,134 @@ +faultOffset; + } + + /** + * @param mixed $faultOffset + */ + public function setFaultOffset($faultOffset): self + { + $this->faultOffset = $faultOffset; + return $this; + } + + + /** + * 获取剪切模板Vo + * @param BackgroundVo $backgroundVo + * @param array | string $templates + * @return TemplateVo + */ + public function getTemplateVo(BackgroundVo $backgroundVo, $templates = []): TemplateVo + { + $background = $backgroundVo->image; + //初始偏移量,让模板图在背景的右1/2位置 + $bgWidth = intval($background->getWidth() / 2); + //随机获取一张图片 + $src = $this->getRandImage($this->getTemplateImages($templates)); + + $templateVo = new TemplateVo($src); + + //随机获取偏移量 + $offset = RandomUtils::getRandomInt(0, $bgWidth - $templateVo->image->getWidth() - 1); + + $templateVo->setOffset(new OffsetVo($offset + $bgWidth, 0)); + return $templateVo; + } + + + + public function getInterfereVo(BackgroundVo $backgroundVo, TemplateVo $templateVo, $templates = []): TemplateVo + { + //背景 + $background = $backgroundVo->image; + //模板库去重 + $templates = $this->exclude($this->getTemplateImages($templates), $templateVo->src); + + //随机获取一张模板图 + $src = $this->getRandImage($templates); + + $interfereVo = new TemplateVo($src); + + $maxOffsetX = intval($templateVo->image->getWidth()/2); + do { + //随机获取偏移量 + $offsetX = RandomUtils::getRandomInt(0, $background->getWidth() - $templateVo->image->getWidth() - 1); + + //不与原模板重复 + if ( + abs($templateVo->offset->x - $offsetX) > $maxOffsetX + ) { + $offsetVO = new OffsetVo($offsetX, 0); + $interfereVo->setOffset($offsetVO); + return $interfereVo; + } + } while (true); + } + + + /** + * @param array|string $templates + * @return array|false + */ + protected function getTemplateImages($templates = []) + { + $dir = dirname(__DIR__, 3) . '/resources/defaultImages/jigsaw/slidingBlock/'; + return $this->getDefaultImage($dir, $templates); + } + + /** + * 排除 + * @param $templates + * @param $exclude + * @return array + */ + protected function exclude($templates, $exclude): array + { + if (false !== ($key = array_search($exclude, $templates))) { + array_splice($templates,$key,1); + } + return $templates; + } + + + + /** + * @param $originPoint + * @param $targetPoint + * @return void + */ + public function check($originPoint, $targetPoint) + { + if ( + abs($originPoint->x - $targetPoint->x) <= $this->faultOffset + && $originPoint->y == $targetPoint->y + ) { + return; + } + throw new BlockException('验证失败!'); + } + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BlockImage.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BlockImage.php new file mode 100644 index 000000000..d990320e0 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/BlockImage.php @@ -0,0 +1,141 @@ +templateVo; + } + + /** + * @param TemplateVo $templateVo + * @return self + */ + public function setTemplateVo(TemplateVo $templateVo): self + { + $this->templateVo = $templateVo; + return $this; + } + + /** + * @return TemplateVo + */ + public function getInterfereVo(): TemplateVo + { + return $this->interfereVo; + } + + /** + * @param TemplateVo $interfereVo + * @return static + */ + public function setInterfereVo(TemplateVo $interfereVo): self + { + + $this->interfereVo = $interfereVo; + return $this; + } + + public function run() + { + $flag = false; + $this->cutByTemplate($this->templateVo, $this->backgroundVo, function ($param) use (&$flag) { + if (!$flag) { + //记录第一个点 + $this->setPoint(new PointVo($param[0], 5));//前端已将y值写死 + $flag = true; + } + }); + if (!empty($this->interfereVo)) { + $this->cutByTemplate($this->interfereVo, $this->backgroundVo); + } + $this->makeWatermark($this->backgroundVo->image); + } + + + public function cutByTemplate(TemplateVo $templateVo, BackgroundVo $backgroundVo, $callable = null) + { + $template = $templateVo->image; + $width = $template->getWidth(); + $height = $template->getHeight(); + for ($x = 0; $x < $width; $x++) { + for ($y = 0; $y < $height; $y++) { + //背景图对应的坐标 + $bgX = $x + $templateVo->offset->x; + $bgY = $y + $templateVo->offset->y; + //是否不透明 + $isOpacity = $templateVo->isOpacity($x, $y); + if ($isOpacity) { //如果不透明 + if ($callable instanceof \Closure) { + $callable([$bgX, $bgY]); + } + $backgroundVo->vagueImage($bgX, $bgY);//模糊背景图选区 + + $this->copyPickColor($backgroundVo, $bgX, $bgY, $templateVo, $x, $y); + } + if ($templateVo->isBoundary($isOpacity, $x, $y)) { + $backgroundVo->setPixel(self::WHITE, $bgX, $bgY); + $templateVo->setPixel(self::WHITE, $x, $y); + } + } + } + } + + /** + * 把$source的颜色复制到$target上 + * @param ImageVo $source + * @param ImageVo $target + */ + + protected function copyPickColor(ImageVo $source, $sourceX, $sourceY, ImageVo $target, $targetX, $targetY) + { + $bgRgba = $source->getPickColor($sourceX, $sourceY); + $target->setPixel($bgRgba, $targetX, $targetY);//复制背景图片给模板 + } + + /** + * 返回前端需要的格式 + * @return false|string[] + */ + public function response($type = 'background') + { + $image = $type == 'background' ? $this->backgroundVo->image : $this->templateVo->image; + $result = $image->encode('data-url')->getEncoded(); + //返回图片base64的第二部分 + return explode(',', $result)[1]; + } + + /** + * 用来调试 + */ + public function echo($type = 'background') + { + $image = $type == 'background' ? $this->backgroundVo->image : $this->templateVo->image; + die($image->response()); + } +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/Cache.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/Cache.php new file mode 100644 index 000000000..cf35db12e --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/Cache.php @@ -0,0 +1,114 @@ + 'get', + 'set' => 'set', + 'delete' => 'delete', + 'has' => 'has' + ]; + + public function __construct($config) + { + if (isset($config['method'])) { + $this->methodMap = array_merge($this->methodMap, $config['method']); + } + $this->driver = $this->getDriver($config['constructor'], $config['options']??[]); + } + + public function getDriver($callback, $options) + { + if ($callback instanceof \Closure) { + $result = $callback($options); + } else if (is_object($callback)) { + $result = $callback; + } else if (is_array($callback)) { + $result = call_user_func($callback, $options); + } else if ($this->isSerialized($callback)) { + $result = unserialize($callback); + } else if (is_string($callback) && class_exists($callback)) { + $result = new $callback($options); + } else { + $result = new CacheUtils($options); + } + return $result; + } + + /** + * 是否可以被反序列化 + * @param $data + * @return bool + */ + public function isSerialized($data): bool + { + if (!is_string($data)) { + return false; + } + $data = trim($data); + if ('N;' == $data) { + return true; + } + if (!preg_match('/^([adObis]):/', $data, $badions)) { + return false; + } + switch ($badions[1]) { + case 'a' : + case 'O' : + case 's' : + if (preg_match("/^{$badions[1]}:[0-9]+:.*[;}]\$/s", $data)) + return true; + break; + case 'b' : + case 'i' : + case 'd' : + if (preg_match("/^{$badions[1]}:[0-9.E-]+;\$/", $data)) + return true; + break; + } + return false; + } + + public function getDriverMethod($name) + { + return $this->methodMap[$name]; + } + + public function get($key, $default = null) + { + $method = $this->getDriverMethod('get'); + return $this->execute($method, [$key,$default]); + } + + public function set($key, $value, $ttl = null) + { + $method = $this->getDriverMethod('set'); + return $this->execute($method, [$key, $value, $ttl]); + } + + public function delete($key) + { + $method = $this->getDriverMethod('delete'); + return $this->execute($method, [$key]); + } + + public function has($key) + { + $method = $this->getDriverMethod('has'); + return $this->execute($method, [$key]); + } + + protected function execute(string $method, array $params){ + return $this->driver->$method(...$params); + } + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/WordData.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/WordData.php new file mode 100644 index 000000000..e4fba23fd --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/WordData.php @@ -0,0 +1,95 @@ +getPoint($width, $height, $i, $number); + } + shuffle($pointList); //随机排序 + return $pointList; + } + + + /** + * @param $list + * @return array + */ + public function array2Point($list): array + { + $result = []; + foreach ($list as $item) { + $result[] = new PointVo($item['x'], $item['y']); + } + return $result; + } + + public function getWordList($number): array + { + return RandomUtils::getRandomChar($number); + } + + /** + * 校验 + * @param array $originPointList + * @param array $targetPointList + */ + public function check(array $originPointList, array $targetPointList) + { + foreach ($originPointList as $key => $originPoint) { + $targetPoint = $targetPointList[$key]; + if ($targetPoint->x - self::FONTSIZE > $originPoint->x + || $targetPoint->x > $originPoint->x + self::FONTSIZE + || $targetPoint->y - self::FONTSIZE > $originPoint->y + || $targetPoint->y > $originPoint->y + self::FONTSIZE) { + throw new WordException('验证失败!'); + } + } + } +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/WordImage.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/WordImage.php new file mode 100644 index 000000000..96d600c53 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Logic/WordImage.php @@ -0,0 +1,83 @@ +wordList = $wordList; + return $this; + } + + public function getWordList() + { + return $this->wordList; + } + + + + public function run() + { + $this->inputWords(); + $this->makeWatermark($this->backgroundVo->image); + } + + /** + * 写入文字 + */ + protected function inputWords(){ + foreach ($this->wordList as $key => $word) { + $point = $this->point[$key]; + $this->backgroundVo->image->text($word, $point->x, $point->y, function (Font $font) { + $font->file($this->fontFile); + $font->size(BaseData::FONTSIZE); + $font->color(RandomUtils::getRandomColor()); + $font->angle(RandomUtils::getRandomAngle()); + $font->align('center'); + $font->valign('center'); + }); + } + } + + /** + * 返回前端需要的格式 + * @return false|string[] + */ + public function response() + { + $result = $this->getBackgroundVo()->image->encode('data-url')->getEncoded(); + //返回图片base64的第二部分 + return explode(',', $result)[1]; + } + + /** + * 用来调试 + */ + public function echo() + { + die($this->getBackgroundVo()->image->response()); + } + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/BackgroundVo.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/BackgroundVo.php new file mode 100644 index 000000000..f1dea21aa --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/BackgroundVo.php @@ -0,0 +1,8 @@ +src = $src; + $this->initImage($src); + } + + public function initImage($src) + { + $this->image = ImageManagerStatic::make($src); + } + + /** + * 获取图片中某一个位置的rgba值 + * @param $x + * @param $y + * @return array + */ + public function getPickColor($x, $y): array + { + if (!isset($this->pickMaps[$x][$y])) { + $this->pickMaps[$x][$y] = $this->image->pickColor($x, $y); + } + return $this->pickMaps[$x][$y]; + } + + + /** + * 设置图片指定位置的颜色值 + */ + public function setPixel($color, $x, $y) + { + $this->image->pixel($color, $x, $y); + } + + /** + * @param int $x + * @param int $y + * @return array + */ + public function getBlurValue(int $x, int $y): array + { + $image = $this->image; + $red = []; + $green = []; + $blue = []; + $alpha = []; + foreach ([ + [0, 1], [0, -1], + [1, 0], [-1, 0], + [1, 1], [1, -1], + [-1, 1], [-1, -1], + ] as $distance) //边框取5个点,4个角取3个点,其余取8个点 + { + $pointX = $x + $distance[0]; + $pointY = $y + $distance[1]; + if ($pointX < 0 || $pointX >= $image->getWidth() || $pointY < 0 || $pointY >= $image->height()) { + continue; + } + [$r, $g, $b, $a] = $this->getPickColor($pointX, $pointY); + $red[] = $r; + $green[] = $g; + $blue[] = $b; + $alpha[] = $a; + } + return [MathUtils::avg($red), MathUtils::avg($green), MathUtils::avg($blue), MathUtils::avg($alpha)]; + } + + + /** + * 是否不透明 + * @param $x + * @param $y + * @return bool + */ + public function isOpacity($x, $y): bool + { + return $this->getPickColor($x, $y)[3] > 0.5; + } + + /** + * 是否为边框 + * @param bool $isOpacity + * @param int $x + * @param int $y + * @return bool + */ + public function isBoundary(bool $isOpacity, int $x, int $y): bool + { + $image = $this->image; + if ($x >= $image->width() - 1 || $y >= $image->height() - 1) { + return false; + } + $right = [$x + 1, $y]; + $down = [$x, $y + 1]; + if ( + $isOpacity && !$this->isOpacity(...$right) + || !$isOpacity && $this->isOpacity(...$right) + || $isOpacity && !$this->isOpacity(...$down) + || !$isOpacity && $this->isOpacity(...$down) + ) { + return true; + } + return false; + } + + /** + * 模糊图片 + * @param $targetX + * @param $targetY + */ + public function vagueImage($targetX, $targetY) + { + $blur = $this->getBlurValue($targetX, $targetY); + $this->setPixel($blur, $targetX, $targetY); + } + + + /** + * @return array + */ + public function getPickMaps(): array + { + return $this->pickMaps; + } + + /** + * @param array $pickMaps + */ + public function setPickMaps(array $pickMaps): void + { + $this->pickMaps = $pickMaps; + } + + /** + * 提前初始化像素 + */ + public function preparePickMaps() + { + $width = $this->image->getWidth(); + $height = $this->image->getHeight(); + for ($x = 0; $x < $width; $x++) { + for ($y = 0; $y < $height; $y++) { + $this->getPickColor($x, $y); + } + } + } + + public function setFinishCallback($finishCallback){ + $this->finishCallback = $finishCallback; + } + + public function __destruct() + { + if(!empty($this->finishCallback) && $this->finishCallback instanceof \Closure){ + ($this->finishCallback)($this); + } + } +} \ No newline at end of file diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/OffsetVo.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/OffsetVo.php new file mode 100644 index 000000000..7a6e597f5 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/OffsetVo.php @@ -0,0 +1,18 @@ +x = $x; + $this->y = $y; + } + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/PointVo.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/PointVo.php new file mode 100644 index 000000000..95c634127 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/PointVo.php @@ -0,0 +1,22 @@ +x = $x; + $this->y = $y; + } +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/TemplateVo.php b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/TemplateVo.php new file mode 100644 index 000000000..8ab7a6eb9 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Domain/Vo/TemplateVo.php @@ -0,0 +1,32 @@ +offset; + } + + /** + * @param OffsetVo $offset + */ + public function setOffset(OffsetVo $offset): void + { + $this->offset = $offset; + } + + + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Exception/BlockException.php b/niucloud/vendor/fastknife/ajcaptcha/src/Exception/BlockException.php new file mode 100644 index 000000000..2efea3774 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Exception/BlockException.php @@ -0,0 +1,10 @@ +factory->getCacheInstance(); + $blockImage = $this->factory->makeBlockImage(); + $blockImage->run(); + $data = [ + 'originalImageBase64' => $blockImage->response(), + 'jigsawImageBase64' => $blockImage->response('template'), + 'secretKey' => RandomUtils::getRandomCode(16, 3), + 'token' => RandomUtils::getUUID(), + ]; + //缓存 + $cacheEntity->set($data['token'], [ + 'secretKey' => $data['secretKey'], + 'point' => $blockImage->getPoint() + ], $this->factory->getConfig()['cache']['options']['expire'] ?? 300); + return $data; + } + + + /** + * 验证 + * @param string $token + * @param string $pointJson + */ + public function validate($token, $pointJson) + { + //获取并设置 $this->originData + $this->setOriginData($token); + + //数据处理类 + $blockData = $this->factory->makeBlockData(); + + //解码出来的前端坐标 + $targetPoint = $this->encodePoint($this->originData['secretKey'], $pointJson);; + $targetPoint = new PointVo($targetPoint['x'], $targetPoint['y']); + + //检查 + $blockData->check($this->originData['point'], $targetPoint); + } +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Service/ClickWordCaptchaService.php b/niucloud/vendor/fastknife/ajcaptcha/src/Service/ClickWordCaptchaService.php new file mode 100644 index 000000000..d7a0608bc --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Service/ClickWordCaptchaService.php @@ -0,0 +1,60 @@ +factory->getCacheInstance(); + $wordImage = $this->factory->makeWordImage(); + //执行创建 + $wordImage->run(); + $data = [ + 'originalImageBase64' => $wordImage->response(), + 'secretKey' => RandomUtils::getRandomCode(16, 3), + 'token' => RandomUtils::getUUID(), + 'wordList' => $wordImage->getWordList() + ]; + //缓存 + $cacheEntity->set($data['token'], [ + 'secretKey' => $data['secretKey'], + 'point' => $wordImage->getPoint() + ],$this->factory->getConfig()['cache']['options']['expire'] ?? 300); + return $data; + } + + + /** + * 验证 + * @param $token + * @param $pointJson + */ + public function validate($token, $pointJson) + { + //获取并设置 $this->originData + $this->setOriginData($token); + + //数据实例 + $wordData = $this->factory->makeWordData(); + //解码出来的前端坐标 + $pointJson = $this->encodePoint($this->originData['secretKey'], $pointJson); + $targetPointList = $wordData->array2Point($pointJson); + + //检查 + $wordData->check($this->originData['point'], $targetPointList); + } + + + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Service/Service.php b/niucloud/vendor/fastknife/ajcaptcha/src/Service/Service.php new file mode 100644 index 000000000..0cbcb9908 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Service/Service.php @@ -0,0 +1,121 @@ +factory = new Factory($config); + } + + abstract public function get(); + + + abstract public function validate( $token, $pointJson); + + /** + * 一次验证 + * @param $token + * @param $pointJson + */ + public function check($token, $pointJson) + { + try { + $this->validate($token, $pointJson); + }catch (\RuntimeException $e){ + $cacheEntity = $this->factory->getCacheInstance(); + $cacheEntity->delete($token); + throw $e; + } + $this->setEncryptCache($token, $pointJson); + } + + private function setEncryptCache($token, $pointJson){ + $cacheEntity = $this->factory->getCacheInstance(); + $pointStr = AesUtils::decrypt($pointJson, $this->originData['secretKey']); + $key = AesUtils::encrypt($token. '---'. $pointStr, $this->originData['secretKey']); + $cacheEntity->set($key, + [ + 'token' => $token, + 'point' => $pointJson + ], + $this->factory->getConfig()['cache']['options']['expire'] ?? 300 + ); + } + + + /** + * 二次验证 + * @param $token + * @param $pointJson + */ + public function verification($token, $pointJson) + { + try { + $this->validate($token, $pointJson); + } finally { + $cacheEntity = $this->factory->getCacheInstance(); + $cacheEntity->delete($token); + } + } + + /** + * 二次验证,必须要先执行一次验证才能调用二次验证 + * 兼容前端 captchaVerification 传值 + * @param string $encryptCode + */ + public function verificationByEncryptCode(string $encryptCode) + { + $result = $this->factory->getCacheInstance()->get($encryptCode); + if(empty($result)){ + throw new ParamException('参数错误!'); + } + + try { + $this->validate($result['token'], $result['point']); + } finally { + $cacheEntity = $this->factory->getCacheInstance(); + $cacheEntity->delete($result['token']); + $cacheEntity->delete($encryptCode); + } + } + + /** + * 解码坐标点 + * @param $secretKey + * @param $point + * @return array + */ + protected function encodePoint($secretKey, $point): array + { + $pointJson = AesUtils::decrypt($point, $secretKey); + if ($pointJson == false) { + throw new ParamException('aes验签失败!'); + } + return json_decode($pointJson, true); + } + + protected function setOriginData($token){ + $cacheEntity = $this->factory->getCacheInstance(); + $this->originData = $cacheEntity->get($token); + if (empty($this->originData)) { + throw new ParamException('参数校验失败:token'); + } + } +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Utils/AesUtils.php b/niucloud/vendor/fastknife/ajcaptcha/src/Utils/AesUtils.php new file mode 100644 index 000000000..6c6e193d2 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Utils/AesUtils.php @@ -0,0 +1,39 @@ + 300, + 'cache_subdir' => true, + 'prefix' => '', + 'path' => '', + 'hash_type' => 'md5', + 'data_compress' => false, + 'tag_prefix' => 'tag:', + 'serialize' => [], + ]; + + /** + * 缓存读取次数 + * @var integer + */ + protected $readTimes = 0; + + /** + * 缓存写入次数 + * @var integer + */ + protected $writeTimes = 0; + + + /** + * 架构函数 + * @param array $options 参数 + */ + public function __construct(array $options = []) + { + if (!empty($options)) { + $this->options = array_merge($this->options, $options); + } + + if (empty($this->options['path'])) { + $root = isset($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['DOCUMENT_ROOT']) ?$_SERVER['DOCUMENT_ROOT'] : getcwd(); + $this->options['path'] = $root. '/runtime/cache'; + } + + if (substr($this->options['path'], -1) != DIRECTORY_SEPARATOR) { + $this->options['path'] .= DIRECTORY_SEPARATOR; + } + } + + /** + * 取得变量的存储文件名 + * @access public + * @param string $name 缓存变量名 + * @return string + */ + public function getCacheKey(string $name): string + { + $name = hash($this->options['hash_type'], $name); + + if ($this->options['cache_subdir']) { + // 使用子目录 + $name = substr($name, 0, 2) . DIRECTORY_SEPARATOR . substr($name, 2); + } + + if ($this->options['prefix']) { + $name = $this->options['prefix'] . DIRECTORY_SEPARATOR . $name; + } + + return $this->options['path'] . $name . '.php'; + } + + /** + * 获取缓存数据 + * @param string $name 缓存标识名 + * @return array|null + */ + protected function getRaw(string $name) + { + $filename = $this->getCacheKey($name); + + if (!is_file($filename)) { + return; + } + + $content = @file_get_contents($filename); + + if (false !== $content) { + $expire = (int) substr($content, 8, 12); + if (0 != $expire && time() - $expire > filemtime($filename)) { + //缓存过期删除缓存文件 + $this->unlink($filename); + return; + } + + $content = substr($content, 32); + + return is_string($content) ? ['content' => $content, 'expire' => $expire] : null; + } + } + + /** + * 判断缓存是否存在 + * @access public + * @param string $name 缓存变量名 + * @return bool + */ + public function has($name): bool + { + return $this->getRaw($name) !== null; + } + + /** + * 读取缓存 + * @access public + * @param string $name 缓存变量名 + * @param mixed $default 默认值 + * @return mixed + */ + public function get($name, $default = null) + { + $this->readTimes++; + + $raw = $this->getRaw($name); + + return is_null($raw) ? $default : $this->unserialize($raw['content']); + } + + /** + * 写入缓存 + * @access public + * @param string $name 缓存变量名 + * @param mixed $value 存储数据 + * @param int $expire 有效时间 0为永久 + * @return bool + */ + public function set($name, $value, $expire = null): bool + { + $this->writeTimes++; + + if (is_null($expire)) { + $expire = $this->options['expire']; + } + + $filename = $this->getCacheKey($name); + + $dir = dirname($filename); + + if (!is_dir($dir)) { + try { + mkdir($dir, 0755, true); + } catch (\Exception $e) { + // 创建失败 + } + } + + $data = $this->serialize($value); + + if ($this->options['data_compress'] && function_exists('gzcompress')) { + //数据压缩 + $data = gzcompress($data, 3); + } + + $data = "\n" . $data; + $result = file_put_contents($filename, $data); + + if ($result) { + clearstatcache(); + return true; + } + + return false; + } + + /** + * 自增缓存(针对数值缓存) + * @access public + * @param string $name 缓存变量名 + * @param int $step 步长 + * @return false|int + */ + public function inc(string $name, int $step = 1) + { + if ($raw = $this->getRaw($name)) { + $value = $this->unserialize($raw['content']) + $step; + $expire = $raw['expire']; + } else { + $value = $step; + $expire = 0; + } + + return $this->set($name, $value, $expire) ? $value : false; + } + + /** + * 自减缓存(针对数值缓存) + * @access public + * @param string $name 缓存变量名 + * @param int $step 步长 + * @return false|int + */ + public function dec(string $name, int $step = 1) + { + return $this->inc($name, -$step); + } + + /** + * 删除缓存 + * @access public + * @param string $name 缓存变量名 + * @return bool + */ + public function delete($name): bool + { + $this->writeTimes++; + + return $this->unlink($this->getCacheKey($name)); + } + + /** + * 清除缓存 + * @access public + * @return bool + */ + public function clear(): bool + { + $this->writeTimes++; + + $dirname = $this->options['path'] . $this->options['prefix']; + + $this->rmdir($dirname); + + return true; + } + + /** + * 删除缓存标签 + * @access public + * @param array $keys 缓存标识列表 + * @return void + */ + public function clearTag(array $keys): void + { + foreach ($keys as $key) { + $this->unlink($key); + } + } + + /** + * 判断文件是否存在后,删除 + * @access private + * @param string $path + * @return bool + */ + private function unlink(string $path): bool + { + try { + return is_file($path) && unlink($path); + } catch (\Exception $e) { + return false; + } + } + + /** + * 删除文件夹 + * @param $dirname + * @return bool + */ + private function rmdir($dirname) + { + if (!is_dir($dirname)) { + return false; + } + + $items = new \FilesystemIterator($dirname); + + foreach ($items as $item) { + if ($item->isDir() && !$item->isLink()) { + $this->rmdir($item->getPathname()); + } else { + $this->unlink($item->getPathname()); + } + } + + @rmdir($dirname); + + return true; + } + /** + * 序列化数据 + * @access protected + * @param mixed $data 缓存数据 + * @return string + */ + protected function serialize($data): string + { + if (is_numeric($data)) { + return (string) $data; + } + + $serialize = $this->options['serialize'][0] ?? "serialize"; + + return $serialize($data); + } + + /** + * 反序列化数据 + * @access protected + * @param string $data 缓存数据 + * @return mixed + */ + protected function unserialize(string $data) + { + if (is_numeric($data)) { + return $data; + } + + $unserialize = $this->options['serialize'][1] ?? "unserialize"; + + return $unserialize($data); + } + + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/src/Utils/MathUtils.php b/niucloud/vendor/fastknife/ajcaptcha/src/Utils/MathUtils.php new file mode 100644 index 000000000..aa794730c --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/src/Utils/MathUtils.php @@ -0,0 +1,16 @@ + '', //自定义字体包路径, 不填使用默认值 + //文字验证码 + 'click_world' => [ + 'backgrounds' => [], + 'word_num' => 4, //写入多少字文字(2-5) + ], + //滑动验证码 + 'block_puzzle' => [ + /*背景图片路径, 不填使用默认值, 支持string与array两种数据结构。string为默认图片的目录,array索引数组则为具体图片的地址*/ + 'backgrounds' => [], + + /*模板图,格式同上支持string与array*/ + 'templates' => [], + + 'offset' => 10, //容错偏移量 + + 'is_cache_pixel' => true, //是否开启缓存图片像素值,开启后能提升服务端响应性能(但要注意更换图片时,需要清除缓存) + + 'is_interfere' => true, //开启干扰图 + ], + //水印 + 'watermark' => [ + 'fontsize' => 12, + 'color' => '#000000', + 'text' => '我的水印' + ], + 'cache' => [ + //若您使用了框架,并且想使用类似于redis这样的缓存驱动,则应换成框架的中的缓存驱动 + 'constructor' => \Fastknife\Utils\CacheUtils::class, + 'method' => [ + //遵守PSR-16规范不需要设置此项(tp6, laravel,hyperf)。如tp5就不支持(tp5缓存方法是rm,所以要配置为"delete" => "rm") + /** + 'get' => 'get', //获取 + 'set' => 'set', //设置 + 'delete' => 'delete',//删除 + 'has' => 'has' //key是否存在 + */ + ], + 'options' => [ + //如果您依然使用\Fastknife\Utils\CacheUtils做为您的缓存驱动,那么您可以自定义缓存配置。 + 'expire' => 300,//缓存有效期 (默认为0 表示永久缓存) + 'prefix' => '', //缓存前缀 + 'path' => '', //缓存目录 + 'serialize' => [], //缓存序列化和反序列化方法 + ] + ] +]; diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/BlockPuzzleController.php b/niucloud/vendor/fastknife/ajcaptcha/test/BlockPuzzleController.php new file mode 100644 index 000000000..fd35f3be6 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/BlockPuzzleController.php @@ -0,0 +1,82 @@ +get(); + echo json_encode([ + 'error' => false, + 'repCode' => '0000', + 'repData' => $data, + 'repMsg' => null, + 'success' => true, + ]); + } + + /** + * 一次验证 + */ + public function check() + { + $config = require '../src/config.php'; + $service = new BlockPuzzleCaptchaService($config); + $data = $_REQUEST; + $msg = null; + $error = false; + $repCode = '0000'; + try { + $service->check($data['token'], $data['pointJson']); + } catch (\Exception $e) { + $msg = $e->getMessage(); + $error = true; + $repCode = '6111'; + } + echo json_encode([ + 'error' => $error, + 'repCode' => $repCode, + 'repData' => null, + 'repMsg' => $msg, + 'success' => ! $error, + ]); + } + + /** + * 二次验证 + */ + public function verification() + { + $config = require '../src/config.php'; + $service = new BlockPuzzleCaptchaService($config); + $data = $_REQUEST; + $msg = null; + $error = false; + $repCode = '0000'; + + try { + if(isset($data['captchaVerification'])){ + $service->verificationByEncryptCode($data['captchaVerification']); + }else if (isset($data['token']) && isset($data['pointJson'])){ + $service->verification($data['token'], $data['pointJson']); + } else { + throw new \Exception('参数错误!'); + } + } catch (\Exception $e) { + $msg = $e->getMessage(); + $error = true; + $repCode = '6111'; + } + echo json_encode([ + 'error' => $error, + 'repCode' => $repCode, + 'repData' => null, + 'repMsg' => $msg, + 'success' => ! $error, + ]); + } + + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/ClickWordController.php b/niucloud/vendor/fastknife/ajcaptcha/test/ClickWordController.php new file mode 100644 index 000000000..dca5048cc --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/ClickWordController.php @@ -0,0 +1,90 @@ +get(); + echo json_encode([ + 'error' => false, + 'repCode' => '0000', + 'repData' => $data, + 'repMsg' => null, + 'success' => true, + ]); + } + + /** + * 一次验证 + */ + public function check() + { + $config = require '../src/config.php'; + $service = new ClickWordCaptchaService($config); + $data = $_REQUEST; + $msg = null; + $error = false; + $repCode = '0000'; + try { + $service->check($data['token'], $data['pointJson']); + } catch (\Exception $e) { + $msg = $e->getMessage(); + $error = true; + $repCode = '6111'; + } + echo json_encode([ + 'error' => $error, + 'repCode' => $repCode, + 'repData' => null, + 'repMsg' => $msg, + 'success' => ! $error, + ]); + } + + /** + * 二次验证 + */ + public function verification() + { + $config = require '../src/config.php'; + $service = new ClickWordCaptchaService($config); + $data = $_REQUEST; + $msg = null; + $error = false; + $repCode = '0000'; + try { + if(isset($data['captchaVerification'])){ + $service->verificationByEncryptCode($data['captchaVerification']); + }else if (isset($data['token']) && isset($data['pointJson'])){ + $service->verification($data['token'], $data['pointJson']); + } else { + throw new \Exception('参数错误!'); + } + } catch (\Exception $e) { + $msg = $e->getMessage(); + $error = true; + $repCode = '6111'; + } + echo json_encode([ + 'error' => $error, + 'repCode' => $repCode, + 'repData' => null, + 'repMsg' => $msg, + 'success' => ! $error, + ]); + } +} + + + + + + + + diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/autoload.php b/niucloud/vendor/fastknife/ajcaptcha/test/autoload.php new file mode 100644 index 000000000..f6aacab63 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/autoload.php @@ -0,0 +1,16 @@ +check(); diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/get.php b/niucloud/vendor/fastknife/ajcaptcha/test/get.php new file mode 100644 index 000000000..52236a7fc --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/get.php @@ -0,0 +1,18 @@ +get(); diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/laravel/IndexController.php b/niucloud/vendor/fastknife/ajcaptcha/test/laravel/IndexController.php new file mode 100644 index 000000000..3c6c9bac4 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/laravel/IndexController.php @@ -0,0 +1,106 @@ +getCaptchaService(); + $data = $service->get(); + } catch (\Exception $e) { + return $this->error($e->getMessage()); + } + return $this->success($data); + } + + /** + * 一次验证 + * @return array + */ + public function check() + { + try { + $data = $this->validate(); + $service = $this->getCaptchaService(); + $service->check($data['token'], $data['pointJson']); + } catch (\Exception $e) { + return $this->error($e->getMessage()); + } + return $this->success([]); + } + + /** + * 二次验证 + * @return array + */ + public function verification() + { + try { + $data = $this->validate(); + $service = $this->getCaptchaService(); + $service->verification($data['token'], $data['pointJson']); + } catch (\Exception $e) { + return $this->error($e->getMessage()); + } + return $this->success([]); + } + + protected function getCaptchaService() + { + $captchaType = request()->post('captchaType', null); + $config = config('captcha'); + switch ($captchaType) { + case "clickWord": + $service = new ClickWordCaptchaService($config); + break; + case "blockPuzzle": + $service = new BlockPuzzleCaptchaService($config); + break; + default: + throw new ParamException('captchaType参数不正确!'); + } + return $service; + } + + protected function validate() + { + return Request::instance()->validate([ + 'token' => 'bail|required', + 'pointJson' => 'required', + ]); + + } + + protected function success($data) + { + return [ + 'error' => false, + 'repCode' => '0000', + 'repData' => $data, + 'repMsg' => null, + 'success' => true, + ]; + } + + + protected function error($msg) + { + return [ + 'error' => true, + 'repCode' => '6111', + 'repData' => null, + 'repMsg' => $msg, + 'success' => false, + ]; + } + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/laravel/captcha.php b/niucloud/vendor/fastknife/ajcaptcha/test/laravel/captcha.php new file mode 100644 index 000000000..fe70e52c5 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/laravel/captcha.php @@ -0,0 +1,33 @@ + '', //自定义字体包路径, 不填使用默认值 + //文字验证码 + 'click_world' => [ + 'backgrounds' => [] + ], + //滑动验证码 + 'block_puzzle' => [ + 'backgrounds' => [], //背景图片路径, 不填使用默认值 + 'templates' => [], //模板图 + 'offset' => 10, //容错偏移量 + ], + //水印 + 'watermark' => [ + 'fontsize' => 12, + 'color' => '#ffffff', + 'text' => '我的水印' + ], + 'cache' => [ + 'constructor' => [\Illuminate\Support\Facades\Cache::class, 'store'], + 'method' => [ + 'get' => 'get', //获取 + 'set' => 'set', //设置 + 'delete' => 'delete',//删除 + 'has' => 'has' //key是否存在 + ] + ] +]; diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/readme.md b/niucloud/vendor/fastknife/ajcaptcha/test/readme.md new file mode 100644 index 000000000..b1d27860b --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/readme.md @@ -0,0 +1,3 @@ +#### 这个是一个demo测试目录。 +* 当前目录下的php文件是不基于任何框架的demo +* thinkphp 目录是基于thinkphp框架的demo diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/testAes.php b/niucloud/vendor/fastknife/ajcaptcha/test/testAes.php new file mode 100644 index 000000000..312d5f53d --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/testAes.php @@ -0,0 +1,22 @@ + 135, 'y' => 58], + ['x' => 82, 'y' => 72], + ['x' => 56, 'y' => 112] +]; +$point = json_encode($point); +//[{"x":135,"y":58},{"x":82,"y":72},{"x":56,"y":112}] +//var_dump(); +//print_r(AesUtils::encrypt($point,$key)); +//php w2GGF3+0q0K0AdTysBEKynRo9hXBbXBPUZU1GPWJKlM4SwtrbmV17CFcTq/T53Kvlk0FWSbFzfCC1NuAA6wsmw== +//js FOl3kz52f4xptJ/Zf7MoZYQmYa7C1pjQaWP8QqhcX8FH43SvpCBPhaSqqMbE8D55ufhgjBVor01UZRH3uE6DNw== + + + + +//js +5s4V1MeDYk1jpvfwJACJA== +//php C01B0oArq8aMhlMmSdRbDA== diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/testCache.php b/niucloud/vendor/fastknife/ajcaptcha/test/testCache.php new file mode 100644 index 000000000..a10b82253 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/testCache.php @@ -0,0 +1,21 @@ +get('haha')); + +$cacheEntity->set('haha', 1, 60); + +var_dump($cacheEntity->has('haha')); + +var_dump($cacheEntity->get('haha')); + +$cacheEntity->delete('haha'); + +var_dump($cacheEntity->get('haha')); \ No newline at end of file diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/testImage.php b/niucloud/vendor/fastknife/ajcaptcha/test/testImage.php new file mode 100644 index 000000000..8383506b5 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/testImage.php @@ -0,0 +1,28 @@ +makeBlockImage(); + $blockImage->run(); + $blockImage->echo(); +} + +function showWord() +{ + global $config; + $factory = new Factory($config); + $blockImage = $factory->makeWordImage(); + $blockImage->run(); + $blockImage->echo(); +} + +showWord(); \ No newline at end of file diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/thinkphp/Index.php b/niucloud/vendor/fastknife/ajcaptcha/test/thinkphp/Index.php new file mode 100644 index 000000000..545e17918 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/thinkphp/Index.php @@ -0,0 +1,116 @@ +getCaptchaService(); + $data = $service->get(); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + $this->success($data); + } + + /** + * 一次验证 + */ + public function check() + { + $data = request()->post(); + try { + $this->validate($data); + $service = $this->getCaptchaService(); + $service->check($data['token'], $data['pointJson']); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + $this->success([]); + } + + /** + * 二次验证 + */ + public function verification() + { + $data = request()->post(); + try { + $this->validate($data); + $service = $this->getCaptchaService(); + $service->verification($data['token'], $data['pointJson']); + } catch (\Exception $e) { + $this->error($e->getMessage()); + } + $this->success([]); + } + + protected function getCaptchaService() + { + $captchaType = request()->post('captchaType', null); + $config = config('captcha'); + switch ($captchaType) { + case "clickWord": + $service = new ClickWordCaptchaService($config); + break; + case "blockPuzzle": + $service = new BlockPuzzleCaptchaService($config); + break; + default: + throw new ParamException('captchaType参数不正确!'); + } + return $service; + } + + protected function validate($data) + { + $rules = [ + 'token' => ['require'], + 'pointJson' => ['require'] + ]; + $validate = Validate::rule($rules)->failException(true); + $validate->check($data); + } + + protected function success($data) + { + $response = [ + 'error' => false, + 'repCode' => '0000', + 'repData' => $data, + 'repMsg' => null, + 'success' => true, + ]; + throw new HttpResponseException(Response::create($response, 'json')); + } + + + protected function error($msg) + { + $response = [ + 'error' => true, + 'repCode' => '6111', + 'repData' => null, + 'repMsg' => $msg, + 'success' => false, + ]; + throw new HttpResponseException(Response::create($response, 'json')); + } + + +} diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/thinkphp/captcha.php b/niucloud/vendor/fastknife/ajcaptcha/test/thinkphp/captcha.php new file mode 100644 index 000000000..4d1dc1999 --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/thinkphp/captcha.php @@ -0,0 +1,27 @@ + '', //自定义字体包路径, 不填使用默认值 + //文字验证码 + 'click_world' => [ + 'backgrounds' => [] + ], + //滑动验证码 + 'block_puzzle' => [ + 'backgrounds' => [], //背景图片路径, 不填使用默认值 + 'templates' => [], //模板图 + 'offset' => 10, //容错偏移量 + ], + //水印 + 'watermark' => [ + 'fontsize' => 12, + 'color' => '#ffffff', + 'text' => '我的水印' + ], + 'cache' => [ + 'constructor' => [\think\facade\Cache::class, 'instance'] + ] +]; diff --git a/niucloud/vendor/fastknife/ajcaptcha/test/verification.php b/niucloud/vendor/fastknife/ajcaptcha/test/verification.php new file mode 100644 index 000000000..12659ff6f --- /dev/null +++ b/niucloud/vendor/fastknife/ajcaptcha/test/verification.php @@ -0,0 +1,19 @@ +verification(); diff --git a/niucloud/vendor/guzzlehttp/psr7/CHANGELOG.md b/niucloud/vendor/guzzlehttp/psr7/CHANGELOG.md index 3fcf18a54..fa716c094 100644 --- a/niucloud/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/niucloud/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 2.5.0 - 2023-04-17 + +### Changed + +- Adjusted `psr/http-message` version constraint to `^1.1 || ^2.0` + +## 2.4.5 - 2023-04-17 + +### Fixed + +- Prevent possible warnings on unset variables in `ServerRequest::normalizeNestedFileSpec` +- Fixed `Message::bodySummary` when `preg_match` fails +- Fixed header validation issue + +## 2.4.4 - 2023-03-09 + +### Changed + +- Removed the need for `AllowDynamicProperties` in `LazyOpenStream` + ## 2.4.3 - 2022-10-26 ### Changed diff --git a/niucloud/vendor/guzzlehttp/psr7/README.md b/niucloud/vendor/guzzlehttp/psr7/README.md index 8b9929a1d..9566a7d47 100644 --- a/niucloud/vendor/guzzlehttp/psr7/README.md +++ b/niucloud/vendor/guzzlehttp/psr7/README.md @@ -8,6 +8,12 @@ functionality like query string parsing. ![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) +# Installation + +```shell +composer require guzzlehttp/psr7 +``` + # Stream implementation This package comes with a number of stream implementations and stream @@ -245,6 +251,8 @@ class EofCallbackStream implements StreamInterface private $callback; + private $stream; + public function __construct(StreamInterface $stream, callable $cb) { $this->stream = $stream; diff --git a/niucloud/vendor/guzzlehttp/psr7/composer.json b/niucloud/vendor/guzzlehttp/psr7/composer.json index cd91040cf..d51dd622e 100644 --- a/niucloud/vendor/guzzlehttp/psr7/composer.json +++ b/niucloud/vendor/guzzlehttp/psr7/composer.json @@ -52,7 +52,7 @@ "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "ralouphie/getallheaders": "^3.0" }, "provide": { @@ -81,9 +81,6 @@ "bamarni-bin": { "bin-links": true, "forward-command": false - }, - "branch-alias": { - "dev-master": "2.4-dev" } }, "config": { diff --git a/niucloud/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/niucloud/vendor/guzzlehttp/psr7/src/LazyOpenStream.php index 5618331f1..f6c84904e 100644 --- a/niucloud/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/niucloud/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -10,7 +10,6 @@ use Psr\Http\Message\StreamInterface; * Lazily reads or writes to a file that is opened only after an IO operation * take place on the stream. */ -#[\AllowDynamicProperties] final class LazyOpenStream implements StreamInterface { use StreamDecoratorTrait; @@ -21,6 +20,11 @@ final class LazyOpenStream implements StreamInterface /** @var string */ private $mode; + /** + * @var StreamInterface + */ + private $stream; + /** * @param string $filename File to lazily open * @param string $mode fopen mode to use when opening the stream @@ -29,6 +33,10 @@ final class LazyOpenStream implements StreamInterface { $this->filename = $filename; $this->mode = $mode; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->stream); } /** diff --git a/niucloud/vendor/guzzlehttp/psr7/src/Message.php b/niucloud/vendor/guzzlehttp/psr7/src/Message.php index 61c1a5dcc..c1e15f826 100644 --- a/niucloud/vendor/guzzlehttp/psr7/src/Message.php +++ b/niucloud/vendor/guzzlehttp/psr7/src/Message.php @@ -77,7 +77,7 @@ final class Message // Matches any printable character, including unicode characters: // letters, marks, numbers, punctuation, spacing, and separators. - if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) { return null; } diff --git a/niucloud/vendor/guzzlehttp/psr7/src/MessageTrait.php b/niucloud/vendor/guzzlehttp/psr7/src/MessageTrait.php index d2dc28b60..464bdfaa4 100644 --- a/niucloud/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ b/niucloud/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -224,12 +224,9 @@ trait MessageTrait )); } - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) { + if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { throw new \InvalidArgumentException( - sprintf( - '"%s" is not valid header name', - $header - ) + sprintf('"%s" is not valid header name.', $header) ); } } @@ -257,8 +254,10 @@ trait MessageTrait // Clients must not send a request with line folding and a server sending folded headers is // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting // folding is not likely to break any legitimate use case. - if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/', $value)) { - throw new \InvalidArgumentException(sprintf('"%s" is not valid header value', $value)); + if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header value.', $value) + ); } } } diff --git a/niucloud/vendor/guzzlehttp/psr7/src/ServerRequest.php b/niucloud/vendor/guzzlehttp/psr7/src/ServerRequest.php index 43cbb502e..b2aa382da 100644 --- a/niucloud/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/niucloud/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -144,10 +144,10 @@ class ServerRequest extends Request implements ServerRequestInterface foreach (array_keys($files['tmp_name']) as $key) { $spec = [ 'tmp_name' => $files['tmp_name'][$key], - 'size' => $files['size'][$key], - 'error' => $files['error'][$key], - 'name' => $files['name'][$key], - 'type' => $files['type'][$key], + 'size' => $files['size'][$key] ?? null, + 'error' => $files['error'][$key] ?? null, + 'name' => $files['name'][$key] ?? null, + 'type' => $files['type'][$key] ?? null, ]; $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); } diff --git a/niucloud/vendor/intervention/image/LICENSE b/niucloud/vendor/intervention/image/LICENSE new file mode 100644 index 000000000..bc444ba22 --- /dev/null +++ b/niucloud/vendor/intervention/image/LICENSE @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2014 Oliver Vogel + +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. \ No newline at end of file diff --git a/niucloud/vendor/intervention/image/composer.json b/niucloud/vendor/intervention/image/composer.json new file mode 100644 index 000000000..6d4d360be --- /dev/null +++ b/niucloud/vendor/intervention/image/composer.json @@ -0,0 +1,47 @@ +{ + "name": "intervention/image", + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": ["image", "gd", "imagick", "laravel", "watermark", "thumbnail"], + "license": "MIT", + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "https://intervention.io/" + } + ], + "require": { + "php": ">=5.4.0", + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1 || ^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15", + "mockery/mockery": "~0.9.2" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "minimum-stability": "stable" +} diff --git a/niucloud/vendor/intervention/image/provides.json b/niucloud/vendor/intervention/image/provides.json new file mode 100644 index 000000000..a8cd1b6a5 --- /dev/null +++ b/niucloud/vendor/intervention/image/provides.json @@ -0,0 +1,11 @@ +{ + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": [ + { + "alias": "Image", + "facade": "Intervention\\Image\\Facades\\Image" + } + ] +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractColor.php b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractColor.php new file mode 100644 index 000000000..c9846c6ae --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractColor.php @@ -0,0 +1,229 @@ +parse($value); + } + + /** + * Parses given value as color + * + * @param mixed $value + * @return \Intervention\Image\AbstractColor + */ + public function parse($value) + { + switch (true) { + + case is_string($value): + $this->initFromString($value); + break; + + case is_int($value): + $this->initFromInteger($value); + break; + + case is_array($value): + $this->initFromArray($value); + break; + + case is_object($value): + $this->initFromObject($value); + break; + + case is_null($value): + $this->initFromArray([255, 255, 255, 0]); + break; + + default: + throw new NotReadableException( + "Color format ({$value}) cannot be read." + ); + } + + return $this; + } + + /** + * Formats current color instance into given format + * + * @param string $type + * @return mixed + */ + public function format($type) + { + switch (strtolower($type)) { + + case 'rgba': + return $this->getRgba(); + + case 'hex': + return $this->getHex('#'); + + case 'int': + case 'integer': + return $this->getInt(); + + case 'array': + return $this->getArray(); + + case 'obj': + case 'object': + return $this; + + default: + throw new NotSupportedException( + "Color format ({$type}) is not supported." + ); + } + } + + /** + * Reads RGBA values from string into array + * + * @param string $value + * @return array + */ + protected function rgbaFromString($value) + { + $result = false; + + // parse color string in hexidecimal format like #cccccc or cccccc or ccc + $hexPattern = '/^#?([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i'; + + // parse color string in format rgb(140, 140, 140) + $rgbPattern = '/^rgb ?\(([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9]{1,3})\)$/i'; + + // parse color string in format rgba(255, 0, 0, 0.5) + $rgbaPattern = '/^rgba ?\(([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9.]{1,4})\)$/i'; + + if (preg_match($hexPattern, $value, $matches)) { + $result = []; + $result[0] = strlen($matches[1]) == '1' ? hexdec($matches[1].$matches[1]) : hexdec($matches[1]); + $result[1] = strlen($matches[2]) == '1' ? hexdec($matches[2].$matches[2]) : hexdec($matches[2]); + $result[2] = strlen($matches[3]) == '1' ? hexdec($matches[3].$matches[3]) : hexdec($matches[3]); + $result[3] = 1; + } elseif (preg_match($rgbPattern, $value, $matches)) { + $result = []; + $result[0] = ($matches[1] >= 0 && $matches[1] <= 255) ? intval($matches[1]) : 0; + $result[1] = ($matches[2] >= 0 && $matches[2] <= 255) ? intval($matches[2]) : 0; + $result[2] = ($matches[3] >= 0 && $matches[3] <= 255) ? intval($matches[3]) : 0; + $result[3] = 1; + } elseif (preg_match($rgbaPattern, $value, $matches)) { + $result = []; + $result[0] = ($matches[1] >= 0 && $matches[1] <= 255) ? intval($matches[1]) : 0; + $result[1] = ($matches[2] >= 0 && $matches[2] <= 255) ? intval($matches[2]) : 0; + $result[2] = ($matches[3] >= 0 && $matches[3] <= 255) ? intval($matches[3]) : 0; + $result[3] = ($matches[4] >= 0 && $matches[4] <= 1) ? $matches[4] : 0; + } else { + throw new NotReadableException( + "Unable to read color ({$value})." + ); + } + + return $result; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php new file mode 100644 index 000000000..e51d4da3c --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php @@ -0,0 +1,364 @@ +data = $data; + } + + /** + * Init from given URL + * + * @param string $url + * @return \Intervention\Image\Image + */ + public function initFromUrl($url) + { + + $options = [ + 'http' => [ + 'method'=>"GET", + 'protocol_version'=>1.1, // force use HTTP 1.1 for service mesh environment with envoy + 'header'=>"Accept-language: en\r\n". + "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\r\n" + ] + ]; + + $context = stream_context_create($options); + + + if ($data = @file_get_contents($url, false, $context)) { + return $this->initFromBinary($data); + } + + throw new NotReadableException( + "Unable to init from given url (".$url.")." + ); + } + + /** + * Init from given stream + * + * @param StreamInterface|resource $stream + * @return \Intervention\Image\Image + */ + public function initFromStream($stream) + { + if (!$stream instanceof StreamInterface) { + $stream = new Stream($stream); + } + + try { + $offset = $stream->tell(); + } catch (\RuntimeException $e) { + $offset = 0; + } + + $shouldAndCanSeek = $offset !== 0 && $stream->isSeekable(); + + if ($shouldAndCanSeek) { + $stream->rewind(); + } + + try { + $data = $stream->getContents(); + } catch (\RuntimeException $e) { + $data = null; + } + + if ($shouldAndCanSeek) { + $stream->seek($offset); + } + + if ($data) { + return $this->initFromBinary($data); + } + + throw new NotReadableException( + "Unable to init from given stream" + ); + } + + /** + * Determines if current source data is GD resource + * + * @return boolean + */ + public function isGdResource() + { + if (is_resource($this->data)) { + return (get_resource_type($this->data) == 'gd'); + } + + if ($this->data instanceof \GdImage) { + return true; + } + + return false; + } + + /** + * Determines if current source data is Imagick object + * + * @return boolean + */ + public function isImagick() + { + return is_a($this->data, 'Imagick'); + } + + /** + * Determines if current source data is Intervention\Image\Image object + * + * @return boolean + */ + public function isInterventionImage() + { + return is_a($this->data, '\Intervention\Image\Image'); + } + + /** + * Determines if current data is SplFileInfo object + * + * @return boolean + */ + public function isSplFileInfo() + { + return is_a($this->data, 'SplFileInfo'); + } + + /** + * Determines if current data is Symfony UploadedFile component + * + * @return boolean + */ + public function isSymfonyUpload() + { + return is_a($this->data, 'Symfony\Component\HttpFoundation\File\UploadedFile'); + } + + /** + * Determines if current source data is file path + * + * @return boolean + */ + public function isFilePath() + { + if (is_string($this->data)) { + try { + return is_file($this->data); + } catch (\Exception $e) { + return false; + } + } + + return false; + } + + /** + * Determines if current source data is url + * + * @return boolean + */ + public function isUrl() + { + return (bool) filter_var($this->data, FILTER_VALIDATE_URL); + } + + /** + * Determines if current source data is a stream resource + * + * @return boolean + */ + public function isStream() + { + if ($this->data instanceof StreamInterface) return true; + if (!is_resource($this->data)) return false; + if (get_resource_type($this->data) !== 'stream') return false; + + return true; + } + + /** + * Determines if current source data is binary data + * + * @return boolean + */ + public function isBinary() + { + if (is_string($this->data)) { + $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $this->data); + return (substr($mime, 0, 4) != 'text' && $mime != 'application/x-empty'); + } + + return false; + } + + /** + * Determines if current source data is data-url + * + * @return boolean + */ + public function isDataUrl() + { + $data = $this->decodeDataUrl($this->data); + + return is_null($data) ? false : true; + } + + /** + * Determines if current source data is base64 encoded + * + * @return boolean + */ + public function isBase64() + { + if (!is_string($this->data)) { + return false; + } + + return base64_encode(base64_decode($this->data)) === str_replace(["\n", "\r"], '', $this->data); + } + + /** + * Initiates new Image from Intervention\Image\Image + * + * @param Image $object + * @return \Intervention\Image\Image + */ + public function initFromInterventionImage($object) + { + return $object; + } + + /** + * Parses and decodes binary image data from data-url + * + * @param string $data_url + * @return string + */ + private function decodeDataUrl($data_url) + { + if (!is_string($data_url)) { + return null; + } + + $pattern = "/^data:(?:image\/[a-zA-Z\-\.]+)(?:charset=\".+\")?;base64,(?P.+)$/"; + preg_match($pattern, str_replace(["\n", "\r"], '', $data_url), $matches); + + if (is_array($matches) && array_key_exists('data', $matches)) { + return base64_decode($matches['data']); + } + + return null; + } + + /** + * Initiates new image from mixed data + * + * @param mixed $data + * @return \Intervention\Image\Image + */ + public function init($data) + { + $this->data = $data; + + switch (true) { + + case $this->isGdResource(): + return $this->initFromGdResource($this->data); + + case $this->isImagick(): + return $this->initFromImagick($this->data); + + case $this->isInterventionImage(): + return $this->initFromInterventionImage($this->data); + + case $this->isSplFileInfo(): + return $this->initFromPath($this->data->getRealPath()); + + case $this->isBinary(): + return $this->initFromBinary($this->data); + + case $this->isUrl(): + return $this->initFromUrl($this->data); + + case $this->isStream(): + return $this->initFromStream($this->data); + + case $this->isDataUrl(): + return $this->initFromBinary($this->decodeDataUrl($this->data)); + + case $this->isFilePath(): + return $this->initFromPath($this->data); + + // isBase64 has to be after isFilePath to prevent false positives + case $this->isBase64(): + return $this->initFromBinary(base64_decode($this->data)); + + default: + throw new NotReadableException("Image source not readable"); + } + } + + /** + * Decoder object transforms to string source data + * + * @return string + */ + public function __toString() + { + return (string) $this->data; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php new file mode 100644 index 000000000..6c591a794 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php @@ -0,0 +1,140 @@ +decoder->init($data); + } + + /** + * Encodes given image + * + * @param Image $image + * @param string $format + * @param int $quality + * @return \Intervention\Image\Image + */ + public function encode($image, $format, $quality) + { + return $this->encoder->process($image, $format, $quality); + } + + /** + * Executes named command on given image + * + * @param Image $image + * @param string $name + * @param array $arguments + * @return \Intervention\Image\Commands\AbstractCommand + */ + public function executeCommand($image, $name, $arguments) + { + $commandName = $this->getCommandClassName($name); + $command = new $commandName($arguments); + $command->execute($image); + + return $command; + } + + /** + * Returns classname of given command name + * + * @param string $name + * @return string + */ + private function getCommandClassName($name) + { + if (extension_loaded('mbstring')) { + $name = mb_strtoupper(mb_substr($name, 0, 1)) . mb_substr($name, 1); + } else { + $name = strtoupper(substr($name, 0, 1)) . substr($name, 1); + } + + $drivername = $this->getDriverName(); + $classnameLocal = sprintf('\Intervention\Image\%s\Commands\%sCommand', $drivername, ucfirst($name)); + $classnameGlobal = sprintf('\Intervention\Image\Commands\%sCommand', ucfirst($name)); + + if (class_exists($classnameLocal)) { + return $classnameLocal; + } elseif (class_exists($classnameGlobal)) { + return $classnameGlobal; + } + + throw new NotSupportedException( + "Command ({$name}) is not available for driver ({$drivername})." + ); + } + + /** + * Returns name of current driver instance + * + * @return string + */ + public function getDriverName() + { + $reflect = new \ReflectionClass($this); + $namespace = $reflect->getNamespaceName(); + + return substr(strrchr($namespace, "\\"), 1); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractEncoder.php b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractEncoder.php new file mode 100644 index 000000000..c25f8bffd --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractEncoder.php @@ -0,0 +1,271 @@ +setImage($image); + $this->setFormat($format); + $this->setQuality($quality); + + switch (strtolower($this->format)) { + + case 'data-url': + $this->result = $this->processDataUrl(); + break; + + case 'gif': + case 'image/gif': + $this->result = $this->processGif(); + break; + + case 'png': + case 'image/png': + case 'image/x-png': + $this->result = $this->processPng(); + break; + + case 'jpg': + case 'jpeg': + case 'jfif': + case 'image/jp2': + case 'image/jpg': + case 'image/jpeg': + case 'image/pjpeg': + case 'image/jfif': + $this->result = $this->processJpeg(); + break; + + case 'tif': + case 'tiff': + case 'image/tiff': + case 'image/tif': + case 'image/x-tif': + case 'image/x-tiff': + $this->result = $this->processTiff(); + break; + + case 'bmp': + case 'ms-bmp': + case 'x-bitmap': + case 'x-bmp': + case 'x-ms-bmp': + case 'x-win-bitmap': + case 'x-windows-bmp': + case 'x-xbitmap': + case 'image/ms-bmp': + case 'image/x-bitmap': + case 'image/x-bmp': + case 'image/x-ms-bmp': + case 'image/x-win-bitmap': + case 'image/x-windows-bmp': + case 'image/x-xbitmap': + $this->result = $this->processBmp(); + break; + + case 'ico': + case 'image/x-ico': + case 'image/x-icon': + case 'image/vnd.microsoft.icon': + $this->result = $this->processIco(); + break; + + case 'psd': + case 'image/vnd.adobe.photoshop': + $this->result = $this->processPsd(); + break; + + case 'webp': + case 'image/webp': + case 'image/x-webp': + $this->result = $this->processWebp(); + break; + + case 'avif': + case 'image/avif': + $this->result = $this->processAvif(); + break; + + case 'heic': + case 'image/heic': + case 'image/heif': + $this->result = $this->processHeic(); + break; + + default: + throw new NotSupportedException( + "Encoding format ({$this->format}) is not supported." + ); + } + + $this->setImage(null); + + return $image->setEncoded($this->result); + } + + /** + * Processes and returns encoded image as data-url string + * + * @return string + */ + protected function processDataUrl() + { + $mime = $this->image->mime ? $this->image->mime : 'image/png'; + + return sprintf('data:%s;base64,%s', + $mime, + base64_encode($this->process($this->image, $mime, $this->quality)) + ); + } + + /** + * Sets image to process + * + * @param Image $image + */ + protected function setImage($image) + { + $this->image = $image; + } + + /** + * Determines output format + * + * @param string $format + */ + protected function setFormat($format = null) + { + if ($format == '' && $this->image instanceof Image) { + $format = $this->image->mime; + } + + $this->format = $format ? $format : 'jpg'; + + return $this; + } + + /** + * Determines output quality + * + * @param int $quality + */ + protected function setQuality($quality) + { + $quality = is_null($quality) ? 90 : $quality; + $quality = $quality === 0 ? 1 : $quality; + + if ($quality < 0 || $quality > 100) { + throw new InvalidArgumentException( + 'Quality must range from 0 to 100.' + ); + } + + $this->quality = intval($quality); + + return $this; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractFont.php b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractFont.php new file mode 100644 index 000000000..35c1825a6 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractFont.php @@ -0,0 +1,295 @@ +text = $text; + } + + /** + * Set text to be written + * + * @param String $text + * @return self + */ + public function text($text) + { + $this->text = $text; + + return $this; + } + + /** + * Get text to be written + * + * @return String + */ + public function getText() + { + return $this->text; + } + + /** + * Set font size in pixels + * + * @param int $size + * @return self + */ + public function size($size) + { + $this->size = $size; + + return $this; + } + + /** + * Get font size in pixels + * + * @return int + */ + public function getSize() + { + return $this->size; + } + + /** + * Set color of text to be written + * + * @param mixed $color + * @return self + */ + public function color($color) + { + $this->color = $color; + + return $this; + } + + /** + * Get color of text + * + * @return mixed + */ + public function getColor() + { + return $this->color; + } + + /** + * Set rotation angle of text + * + * @param int $angle + * @return self + */ + public function angle($angle) + { + $this->angle = $angle; + + return $this; + } + + /** + * Get rotation angle of text + * + * @return int + */ + public function getAngle() + { + return $this->angle; + } + + /** + * Set horizontal text alignment + * + * @param string $align + * @return self + */ + public function align($align) + { + $this->align = $align; + + return $this; + } + + /** + * Get horizontal text alignment + * + * @return string + */ + public function getAlign() + { + return $this->align; + } + + /** + * Set vertical text alignment + * + * @param string $valign + * @return self + */ + public function valign($valign) + { + $this->valign = $valign; + + return $this; + } + + /** + * Get vertical text alignment + * + * @return string + */ + public function getValign() + { + return $this->valign; + } + + /** + * Set text kerning + * + * @param string $kerning + * @return void + */ + public function kerning($kerning) + { + $this->kerning = $kerning; + } + + /** + * Get kerning + * + * @return float + */ + public function getKerning() + { + return $this->kerning; + } + + /** + * Set path to font file + * + * @param string $file + * @return self + */ + public function file($file) + { + $this->file = $file; + + return $this; + } + + /** + * Get path to font file + * + * @return string + */ + public function getFile() + { + return $this->file; + } + + /** + * Checks if current font has access to an applicable font file + * + * @return boolean + */ + protected function hasApplicableFontFile() + { + if (is_string($this->file)) { + return file_exists($this->file); + } + + return false; + } + + /** + * Counts lines of text to be written + * + * @return int + */ + public function countLines() + { + return count(explode(PHP_EOL, $this->text)); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractShape.php new file mode 100644 index 000000000..cd4a9f1c6 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/AbstractShape.php @@ -0,0 +1,71 @@ +background = $color; + } + + /** + * Set border width and color of current shape + * + * @param int $width + * @param string $color + * @return void + */ + public function border($width, $color = null) + { + $this->border_width = is_numeric($width) ? intval($width) : 0; + $this->border_color = is_null($color) ? '#000000' : $color; + } + + /** + * Determines if current shape has border + * + * @return boolean + */ + public function hasBorder() + { + return ($this->border_width >= 1); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/AbstractCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/AbstractCommand.php new file mode 100644 index 000000000..e31078ceb --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/AbstractCommand.php @@ -0,0 +1,81 @@ +arguments = $arguments; + } + + /** + * Creates new argument instance from given argument key + * + * @param int $key + * @return \Intervention\Image\Commands\Argument + */ + public function argument($key) + { + return new Argument($this, $key); + } + + /** + * Returns output data of current command + * + * @return mixed + */ + public function getOutput() + { + return $this->output ? $this->output : null; + } + + /** + * Determines if current instance has output data + * + * @return boolean + */ + public function hasOutput() + { + return ! is_null($this->output); + } + + /** + * Sets output data of current command + * + * @param mixed $value + */ + public function setOutput($value) + { + $this->output = $value; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/Argument.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/Argument.php new file mode 100644 index 000000000..9538199f6 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/Argument.php @@ -0,0 +1,225 @@ +command = $command; + $this->key = $key; + } + + /** + * Returns name of current arguments command + * + * @return string + */ + public function getCommandName() + { + preg_match("/\\\\([\w]+)Command$/", get_class($this->command), $matches); + return isset($matches[1]) ? lcfirst($matches[1]).'()' : 'Method'; + } + + /** + * Returns value of current argument + * + * @param mixed $default + * @return mixed + */ + public function value($default = null) + { + $arguments = $this->command->arguments; + + if (is_array($arguments)) { + return isset($arguments[$this->key]) ? $arguments[$this->key] : $default; + } + + return $default; + } + + /** + * Defines current argument as required + * + * @return \Intervention\Image\Commands\Argument + */ + public function required() + { + if ( ! array_key_exists($this->key, $this->command->arguments)) { + throw new InvalidArgumentException( + sprintf("Missing argument %d for %s", $this->key + 1, $this->getCommandName()) + ); + } + + return $this; + } + + /** + * Determines that current argument must be of given type + * + * @return \Intervention\Image\Commands\Argument + */ + public function type($type) + { + $valid = true; + $value = $this->value(); + + if ($value === null) { + return $this; + } + + switch (strtolower($type)) { + case 'bool': + case 'boolean': + $valid = \is_bool($value); + $message = '%s accepts only boolean values as argument %d.'; + break; + case 'int': + case 'integer': + $valid = \is_int($value); + $message = '%s accepts only integer values as argument %d.'; + break; + case 'num': + case 'numeric': + $valid = is_numeric($value); + $message = '%s accepts only numeric values as argument %d.'; + break; + case 'str': + case 'string': + $valid = \is_string($value); + $message = '%s accepts only string values as argument %d.'; + break; + case 'array': + $valid = \is_array($value); + $message = '%s accepts only array as argument %d.'; + break; + case 'closure': + $valid = is_a($value, '\Closure'); + $message = '%s accepts only Closure as argument %d.'; + break; + case 'digit': + $valid = $this->isDigit($value); + $message = '%s accepts only integer values as argument %d.'; + break; + } + + if (! $valid) { + $commandName = $this->getCommandName(); + $argument = $this->key + 1; + + if (isset($message)) { + $message = sprintf($message, $commandName, $argument); + } else { + $message = sprintf('Missing argument for %d.', $argument); + } + + throw new InvalidArgumentException( + $message + ); + } + + return $this; + } + + /** + * Determines that current argument value must be numeric between given values + * + * @return \Intervention\Image\Commands\Argument + */ + public function between($x, $y) + { + $value = $this->type('numeric')->value(); + + if (is_null($value)) { + return $this; + } + + $alpha = min($x, $y); + $omega = max($x, $y); + + if ($value < $alpha || $value > $omega) { + throw new InvalidArgumentException( + sprintf('Argument %d must be between %s and %s.', $this->key, $x, $y) + ); + } + + return $this; + } + + /** + * Determines that current argument must be over a minimum value + * + * @return \Intervention\Image\Commands\Argument + */ + public function min($value) + { + $v = $this->type('numeric')->value(); + + if (is_null($v)) { + return $this; + } + + if ($v < $value) { + throw new InvalidArgumentException( + sprintf('Argument %d must be at least %s.', $this->key, $value) + ); + } + + return $this; + } + + /** + * Determines that current argument must be under a maxiumum value + * + * @return \Intervention\Image\Commands\Argument + */ + public function max($value) + { + $v = $this->type('numeric')->value(); + + if (is_null($v)) { + return $this; + } + + if ($v > $value) { + throw new InvalidArgumentException( + sprintf('Argument %d may not be greater than %s.', $this->key, $value) + ); + } + + return $this; + } + + /** + * Checks if value is "PHP" integer (120 but also 120.0) + * + * @param mixed $value + * @return boolean + */ + private function isDigit($value) + { + return is_numeric($value) ? intval($value) == $value : false; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ChecksumCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ChecksumCommand.php new file mode 100644 index 000000000..9acc40308 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ChecksumCommand.php @@ -0,0 +1,29 @@ +getSize(); + + for ($x=0; $x <= ($size->width-1); $x++) { + for ($y=0; $y <= ($size->height-1); $y++) { + $colors[] = $image->pickColor($x, $y, 'array'); + } + } + + $this->setOutput(md5(serialize($colors))); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/CircleCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/CircleCommand.php new file mode 100644 index 000000000..c627818e3 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/CircleCommand.php @@ -0,0 +1,35 @@ +argument(0)->type('numeric')->required()->value(); + $x = $this->argument(1)->type('numeric')->required()->value(); + $y = $this->argument(2)->type('numeric')->required()->value(); + $callback = $this->argument(3)->type('closure')->value(); + + $circle_classname = sprintf('\Intervention\Image\%s\Shapes\CircleShape', + $image->getDriver()->getDriverName()); + + $circle = new $circle_classname($diameter); + + if ($callback instanceof Closure) { + $callback($circle); + } + + $circle->applyToImage($image, $x, $y); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/EllipseCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/EllipseCommand.php new file mode 100644 index 000000000..4637e0205 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/EllipseCommand.php @@ -0,0 +1,36 @@ +argument(0)->type('numeric')->required()->value(); + $height = $this->argument(1)->type('numeric')->required()->value(); + $x = $this->argument(2)->type('numeric')->required()->value(); + $y = $this->argument(3)->type('numeric')->required()->value(); + $callback = $this->argument(4)->type('closure')->value(); + + $ellipse_classname = sprintf('\Intervention\Image\%s\Shapes\EllipseShape', + $image->getDriver()->getDriverName()); + + $ellipse = new $ellipse_classname($width, $height); + + if ($callback instanceof Closure) { + $callback($ellipse); + } + + $ellipse->applyToImage($image, $x, $y); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ExifCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ExifCommand.php new file mode 100644 index 000000000..063df6ef6 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ExifCommand.php @@ -0,0 +1,61 @@ +argument(0)->value(); + + // try to read exif data from image file + try { + if ($image->dirname && $image->basename) { + $stream = $image->dirname . '/' . $image->basename; + } elseif (version_compare(PHP_VERSION, '7.2.0', '>=')) { + // https://www.php.net/manual/en/function.exif-read-data.php#refsect1-function.exif-read-data-changelog + $stream = $image->stream()->detach(); + } else { + // https://bugs.php.net/bug.php?id=65187 + $stream = $image->encode('data-url')->encoded; + } + + $data = @exif_read_data($stream); + + if (!is_null($key) && is_array($data)) { + $data = array_key_exists($key, $data) ? $data[$key] : false; + } + + } catch (\Exception $e) { + throw new NotReadableException( + sprintf( + "Cannot read the Exif data from the filename (%s) provided ", + $image->dirname . '/' . $image->basename + ), + $e->getCode(), + $e + ); + } + + $this->setOutput($data); + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/IptcCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/IptcCommand.php new file mode 100644 index 000000000..b78a2a8e4 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/IptcCommand.php @@ -0,0 +1,68 @@ +argument(0)->value(); + + $info = []; + @getimagesize($image->dirname .'/'. $image->basename, $info); + + $data = []; + + if (array_key_exists('APP13', $info)) { + $iptc = iptcparse($info['APP13']); + + if (is_array($iptc)) { + $data['DocumentTitle'] = isset($iptc["2#005"][0]) ? $iptc["2#005"][0] : null; + $data['Urgency'] = isset($iptc["2#010"][0]) ? $iptc["2#010"][0] : null; + $data['Category'] = isset($iptc["2#015"][0]) ? $iptc["2#015"][0] : null; + $data['Subcategories'] = isset($iptc["2#020"][0]) ? $iptc["2#020"][0] : null; + $data['Keywords'] = isset($iptc["2#025"][0]) ? $iptc["2#025"] : null; + $data['ReleaseDate'] = isset($iptc["2#030"][0]) ? $iptc["2#030"][0] : null; + $data['ReleaseTime'] = isset($iptc["2#035"][0]) ? $iptc["2#035"][0] : null; + $data['SpecialInstructions'] = isset($iptc["2#040"][0]) ? $iptc["2#040"][0] : null; + $data['CreationDate'] = isset($iptc["2#055"][0]) ? $iptc["2#055"][0] : null; + $data['CreationTime'] = isset($iptc["2#060"][0]) ? $iptc["2#060"][0] : null; + $data['AuthorByline'] = isset($iptc["2#080"][0]) ? $iptc["2#080"][0] : null; + $data['AuthorTitle'] = isset($iptc["2#085"][0]) ? $iptc["2#085"][0] : null; + $data['City'] = isset($iptc["2#090"][0]) ? $iptc["2#090"][0] : null; + $data['SubLocation'] = isset($iptc["2#092"][0]) ? $iptc["2#092"][0] : null; + $data['State'] = isset($iptc["2#095"][0]) ? $iptc["2#095"][0] : null; + $data['Country'] = isset($iptc["2#101"][0]) ? $iptc["2#101"][0] : null; + $data['OTR'] = isset($iptc["2#103"][0]) ? $iptc["2#103"][0] : null; + $data['Headline'] = isset($iptc["2#105"][0]) ? $iptc["2#105"][0] : null; + $data['Source'] = isset($iptc["2#110"][0]) ? $iptc["2#110"][0] : null; + $data['PhotoSource'] = isset($iptc["2#115"][0]) ? $iptc["2#115"][0] : null; + $data['Copyright'] = isset($iptc["2#116"][0]) ? $iptc["2#116"][0] : null; + $data['Caption'] = isset($iptc["2#120"][0]) ? $iptc["2#120"][0] : null; + $data['CaptionWriter'] = isset($iptc["2#122"][0]) ? $iptc["2#122"][0] : null; + } + } + + if (! is_null($key) && is_array($data)) { + $data = array_key_exists($key, $data) ? $data[$key] : false; + } + + $this->setOutput($data); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/LineCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/LineCommand.php new file mode 100644 index 000000000..a068c662a --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/LineCommand.php @@ -0,0 +1,36 @@ +argument(0)->type('numeric')->required()->value(); + $y1 = $this->argument(1)->type('numeric')->required()->value(); + $x2 = $this->argument(2)->type('numeric')->required()->value(); + $y2 = $this->argument(3)->type('numeric')->required()->value(); + $callback = $this->argument(4)->type('closure')->value(); + + $line_classname = sprintf('\Intervention\Image\%s\Shapes\LineShape', + $image->getDriver()->getDriverName()); + + $line = new $line_classname($x2, $y2); + + if ($callback instanceof Closure) { + $callback($line); + } + + $line->applyToImage($image, $x1, $y1); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/OrientateCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/OrientateCommand.php new file mode 100644 index 000000000..552482cb4 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/OrientateCommand.php @@ -0,0 +1,48 @@ +exif('Orientation')) { + + case 2: + $image->flip(); + break; + + case 3: + $image->rotate(180); + break; + + case 4: + $image->rotate(180)->flip(); + break; + + case 5: + $image->rotate(270)->flip(); + break; + + case 6: + $image->rotate(270); + break; + + case 7: + $image->rotate(90)->flip(); + break; + + case 8: + $image->rotate(90); + break; + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/PolygonCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/PolygonCommand.php new file mode 100644 index 000000000..a2fa99788 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/PolygonCommand.php @@ -0,0 +1,49 @@ +argument(0)->type('array')->required()->value(); + $callback = $this->argument(1)->type('closure')->value(); + + $vertices_count = count($points); + + // check if number if coordinates is even + if ($vertices_count % 2 !== 0) { + throw new InvalidArgumentException( + "The number of given polygon vertices must be even." + ); + } + + if ($vertices_count < 6) { + throw new InvalidArgumentException( + "You must have at least 3 points in your array." + ); + } + + $polygon_classname = sprintf('\Intervention\Image\%s\Shapes\PolygonShape', + $image->getDriver()->getDriverName()); + + $polygon = new $polygon_classname($points); + + if ($callback instanceof Closure) { + $callback($polygon); + } + + $polygon->applyToImage($image); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/PsrResponseCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/PsrResponseCommand.php new file mode 100644 index 000000000..d75cd903b --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/PsrResponseCommand.php @@ -0,0 +1,45 @@ +argument(0)->value(); + $quality = $this->argument(1)->between(0, 100)->value(); + + //Encoded property will be populated at this moment + $stream = $image->stream($format, $quality); + + $mimetype = finfo_buffer( + finfo_open(FILEINFO_MIME_TYPE), + $image->getEncoded() + ); + + $this->setOutput(new Response( + 200, + [ + 'Content-Type' => $mimetype, + 'Content-Length' => strlen($image->getEncoded()) + ], + $stream + )); + + return true; + } +} \ No newline at end of file diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/RectangleCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/RectangleCommand.php new file mode 100644 index 000000000..24378b386 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/RectangleCommand.php @@ -0,0 +1,36 @@ +argument(0)->type('numeric')->required()->value(); + $y1 = $this->argument(1)->type('numeric')->required()->value(); + $x2 = $this->argument(2)->type('numeric')->required()->value(); + $y2 = $this->argument(3)->type('numeric')->required()->value(); + $callback = $this->argument(4)->type('closure')->value(); + + $rectangle_classname = sprintf('\Intervention\Image\%s\Shapes\RectangleShape', + $image->getDriver()->getDriverName()); + + $rectangle = new $rectangle_classname($x1, $y1, $x2, $y2); + + if ($callback instanceof Closure) { + $callback($rectangle); + } + + $rectangle->applyToImage($image, $x1, $y1); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ResponseCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ResponseCommand.php new file mode 100644 index 000000000..7903b5af4 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/ResponseCommand.php @@ -0,0 +1,26 @@ +argument(0)->value(); + $quality = $this->argument(1)->between(0, 100)->value(); + + $response = new Response($image, $format, $quality); + + $this->setOutput($response->make()); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/StreamCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/StreamCommand.php new file mode 100644 index 000000000..bc2ff9efb --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/StreamCommand.php @@ -0,0 +1,39 @@ +argument(0)->value(); + $quality = $this->argument(1)->between(0, 100)->value(); + $data = $image->encode($format, $quality)->getEncoded(); + + $this->setOutput($this->getStream($data)); + + return true; + } + + /** + * Create stream from given data + * + * @param string $data + * @return \Psr\Http\Message\StreamInterface + */ + protected function getStream($data) + { + if (class_exists(\GuzzleHttp\Psr7\Utils::class)) { + return \GuzzleHttp\Psr7\Utils::streamFor($data); // guzzlehttp/psr7 >= 2.0 + } + + return \GuzzleHttp\Psr7\stream_for($data); // guzzlehttp/psr7 < 2.0 + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/TextCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/TextCommand.php new file mode 100644 index 000000000..3c60b4e77 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Commands/TextCommand.php @@ -0,0 +1,34 @@ +argument(0)->required()->value(); + $x = $this->argument(1)->type('numeric')->value(0); + $y = $this->argument(2)->type('numeric')->value(0); + $callback = $this->argument(3)->type('closure')->value(); + + $fontclassname = sprintf('\Intervention\Image\%s\Font', + $image->getDriver()->getDriverName()); + + $font = new $fontclassname($text); + + if ($callback instanceof Closure) { + $callback($font); + } + + $font->applyToImage($image, $x, $y); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Constraint.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Constraint.php new file mode 100644 index 000000000..44bdd67a6 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Constraint.php @@ -0,0 +1,92 @@ +size = $size; + } + + /** + * Returns current size of constraint + * + * @return \Intervention\Image\Size + */ + public function getSize() + { + return $this->size; + } + + /** + * Fix the given argument in current constraint + * + * @param int $type + * @return void + */ + public function fix($type) + { + $this->fixed = ($this->fixed & ~(1 << $type)) | (1 << $type); + } + + /** + * Checks if given argument is fixed in current constraint + * + * @param int $type + * @return boolean + */ + public function isFixed($type) + { + return (bool) ($this->fixed & (1 << $type)); + } + + /** + * Fixes aspect ratio in current constraint + * + * @return void + */ + public function aspectRatio() + { + $this->fix(self::ASPECTRATIO); + } + + /** + * Fixes possibility to size up in current constraint + * + * @return void + */ + public function upsize() + { + $this->fix(self::UPSIZE); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Exception/ImageException.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Exception/ImageException.php new file mode 100644 index 000000000..83e6b91f2 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Exception/ImageException.php @@ -0,0 +1,8 @@ +dirname = array_key_exists('dirname', $info) ? $info['dirname'] : null; + $this->basename = array_key_exists('basename', $info) ? $info['basename'] : null; + $this->extension = array_key_exists('extension', $info) ? $info['extension'] : null; + $this->filename = array_key_exists('filename', $info) ? $info['filename'] : null; + + if (file_exists($path) && is_file($path)) { + $this->mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path); + } + + return $this; + } + + /** + * Get file size + * + * @return mixed + */ + public function filesize() + { + $path = $this->basePath(); + + if (file_exists($path) && is_file($path)) { + return filesize($path); + } + + return false; + } + + /** + * Get fully qualified path + * + * @return string + */ + public function basePath() + { + if ($this->dirname && $this->basename) { + return ($this->dirname .'/'. $this->basename); + } + + return null; + } + +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Filters/DemoFilter.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Filters/DemoFilter.php new file mode 100644 index 000000000..4e8f92b82 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Filters/DemoFilter.php @@ -0,0 +1,44 @@ +size = is_numeric($size) ? intval($size) : self::DEFAULT_SIZE; + } + + /** + * Applies filter effects to given image + * + * @param \Intervention\Image\Image $image + * @return \Intervention\Image\Image + */ + public function applyFilter(Image $image) + { + $image->pixelate($this->size); + $image->greyscale(); + + return $image; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Filters/FilterInterface.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Filters/FilterInterface.php new file mode 100644 index 000000000..88f6cbfe0 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Filters/FilterInterface.php @@ -0,0 +1,16 @@ +a = ($value >> 24) & 0xFF; + $this->r = ($value >> 16) & 0xFF; + $this->g = ($value >> 8) & 0xFF; + $this->b = $value & 0xFF; + } + + /** + * Initiates color object from given array + * + * @param array $value + * @return \Intervention\Image\AbstractColor + */ + public function initFromArray($array) + { + $array = array_values($array); + + if (count($array) == 4) { + + // color array with alpha value + list($r, $g, $b, $a) = $array; + $this->a = $this->alpha2gd($a); + + } elseif (count($array) == 3) { + + // color array without alpha value + list($r, $g, $b) = $array; + $this->a = 0; + + } + + $this->r = $r; + $this->g = $g; + $this->b = $b; + } + + /** + * Initiates color object from given string + * + * @param string $value + * @return \Intervention\Image\AbstractColor + */ + public function initFromString($value) + { + if ($color = $this->rgbaFromString($value)) { + $this->r = $color[0]; + $this->g = $color[1]; + $this->b = $color[2]; + $this->a = $this->alpha2gd($color[3]); + } + } + + /** + * Initiates color object from given R, G and B values + * + * @param int $r + * @param int $g + * @param int $b + * @return \Intervention\Image\AbstractColor + */ + public function initFromRgb($r, $g, $b) + { + $this->r = intval($r); + $this->g = intval($g); + $this->b = intval($b); + $this->a = 0; + } + + /** + * Initiates color object from given R, G, B and A values + * + * @param int $r + * @param int $g + * @param int $b + * @param float $a + * @return \Intervention\Image\AbstractColor + */ + public function initFromRgba($r, $g, $b, $a = 1) + { + $this->r = intval($r); + $this->g = intval($g); + $this->b = intval($b); + $this->a = $this->alpha2gd($a); + } + + /** + * Initiates color object from given ImagickPixel object + * + * @param ImagickPixel $value + * @return \Intervention\Image\AbstractColor + */ + public function initFromObject($value) + { + throw new NotSupportedException( + "GD colors cannot init from ImagickPixel objects." + ); + } + + /** + * Calculates integer value of current color instance + * + * @return int + */ + public function getInt() + { + return ($this->a << 24) + ($this->r << 16) + ($this->g << 8) + $this->b; + } + + /** + * Calculates hexadecimal value of current color instance + * + * @param string $prefix + * @return string + */ + public function getHex($prefix = '') + { + return sprintf('%s%02x%02x%02x', $prefix, $this->r, $this->g, $this->b); + } + + /** + * Calculates RGB(A) in array format of current color instance + * + * @return array + */ + public function getArray() + { + return [$this->r, $this->g, $this->b, round(1 - $this->a / 127, 2)]; + } + + /** + * Calculates RGBA in string format of current color instance + * + * @return string + */ + public function getRgba() + { + return sprintf('rgba(%d, %d, %d, %.2F)', $this->r, $this->g, $this->b, round(1 - $this->a / 127, 2)); + } + + /** + * Determines if current color is different from given color + * + * @param AbstractColor $color + * @param int $tolerance + * @return boolean + */ + public function differs(AbstractColor $color, $tolerance = 0) + { + $color_tolerance = round($tolerance * 2.55); + $alpha_tolerance = round($tolerance * 1.27); + + $delta = [ + 'r' => abs($color->r - $this->r), + 'g' => abs($color->g - $this->g), + 'b' => abs($color->b - $this->b), + 'a' => abs($color->a - $this->a) + ]; + + return ( + $delta['r'] > $color_tolerance or + $delta['g'] > $color_tolerance or + $delta['b'] > $color_tolerance or + $delta['a'] > $alpha_tolerance + ); + } + + /** + * Convert rgba alpha (0-1) value to gd value (0-127) + * + * @param float $input + * @return int + */ + private function alpha2gd($input) + { + $oldMin = 0; + $oldMax = 1; + + $newMin = 127; + $newMax = 0; + + return ceil(((($input- $oldMin) * ($newMax - $newMin)) / ($oldMax - $oldMin)) + $newMin); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BackupCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BackupCommand.php new file mode 100644 index 000000000..310dc03a9 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BackupCommand.php @@ -0,0 +1,25 @@ +argument(0)->value(); + + // clone current image resource + $clone = clone $image; + $image->setBackup($clone->getCore(), $backupName); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BlurCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BlurCommand.php new file mode 100644 index 000000000..c4fca0eae --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BlurCommand.php @@ -0,0 +1,25 @@ +argument(0)->between(0, 100)->value(1); + + for ($i=0; $i < intval($amount); $i++) { + imagefilter($image->getCore(), IMG_FILTER_GAUSSIAN_BLUR); + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BrightnessCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BrightnessCommand.php new file mode 100644 index 000000000..4e48464b1 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BrightnessCommand.php @@ -0,0 +1,21 @@ +argument(0)->between(-100, 100)->required()->value(); + + return imagefilter($image->getCore(), IMG_FILTER_BRIGHTNESS, ($level * 2.55)); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ColorizeCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ColorizeCommand.php new file mode 100644 index 000000000..410917b33 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ColorizeCommand.php @@ -0,0 +1,29 @@ +argument(0)->between(-100, 100)->required()->value(); + $green = $this->argument(1)->between(-100, 100)->required()->value(); + $blue = $this->argument(2)->between(-100, 100)->required()->value(); + + // normalize colorize levels + $red = round($red * 2.55); + $green = round($green * 2.55); + $blue = round($blue * 2.55); + + // apply filter + return imagefilter($image->getCore(), IMG_FILTER_COLORIZE, $red, $green, $blue); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ContrastCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ContrastCommand.php new file mode 100644 index 000000000..916c41f82 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ContrastCommand.php @@ -0,0 +1,21 @@ +argument(0)->between(-100, 100)->required()->value(); + + return imagefilter($image->getCore(), IMG_FILTER_CONTRAST, ($level * -1)); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/CropCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/CropCommand.php new file mode 100644 index 000000000..b7f595421 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/CropCommand.php @@ -0,0 +1,40 @@ +argument(0)->type('digit')->required()->value(); + $height = $this->argument(1)->type('digit')->required()->value(); + $x = $this->argument(2)->type('digit')->value(); + $y = $this->argument(3)->type('digit')->value(); + + if (is_null($width) || is_null($height)) { + throw new \Intervention\Image\Exception\InvalidArgumentException( + "Width and height of cutout needs to be defined." + ); + } + + $cropped = new Size($width, $height); + $position = new Point($x, $y); + + // align boxes + if (is_null($x) && is_null($y)) { + $position = $image->getSize()->align('center')->relativePosition($cropped->align('center')); + } + + // crop image core + return $this->modify($image, 0, 0, $position->x, $position->y, $cropped->width, $cropped->height, $cropped->width, $cropped->height); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/DestroyCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/DestroyCommand.php new file mode 100644 index 000000000..4503d10fe --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/DestroyCommand.php @@ -0,0 +1,27 @@ +getCore()); + + // destroy backups + foreach ($image->getBackups() as $backup) { + imagedestroy($backup); + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FillCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FillCommand.php new file mode 100644 index 000000000..cf1908210 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FillCommand.php @@ -0,0 +1,69 @@ +argument(0)->value(); + $x = $this->argument(1)->type('digit')->value(); + $y = $this->argument(2)->type('digit')->value(); + + $width = $image->getWidth(); + $height = $image->getHeight(); + $resource = $image->getCore(); + + try { + + // set image tile filling + $source = new Decoder; + $tile = $source->init($filling); + imagesettile($image->getCore(), $tile->getCore()); + $filling = IMG_COLOR_TILED; + + } catch (\Intervention\Image\Exception\NotReadableException $e) { + + // set solid color filling + $color = new Color($filling); + $filling = $color->getInt(); + } + + imagealphablending($resource, true); + + if (is_int($x) && is_int($y)) { + + // resource should be visible through transparency + $base = $image->getDriver()->newImage($width, $height)->getCore(); + imagecopy($base, $resource, 0, 0, 0, 0, $width, $height); + + // floodfill if exact position is defined + imagefill($resource, $x, $y, $filling); + + // copy filled original over base + imagecopy($base, $resource, 0, 0, 0, 0, $width, $height); + + // set base as new resource-core + $image->setCore($base); + imagedestroy($resource); + + } else { + // fill whole image otherwise + imagefilledrectangle($resource, 0, 0, $width - 1, $height - 1, $filling); + } + + isset($tile) ? imagedestroy($tile->getCore()) : null; + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FitCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FitCommand.php new file mode 100644 index 000000000..d861ad94c --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FitCommand.php @@ -0,0 +1,32 @@ +argument(0)->type('digit')->required()->value(); + $height = $this->argument(1)->type('digit')->value($width); + $constraints = $this->argument(2)->type('closure')->value(); + $position = $this->argument(3)->type('string')->value('center'); + + // calculate size + $cropped = $image->getSize()->fit(new Size($width, $height), $position); + $resized = clone $cropped; + $resized = $resized->resize($width, $height, $constraints); + + // modify image + $this->modify($image, 0, 0, $cropped->pivot->x, $cropped->pivot->y, $resized->getWidth(), $resized->getHeight(), $cropped->getWidth(), $cropped->getHeight()); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FlipCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FlipCommand.php new file mode 100644 index 000000000..aa8f230e8 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/FlipCommand.php @@ -0,0 +1,37 @@ +argument(0)->value('h'); + + $size = $image->getSize(); + $dst = clone $size; + + switch (strtolower($mode)) { + case 2: + case 'v': + case 'vert': + case 'vertical': + $size->pivot->y = $size->height - 1; + $size->height = $size->height * (-1); + break; + + default: + $size->pivot->x = $size->width - 1; + $size->width = $size->width * (-1); + break; + } + + return $this->modify($image, 0, 0, $size->pivot->x, $size->pivot->y, $dst->width, $dst->height, $size->width, $size->height); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GammaCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GammaCommand.php new file mode 100644 index 000000000..7de0fb8a1 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GammaCommand.php @@ -0,0 +1,21 @@ +argument(0)->type('numeric')->required()->value(); + + return imagegammacorrect($image->getCore(), 1, $gamma); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GetSizeCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GetSizeCommand.php new file mode 100644 index 000000000..9eb7e2092 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GetSizeCommand.php @@ -0,0 +1,25 @@ +setOutput(new Size( + imagesx($image->getCore()), + imagesy($image->getCore()) + )); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GreyscaleCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GreyscaleCommand.php new file mode 100644 index 000000000..12921e79e --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/GreyscaleCommand.php @@ -0,0 +1,19 @@ +getCore(), IMG_FILTER_GRAYSCALE); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/HeightenCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/HeightenCommand.php new file mode 100644 index 000000000..d31e9cde0 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/HeightenCommand.php @@ -0,0 +1,28 @@ +argument(0)->type('digit')->required()->value(); + $additionalConstraints = $this->argument(1)->type('closure')->value(); + + $this->arguments[0] = null; + $this->arguments[1] = $height; + $this->arguments[2] = function ($constraint) use ($additionalConstraints) { + $constraint->aspectRatio(); + if(is_callable($additionalConstraints)) + $additionalConstraints($constraint); + }; + + return parent::execute($image); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InsertCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InsertCommand.php new file mode 100644 index 000000000..47c770398 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InsertCommand.php @@ -0,0 +1,34 @@ +argument(0)->required()->value(); + $position = $this->argument(1)->type('string')->value(); + $x = $this->argument(2)->type('digit')->value(0); + $y = $this->argument(3)->type('digit')->value(0); + + // build watermark + $watermark = $image->getDriver()->init($source); + + // define insertion point + $image_size = $image->getSize()->align($position, $x, $y); + $watermark_size = $watermark->getSize()->align($position); + $target = $image_size->relativePosition($watermark_size); + + // insert image at position + imagealphablending($image->getCore(), true); + return imagecopy($image->getCore(), $watermark->getCore(), $target->x, $target->y, 0, 0, $watermark_size->width, $watermark_size->height); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InterlaceCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InterlaceCommand.php new file mode 100644 index 000000000..e3461cb07 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InterlaceCommand.php @@ -0,0 +1,23 @@ +argument(0)->type('bool')->value(true); + + imageinterlace($image->getCore(), $mode); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InvertCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InvertCommand.php new file mode 100644 index 000000000..1a514f1d4 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/InvertCommand.php @@ -0,0 +1,19 @@ +getCore(), IMG_FILTER_NEGATE); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/LimitColorsCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/LimitColorsCommand.php new file mode 100644 index 000000000..0baed7e91 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/LimitColorsCommand.php @@ -0,0 +1,53 @@ +argument(0)->value(); + $matte = $this->argument(1)->value(); + + // get current image size + $size = $image->getSize(); + + // create empty canvas + $resource = imagecreatetruecolor($size->width, $size->height); + + // define matte + if (is_null($matte)) { + $matte = imagecolorallocatealpha($resource, 255, 255, 255, 127); + } else { + $matte = $image->getDriver()->parseColor($matte)->getInt(); + } + + // fill with matte and copy original image + imagefill($resource, 0, 0, $matte); + + // set transparency + imagecolortransparent($resource, $matte); + + // copy original image + imagecopy($resource, $image->getCore(), 0, 0, 0, 0, $size->width, $size->height); + + if (is_numeric($count) && $count <= 256) { + // decrease colors + imagetruecolortopalette($resource, true, $count); + } + + // set new resource + $image->setCore($resource); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/MaskCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/MaskCommand.php new file mode 100644 index 000000000..4c61429b2 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/MaskCommand.php @@ -0,0 +1,83 @@ +argument(0)->value(); + $mask_w_alpha = $this->argument(1)->type('bool')->value(false); + + $image_size = $image->getSize(); + + // create empty canvas + $canvas = $image->getDriver()->newImage($image_size->width, $image_size->height, [0,0,0,0]); + + // build mask image from source + $mask = $image->getDriver()->init($mask_source); + $mask_size = $mask->getSize(); + + // resize mask to size of current image (if necessary) + if ($mask_size != $image_size) { + $mask->resize($image_size->width, $image_size->height); + } + + imagealphablending($canvas->getCore(), false); + + if ( ! $mask_w_alpha) { + // mask from greyscale image + imagefilter($mask->getCore(), IMG_FILTER_GRAYSCALE); + } + + // redraw old image pixel by pixel considering alpha map + for ($x=0; $x < $image_size->width; $x++) { + for ($y=0; $y < $image_size->height; $y++) { + + $color = $image->pickColor($x, $y, 'array'); + $alpha = $mask->pickColor($x, $y, 'array'); + + if ($mask_w_alpha) { + $alpha = $alpha[3]; // use alpha channel as mask + } else { + + if ($alpha[3] == 0) { // transparent as black + $alpha = 0; + } else { + + // $alpha = floatval(round((($alpha[0] + $alpha[1] + $alpha[3]) / 3) / 255, 2)); + + // image is greyscale, so channel doesn't matter (use red channel) + $alpha = floatval(round($alpha[0] / 255, 2)); + } + + } + + // preserve alpha of original image... + if ($color[3] < $alpha) { + $alpha = $color[3]; + } + + // replace alpha value + $color[3] = $alpha; + + // redraw pixel + $canvas->pixel($color, $x, $y); + } + } + + + // replace current image with masked instance + $image->setCore($canvas->getCore()); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/OpacityCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/OpacityCommand.php new file mode 100644 index 000000000..48492d24f --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/OpacityCommand.php @@ -0,0 +1,31 @@ +argument(0)->between(0, 100)->required()->value(); + + // get size of image + $size = $image->getSize(); + + // build temp alpha mask + $mask_color = sprintf('rgba(0, 0, 0, %.1F)', $transparency / 100); + $mask = $image->getDriver()->newImage($size->width, $size->height, $mask_color); + + // mask image + $image->mask($mask->getCore(), true); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PickColorCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PickColorCommand.php new file mode 100644 index 000000000..bad96f498 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PickColorCommand.php @@ -0,0 +1,37 @@ +argument(0)->type('digit')->required()->value(); + $y = $this->argument(1)->type('digit')->required()->value(); + $format = $this->argument(2)->type('string')->value('array'); + + // pick color + $color = imagecolorat($image->getCore(), $x, $y); + + if ( ! imageistruecolor($image->getCore())) { + $color = imagecolorsforindex($image->getCore(), $color); + $color['alpha'] = round(1 - $color['alpha'] / 127, 2); + } + + $color = new Color($color); + + // format to output + $this->setOutput($color->format($format)); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelCommand.php new file mode 100644 index 000000000..2a90ce34f --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelCommand.php @@ -0,0 +1,25 @@ +argument(0)->required()->value(); + $color = new Color($color); + $x = $this->argument(1)->type('digit')->required()->value(); + $y = $this->argument(2)->type('digit')->required()->value(); + + return imagesetpixel($image->getCore(), $x, $y, $color->getInt()); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelateCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelateCommand.php new file mode 100644 index 000000000..0934797a8 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/PixelateCommand.php @@ -0,0 +1,21 @@ +argument(0)->type('digit')->value(10); + + return imagefilter($image->getCore(), IMG_FILTER_PIXELATE, $size, true); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResetCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResetCommand.php new file mode 100644 index 000000000..a68b75eaf --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResetCommand.php @@ -0,0 +1,39 @@ +argument(0)->value(); + $backup = $image->getBackup($backupName); + + if (is_resource($backup) || $backup instanceof \GdImage) { + + // destroy current resource + imagedestroy($image->getCore()); + + // clone backup + $backup = $image->getDriver()->cloneCore($backup); + + // reset to new resource + $image->setCore($backup); + + return true; + } + + throw new RuntimeException( + "Backup not available. Call backup() before reset()." + ); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCanvasCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCanvasCommand.php new file mode 100644 index 000000000..73f3df308 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCanvasCommand.php @@ -0,0 +1,83 @@ +argument(0)->type('digit')->required()->value(); + $height = $this->argument(1)->type('digit')->required()->value(); + $anchor = $this->argument(2)->value('center'); + $relative = $this->argument(3)->type('boolean')->value(false); + $bgcolor = $this->argument(4)->value(); + + $original_width = $image->getWidth(); + $original_height = $image->getHeight(); + + // check of only width or height is set + $width = is_null($width) ? $original_width : intval($width); + $height = is_null($height) ? $original_height : intval($height); + + // check on relative width/height + if ($relative) { + $width = $original_width + $width; + $height = $original_height + $height; + } + + // check for negative width/height + $width = ($width <= 0) ? $width + $original_width : $width; + $height = ($height <= 0) ? $height + $original_height : $height; + + // create new canvas + $canvas = $image->getDriver()->newImage($width, $height, $bgcolor); + + // set copy position + $canvas_size = $canvas->getSize()->align($anchor); + $image_size = $image->getSize()->align($anchor); + $canvas_pos = $image_size->relativePosition($canvas_size); + $image_pos = $canvas_size->relativePosition($image_size); + + if ($width <= $original_width) { + $dst_x = 0; + $src_x = $canvas_pos->x; + $src_w = $canvas_size->width; + } else { + $dst_x = $image_pos->x; + $src_x = 0; + $src_w = $original_width; + } + + if ($height <= $original_height) { + $dst_y = 0; + $src_y = $canvas_pos->y; + $src_h = $canvas_size->height; + } else { + $dst_y = $image_pos->y; + $src_y = 0; + $src_h = $original_height; + } + + // make image area transparent to keep transparency + // even if background-color is set + $transparent = imagecolorallocatealpha($canvas->getCore(), 255, 255, 255, 127); + imagealphablending($canvas->getCore(), false); // do not blend / just overwrite + imagefilledrectangle($canvas->getCore(), $dst_x, $dst_y, $dst_x + $src_w - 1, $dst_y + $src_h - 1, $transparent); + + // copy image into new canvas + imagecopy($canvas->getCore(), $image->getCore(), $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); + + // set new core to canvas + $image->setCore($canvas->getCore()); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCommand.php new file mode 100644 index 000000000..e8ef7c753 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/ResizeCommand.php @@ -0,0 +1,84 @@ +argument(0)->value(); + $height = $this->argument(1)->value(); + $constraints = $this->argument(2)->type('closure')->value(); + + // resize box + $resized = $image->getSize()->resize($width, $height, $constraints); + + // modify image + $this->modify($image, 0, 0, 0, 0, $resized->getWidth(), $resized->getHeight(), $image->getWidth(), $image->getHeight()); + + return true; + } + + /** + * Wrapper function for 'imagecopyresampled' + * + * @param Image $image + * @param int $dst_x + * @param int $dst_y + * @param int $src_x + * @param int $src_y + * @param int $dst_w + * @param int $dst_h + * @param int $src_w + * @param int $src_h + * @return boolean + */ + protected function modify($image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) + { + // create new image + $modified = imagecreatetruecolor(intval($dst_w), intval($dst_h)); + + // get current image + $resource = $image->getCore(); + + // preserve transparency + $transIndex = imagecolortransparent($resource); + + if ($transIndex != -1) { + $rgba = imagecolorsforindex($modified, $transIndex); + $transColor = imagecolorallocatealpha($modified, $rgba['red'], $rgba['green'], $rgba['blue'], 127); + imagefill($modified, 0, 0, $transColor); + imagecolortransparent($modified, $transColor); + } else { + imagealphablending($modified, false); + imagesavealpha($modified, true); + } + + // copy content from resource + $result = imagecopyresampled( + $modified, + $resource, + $dst_x, + $dst_y, + $src_x, + $src_y, + intval($dst_w), + intval($dst_h), + $src_w, + $src_h + ); + + // set new content as recource + $image->setCore($modified); + + return $result; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/RotateCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/RotateCommand.php new file mode 100644 index 000000000..682ec0d4a --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/RotateCommand.php @@ -0,0 +1,30 @@ +argument(0)->type('numeric')->required()->value(); + $color = $this->argument(1)->value(); + $color = new Color($color); + + // restrict rotations beyond 360 degrees, since the end result is the same + $angle = fmod($angle, 360); + + // rotate image + $image->setCore(imagerotate($image->getCore(), $angle, $color->getInt())); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/SharpenCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/SharpenCommand.php new file mode 100644 index 000000000..782e56502 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/SharpenCommand.php @@ -0,0 +1,34 @@ +argument(0)->between(0, 100)->value(10); + + // build matrix + $min = $amount >= 10 ? $amount * -0.01 : 0; + $max = $amount * -0.025; + $abs = ((4 * $min + 4 * $max) * -1) + 1; + $div = 1; + + $matrix = [ + [$min, $max, $min], + [$max, $abs, $max], + [$min, $max, $min] + ]; + + // apply the matrix + return imageconvolution($image->getCore(), $matrix, $div, 0); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/TrimCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/TrimCommand.php new file mode 100644 index 000000000..2e3697527 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/TrimCommand.php @@ -0,0 +1,176 @@ +argument(0)->type('string')->value(); + $away = $this->argument(1)->value(); + $tolerance = $this->argument(2)->type('numeric')->value(0); + $feather = $this->argument(3)->type('numeric')->value(0); + + $width = $image->getWidth(); + $height = $image->getHeight(); + + // default values + $checkTransparency = false; + + // define borders to trim away + if (is_null($away)) { + $away = ['top', 'right', 'bottom', 'left']; + } elseif (is_string($away)) { + $away = [$away]; + } + + // lower border names + foreach ($away as $key => $value) { + $away[$key] = strtolower($value); + } + + // define base color position + switch (strtolower($base)) { + case 'transparent': + case 'trans': + $checkTransparency = true; + $base_x = 0; + $base_y = 0; + break; + + case 'bottom-right': + case 'right-bottom': + $base_x = $width - 1; + $base_y = $height - 1; + break; + + default: + case 'top-left': + case 'left-top': + $base_x = 0; + $base_y = 0; + break; + } + + // pick base color + if ($checkTransparency) { + $color = new Color; // color will only be used to compare alpha channel + } else { + $color = $image->pickColor($base_x, $base_y, 'object'); + } + + $top_x = 0; + $top_y = 0; + $bottom_x = $width; + $bottom_y = $height; + + // search upper part of image for colors to trim away + if (in_array('top', $away)) { + + for ($y=0; $y < ceil($height/2); $y++) { + for ($x=0; $x < $width; $x++) { + + $checkColor = $image->pickColor($x, $y, 'object'); + + if ($checkTransparency) { + $checkColor->r = $color->r; + $checkColor->g = $color->g; + $checkColor->b = $color->b; + } + + if ($color->differs($checkColor, $tolerance)) { + $top_y = max(0, $y - $feather); + break 2; + } + + } + } + + } + + // search left part of image for colors to trim away + if (in_array('left', $away)) { + + for ($x=0; $x < ceil($width/2); $x++) { + for ($y=$top_y; $y < $height; $y++) { + + $checkColor = $image->pickColor($x, $y, 'object'); + + if ($checkTransparency) { + $checkColor->r = $color->r; + $checkColor->g = $color->g; + $checkColor->b = $color->b; + } + + if ($color->differs($checkColor, $tolerance)) { + $top_x = max(0, $x - $feather); + break 2; + } + + } + } + + } + + // search lower part of image for colors to trim away + if (in_array('bottom', $away)) { + + for ($y=($height-1); $y >= floor($height/2)-1; $y--) { + for ($x=$top_x; $x < $width; $x++) { + + $checkColor = $image->pickColor($x, $y, 'object'); + + if ($checkTransparency) { + $checkColor->r = $color->r; + $checkColor->g = $color->g; + $checkColor->b = $color->b; + } + + if ($color->differs($checkColor, $tolerance)) { + $bottom_y = min($height, $y+1 + $feather); + break 2; + } + + } + } + + } + + // search right part of image for colors to trim away + if (in_array('right', $away)) { + + for ($x=($width-1); $x >= floor($width/2)-1; $x--) { + for ($y=$top_y; $y < $bottom_y; $y++) { + + $checkColor = $image->pickColor($x, $y, 'object'); + + if ($checkTransparency) { + $checkColor->r = $color->r; + $checkColor->g = $color->g; + $checkColor->b = $color->b; + } + + if ($color->differs($checkColor, $tolerance)) { + $bottom_x = min($width, $x+1 + $feather); + break 2; + } + + } + } + + } + + + // trim parts of image + return $this->modify($image, 0, 0, $top_x, $top_y, ($bottom_x-$top_x), ($bottom_y-$top_y), ($bottom_x-$top_x), ($bottom_y-$top_y)); + + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/WidenCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/WidenCommand.php new file mode 100644 index 000000000..43000d5dc --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Commands/WidenCommand.php @@ -0,0 +1,28 @@ +argument(0)->type('digit')->required()->value(); + $additionalConstraints = $this->argument(1)->type('closure')->value(); + + $this->arguments[0] = $width; + $this->arguments[1] = null; + $this->arguments[2] = function ($constraint) use ($additionalConstraints) { + $constraint->aspectRatio(); + if(is_callable($additionalConstraints)) + $additionalConstraints($constraint); + }; + + return parent::execute($image); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php new file mode 100644 index 000000000..f5c34aa50 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php @@ -0,0 +1,171 @@ +gdResourceToTruecolor($core); + + // build image + $image = $this->initFromGdResource($core); + $image->mime = $mime; + $image->setFileInfoFromPath($path); + + return $image; + } + + /** + * Initiates new image from GD resource + * + * @param Resource $resource + * @return \Intervention\Image\Image + */ + public function initFromGdResource($resource) + { + return new Image(new Driver, $resource); + } + + /** + * Initiates new image from Imagick object + * + * @param Imagick $object + * @return \Intervention\Image\Image + */ + public function initFromImagick(\Imagick $object) + { + throw new NotSupportedException( + "Gd driver is unable to init from Imagick object." + ); + } + + /** + * Initiates new image from binary data + * + * @param string $data + * @return \Intervention\Image\Image + */ + public function initFromBinary($binary) + { + $resource = @imagecreatefromstring($binary); + + if ($resource === false) { + throw new NotReadableException( + "Unable to init from given binary data." + ); + } + + $image = $this->initFromGdResource($resource); + $image->mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $binary); + + return $image; + } + + /** + * Transform GD resource into Truecolor version + * + * @param resource $resource + * @return bool + */ + public function gdResourceToTruecolor(&$resource) + { + $width = imagesx($resource); + $height = imagesy($resource); + + // new canvas + $canvas = imagecreatetruecolor($width, $height); + + // fill with transparent color + imagealphablending($canvas, false); + $transparent = imagecolorallocatealpha($canvas, 255, 255, 255, 127); + imagefilledrectangle($canvas, 0, 0, $width, $height, $transparent); + imagecolortransparent($canvas, $transparent); + imagealphablending($canvas, true); + + // copy original + imagecopy($canvas, $resource, 0, 0, 0, 0, $width, $height); + imagedestroy($resource); + + $resource = $canvas; + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Driver.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Driver.php new file mode 100644 index 000000000..5f2f23ea3 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Driver.php @@ -0,0 +1,89 @@ +coreAvailable()) { + throw new NotSupportedException( + "GD Library extension not available with this PHP installation." + ); + } + + $this->decoder = $decoder ? $decoder : new Decoder; + $this->encoder = $encoder ? $encoder : new Encoder; + } + + /** + * Creates new image instance + * + * @param int $width + * @param int $height + * @param mixed $background + * @return \Intervention\Image\Image + */ + public function newImage($width, $height, $background = null) + { + // create empty resource + $core = imagecreatetruecolor($width, $height); + $image = new Image(new static, $core); + + // set background color + $background = new Color($background); + imagefill($image->getCore(), 0, 0, $background->getInt()); + + return $image; + } + + /** + * Reads given string into color object + * + * @param string $value + * @return AbstractColor + */ + public function parseColor($value) + { + return new Color($value); + } + + /** + * Checks if core module installation is available + * + * @return boolean + */ + protected function coreAvailable() + { + return (extension_loaded('gd') && function_exists('gd_info')); + } + + /** + * Returns clone of given core + * + * @return mixed + */ + public function cloneCore($core) + { + $width = imagesx($core); + $height = imagesy($core); + $clone = imagecreatetruecolor($width, $height); + imagealphablending($clone, false); + imagesavealpha($clone, true); + $transparency = imagecolorallocatealpha($clone, 0, 0, 0, 127); + imagefill($clone, 0, 0, $transparency); + + imagecopy($clone, $core, 0, 0, 0, 0, $width, $height); + + return $clone; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Encoder.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Encoder.php new file mode 100644 index 000000000..559d60dcc --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Encoder.php @@ -0,0 +1,180 @@ +image->getCore(), null, $this->quality); + $this->image->mime = image_type_to_mime_type(IMAGETYPE_JPEG); + $buffer = ob_get_contents(); + ob_end_clean(); + + return $buffer; + } + + /** + * Processes and returns encoded image as PNG string + * + * @return string + */ + protected function processPng() + { + ob_start(); + $resource = $this->image->getCore(); + imagealphablending($resource, false); + imagesavealpha($resource, true); + imagepng($resource, null, -1); + $this->image->mime = image_type_to_mime_type(IMAGETYPE_PNG); + $buffer = ob_get_contents(); + ob_end_clean(); + + return $buffer; + } + + /** + * Processes and returns encoded image as GIF string + * + * @return string + */ + protected function processGif() + { + ob_start(); + imagegif($this->image->getCore()); + $this->image->mime = image_type_to_mime_type(IMAGETYPE_GIF); + $buffer = ob_get_contents(); + ob_end_clean(); + + return $buffer; + } + + /** + * Processes and returns encoded image as WEBP string + * + * @return string + */ + protected function processWebp() + { + if ( ! function_exists('imagewebp')) { + throw new NotSupportedException( + "Webp format is not supported by PHP installation." + ); + } + + ob_start(); + imagepalettetotruecolor($this->image->getCore()); + imagealphablending($this->image->getCore(), true); + imagesavealpha($this->image->getCore(), true); + imagewebp($this->image->getCore(), null, $this->quality); + $this->image->mime = defined('IMAGETYPE_WEBP') ? image_type_to_mime_type(IMAGETYPE_WEBP) : 'image/webp'; + $buffer = ob_get_contents(); + ob_end_clean(); + + return $buffer; + } + + /** + * Processes and returns encoded image as TIFF string + * + * @return string + */ + protected function processTiff() + { + throw new NotSupportedException( + "TIFF format is not supported by Gd Driver." + ); + } + + /** + * Processes and returns encoded image as BMP string + * + * @return string + */ + protected function processBmp() + { + if ( ! function_exists('imagebmp')) { + throw new NotSupportedException( + "BMP format is not supported by PHP installation." + ); + } + + ob_start(); + imagebmp($this->image->getCore()); + $this->image->mime = defined('IMAGETYPE_BMP') ? image_type_to_mime_type(IMAGETYPE_BMP) : 'image/bmp'; + $buffer = ob_get_contents(); + ob_end_clean(); + + return $buffer; + } + + /** + * Processes and returns encoded image as ICO string + * + * @return string + */ + protected function processIco() + { + throw new NotSupportedException( + "ICO format is not supported by Gd Driver." + ); + } + + /** + * Processes and returns encoded image as PSD string + * + * @return string + */ + protected function processPsd() + { + throw new NotSupportedException( + "PSD format is not supported by Gd Driver." + ); + } + + /** + * Processes and returns encoded image as AVIF string + * + * @return string + */ + protected function processAvif() + { + if ( ! function_exists('imageavif')) { + throw new NotSupportedException( + "AVIF format is not supported by PHP installation." + ); + } + + ob_start(); + $resource = $this->image->getCore(); + imagepalettetotruecolor($resource); + imagealphablending($resource, true); + imagesavealpha($resource, true); + imageavif($resource, null, $this->quality); + $this->image->mime = defined('IMAGETYPE_AVIF') ? image_type_to_mime_type(IMAGETYPE_AVIF) : 'image/avif'; + $buffer = ob_get_contents(); + ob_end_clean(); + + return $buffer; + } + + /** + * Processes and returns encoded image as HEIC string + * + * @return string + */ + protected function processHeic() + { + throw new NotSupportedException( + "HEIC format is not supported by Gd Driver." + ); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Font.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Font.php new file mode 100644 index 000000000..3f5888780 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Font.php @@ -0,0 +1,277 @@ +size * 0.75)); + } + + /** + * Filter function to access internal integer font values + * + * @return int + */ + private function getInternalFont() + { + $internalfont = is_null($this->file) ? 1 : $this->file; + $internalfont = is_numeric($internalfont) ? $internalfont : false; + + if ( ! in_array($internalfont, [1, 2, 3, 4, 5])) { + throw new NotSupportedException( + sprintf('Internal GD font (%s) not available. Use only 1-5.', $internalfont) + ); + } + + return intval($internalfont); + } + + /** + * Get width of an internal font character + * + * @return int + */ + private function getInternalFontWidth() + { + return $this->getInternalFont() + 4; + } + + /** + * Get height of an internal font character + * + * @return int + */ + private function getInternalFontHeight() + { + switch ($this->getInternalFont()) { + case 1: + return 8; + + case 2: + return 14; + + case 3: + return 14; + + case 4: + return 16; + + case 5: + return 16; + } + } + + /** + * Calculates bounding box of current font setting + * + * @return Array + */ + public function getBoxSize() + { + $box = []; + + if ($this->hasApplicableFontFile()) { + + // imagettfbbox() converts numeric entities to their respective + // character. Preserve any originally double encoded entities to be + // represented as is. + // eg: &#160; will render   rather than its character. + $this->text = preg_replace('/&(#(?:x[a-fA-F0-9]+|[0-9]+);)/', '&\1', $this->text); + $this->text = mb_encode_numericentity($this->text, array(0x0080, 0xffff, 0, 0xffff), 'UTF-8'); + + // get bounding box with angle 0 + $box = imagettfbbox($this->getPointSize(), 0, $this->file, $this->text); + + // rotate points manually + if ($this->angle != 0) { + + $angle = pi() * 2 - $this->angle * pi() * 2 / 360; + + for ($i=0; $i<4; $i++) { + $x = $box[$i * 2]; + $y = $box[$i * 2 + 1]; + $box[$i * 2] = cos($angle) * $x - sin($angle) * $y; + $box[$i * 2 + 1] = sin($angle) * $x + cos($angle) * $y; + } + } + + $box['width'] = intval(abs($box[4] - $box[0])); + $box['height'] = intval(abs($box[5] - $box[1])); + + } else { + + // get current internal font size + $width = $this->getInternalFontWidth(); + $height = $this->getInternalFontHeight(); + + if (strlen($this->text) == 0) { + // no text -> no boxsize + $box['width'] = 0; + $box['height'] = 0; + } else { + // calculate boxsize + $box['width'] = strlen($this->text) * $width; + $box['height'] = $height; + } + } + + return $box; + } + + /** + * Draws font to given image at given position + * + * @param Image $image + * @param int $posx + * @param int $posy + * @return void + */ + public function applyToImage(Image $image, $posx = 0, $posy = 0) + { + // parse text color + $color = new Color($this->color); + + if ($this->hasApplicableFontFile()) { + + if ($this->angle != 0 || is_string($this->align) || is_string($this->valign)) { + + $box = $this->getBoxSize(); + + $align = is_null($this->align) ? 'left' : strtolower($this->align); + $valign = is_null($this->valign) ? 'bottom' : strtolower($this->valign); + + // correction on position depending on v/h alignment + switch ($align.'-'.$valign) { + + case 'center-top': + $posx = $posx - round(($box[6]+$box[4])/2); + $posy = $posy - round(($box[7]+$box[5])/2); + break; + + case 'right-top': + $posx = $posx - $box[4]; + $posy = $posy - $box[5]; + break; + + case 'left-top': + $posx = $posx - $box[6]; + $posy = $posy - $box[7]; + break; + + case 'center-center': + case 'center-middle': + $posx = $posx - round(($box[0]+$box[4])/2); + $posy = $posy - round(($box[1]+$box[5])/2); + break; + + case 'right-center': + case 'right-middle': + $posx = $posx - round(($box[2]+$box[4])/2); + $posy = $posy - round(($box[3]+$box[5])/2); + break; + + case 'left-center': + case 'left-middle': + $posx = $posx - round(($box[0]+$box[6])/2); + $posy = $posy - round(($box[1]+$box[7])/2); + break; + + case 'center-bottom': + $posx = $posx - round(($box[0]+$box[2])/2); + $posy = $posy - round(($box[1]+$box[3])/2); + break; + + case 'right-bottom': + $posx = $posx - $box[2]; + $posy = $posy - $box[3]; + break; + + case 'left-bottom': + $posx = $posx - $box[0]; + $posy = $posy - $box[1]; + break; + } + } + + // enable alphablending for imagettftext + imagealphablending($image->getCore(), true); + + // draw ttf text + imagettftext($image->getCore(), $this->getPointSize(), $this->angle, $posx, $posy, $color->getInt(), $this->file, $this->text); + + } else { + + // get box size + $box = $this->getBoxSize(); + $width = $box['width']; + $height = $box['height']; + + // internal font specific position corrections + if ($this->getInternalFont() == 1) { + $top_correction = 1; + $bottom_correction = 2; + } elseif ($this->getInternalFont() == 3) { + $top_correction = 2; + $bottom_correction = 4; + } else { + $top_correction = 3; + $bottom_correction = 4; + } + + // x-position corrections for horizontal alignment + switch (strtolower($this->align)) { + case 'center': + $posx = ceil($posx - ($width / 2)); + break; + + case 'right': + $posx = ceil($posx - $width) + 1; + break; + } + + // y-position corrections for vertical alignment + switch (strtolower($this->valign)) { + case 'center': + case 'middle': + $posy = ceil($posy - ($height / 2)); + break; + + case 'top': + $posy = ceil($posy - $top_correction); + break; + + default: + case 'bottom': + $posy = round($posy - $height + $bottom_correction); + break; + } + + // draw text + imagestring($image->getCore(), $this->getInternalFont(), $posx, $posy, $this->text, $color->getInt()); + } + } + + /** + * Set text kerning + * + * @param string $kerning + * @return void + */ + public function kerning($kerning) + { + throw new \Intervention\Image\Exception\NotSupportedException( + "Kerning is not supported by GD driver." + ); + } + +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/CircleShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/CircleShape.php new file mode 100644 index 000000000..c3c42144d --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/CircleShape.php @@ -0,0 +1,40 @@ +width = is_numeric($diameter) ? intval($diameter) : $this->diameter; + $this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter; + $this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter; + } + + /** + * Draw current circle on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + return parent::applyToImage($image, $x, $y); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/EllipseShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/EllipseShape.php new file mode 100644 index 000000000..78e5e4a59 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/EllipseShape.php @@ -0,0 +1,65 @@ +width = is_numeric($width) ? intval($width) : $this->width; + $this->height = is_numeric($height) ? intval($height) : $this->height; + } + + /** + * Draw ellipse instance on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + // parse background color + $background = new Color($this->background); + + if ($this->hasBorder()) { + // slightly smaller ellipse to keep 1px bordered edges clean + imagefilledellipse($image->getCore(), $x, $y, $this->width-1, $this->height-1, $background->getInt()); + + $border_color = new Color($this->border_color); + imagesetthickness($image->getCore(), $this->border_width); + + // gd's imageellipse doesn't respect imagesetthickness so i use imagearc with 359.9 degrees here + imagearc($image->getCore(), $x, $y, $this->width, $this->height, 0, 359.99, $border_color->getInt()); + } else { + imagefilledellipse($image->getCore(), $x, $y, $this->width, $this->height, $background->getInt()); + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/LineShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/LineShape.php new file mode 100644 index 000000000..ea38b513e --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/LineShape.php @@ -0,0 +1,90 @@ +x = is_numeric($x) ? intval($x) : $this->x; + $this->y = is_numeric($y) ? intval($y) : $this->y; + } + + /** + * Set current line color + * + * @param string $color + * @return void + */ + public function color($color) + { + $this->color = $color; + } + + /** + * Set current line width in pixels + * + * @param int $width + * @return void + */ + public function width($width) + { + throw new \Intervention\Image\Exception\NotSupportedException( + "Line width is not supported by GD driver." + ); + } + + /** + * Draw current instance of line to given endpoint on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + $color = new Color($this->color); + imageline($image->getCore(), $x, $y, $this->x, $this->y, $color->getInt()); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/PolygonShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/PolygonShape.php new file mode 100644 index 000000000..5e14df40e --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/PolygonShape.php @@ -0,0 +1,49 @@ +points = $points; + } + + /** + * Draw polygon on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + $background = new Color($this->background); + imagefilledpolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $background->getInt()); + + if ($this->hasBorder()) { + $border_color = new Color($this->border_color); + imagesetthickness($image->getCore(), $this->border_width); + imagepolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $border_color->getInt()); + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/RectangleShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/RectangleShape.php new file mode 100644 index 000000000..5f69a7f92 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Gd/Shapes/RectangleShape.php @@ -0,0 +1,76 @@ +x1 = is_numeric($x1) ? intval($x1) : $this->x1; + $this->y1 = is_numeric($y1) ? intval($y1) : $this->y1; + $this->x2 = is_numeric($x2) ? intval($x2) : $this->x2; + $this->y2 = is_numeric($y2) ? intval($y2) : $this->y2; + } + + /** + * Draw rectangle to given image at certain position + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + $background = new Color($this->background); + imagefilledrectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $background->getInt()); + + if ($this->hasBorder()) { + $border_color = new Color($this->border_color); + imagesetthickness($image->getCore(), $this->border_width); + imagerectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $border_color->getInt()); + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Image.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Image.php new file mode 100644 index 000000000..3b26ea2a9 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Image.php @@ -0,0 +1,370 @@ +driver = $driver; + $this->core = $core; + } + + /** + * Magic method to catch all image calls + * usually any AbstractCommand + * + * @param string $name + * @param Array $arguments + * @return mixed + */ + public function __call($name, $arguments) + { + $command = $this->driver->executeCommand($this, $name, $arguments); + return $command->hasOutput() ? $command->getOutput() : $this; + } + + /** + * Starts encoding of current image + * + * @param string $format + * @param int $quality + * @return \Intervention\Image\Image + */ + public function encode($format = null, $quality = 90) + { + return $this->driver->encode($this, $format, $quality); + } + + /** + * Saves encoded image in filesystem + * + * @param string $path + * @param int $quality + * @param string $format + * @return \Intervention\Image\Image + */ + public function save($path = null, $quality = null, $format = null) + { + $path = is_null($path) ? $this->basePath() : $path; + + if (is_null($path)) { + throw new NotWritableException( + "Can't write to undefined path." + ); + } + + if ($format === null) { + $format = pathinfo($path, PATHINFO_EXTENSION); + } + + $data = $this->encode($format, $quality); + $saved = @file_put_contents($path, $data); + + if ($saved === false) { + throw new NotWritableException( + "Can't write image data to path ({$path})" + ); + } + + // set new file info + $this->setFileInfoFromPath($path); + + return $this; + } + + /** + * Runs a given filter on current image + * + * @param FiltersFilterInterface $filter + * @return \Intervention\Image\Image + */ + public function filter(Filters\FilterInterface $filter) + { + return $filter->applyFilter($this); + } + + /** + * Returns current image driver + * + * @return \Intervention\Image\AbstractDriver + */ + public function getDriver() + { + return $this->driver; + } + + /** + * Sets current image driver + * @param AbstractDriver $driver + */ + public function setDriver(AbstractDriver $driver) + { + $this->driver = $driver; + + return $this; + } + + /** + * Returns current image resource/obj + * + * @return mixed + */ + public function getCore() + { + return $this->core; + } + + /** + * Sets current image resource + * + * @param mixed $core + */ + public function setCore($core) + { + $this->core = $core; + + return $this; + } + + /** + * Returns current image backup + * + * @param string $name + * @return mixed + */ + public function getBackup($name = null) + { + $name = is_null($name) ? 'default' : $name; + + if ( ! $this->backupExists($name)) { + throw new RuntimeException( + "Backup with name ({$name}) not available. Call backup() before reset()." + ); + } + + return $this->backups[$name]; + } + + /** + * Returns all backups attached to image + * + * @return array + */ + public function getBackups() + { + return $this->backups; + } + + /** + * Sets current image backup + * + * @param mixed $resource + * @param string $name + * @return self + */ + public function setBackup($resource, $name = null) + { + $name = is_null($name) ? 'default' : $name; + + $this->backups[$name] = $resource; + + return $this; + } + + /** + * Checks if named backup exists + * + * @param string $name + * @return bool + */ + private function backupExists($name) + { + return array_key_exists($name, $this->backups); + } + + /** + * Checks if current image is already encoded + * + * @return boolean + */ + public function isEncoded() + { + return ! empty($this->encoded); + } + + /** + * Returns encoded image data of current image + * + * @return string + */ + public function getEncoded() + { + return $this->encoded; + } + + /** + * Sets encoded image buffer + * + * @param string $value + */ + public function setEncoded($value) + { + $this->encoded = $value; + + return $this; + } + + /** + * Calculates current image width + * + * @return int + */ + public function getWidth() + { + return $this->getSize()->width; + } + + /** + * Alias of getWidth() + * + * @return int + */ + public function width() + { + return $this->getWidth(); + } + + /** + * Calculates current image height + * + * @return int + */ + public function getHeight() + { + return $this->getSize()->height; + } + + /** + * Alias of getHeight + * + * @return int + */ + public function height() + { + return $this->getHeight(); + } + + /** + * Reads mime type + * + * @return string + */ + public function mime() + { + return $this->mime; + } + + /** + * Returns encoded image data in string conversion + * + * @return string + */ + public function __toString() + { + return $this->encoded; + } + + /** + * Cloning an image + */ + public function __clone() + { + $this->core = $this->driver->cloneCore($this->core); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/ImageManager.php b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageManager.php new file mode 100644 index 000000000..324fe7fa3 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageManager.php @@ -0,0 +1,142 @@ + 'gd' + ]; + + /** + * Creates new instance of Image Manager + * + * @param array $config + */ + public function __construct(array $config = []) + { + $this->checkRequirements(); + $this->configure($config); + } + + /** + * Overrides configuration settings + * + * @param array $config + * + * @return self + */ + public function configure(array $config = []) + { + $this->config = array_replace($this->config, $config); + + return $this; + } + + /** + * Initiates an Image instance from different input types + * + * @param mixed $data + * + * @return \Intervention\Image\Image + */ + public function make($data) + { + return $this->createDriver()->init($data); + } + + /** + * Creates an empty image canvas + * + * @param int $width + * @param int $height + * @param mixed $background + * + * @return \Intervention\Image\Image + */ + public function canvas($width, $height, $background = null) + { + return $this->createDriver()->newImage($width, $height, $background); + } + + /** + * Create new cached image and run callback + * (requires additional package intervention/imagecache) + * + * @param Closure $callback + * @param int $lifetime + * @param boolean $returnObj + * + * @return Image + */ + public function cache(Closure $callback, $lifetime = null, $returnObj = false) + { + if (class_exists('Intervention\\Image\\ImageCache')) { + // create imagecache + $imagecache = new ImageCache($this); + + // run callback + if (is_callable($callback)) { + $callback($imagecache); + } + + return $imagecache->get($lifetime, $returnObj); + } + + throw new MissingDependencyException( + "Please install package intervention/imagecache before running this function." + ); + } + + /** + * Creates a driver instance according to config settings + * + * @return \Intervention\Image\AbstractDriver + */ + private function createDriver() + { + if (is_string($this->config['driver'])) { + $drivername = ucfirst($this->config['driver']); + $driverclass = sprintf('Intervention\\Image\\%s\\Driver', $drivername); + + if (class_exists($driverclass)) { + return new $driverclass; + } + + throw new NotSupportedException( + "Driver ({$drivername}) could not be instantiated." + ); + } + + if ($this->config['driver'] instanceof AbstractDriver) { + return $this->config['driver']; + } + + throw new NotSupportedException( + "Unknown driver type." + ); + } + + /** + * Check if all requirements are available + * + * @return void + */ + private function checkRequirements() + { + if ( ! function_exists('finfo_buffer')) { + throw new MissingDependencyException( + "PHP Fileinfo extension must be installed/enabled to use Intervention Image." + ); + } + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/ImageManagerStatic.php b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageManagerStatic.php new file mode 100644 index 000000000..a1b564264 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageManagerStatic.php @@ -0,0 +1,88 @@ +configure($config); + } + + /** + * Statically initiates an Image instance from different input types + * + * @param mixed $data + * + * @return \Intervention\Image\Image + * @throws \Intervention\Image\Exception\NotReadableException + */ + public static function make($data) + { + return self::getManager()->make($data); + } + + /** + * Statically creates an empty image canvas + * + * @param int $width + * @param int $height + * @param mixed $background + * + * @return \Intervention\Image\Image + */ + public static function canvas($width, $height, $background = null) + { + return self::getManager()->canvas($width, $height, $background); + } + + /** + * Create new cached image and run callback statically + * + * @param Closure $callback + * @param int $lifetime + * @param boolean $returnObj + * + * @return mixed + */ + public static function cache(Closure $callback, $lifetime = null, $returnObj = false) + { + return self::getManager()->cache($callback, $lifetime, $returnObj); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProvider.php b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProvider.php new file mode 100644 index 000000000..f99fe4a37 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProvider.php @@ -0,0 +1,87 @@ +provider = $this->getProvider(); + } + + /** + * Bootstrap the application events. + * + * @return void + */ + public function boot() + { + if (method_exists($this->provider, 'boot')) { + return $this->provider->boot(); + } + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + return $this->provider->register(); + } + + /** + * Return ServiceProvider according to Laravel version + * + * @return \Intervention\Image\Provider\ProviderInterface + */ + private function getProvider() + { + if ($this->app instanceof LumenApplication) { + $provider = '\Intervention\Image\ImageServiceProviderLumen'; + } elseif (version_compare(IlluminateApplication::VERSION, '5.0', '<')) { + $provider = '\Intervention\Image\ImageServiceProviderLaravel4'; + } else { + $provider = '\Intervention\Image\ImageServiceProviderLaravelRecent'; + } + + return new $provider($this->app); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return ['image']; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLaravel4.php b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLaravel4.php new file mode 100644 index 000000000..3b1388f25 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLaravel4.php @@ -0,0 +1,112 @@ +package('intervention/image'); + + // try to create imagecache route only if imagecache is present + if (class_exists('Intervention\\Image\\ImageCache')) { + + $app = $this->app; + + // load imagecache config + $app['config']->package('intervention/imagecache', __DIR__.'/../../../../imagecache/src/config', 'imagecache'); + $config = $app['config']; + + // create dynamic manipulation route + if (is_string($config->get('imagecache::route'))) { + + // add original to route templates + $config->set('imagecache::templates.original', null); + + // setup image manipulator route + $app['router']->get($config->get('imagecache::route').'/{template}/{filename}', ['as' => 'imagecache', function ($template, $filename) use ($app, $config) { + + // disable session cookies for image route + $app['config']->set('session.driver', 'array'); + + // find file + foreach ($config->get('imagecache::paths') as $path) { + // don't allow '..' in filenames + $image_path = $path.'/'.str_replace('..', '', $filename); + if (file_exists($image_path) && is_file($image_path)) { + break; + } else { + $image_path = false; + } + } + + // abort if file not found + if ($image_path === false) { + $app->abort(404); + } + + // define template callback + $callback = $config->get("imagecache::templates.{$template}"); + + if (is_callable($callback) || class_exists($callback)) { + + // image manipulation based on callback + $content = $app['image']->cache(function ($image) use ($image_path, $callback) { + + switch (true) { + case is_callable($callback): + return $callback($image->make($image_path)); + break; + + case class_exists($callback): + return $image->make($image_path)->filter(new $callback); + break; + } + + }, $config->get('imagecache::lifetime')); + + } else { + + // get original image file contents + $content = file_get_contents($image_path); + } + + // define mime type + $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $content); + + // return http response + return new IlluminateResponse($content, 200, [ + 'Content-Type' => $mime, + 'Cache-Control' => 'max-age='.($config->get('imagecache::lifetime')*60).', public', + 'Etag' => md5($content) + ]); + + }])->where(['template' => join('|', array_keys($config->get('imagecache::templates'))), 'filename' => '[ \w\\.\\/\\-]+']); + } + } + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $app = $this->app; + + $app['image'] = $app->share(function ($app) { + return new ImageManager($app['config']->get('image::config')); + }); + + $app->alias('image', 'Intervention\Image\ImageManager'); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLaravelRecent.php b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLaravelRecent.php new file mode 100644 index 000000000..17a84d0ac --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLaravelRecent.php @@ -0,0 +1,106 @@ +publishes([ + __DIR__.'/../../config/config.php' => config_path('image.php') + ]); + + // setup intervention/imagecache if package is installed + $this->cacheIsInstalled() ? $this->bootstrapImageCache() : null; + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $app = $this->app; + + // merge default config + $this->mergeConfigFrom( + __DIR__.'/../../config/config.php', + 'image' + ); + + // create image + $app->singleton('image', function ($app) { + return new ImageManager($this->getImageConfig($app)); + }); + + $app->alias('image', 'Intervention\Image\ImageManager'); + } + + /** + * Bootstrap imagecache + * + * @return void + */ + protected function bootstrapImageCache() + { + $app = $this->app; + $config = __DIR__.'/../../../../imagecache/src/config/config.php'; + + $this->publishes([ + $config => config_path('imagecache.php') + ]); + + // merge default config + $this->mergeConfigFrom( + $config, + 'imagecache' + ); + + // imagecache route + if (is_string(config('imagecache.route'))) { + + $filename_pattern = '[ \w\\.\\/\\-\\@\(\)\=]+'; + + // route to access template applied image file + $app['router']->get(config('imagecache.route').'/{template}/{filename}', [ + 'uses' => 'Intervention\Image\ImageCacheController@getResponse', + 'as' => 'imagecache' + ])->where(['filename' => $filename_pattern]); + } + } + + /** + * Return image configuration as array + * + * @param Application $app + * @return array + */ + private function getImageConfig($app) + { + $config = $app['config']->get('image'); + + if (is_null($config)) { + return []; + } + + return $config; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLeague.php b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLeague.php new file mode 100644 index 000000000..b756a61f5 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLeague.php @@ -0,0 +1,42 @@ +config = $config; + } + + /** + * Register the server provider. + * + * @return void + */ + public function register() + { + $this->getContainer()->share('Intervention\Image\ImageManager', function () { + return new ImageManager($this->config); + }); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLumen.php b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLumen.php new file mode 100644 index 000000000..4a381ccd4 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/ImageServiceProviderLumen.php @@ -0,0 +1,34 @@ +app; + + // merge default config + $this->mergeConfigFrom( + __DIR__.'/../../config/config.php', + 'image' + ); + + // set configuration + $app->configure('image'); + + // create image + $app->singleton('image',function ($app) { + return new ImageManager($app['config']->get('image')); + }); + + $app->alias('image', 'Intervention\Image\ImageManager'); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Color.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Color.php new file mode 100644 index 000000000..1e109b171 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Color.php @@ -0,0 +1,279 @@ +> 24) & 0xFF; + $r = ($value >> 16) & 0xFF; + $g = ($value >> 8) & 0xFF; + $b = $value & 0xFF; + $a = $this->rgb2alpha($a); + + $this->setPixel($r, $g, $b, $a); + } + + /** + * Initiates color object from given array + * + * @param array $value + * @return \Intervention\Image\AbstractColor + */ + public function initFromArray($array) + { + $array = array_values($array); + + if (count($array) == 4) { + + // color array with alpha value + list($r, $g, $b, $a) = $array; + + } elseif (count($array) == 3) { + + // color array without alpha value + list($r, $g, $b) = $array; + $a = 1; + } + + $this->setPixel($r, $g, $b, $a); + } + + /** + * Initiates color object from given string + * + * @param string $value + * + * @return \Intervention\Image\AbstractColor + */ + public function initFromString($value) + { + if ($color = $this->rgbaFromString($value)) { + $this->setPixel($color[0], $color[1], $color[2], $color[3]); + } + } + + /** + * Initiates color object from given ImagickPixel object + * + * @param ImagickPixel $value + * + * @return \Intervention\Image\AbstractColor + */ + public function initFromObject($value) + { + if (is_a($value, '\ImagickPixel')) { + $this->pixel = $value; + } + } + + /** + * Initiates color object from given R, G and B values + * + * @param int $r + * @param int $g + * @param int $b + * + * @return \Intervention\Image\AbstractColor + */ + public function initFromRgb($r, $g, $b) + { + $this->setPixel($r, $g, $b); + } + + /** + * Initiates color object from given R, G, B and A values + * + * @param int $r + * @param int $g + * @param int $b + * @param float $a + * + * @return \Intervention\Image\AbstractColor + */ + public function initFromRgba($r, $g, $b, $a) + { + $this->setPixel($r, $g, $b, $a); + } + + /** + * Calculates integer value of current color instance + * + * @return int + */ + public function getInt() + { + $r = $this->getRedValue(); + $g = $this->getGreenValue(); + $b = $this->getBlueValue(); + $a = intval(round($this->getAlphaValue() * 255)); + + return intval(($a << 24) + ($r << 16) + ($g << 8) + $b); + } + + /** + * Calculates hexadecimal value of current color instance + * + * @param string $prefix + * + * @return string + */ + public function getHex($prefix = '') + { + return sprintf('%s%02x%02x%02x', $prefix, + $this->getRedValue(), + $this->getGreenValue(), + $this->getBlueValue() + ); + } + + /** + * Calculates RGB(A) in array format of current color instance + * + * @return array + */ + public function getArray() + { + return [ + $this->getRedValue(), + $this->getGreenValue(), + $this->getBlueValue(), + $this->getAlphaValue() + ]; + } + + /** + * Calculates RGBA in string format of current color instance + * + * @return string + */ + public function getRgba() + { + return sprintf('rgba(%d, %d, %d, %.2F)', + $this->getRedValue(), + $this->getGreenValue(), + $this->getBlueValue(), + $this->getAlphaValue() + ); + } + + /** + * Determines if current color is different from given color + * + * @param AbstractColor $color + * @param int $tolerance + * @return boolean + */ + public function differs(AbstractColor $color, $tolerance = 0) + { + $color_tolerance = round($tolerance * 2.55); + $alpha_tolerance = round($tolerance); + + $delta = [ + 'r' => abs($color->getRedValue() - $this->getRedValue()), + 'g' => abs($color->getGreenValue() - $this->getGreenValue()), + 'b' => abs($color->getBlueValue() - $this->getBlueValue()), + 'a' => abs($color->getAlphaValue() - $this->getAlphaValue()) + ]; + + return ( + $delta['r'] > $color_tolerance or + $delta['g'] > $color_tolerance or + $delta['b'] > $color_tolerance or + $delta['a'] > $alpha_tolerance + ); + } + + /** + * Returns RGB red value of current color + * + * @return int + */ + public function getRedValue() + { + return intval(round($this->pixel->getColorValue(\Imagick::COLOR_RED) * 255)); + } + + /** + * Returns RGB green value of current color + * + * @return int + */ + public function getGreenValue() + { + return intval(round($this->pixel->getColorValue(\Imagick::COLOR_GREEN) * 255)); + } + + /** + * Returns RGB blue value of current color + * + * @return int + */ + public function getBlueValue() + { + return intval(round($this->pixel->getColorValue(\Imagick::COLOR_BLUE) * 255)); + } + + /** + * Returns RGB alpha value of current color + * + * @return float + */ + public function getAlphaValue() + { + return round($this->pixel->getColorValue(\Imagick::COLOR_ALPHA), 2); + } + + /** + * Initiates ImagickPixel from given RGBA values + * + * @return \ImagickPixel + */ + private function setPixel($r, $g, $b, $a = null) + { + $a = is_null($a) ? 1 : $a; + + return $this->pixel = new \ImagickPixel( + sprintf('rgba(%d, %d, %d, %.2F)', $r, $g, $b, $a) + ); + } + + /** + * Returns current color as ImagickPixel + * + * @return \ImagickPixel + */ + public function getPixel() + { + return $this->pixel; + } + + /** + * Calculates RGBA integer alpha value into float value + * + * @param int $value + * @return float + */ + private function rgb2alpha($value) + { + // (255 -> 1.0) / (0 -> 0.0) + return (float) round($value/255, 2); + } + +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BackupCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BackupCommand.php new file mode 100644 index 000000000..76b4f72bb --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BackupCommand.php @@ -0,0 +1,25 @@ +argument(0)->value(); + + // clone current image resource + $clone = clone $image; + $image->setBackup($clone->getCore(), $backupName); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BlurCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BlurCommand.php new file mode 100644 index 000000000..d2533e0ea --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BlurCommand.php @@ -0,0 +1,21 @@ +argument(0)->between(0, 100)->value(1); + + return $image->getCore()->blurImage(1 * $amount, 0.5 * $amount); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BrightnessCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BrightnessCommand.php new file mode 100644 index 000000000..03ac8478d --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/BrightnessCommand.php @@ -0,0 +1,21 @@ +argument(0)->between(-100, 100)->required()->value(); + + return $image->getCore()->modulateImage(100 + $level, 100, 100); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ColorizeCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ColorizeCommand.php new file mode 100644 index 000000000..3a6506f6d --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ColorizeCommand.php @@ -0,0 +1,44 @@ +argument(0)->between(-100, 100)->required()->value(); + $green = $this->argument(1)->between(-100, 100)->required()->value(); + $blue = $this->argument(2)->between(-100, 100)->required()->value(); + + // normalize colorize levels + $red = $this->normalizeLevel($red); + $green = $this->normalizeLevel($green); + $blue = $this->normalizeLevel($blue); + + $qrange = $image->getCore()->getQuantumRange(); + + // apply + $image->getCore()->levelImage(0, $red, $qrange['quantumRangeLong'], \Imagick::CHANNEL_RED); + $image->getCore()->levelImage(0, $green, $qrange['quantumRangeLong'], \Imagick::CHANNEL_GREEN); + $image->getCore()->levelImage(0, $blue, $qrange['quantumRangeLong'], \Imagick::CHANNEL_BLUE); + + return true; + } + + private function normalizeLevel($level) + { + if ($level > 0) { + return $level/5; + } else { + return ($level+100)/100; + } + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ContrastCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ContrastCommand.php new file mode 100644 index 000000000..c4847c61d --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ContrastCommand.php @@ -0,0 +1,21 @@ +argument(0)->between(-100, 100)->required()->value(); + + return $image->getCore()->sigmoidalContrastImage($level > 0, $level / 4, 0); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/CropCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/CropCommand.php new file mode 100644 index 000000000..618edea7d --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/CropCommand.php @@ -0,0 +1,45 @@ +argument(0)->type('digit')->required()->value(); + $height = $this->argument(1)->type('digit')->required()->value(); + $x = $this->argument(2)->type('digit')->value(); + $y = $this->argument(3)->type('digit')->value(); + + if (is_null($width) || is_null($height)) { + throw new InvalidArgumentException( + "Width and height of cutout needs to be defined." + ); + } + + $cropped = new Size($width, $height); + $position = new Point($x, $y); + + // align boxes + if (is_null($x) && is_null($y)) { + $position = $image->getSize()->align('center')->relativePosition($cropped->align('center')); + } + + // crop image core + $image->getCore()->cropImage($cropped->width, $cropped->height, $position->x, $position->y); + $image->getCore()->setImagePage(0,0,0,0); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/DestroyCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/DestroyCommand.php new file mode 100644 index 000000000..58c9556e4 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/DestroyCommand.php @@ -0,0 +1,27 @@ +getCore()->clear(); + + // destroy backups + foreach ($image->getBackups() as $backup) { + $backup->clear(); + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ExifCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ExifCommand.php new file mode 100644 index 000000000..521b38b09 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ExifCommand.php @@ -0,0 +1,63 @@ +preferExtension = false; + } + + /** + * Read Exif data from the given image + * + * @param \Intervention\Image\Image $image + * @return boolean + */ + public function execute($image) + { + if ($this->preferExtension && function_exists('exif_read_data')) { + return parent::execute($image); + } + + $core = $image->getCore(); + + if ( ! method_exists($core, 'getImageProperties')) { + throw new NotSupportedException( + "Reading Exif data is not supported by this PHP installation." + ); + } + + $requestedKey = $this->argument(0)->value(); + if ($requestedKey !== null) { + $this->setOutput($core->getImageProperty('exif:' . $requestedKey)); + return true; + } + + $exif = []; + $properties = $core->getImageProperties(); + foreach ($properties as $key => $value) { + if (substr($key, 0, 5) !== 'exif:') { + continue; + } + + $exif[substr($key, 5)] = $value; + } + + $this->setOutput($exif); + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FillCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FillCommand.php new file mode 100644 index 000000000..82baac532 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FillCommand.php @@ -0,0 +1,105 @@ +argument(0)->value(); + $x = $this->argument(1)->type('digit')->value(); + $y = $this->argument(2)->type('digit')->value(); + + $imagick = $image->getCore(); + + try { + // set image filling + $source = new Decoder; + $filling = $source->init($filling); + + } catch (NotReadableException $e) { + + // set solid color filling + $filling = new Color($filling); + } + + // flood fill if coordinates are set + if (is_int($x) && is_int($y)) { + + // flood fill with texture + if ($filling instanceof Image) { + + // create tile + $tile = clone $image->getCore(); + + // mask away color at position + $tile->transparentPaintImage($tile->getImagePixelColor($x, $y), 0, 0, false); + + // create canvas + $canvas = clone $image->getCore(); + + // fill canvas with texture + $canvas = $canvas->textureImage($filling->getCore()); + + // merge canvas and tile + $canvas->compositeImage($tile, \Imagick::COMPOSITE_DEFAULT, 0, 0); + + // replace image core + $image->setCore($canvas); + + // flood fill with color + } elseif ($filling instanceof Color) { + + // create canvas with filling + $canvas = new \Imagick; + $canvas->newImage($image->getWidth(), $image->getHeight(), $filling->getPixel(), 'png'); + + // create tile to put on top + $tile = clone $image->getCore(); + + // mask away color at pos. + $tile->transparentPaintImage($tile->getImagePixelColor($x, $y), 0, 0, false); + + // save alpha channel of original image + $alpha = clone $image->getCore(); + + // merge original with canvas and tile + $image->getCore()->compositeImage($canvas, \Imagick::COMPOSITE_DEFAULT, 0, 0); + $image->getCore()->compositeImage($tile, \Imagick::COMPOSITE_DEFAULT, 0, 0); + + // restore alpha channel of original image + $image->getCore()->compositeImage($alpha, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); + } + + } else { + + if ($filling instanceof Image) { + + // fill whole image with texture + $image->setCore($image->getCore()->textureImage($filling->getCore())); + + } elseif ($filling instanceof Color) { + + // fill whole image with color + $draw = new \ImagickDraw(); + $draw->setFillColor($filling->getPixel()); + $draw->rectangle(0, 0, $image->getWidth(), $image->getHeight()); + $image->getCore()->drawImage($draw); + } + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FitCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FitCommand.php new file mode 100644 index 000000000..6d62ba677 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FitCommand.php @@ -0,0 +1,42 @@ +argument(0)->type('digit')->required()->value(); + $height = $this->argument(1)->type('digit')->value($width); + $constraints = $this->argument(2)->type('closure')->value(); + $position = $this->argument(3)->type('string')->value('center'); + + // calculate size + $cropped = $image->getSize()->fit(new Size($width, $height), $position); + $resized = clone $cropped; + $resized = $resized->resize($width, $height, $constraints); + + // crop image + $image->getCore()->cropImage( + $cropped->width, + $cropped->height, + $cropped->pivot->x, + $cropped->pivot->y + ); + + // resize image + $image->getCore()->scaleImage($resized->getWidth(), $resized->getHeight()); + $image->getCore()->setImagePage(0,0,0,0); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FlipCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FlipCommand.php new file mode 100644 index 000000000..abae16ad1 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/FlipCommand.php @@ -0,0 +1,27 @@ +argument(0)->value('h'); + + if (in_array(strtolower($mode), [2, 'v', 'vert', 'vertical'])) { + // flip vertical + return $image->getCore()->flipImage(); + } else { + // flip horizontal + return $image->getCore()->flopImage(); + } + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GammaCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GammaCommand.php new file mode 100644 index 000000000..200515f3b --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GammaCommand.php @@ -0,0 +1,21 @@ +argument(0)->type('numeric')->required()->value(); + + return $image->getCore()->gammaImage($gamma); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php new file mode 100644 index 000000000..ccccedb03 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GetSizeCommand.php @@ -0,0 +1,28 @@ +getCore(); + + $this->setOutput(new Size( + $core->getImageWidth(), + $core->getImageHeight() + )); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GreyscaleCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GreyscaleCommand.php new file mode 100644 index 000000000..df0ff5b57 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/GreyscaleCommand.php @@ -0,0 +1,19 @@ +getCore()->modulateImage(100, 0, 100); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/HeightenCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/HeightenCommand.php new file mode 100644 index 000000000..0b61e50c1 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/HeightenCommand.php @@ -0,0 +1,28 @@ +argument(0)->type('digit')->required()->value(); + $additionalConstraints = $this->argument(1)->type('closure')->value(); + + $this->arguments[0] = null; + $this->arguments[1] = $height; + $this->arguments[2] = function ($constraint) use ($additionalConstraints) { + $constraint->aspectRatio(); + if(is_callable($additionalConstraints)) + $additionalConstraints($constraint); + }; + + return parent::execute($image); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InsertCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InsertCommand.php new file mode 100644 index 000000000..2a9974367 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InsertCommand.php @@ -0,0 +1,33 @@ +argument(0)->required()->value(); + $position = $this->argument(1)->type('string')->value(); + $x = $this->argument(2)->type('digit')->value(0); + $y = $this->argument(3)->type('digit')->value(0); + + // build watermark + $watermark = $image->getDriver()->init($source); + + // define insertion point + $image_size = $image->getSize()->align($position, $x, $y); + $watermark_size = $watermark->getSize()->align($position); + $target = $image_size->relativePosition($watermark_size); + + // insert image at position + return $image->getCore()->compositeImage($watermark->getCore(), \Imagick::COMPOSITE_DEFAULT, $target->x, $target->y); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InterlaceCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InterlaceCommand.php new file mode 100644 index 000000000..913cab7e0 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InterlaceCommand.php @@ -0,0 +1,29 @@ +argument(0)->type('bool')->value(true); + + if ($mode) { + $mode = \Imagick::INTERLACE_LINE; + } else { + $mode = \Imagick::INTERLACE_NO; + } + + $image->getCore()->setInterlaceScheme($mode); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InvertCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InvertCommand.php new file mode 100644 index 000000000..1d134301b --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/InvertCommand.php @@ -0,0 +1,19 @@ +getCore()->negateImage(false); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/LimitColorsCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/LimitColorsCommand.php new file mode 100644 index 000000000..16f9b82e9 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/LimitColorsCommand.php @@ -0,0 +1,59 @@ +argument(0)->value(); + $matte = $this->argument(1)->value(); + + // get current image size + $size = $image->getSize(); + + // build 2 color alpha mask from original alpha + $alpha = clone $image->getCore(); + $alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA); + $alpha->transparentPaintImage('#ffffff', 0, 0, false); + $alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA); + $alpha->negateImage(false); + + if ($matte) { + + // get matte color + $mattecolor = $image->getDriver()->parseColor($matte)->getPixel(); + + // create matte image + $canvas = new \Imagick; + $canvas->newImage($size->width, $size->height, $mattecolor, 'png'); + + // lower colors of original and copy to matte + $image->getCore()->quantizeImage($count, \Imagick::COLORSPACE_RGB, 0, false, false); + $canvas->compositeImage($image->getCore(), \Imagick::COMPOSITE_DEFAULT, 0, 0); + + // copy new alpha to canvas + $canvas->compositeImage($alpha, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); + + // replace core + $image->setCore($canvas); + + } else { + + $image->getCore()->quantizeImage($count, \Imagick::COLORSPACE_RGB, 0, false, false); + $image->getCore()->compositeImage($alpha, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); + + } + + return true; + + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/MaskCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/MaskCommand.php new file mode 100644 index 000000000..af9d6b2f5 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/MaskCommand.php @@ -0,0 +1,60 @@ +argument(0)->value(); + $mask_w_alpha = $this->argument(1)->type('bool')->value(false); + + // get imagick + $imagick = $image->getCore(); + + // build mask image from source + $mask = $image->getDriver()->init($mask_source); + + // resize mask to size of current image (if necessary) + $image_size = $image->getSize(); + if ($mask->getSize() != $image_size) { + $mask->resize($image_size->width, $image_size->height); + } + + $imagick->setImageMatte(true); + + if ($mask_w_alpha) { + + // just mask with alpha map + $imagick->compositeImage($mask->getCore(), \Imagick::COMPOSITE_DSTIN, 0, 0); + + } else { + + // get alpha channel of original as greyscale image + $original_alpha = clone $imagick; + $original_alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA); + + // use red channel from mask ask alpha + $mask_alpha = clone $mask->getCore(); + $mask_alpha->compositeImage($mask->getCore(), \Imagick::COMPOSITE_DEFAULT, 0, 0); + // $mask_alpha->setImageAlphaChannel(\Imagick::ALPHACHANNEL_DEACTIVATE); + $mask_alpha->separateImageChannel(\Imagick::CHANNEL_ALL); + + // combine both alphas from original and mask + $original_alpha->compositeImage($mask_alpha, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); + + // mask the image with the alpha combination + $imagick->compositeImage($original_alpha, \Imagick::COMPOSITE_DSTIN, 0, 0); + } + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/OpacityCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/OpacityCommand.php new file mode 100644 index 000000000..b4708d899 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/OpacityCommand.php @@ -0,0 +1,23 @@ +argument(0)->between(0, 100)->required()->value(); + + $transparency = $transparency > 0 ? (100 / $transparency) : 1000; + + return $image->getCore()->evaluateImage(\Imagick::EVALUATE_DIVIDE, $transparency, \Imagick::CHANNEL_ALPHA); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PickColorCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PickColorCommand.php new file mode 100644 index 000000000..978a1284e --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PickColorCommand.php @@ -0,0 +1,30 @@ +argument(0)->type('digit')->required()->value(); + $y = $this->argument(1)->type('digit')->required()->value(); + $format = $this->argument(2)->type('string')->value('array'); + + // pick color + $color = new Color($image->getCore()->getImagePixelColor($x, $y)); + + // format to output + $this->setOutput($color->format($format)); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelCommand.php new file mode 100644 index 000000000..6eb6ae715 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelCommand.php @@ -0,0 +1,31 @@ +argument(0)->required()->value(); + $color = new Color($color); + $x = $this->argument(1)->type('digit')->required()->value(); + $y = $this->argument(2)->type('digit')->required()->value(); + + // prepare pixel + $draw = new \ImagickDraw; + $draw->setFillColor($color->getPixel()); + $draw->point($x, $y); + + // apply pixel + return $image->getCore()->drawImage($draw); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelateCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelateCommand.php new file mode 100644 index 000000000..66a3205da --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelateCommand.php @@ -0,0 +1,27 @@ +argument(0)->type('digit')->value(10); + + $width = $image->getWidth(); + $height = $image->getHeight(); + + $image->getCore()->scaleImage(max(1, intval($width / $size)), max(1, intval($height / $size))); + $image->getCore()->scaleImage($width, $height); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResetCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResetCommand.php new file mode 100644 index 000000000..77b7f3366 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResetCommand.php @@ -0,0 +1,40 @@ +argument(0)->value(); + + $backup = $image->getBackup($backupName); + + if ($backup instanceof \Imagick) { + + // destroy current core + $image->getCore()->clear(); + + // clone backup + $backup = clone $backup; + + // reset to new resource + $image->setCore($backup); + + return true; + } + + throw new RuntimeException( + "Backup not available. Call backup({$backupName}) before reset()." + ); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCanvasCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCanvasCommand.php new file mode 100644 index 000000000..ecf076106 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCanvasCommand.php @@ -0,0 +1,91 @@ +argument(0)->type('digit')->required()->value(); + $height = $this->argument(1)->type('digit')->required()->value(); + $anchor = $this->argument(2)->value('center'); + $relative = $this->argument(3)->type('boolean')->value(false); + $bgcolor = $this->argument(4)->value(); + + $original_width = $image->getWidth(); + $original_height = $image->getHeight(); + + // check of only width or height is set + $width = is_null($width) ? $original_width : intval($width); + $height = is_null($height) ? $original_height : intval($height); + + // check on relative width/height + if ($relative) { + $width = $original_width + $width; + $height = $original_height + $height; + } + + // check for negative width/height + $width = ($width <= 0) ? $width + $original_width : $width; + $height = ($height <= 0) ? $height + $original_height : $height; + + // create new canvas + $canvas = $image->getDriver()->newImage($width, $height, $bgcolor); + + // set copy position + $canvas_size = $canvas->getSize()->align($anchor); + $image_size = $image->getSize()->align($anchor); + $canvas_pos = $image_size->relativePosition($canvas_size); + $image_pos = $canvas_size->relativePosition($image_size); + + if ($width <= $original_width) { + $dst_x = 0; + $src_x = $canvas_pos->x; + $src_w = $canvas_size->width; + } else { + $dst_x = $image_pos->x; + $src_x = 0; + $src_w = $original_width; + } + + if ($height <= $original_height) { + $dst_y = 0; + $src_y = $canvas_pos->y; + $src_h = $canvas_size->height; + } else { + $dst_y = $image_pos->y; + $src_y = 0; + $src_h = $original_height; + } + + // make image area transparent to keep transparency + // even if background-color is set + $rect = new \ImagickDraw; + $fill = $canvas->pickColor(0, 0, 'hex'); + $fill = $fill == '#ff0000' ? '#00ff00' : '#ff0000'; + $rect->setFillColor($fill); + $rect->rectangle($dst_x, $dst_y, $dst_x + $src_w - 1, $dst_y + $src_h - 1); + $canvas->getCore()->drawImage($rect); + $canvas->getCore()->transparentPaintImage($fill, 0, 0, false); + + $canvas->getCore()->setImageColorspace($image->getCore()->getImageColorspace()); + + // copy image into new canvas + $image->getCore()->cropImage($src_w, $src_h, $src_x, $src_y); + $canvas->getCore()->compositeImage($image->getCore(), \Imagick::COMPOSITE_DEFAULT, $dst_x, $dst_y); + $canvas->getCore()->setImagePage(0,0,0,0); + + // set new core to canvas + $image->setCore($canvas->getCore()); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCommand.php new file mode 100644 index 000000000..3d4dc5bed --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/ResizeCommand.php @@ -0,0 +1,29 @@ +argument(0)->value(); + $height = $this->argument(1)->value(); + $constraints = $this->argument(2)->type('closure')->value(); + + // resize box + $resized = $image->getSize()->resize($width, $height, $constraints); + + // modify image + $image->getCore()->scaleImage($resized->getWidth(), $resized->getHeight()); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/RotateCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/RotateCommand.php new file mode 100644 index 000000000..b3e12a535 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/RotateCommand.php @@ -0,0 +1,30 @@ +argument(0)->type('numeric')->required()->value(); + $color = $this->argument(1)->value(); + $color = new Color($color); + + // restrict rotations beyond 360 degrees, since the end result is the same + $angle = fmod($angle, 360); + + // rotate image + $image->getCore()->rotateImage($color->getPixel(), ($angle * -1)); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/SharpenCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/SharpenCommand.php new file mode 100644 index 000000000..bc5e393f2 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/SharpenCommand.php @@ -0,0 +1,21 @@ +argument(0)->between(0, 100)->value(10); + + return $image->getCore()->unsharpMaskImage(1, 1, $amount / 6.25, 0); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/TrimCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/TrimCommand.php new file mode 100644 index 000000000..bdc897be7 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/TrimCommand.php @@ -0,0 +1,121 @@ +argument(0)->type('string')->value(); + $away = $this->argument(1)->value(); + $tolerance = $this->argument(2)->type('numeric')->value(0); + $feather = $this->argument(3)->type('numeric')->value(0); + + $width = $image->getWidth(); + $height = $image->getHeight(); + + $checkTransparency = false; + + // define borders to trim away + if (is_null($away)) { + $away = ['top', 'right', 'bottom', 'left']; + } elseif (is_string($away)) { + $away = [$away]; + } + + // lower border names + foreach ($away as $key => $value) { + $away[$key] = strtolower($value); + } + + // define base color position + switch (strtolower($base)) { + case 'transparent': + case 'trans': + $checkTransparency = true; + $base_x = 0; + $base_y = 0; + break; + + case 'bottom-right': + case 'right-bottom': + $base_x = $width - 1; + $base_y = $height - 1; + break; + + default: + case 'top-left': + case 'left-top': + $base_x = 0; + $base_y = 0; + break; + } + + // pick base color + if ($checkTransparency) { + $base_color = new Color; // color will only be used to compare alpha channel + } else { + $base_color = $image->pickColor($base_x, $base_y, 'object'); + } + + // trim on clone to get only coordinates + $trimed = clone $image->getCore(); + + // add border to trim specific color + $trimed->borderImage($base_color->getPixel(), 1, 1); + + // trim image + $trimed->trimImage(65850 / 100 * $tolerance); + + // get coordinates of trim + $imagePage = $trimed->getImagePage(); + list($crop_x, $crop_y) = [$imagePage['x']-1, $imagePage['y']-1]; + // $trimed->setImagePage(0, 0, 0, 0); + list($crop_width, $crop_height) = [$trimed->width, $trimed->height]; + + // adjust settings if right should not be trimed + if ( ! in_array('right', $away)) { + $crop_width = $crop_width + ($width - ($width - $crop_x)); + } + + // adjust settings if bottom should not be trimed + if ( ! in_array('bottom', $away)) { + $crop_height = $crop_height + ($height - ($height - $crop_y)); + } + + // adjust settings if left should not be trimed + if ( ! in_array('left', $away)) { + $crop_width = $crop_width + $crop_x; + $crop_x = 0; + } + + // adjust settings if top should not be trimed + if ( ! in_array('top', $away)) { + $crop_height = $crop_height + $crop_y; + $crop_y = 0; + } + + // add feather + $crop_width = min($width, ($crop_width + $feather * 2)); + $crop_height = min($height, ($crop_height + $feather * 2)); + $crop_x = max(0, ($crop_x - $feather)); + $crop_y = max(0, ($crop_y - $feather)); + + // finally crop based on page + $image->getCore()->cropImage($crop_width, $crop_height, $crop_x, $crop_y); + $image->getCore()->setImagePage(0,0,0,0); + + $trimed->destroy(); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/WidenCommand.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/WidenCommand.php new file mode 100644 index 000000000..a1967534c --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/WidenCommand.php @@ -0,0 +1,28 @@ +argument(0)->type('digit')->required()->value(); + $additionalConstraints = $this->argument(1)->type('closure')->value(); + + $this->arguments[0] = $width; + $this->arguments[1] = null; + $this->arguments[2] = function ($constraint) use ($additionalConstraints) { + $constraint->aspectRatio(); + if(is_callable($additionalConstraints)) + $additionalConstraints($constraint); + }; + + return parent::execute($image); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Decoder.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Decoder.php new file mode 100644 index 000000000..f4dde9a84 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Decoder.php @@ -0,0 +1,124 @@ +setBackgroundColor(new \ImagickPixel('transparent')); + $core->readImage($path); + $core->setImageType(defined('\Imagick::IMGTYPE_TRUECOLORALPHA') ? \Imagick::IMGTYPE_TRUECOLORALPHA : \Imagick::IMGTYPE_TRUECOLORMATTE); + + } catch (\ImagickException $e) { + throw new \Intervention\Image\Exception\NotReadableException( + "Unable to read image from path ({$path}).", + 0, + $e + ); + } + + // build image + $image = $this->initFromImagick($core); + $image->setFileInfoFromPath($path); + + return $image; + } + + /** + * Initiates new image from GD resource + * + * @param Resource $resource + * @return \Intervention\Image\Image + */ + public function initFromGdResource($resource) + { + throw new NotSupportedException( + 'Imagick driver is unable to init from GD resource.' + ); + } + + /** + * Initiates new image from Imagick object + * + * @param Imagick $object + * @return \Intervention\Image\Image + */ + public function initFromImagick(\Imagick $object) + { + // currently animations are not supported + // so all images are turned into static + $object = $this->removeAnimation($object); + + // reset image orientation + $object->setImageOrientation(\Imagick::ORIENTATION_UNDEFINED); + + return new Image(new Driver, $object); + } + + /** + * Initiates new image from binary data + * + * @param string $data + * @return \Intervention\Image\Image + */ + public function initFromBinary($binary) + { + $core = new \Imagick; + + try { + $core->setBackgroundColor(new \ImagickPixel('transparent')); + + $core->readImageBlob($binary); + + } catch (\ImagickException $e) { + throw new NotReadableException( + "Unable to read image from binary data.", + 0, + $e + ); + } + + // build image + $image = $this->initFromImagick($core); + $image->mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $binary); + + return $image; + } + + /** + * Turns object into one frame Imagick object + * by removing all frames except first + * + * @param Imagick $object + * @return Imagick + */ + private function removeAnimation(\Imagick $object) + { + $imagick = new \Imagick; + + foreach ($object as $frame) { + $imagick->addImage($frame->getImage()); + break; + } + + $object->destroy(); + + return $imagick; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Driver.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Driver.php new file mode 100644 index 000000000..bb26ca0fe --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Driver.php @@ -0,0 +1,74 @@ +coreAvailable()) { + throw new NotSupportedException( + "ImageMagick module not available with this PHP installation." + ); + } + + $this->decoder = $decoder ? $decoder : new Decoder; + $this->encoder = $encoder ? $encoder : new Encoder; + } + + /** + * Creates new image instance + * + * @param int $width + * @param int $height + * @param mixed $background + * @return \Intervention\Image\Image + */ + public function newImage($width, $height, $background = null) + { + $background = new Color($background); + + // create empty core + $core = new \Imagick; + $core->newImage($width, $height, $background->getPixel(), 'png'); + $core->setType(\Imagick::IMGTYPE_UNDEFINED); + $core->setImageType(\Imagick::IMGTYPE_UNDEFINED); + $core->setColorspace(\Imagick::COLORSPACE_UNDEFINED); + + // build image + $image = new Image(new static, $core); + + return $image; + } + + /** + * Reads given string into color object + * + * @param string $value + * @return AbstractColor + */ + public function parseColor($value) + { + return new Color($value); + } + + /** + * Checks if core module installation is available + * + * @return boolean + */ + protected function coreAvailable() + { + return (extension_loaded('imagick') && class_exists('Imagick')); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Encoder.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Encoder.php new file mode 100644 index 000000000..feb8a9d53 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Encoder.php @@ -0,0 +1,239 @@ +image->getCore(); + $imagick->setImageBackgroundColor('white'); + $imagick->setBackgroundColor('white'); + $imagick = $imagick->mergeImageLayers(\Imagick::LAYERMETHOD_MERGE); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + $imagick->setCompressionQuality($this->quality); + $imagick->setImageCompressionQuality($this->quality); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as PNG string + * + * @return string + */ + protected function processPng() + { + $format = 'png'; + $compression = \Imagick::COMPRESSION_ZIP; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + + $this->image->mime = image_type_to_mime_type(IMAGETYPE_PNG); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as GIF string + * + * @return string + */ + protected function processGif() + { + $format = 'gif'; + $compression = \Imagick::COMPRESSION_LZW; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + + $this->image->mime = image_type_to_mime_type(IMAGETYPE_GIF); + + return $imagick->getImagesBlob(); + } + + protected function processWebp() + { + if ( ! \Imagick::queryFormats('WEBP')) { + throw new NotSupportedException( + "Webp format is not supported by Imagick installation." + ); + } + + $format = 'webp'; + $compression = \Imagick::COMPRESSION_JPEG; + + $imagick = $this->image->getCore(); + $imagick->setImageBackgroundColor(new \ImagickPixel('transparent')); + + $imagick = $imagick->mergeImageLayers(\Imagick::LAYERMETHOD_MERGE); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + $imagick->setImageCompressionQuality($this->quality); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as TIFF string + * + * @return string + */ + protected function processTiff() + { + $format = 'tiff'; + $compression = \Imagick::COMPRESSION_UNDEFINED; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + $imagick->setCompressionQuality($this->quality); + $imagick->setImageCompressionQuality($this->quality); + + $this->image->mime = image_type_to_mime_type(IMAGETYPE_TIFF_II); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as BMP string + * + * @return string + */ + protected function processBmp() + { + $format = 'bmp'; + $compression = \Imagick::COMPRESSION_UNDEFINED; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + + $this->image->mime = image_type_to_mime_type(IMAGETYPE_BMP); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as ICO string + * + * @return string + */ + protected function processIco() + { + $format = 'ico'; + $compression = \Imagick::COMPRESSION_UNDEFINED; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + + $this->image->mime = image_type_to_mime_type(IMAGETYPE_ICO); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as PSD string + * + * @return string + */ + protected function processPsd() + { + $format = 'psd'; + $compression = \Imagick::COMPRESSION_UNDEFINED; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + + $this->image->mime = image_type_to_mime_type(IMAGETYPE_PSD); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as AVIF string + * + * @return string + */ + protected function processAvif() + { + if ( ! \Imagick::queryFormats('AVIF')) { + throw new NotSupportedException( + "AVIF format is not supported by Imagick installation." + ); + } + + $format = 'avif'; + $compression = \Imagick::COMPRESSION_UNDEFINED; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + $imagick->setCompressionQuality($this->quality); + $imagick->setImageCompressionQuality($this->quality); + + return $imagick->getImagesBlob(); + } + + /** + * Processes and returns encoded image as HEIC string + * + * @return string + */ + protected function processHeic() + { + if ( ! \Imagick::queryFormats('HEIC')) { + throw new NotSupportedException( + "HEIC format is not supported by Imagick installation." + ); + } + + $format = 'heic'; + $compression = \Imagick::COMPRESSION_UNDEFINED; + + $imagick = $this->image->getCore(); + $imagick->setFormat($format); + $imagick->setImageFormat($format); + $imagick->setCompression($compression); + $imagick->setImageCompression($compression); + $imagick->setCompressionQuality($this->quality); + $imagick->setImageCompressionQuality($this->quality); + + return $imagick->getImagesBlob(); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Font.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Font.php new file mode 100644 index 000000000..9869d067a --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Font.php @@ -0,0 +1,122 @@ +setStrokeAntialias(true); + $draw->setTextAntialias(true); + + // set font file + if ($this->hasApplicableFontFile()) { + $draw->setFont($this->file); + } else { + throw new RuntimeException( + "Font file must be provided to apply text to image." + ); + } + + // parse text color + $color = new Color($this->color); + + $draw->setFontSize($this->size); + $draw->setFillColor($color->getPixel()); + $draw->setTextKerning($this->kerning); + + // align horizontal + switch (strtolower($this->align)) { + case 'center': + $align = \Imagick::ALIGN_CENTER; + break; + + case 'right': + $align = \Imagick::ALIGN_RIGHT; + break; + + default: + $align = \Imagick::ALIGN_LEFT; + break; + } + + $draw->setTextAlignment($align); + + // align vertical + if (strtolower($this->valign) != 'bottom') { + + // corrections on y-position + switch (strtolower($this->valign)) { + case 'center': + case 'middle': + // calculate box size + $dimensions = $image->getCore()->queryFontMetrics($draw, $this->text); + $posy = $posy + $dimensions['textHeight'] * 0.65 / 2; + break; + + case 'top': + // calculate box size + $dimensions = $image->getCore()->queryFontMetrics($draw, $this->text, false); + $posy = $posy + $dimensions['characterHeight']; + break; + } + } + + // apply to image + $image->getCore()->annotateImage($draw, $posx, $posy, $this->angle * (-1), $this->text); + } + + /** + * Calculates bounding box of current font setting + * + * @return array + */ + public function getBoxSize() + { + $box = []; + + // build draw object + $draw = new \ImagickDraw(); + $draw->setStrokeAntialias(true); + $draw->setTextAntialias(true); + + // set font file + if ($this->hasApplicableFontFile()) { + $draw->setFont($this->file); + } else { + throw new RuntimeException( + "Font file must be provided to apply text to image." + ); + } + + $draw->setFontSize($this->size); + + $dimensions = (new \Imagick())->queryFontMetrics($draw, $this->text); + + if (strlen($this->text) == 0) { + // no text -> no boxsize + $box['width'] = 0; + $box['height'] = 0; + } else { + // get boxsize + $box['width'] = intval(abs($dimensions['textWidth'])); + $box['height'] = intval(abs($dimensions['textHeight'])); + } + + return $box; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/CircleShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/CircleShape.php new file mode 100644 index 000000000..24172ea11 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/CircleShape.php @@ -0,0 +1,40 @@ +width = is_numeric($diameter) ? intval($diameter) : $this->diameter; + $this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter; + $this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter; + } + + /** + * Draw current circle on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + return parent::applyToImage($image, $x, $y); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/EllipseShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/EllipseShape.php new file mode 100644 index 000000000..99694b97b --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/EllipseShape.php @@ -0,0 +1,66 @@ +width = is_numeric($width) ? intval($width) : $this->width; + $this->height = is_numeric($height) ? intval($height) : $this->height; + } + + /** + * Draw ellipse instance on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + $circle = new \ImagickDraw; + + // set background + $bgcolor = new Color($this->background); + $circle->setFillColor($bgcolor->getPixel()); + + // set border + if ($this->hasBorder()) { + $border_color = new Color($this->border_color); + $circle->setStrokeWidth($this->border_width); + $circle->setStrokeColor($border_color->getPixel()); + } + + $circle->ellipse($x, $y, $this->width / 2, $this->height / 2, 0, 360); + + $image->getCore()->drawImage($circle); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/LineShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/LineShape.php new file mode 100644 index 000000000..0d6b3297d --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/LineShape.php @@ -0,0 +1,94 @@ +x = is_numeric($x) ? intval($x) : $this->x; + $this->y = is_numeric($y) ? intval($y) : $this->y; + } + + /** + * Set current line color + * + * @param string $color + * @return void + */ + public function color($color) + { + $this->color = $color; + } + + /** + * Set current line width in pixels + * + * @param int $width + * @return void + */ + public function width($width) + { + $this->width = $width; + } + + /** + * Draw current instance of line to given endpoint on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + $line = new \ImagickDraw; + + $color = new Color($this->color); + $line->setStrokeColor($color->getPixel()); + $line->setStrokeWidth($this->width); + + $line->line($this->x, $this->y, $x, $y); + $image->getCore()->drawImage($line); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/PolygonShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/PolygonShape.php new file mode 100644 index 000000000..45f44ad88 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/PolygonShape.php @@ -0,0 +1,81 @@ +points = $this->formatPoints($points); + } + + /** + * Draw polygon on given image + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + $polygon = new \ImagickDraw; + + // set background + $bgcolor = new Color($this->background); + $polygon->setFillColor($bgcolor->getPixel()); + + // set border + if ($this->hasBorder()) { + $border_color = new Color($this->border_color); + $polygon->setStrokeWidth($this->border_width); + $polygon->setStrokeColor($border_color->getPixel()); + } + + $polygon->polygon($this->points); + + $image->getCore()->drawImage($polygon); + + return true; + } + + /** + * Format polygon points to Imagick format + * + * @param Array $points + * @return Array + */ + private function formatPoints($points) + { + $ipoints = []; + $count = 1; + + foreach ($points as $key => $value) { + if ($count%2 === 0) { + $y = $value; + $ipoints[] = ['x' => $x, 'y' => $y]; + } else { + $x = $value; + } + $count++; + } + + return $ipoints; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/RectangleShape.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/RectangleShape.php new file mode 100644 index 000000000..1166d77b7 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Imagick/Shapes/RectangleShape.php @@ -0,0 +1,84 @@ +x1 = is_numeric($x1) ? intval($x1) : $this->x1; + $this->y1 = is_numeric($y1) ? intval($y1) : $this->y1; + $this->x2 = is_numeric($x2) ? intval($x2) : $this->x2; + $this->y2 = is_numeric($y2) ? intval($y2) : $this->y2; + } + + /** + * Draw rectangle to given image at certain position + * + * @param Image $image + * @param int $x + * @param int $y + * @return boolean + */ + public function applyToImage(Image $image, $x = 0, $y = 0) + { + $rectangle = new \ImagickDraw; + + // set background + $bgcolor = new Color($this->background); + $rectangle->setFillColor($bgcolor->getPixel()); + + // set border + if ($this->hasBorder()) { + $border_color = new Color($this->border_color); + $rectangle->setStrokeWidth($this->border_width); + $rectangle->setStrokeColor($border_color->getPixel()); + } + + $rectangle->rectangle($this->x1, $this->y1, $this->x2, $this->y2); + + $image->getCore()->drawImage($rectangle); + + return true; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Point.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Point.php new file mode 100644 index 000000000..d51452e02 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Point.php @@ -0,0 +1,64 @@ +x = is_numeric($x) ? intval($x) : 0; + $this->y = is_numeric($y) ? intval($y) : 0; + } + + /** + * Sets X coordinate + * + * @param int $x + */ + public function setX($x) + { + $this->x = intval($x); + } + + /** + * Sets Y coordinate + * + * @param int $y + */ + public function setY($y) + { + $this->y = intval($y); + } + + /** + * Sets both X and Y coordinate + * + * @param int $x + * @param int $y + */ + public function setPosition($x, $y) + { + $this->setX($x); + $this->setY($y); + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Response.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Response.php new file mode 100644 index 000000000..59a51e992 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Response.php @@ -0,0 +1,78 @@ +image = $image; + $this->format = $format ? $format : $image->mime; + $this->quality = $quality ? $quality : 90; + } + + /** + * Builds response according to settings + * + * @return mixed + */ + public function make() + { + $this->image->encode($this->format, $this->quality); + $data = $this->image->getEncoded(); + $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $data); + $length = strlen($data); + + if (function_exists('app') && is_a($app = app(), 'Illuminate\Foundation\Application')) { + + $response = IlluminateResponse::make($data); + $response->header('Content-Type', $mime); + $response->header('Content-Length', $length); + + } elseif (class_exists('\Symfony\Component\HttpFoundation\Response')) { + + $response = new SymfonyResponse($data); + $response->headers->set('Content-Type', $mime); + $response->headers->set('Content-Length', $length); + + } else { + + header('Content-Type: ' . $mime); + header('Content-Length: ' . $length); + $response = $data; + } + + return $response; + } +} diff --git a/niucloud/vendor/intervention/image/src/Intervention/Image/Size.php b/niucloud/vendor/intervention/image/src/Intervention/Image/Size.php new file mode 100644 index 000000000..b1f26e405 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/Intervention/Image/Size.php @@ -0,0 +1,374 @@ +width = is_numeric($width) ? intval($width) : 1; + $this->height = is_numeric($height) ? intval($height) : 1; + $this->pivot = $pivot ? $pivot : new Point; + } + + /** + * Set the width and height absolutely + * + * @param int $width + * @param int $height + */ + public function set($width, $height) + { + $this->width = $width; + $this->height = $height; + } + + /** + * Set current pivot point + * + * @param Point $point + */ + public function setPivot(Point $point) + { + $this->pivot = $point; + } + + /** + * Get the current width + * + * @return int + */ + public function getWidth() + { + return intval($this->width); + } + + /** + * Get the current height + * + * @return int + */ + public function getHeight() + { + return intval($this->height); + } + + /** + * Calculate the current aspect ratio + * + * @return float + */ + public function getRatio() + { + return $this->width / $this->height; + } + + /** + * Resize to desired width and/or height + * + * @param int $width + * @param int $height + * @param Closure $callback + * @return Size + */ + public function resize($width, $height, Closure $callback = null) + { + if (is_null($width) && is_null($height)) { + throw new InvalidArgumentException( + "Width or height needs to be defined." + ); + } + + // new size with dominant width + $dominant_w_size = clone $this; + $dominant_w_size->resizeHeight($height, $callback); + $dominant_w_size->resizeWidth($width, $callback); + + // new size with dominant height + $dominant_h_size = clone $this; + $dominant_h_size->resizeWidth($width, $callback); + $dominant_h_size->resizeHeight($height, $callback); + + // decide which size to use + if ($dominant_h_size->fitsInto(new self($width, $height))) { + $this->set($dominant_h_size->width, $dominant_h_size->height); + } else { + $this->set($dominant_w_size->width, $dominant_w_size->height); + } + + return $this; + } + + /** + * Scale size according to given constraints + * + * @param int $width + * @param Closure $callback + * @return Size + */ + private function resizeWidth($width, Closure $callback = null) + { + $constraint = $this->getConstraint($callback); + + if ($constraint->isFixed(Constraint::UPSIZE)) { + $max_width = $constraint->getSize()->getWidth(); + $max_height = $constraint->getSize()->getHeight(); + } + + if (is_numeric($width)) { + + if ($constraint->isFixed(Constraint::UPSIZE)) { + $this->width = ($width > $max_width) ? $max_width : $width; + } else { + $this->width = $width; + } + + if ($constraint->isFixed(Constraint::ASPECTRATIO)) { + $h = max(1, intval(round($this->width / $constraint->getSize()->getRatio()))); + + if ($constraint->isFixed(Constraint::UPSIZE)) { + $this->height = ($h > $max_height) ? $max_height : $h; + } else { + $this->height = $h; + } + } + } + } + + /** + * Scale size according to given constraints + * + * @param int $height + * @param Closure $callback + * @return Size + */ + private function resizeHeight($height, Closure $callback = null) + { + $constraint = $this->getConstraint($callback); + + if ($constraint->isFixed(Constraint::UPSIZE)) { + $max_width = $constraint->getSize()->getWidth(); + $max_height = $constraint->getSize()->getHeight(); + } + + if (is_numeric($height)) { + + if ($constraint->isFixed(Constraint::UPSIZE)) { + $this->height = ($height > $max_height) ? $max_height : $height; + } else { + $this->height = $height; + } + + if ($constraint->isFixed(Constraint::ASPECTRATIO)) { + $w = max(1, intval(round($this->height * $constraint->getSize()->getRatio()))); + + if ($constraint->isFixed(Constraint::UPSIZE)) { + $this->width = ($w > $max_width) ? $max_width : $w; + } else { + $this->width = $w; + } + } + } + } + + /** + * Calculate the relative position to another Size + * based on the pivot point settings of both sizes. + * + * @param Size $size + * @return \Intervention\Image\Point + */ + public function relativePosition(Size $size) + { + $x = $this->pivot->x - $size->pivot->x; + $y = $this->pivot->y - $size->pivot->y; + + return new Point($x, $y); + } + + /** + * Resize given Size to best fitting size of current size. + * + * @param Size $size + * @return \Intervention\Image\Size + */ + public function fit(Size $size, $position = 'center') + { + // create size with auto height + $auto_height = clone $size; + + $auto_height->resize($this->width, null, function ($constraint) { + $constraint->aspectRatio(); + }); + + // decide which version to use + if ($auto_height->fitsInto($this)) { + + $size = $auto_height; + + } else { + + // create size with auto width + $auto_width = clone $size; + + $auto_width->resize(null, $this->height, function ($constraint) { + $constraint->aspectRatio(); + }); + + $size = $auto_width; + } + + $this->align($position); + $size->align($position); + $size->setPivot($this->relativePosition($size)); + + return $size; + } + + /** + * Checks if given size fits into current size + * + * @param Size $size + * @return boolean + */ + public function fitsInto(Size $size) + { + return ($this->width <= $size->width) && ($this->height <= $size->height); + } + + /** + * Aligns current size's pivot point to given position + * and moves point automatically by offset. + * + * @param string $position + * @param int $offset_x + * @param int $offset_y + * @return \Intervention\Image\Size + */ + public function align($position, $offset_x = 0, $offset_y = 0) + { + switch (strtolower($position)) { + + case 'top': + case 'top-center': + case 'top-middle': + case 'center-top': + case 'middle-top': + $x = intval($this->width / 2); + $y = 0 + $offset_y; + break; + + case 'top-right': + case 'right-top': + $x = $this->width - $offset_x; + $y = 0 + $offset_y; + break; + + case 'left': + case 'left-center': + case 'left-middle': + case 'center-left': + case 'middle-left': + $x = 0 + $offset_x; + $y = intval($this->height / 2); + break; + + case 'right': + case 'right-center': + case 'right-middle': + case 'center-right': + case 'middle-right': + $x = $this->width - $offset_x; + $y = intval($this->height / 2); + break; + + case 'bottom-left': + case 'left-bottom': + $x = 0 + $offset_x; + $y = $this->height - $offset_y; + break; + + case 'bottom': + case 'bottom-center': + case 'bottom-middle': + case 'center-bottom': + case 'middle-bottom': + $x = intval($this->width / 2); + $y = $this->height - $offset_y; + break; + + case 'bottom-right': + case 'right-bottom': + $x = $this->width - $offset_x; + $y = $this->height - $offset_y; + break; + + case 'center': + case 'middle': + case 'center-center': + case 'middle-middle': + $x = intval($this->width / 2) + $offset_x; + $y = intval($this->height / 2) + $offset_y; + break; + + default: + case 'top-left': + case 'left-top': + $x = 0 + $offset_x; + $y = 0 + $offset_y; + break; + } + + $this->pivot->setPosition($x, $y); + + return $this; + } + + /** + * Runs constraints on current size + * + * @param Closure $callback + * @return \Intervention\Image\Constraint + */ + private function getConstraint(Closure $callback = null) + { + $constraint = new Constraint(clone $this); + + if (is_callable($callback)) { + $callback($constraint); + } + + return $constraint; + } +} diff --git a/niucloud/vendor/intervention/image/src/config/config.php b/niucloud/vendor/intervention/image/src/config/config.php new file mode 100644 index 000000000..2b1d2c3e1 --- /dev/null +++ b/niucloud/vendor/intervention/image/src/config/config.php @@ -0,0 +1,20 @@ + 'gd' + +]; diff --git a/niucloud/vendor/monolog/monolog/CHANGELOG.md b/niucloud/vendor/monolog/monolog/CHANGELOG.md index 8a8c65124..98d1f8b27 100644 --- a/niucloud/vendor/monolog/monolog/CHANGELOG.md +++ b/niucloud/vendor/monolog/monolog/CHANGELOG.md @@ -1,7 +1,3 @@ -### 2.9.1 (2023-02-06) - - * Fixed Logger not being serializable anymore (#1792) - ### 2.9.0 (2023-02-05) * Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown (#1748) diff --git a/niucloud/vendor/monolog/monolog/src/Monolog/Logger.php b/niucloud/vendor/monolog/monolog/src/Monolog/Logger.php index 84a2f5510..775d7cf1f 100644 --- a/niucloud/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/niucloud/vendor/monolog/monolog/src/Monolog/Logger.php @@ -722,40 +722,4 @@ class Logger implements LoggerInterface, ResettableInterface ($this->exceptionHandler)($e, $record); } - - /** - * @return array - */ - public function __serialize(): array - { - return [ - 'name' => $this->name, - 'handlers' => $this->handlers, - 'processors' => $this->processors, - 'microsecondTimestamps' => $this->microsecondTimestamps, - 'timezone' => $this->timezone, - 'exceptionHandler' => $this->exceptionHandler, - 'logDepth' => $this->logDepth, - 'detectCycles' => $this->detectCycles, - ]; - } - - /** - * @param array $data - */ - public function __unserialize(array $data): void - { - foreach (['name', 'handlers', 'processors', 'microsecondTimestamps', 'timezone', 'exceptionHandler', 'logDepth', 'detectCycles'] as $property) { - if (isset($data[$property])) { - $this->$property = $data[$property]; - } - } - - if (\PHP_VERSION_ID >= 80100) { - // Local variable for phpstan, see https://github.com/phpstan/phpstan/issues/6732#issuecomment-1111118412 - /** @var \WeakMap<\Fiber, int> $fiberLogDepth */ - $fiberLogDepth = new \WeakMap(); - $this->fiberLogDepth = $fiberLogDepth; - } - } } diff --git a/niucloud/vendor/myclabs/php-enum/README.md b/niucloud/vendor/myclabs/php-enum/README.md index 681d55ee7..1e4d1ff42 100644 --- a/niucloud/vendor/myclabs/php-enum/README.md +++ b/niucloud/vendor/myclabs/php-enum/README.md @@ -1,9 +1,9 @@ # PHP Enum implementation inspired from SplEnum -[![GitHub Actions][GA Image]][GA Link] +[![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 Shepherd][Shepherd Image]][Shepherd Link] +[![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). @@ -130,65 +130,9 @@ final class Action extends Enum } ``` -## Native enums and migration -Native enum arrived to PHP in version 8.1: https://www.php.net/enumerations -If your project is running PHP 8.1+ or your library has it as a minimum requirement you should use it instead of this library. - -When migrating from `myclabs/php-enum`, the effort should be small if the usage was in the recommended way: -- private constants -- final classes -- no method overridden - -Changes for migration: -- Class definition should be changed from -```php -/** - * @method static Action VIEW() - * @method static Action EDIT() - */ -final class Action extends Enum -{ - private const VIEW = 'view'; - private const EDIT = 'edit'; -} -``` - to -```php -enum Action: string -{ - case VIEW = 'view'; - case EDIT = 'edit'; -} -``` -All places where the class was used as a type will continue to work. - -Usages and the change needed: - -| Operation | myclabs/php-enum | native enum | -|----------------------------------------------------------------|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Obtain an instance will change from | `$enumCase = Action::VIEW()` | `$enumCase = Action::VIEW` | -| Create an enum from a backed value | `$enumCase = new Action('view')` | `$enumCase = Action::from('view')` | -| Get the backed value of the enum instance | `$enumCase->getValue()` | `$enumCase->value` | -| Compare two enum instances | `$enumCase1 == $enumCase2`
or
`$enumCase1->equals($enumCase2)` | `$enumCase1 === $enumCase2` | -| Get the key/name of the enum instance | `$enumCase->getKey()` | `$enumCase->name` | -| Get a list of all the possible instances of the enum | `Action::values()` | `Action::cases()` | -| Get a map of possible instances of the enum mapped by name | `Action::values()` | `array_combine(array_map(fn($case) => $case->name, Action::cases()), Action::cases())`
or
`(new ReflectionEnum(Action::class))->getConstants()` | -| Get a list of all possible names of the enum | `Action::keys()` | `array_map(fn($case) => $case->name, Action::cases())` | -| Get a list of all possible backed values of the enum | `Action::toArray()` | `array_map(fn($case) => $case->value, Action::cases())` | -| Get a map of possible backed values of the enum mapped by name | `Action::toArray()` | `array_combine(array_map(fn($case) => $case->name, Action::cases()), array_map(fn($case) => $case->value, Action::cases()))`
or
`array_map(fn($case) => $case->value, (new ReflectionEnum(Action::class))->getConstants()))` | - ## Related projects -- [PHP 8.1+ native enum](https://www.php.net/enumerations) - [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) - - -[GA Image]: https://github.com/myclabs/php-enum/workflows/CI/badge.svg - -[GA Link]: https://github.com/myclabs/php-enum/actions?query=workflow%3A%22CI%22+branch%3Amaster - -[Shepherd Image]: https://shepherd.dev/github/myclabs/php-enum/coverage.svg - -[Shepherd Link]: https://shepherd.dev/github/myclabs/php-enum +- [Yii2 enum mapping](https://github.com/KartaviK/yii2-enum) diff --git a/niucloud/vendor/myclabs/php-enum/composer.json b/niucloud/vendor/myclabs/php-enum/composer.json index 978cb1959..924f924bb 100644 --- a/niucloud/vendor/myclabs/php-enum/composer.json +++ b/niucloud/vendor/myclabs/php-enum/composer.json @@ -14,10 +14,7 @@ "autoload": { "psr-4": { "MyCLabs\\Enum\\": "src/" - }, - "classmap": [ - "stubs/Stringable.php" - ] + } }, "autoload-dev": { "psr-4": { diff --git a/niucloud/vendor/myclabs/php-enum/psalm.xml b/niucloud/vendor/myclabs/php-enum/psalm.xml new file mode 100644 index 000000000..ff06b66ed --- /dev/null +++ b/niucloud/vendor/myclabs/php-enum/psalm.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/niucloud/vendor/myclabs/php-enum/src/Enum.php b/niucloud/vendor/myclabs/php-enum/src/Enum.php index 4c94cf6d3..89064eba7 100644 --- a/niucloud/vendor/myclabs/php-enum/src/Enum.php +++ b/niucloud/vendor/myclabs/php-enum/src/Enum.php @@ -19,7 +19,7 @@ namespace MyCLabs\Enum; * @psalm-immutable * @psalm-consistent-constructor */ -abstract class Enum implements \JsonSerializable, \Stringable +abstract class Enum implements \JsonSerializable { /** * Enum value diff --git a/niucloud/vendor/myclabs/php-enum/stubs/Stringable.php b/niucloud/vendor/myclabs/php-enum/stubs/Stringable.php deleted file mode 100644 index 4811af700..000000000 --- a/niucloud/vendor/myclabs/php-enum/stubs/Stringable.php +++ /dev/null @@ -1,11 +0,0 @@ - $matchRule, ]); } + return $this->httpPostJson('cgi-bin/menu/create', ['button' => $buttons]); } diff --git a/niucloud/vendor/overtrue/wechat/src/OpenWork/License/Account.php b/niucloud/vendor/overtrue/wechat/src/OpenWork/License/Account.php index 691e380f9..772259cc9 100644 --- a/niucloud/vendor/overtrue/wechat/src/OpenWork/License/Account.php +++ b/niucloud/vendor/overtrue/wechat/src/OpenWork/License/Account.php @@ -203,33 +203,4 @@ class Account extends BaseClient 'transfer_list' => $transferList ]); } - - /** - * 分配激活码给下游企业 - * - * >服务商可调用该接口将为上游企业购买的激活码分配给下游企业使用。 - * - * @param string $fromCorpid 上游企业corpid。支持明文或者密文的corpid - * @param string $toCorpid 下游企业corpid。支持明文或者密文的corpid - * @param array $activeCode 分享的接口许可激活码。单次分享激活码不可超过1000个,累计分享给同一下游企业的激活码总数不可超过上下游通讯录中该下游企业人数的2倍 - * - * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string - * - * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException - * @throws \GuzzleHttp\Exception\GuzzleException - * @noinspection PhpFullyQualifiedNameUsageInspection - * @noinspection SpellCheckingInspection - */ - public function share(string $fromCorpid, string $toCorpid, array $activeCode) - { - return $this->httpPostJson('cgi-bin/license/batch_share_active_code', [ - 'from_corpid' => $fromCorpid, - 'to_corpid' => $toCorpid, - 'share_list' => array_map(function ($code) { - return [ - 'active_code' => $code, - ]; - }, $activeCode), - ]); - } } diff --git a/niucloud/vendor/overtrue/wechat/src/Work/Auth/Client.php b/niucloud/vendor/overtrue/wechat/src/Work/Auth/Client.php deleted file mode 100644 index 4584eb8da..000000000 --- a/niucloud/vendor/overtrue/wechat/src/Work/Auth/Client.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace EasyWeChat\Work\Auth; - -use EasyWeChat\Kernel\BaseClient; - -/** - * Class Client. - * - * @author lujunyi - */ -class Client extends BaseClient -{ - /** - * 获取网页授权登录url,适用于自建应用与代开发应用。 - * - * @see https://developer.work.weixin.qq.com/document/path/91022 - * - * @param string $redirectUri - * @param string $scope - * @param string $agentId - * @param string|null $state - * - * @return string - * @throws \Exception - */ - public function getOAuthRedirectUrl(string $redirectUri = '', string $scope = 'snsapi_privateinfo', string $agentId = '', string $state = null) - { - $redirectUri || $redirectUri = $this->app->config['redirect_uri_oauth']; - $state || $state = random_bytes(64); - $params = [ - 'appid' => $this->app['config']['suite_id'], - 'redirect_uri' => $redirectUri, - 'response_type' => 'code', - 'scope' => $scope, - 'state' => $state, - 'agentid' => $agentId, - ]; - - return 'https://open.weixin.qq.com/connect/oauth2/authorize?' . http_build_query($params) . '#wechat_redirect'; - } - - - /** - * 获取访问用户身份。根据code获取成员信息,适用于自建应用与代开发应用。 - * - * @see https://developer.work.weixin.qq.com/document/path/91023 - * - * @param string $code - * - * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string - * - * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function getUserByCode(string $code) - { - $params = [ - 'code' => $code, - ]; - - return $this->httpGet('cgi-bin/auth/getuserinfo', $params); - } - - /** - * 获取访问用户敏感信息。自建应用与代开发应用可通过该接口获取成员授权的敏感字段。 - * - * @see https://developer.work.weixin.qq.com/document/path/95833 - * - * @param string $userTicket - * - * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string - * - * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function getUserByTicket(string $userTicket) - { - $params = [ - 'user_ticket' => $userTicket, - ]; - - return $this->httpPostJson('cgi-bin/auth/getuserdetail', $params); - } -} diff --git a/niucloud/vendor/overtrue/wechat/src/Work/Auth/ServiceProvider.php b/niucloud/vendor/overtrue/wechat/src/Work/Auth/ServiceProvider.php index 7e0ee9528..5f0dba9db 100644 --- a/niucloud/vendor/overtrue/wechat/src/Work/Auth/ServiceProvider.php +++ b/niucloud/vendor/overtrue/wechat/src/Work/Auth/ServiceProvider.php @@ -29,8 +29,5 @@ class ServiceProvider implements ServiceProviderInterface isset($app['access_token']) || $app['access_token'] = function ($app) { return new AccessToken($app); }; - !isset($app['auth']) && $app['auth'] = function ($app) { - return new Client($app); - }; } } diff --git a/niucloud/vendor/overtrue/wechat/src/Work/Message/Client.php b/niucloud/vendor/overtrue/wechat/src/Work/Message/Client.php index fff1cbe50..7cf749379 100644 --- a/niucloud/vendor/overtrue/wechat/src/Work/Message/Client.php +++ b/niucloud/vendor/overtrue/wechat/src/Work/Message/Client.php @@ -72,33 +72,4 @@ class Client extends BaseClient return $this->httpPostJson('cgi-bin/message/update_taskcard', $params); } - - /** - * * 更新模版卡片消息状态 - * - * @see https://developer.work.weixin.qq.com/document/path/94888 - * - * @param array $userids - * @param int $agentId - * @param string $responseCode - * @param string $replaceName - * - * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string - * - * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException - * @throws \GuzzleHttp\Exception\GuzzleException - */ - public function updateTemplateCard(array $userids, int $agentId, string $responseCode, string $replaceName = '已收到') - { - $params = [ - 'userids' => $userids, - 'agentid' => $agentId, - 'response_code' => $responseCode, - 'button' => [ - 'replace_name' => $replaceName - ] - ]; - - return $this->httpPostJson('cgi-bin/message/update_template_card', $params); - } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/CHANGELOG.md b/niucloud/vendor/phpoffice/phpspreadsheet/CHANGELOG.md index 1a0b5f3f7..2f383e23f 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/CHANGELOG.md +++ b/niucloud/vendor/phpoffice/phpspreadsheet/CHANGELOG.md @@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). +## 1.28.0 - 2023-02-25 + +### Added + +- Support for configuring a Chart Title's overlay [PR #3325](https://github.com/PHPOffice/PhpSpreadsheet/pull/3325) +- Wizards for defining Number Format masks for Numbers, Percentages, Scientific, Currency and Accounting [PR #3334](https://github.com/PHPOffice/PhpSpreadsheet/pull/3334) +- Support for fixed value divisor in fractional Number Format Masks [PR #3339](https://github.com/PHPOffice/PhpSpreadsheet/pull/3339) +- Allow More Fonts/Fontnames for Exact Width Calculation [PR #3326](https://github.com/PHPOffice/PhpSpreadsheet/pull/3326) [Issue #3190](https://github.com/PHPOffice/PhpSpreadsheet/issues/3190) +- Allow override of the Value Binder when setting a Cell value [PR #3361](https://github.com/PHPOffice/PhpSpreadsheet/pull/3361) + +### Changed + +- Improved handling for @ placeholder in Number Format Masks [PR #3344](https://github.com/PHPOffice/PhpSpreadsheet/pull/3344) +- Improved handling for ? placeholder in Number Format Masks [PR #3394](https://github.com/PHPOffice/PhpSpreadsheet/pull/3394) +- Improved support for locale settings and currency codes when matching formatted strings to numerics in the Calculation Engine [PR #3373](https://github.com/PHPOffice/PhpSpreadsheet/pull/3373) and [PR #3374](https://github.com/PHPOffice/PhpSpreadsheet/pull/3374) +- Improved support for locale settings and matching in the Advanced Value Binder [PR #3376](https://github.com/PHPOffice/PhpSpreadsheet/pull/3376) + +### Deprecated + +- Rationalisation of Pre-defined Currency Format Masks + +### Removed + +- Nothing + +### Fixed + +- Calculation Engine doesn't evaluate Defined Name when default cell A1 is quote-prefixed [Issue #3335](https://github.com/PHPOffice/PhpSpreadsheet/issues/3335) [PR #3336](https://github.com/PHPOffice/PhpSpreadsheet/pull/3336) +- XLSX Writer - Array Formulas do not include function prefix [Issue #3337](https://github.com/PHPOffice/PhpSpreadsheet/issues/3337) [PR #3338](https://github.com/PHPOffice/PhpSpreadsheet/pull/3338) +- Permit Max Column for Row Breaks [Issue #3143](https://github.com/PHPOffice/PhpSpreadsheet/issues/3143) [PR #3345](https://github.com/PHPOffice/PhpSpreadsheet/pull/3345) +- AutoSize Columns should allow for dropdown icon when AutoFilter is for a Table [Issue #3356](https://github.com/PHPOffice/PhpSpreadsheet/issues/3356) [PR #3358](https://github.com/PHPOffice/PhpSpreadsheet/pull/3358) and for Center Alignment of Headers [Issue #3395](https://github.com/PHPOffice/PhpSpreadsheet/issues/3395) [PR #3399](https://github.com/PHPOffice/PhpSpreadsheet/pull/3399) +- Decimal Precision for Scientific Number Format Mask [Issue #3381](https://github.com/PHPOffice/PhpSpreadsheet/issues/3381) [PR #3382](https://github.com/PHPOffice/PhpSpreadsheet/pull/3382) +- Xls Writer Parser Handle Boolean Literals as Function Arguments [Issue #3369](https://github.com/PHPOffice/PhpSpreadsheet/issues/3369) [PR #3391](https://github.com/PHPOffice/PhpSpreadsheet/pull/3391) +- Conditional Formatting Improvements for Xlsx [Issue #3370](https://github.com/PHPOffice/PhpSpreadsheet/issues/3370) [Issue #3202](https://github.com/PHPOffice/PhpSpreadsheet/issues/3302) [PR #3372](https://github.com/PHPOffice/PhpSpreadsheet/pull/3372) +- Coerce Bool to Int for Mathematical Operations on Arrays [Issue #3389](https://github.com/PHPOffice/PhpSpreadsheet/issues/3389) [Issue #3396](https://github.com/PHPOffice/PhpSpreadsheet/issues/3396) [PR #3392](https://github.com/PHPOffice/PhpSpreadsheet/pull/3392) + ## 1.27.1 - 2023-02-08 ### Added @@ -39,7 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Changed -- Nothing +- `toFormattedString` will now always return a string. This can affect the results of `toArray`, `namedRangeToArray`, and `rangeToArray`. [PR #3304](https://github.com/PHPOffice/PhpSpreadsheet/pull/3304) ### Deprecated @@ -167,7 +203,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Fixed -- Fix update to defined names when inserting/deleting rows/columns [Issue #3076](https://github.com/PHPOffice/PhpSpreadsheet/issues/3076) [PR #3077](https://github.com/PHPOffice/PhpSpreadsheet/pull/3077) +- Fix update to defined names when inserting/deleting rows/columns [Issue #3076](https://github.com/PHPOffice/PhpSpreadsheet/issues/3076) [PR #3077](https://github.com/PHPOffice/PhpSpreadsheet/pull/3077) - Fix DataValidation sqRef when inserting/deleting rows/columns [Issue #3056](https://github.com/PHPOffice/PhpSpreadsheet/issues/3056) [PR #3074](https://github.com/PHPOffice/PhpSpreadsheet/pull/3074) - Named ranges not usable as anchors in OFFSET function [Issue #3013](https://github.com/PHPOffice/PhpSpreadsheet/issues/3013) - Fully flatten an array [Issue #2955](https://github.com/PHPOffice/PhpSpreadsheet/issues/2955) [PR #2956](https://github.com/PHPOffice/PhpSpreadsheet/pull/2956) @@ -357,7 +393,7 @@ Note that this will be the last 1.x branch release before the 2.x release. We wi - Use color palette if supplied [Issue #2499](https://github.com/PHPOffice/PhpSpreadsheet/issues/2499) [PR #2595](https://github.com/PHPOffice/PhpSpreadsheet/pull/2595) - Xls reader treat drawing offsets as int rather than float [PR #2648](https://github.com/PHPOffice/PhpSpreadsheet/pull/2648) - Handle booleans in conditional styles properly [PR #2654](https://github.com/PHPOffice/PhpSpreadsheet/pull/2654) -- Fix for reading files in the root directory of a ZipFile, which should not be prefixed by relative paths ("./") as dirname($filename) does by default. +- Fix for reading files in the root directory of a ZipFile, which should not be prefixed by relative paths ("./") as dirname($filename) does by default. - Fix invalid style of cells in empty columns with columnDimensions and rows with rowDimensions in added external sheet. [PR #2739](https://github.com/PHPOffice/PhpSpreadsheet/pull/2739) - Time Interval Formatting [Issue #2768](https://github.com/PHPOffice/PhpSpreadsheet/issues/2768) [PR #2772](https://github.com/PHPOffice/PhpSpreadsheet/pull/2772) @@ -370,9 +406,9 @@ Note that this will be the last 1.x branch release before the 2.x release. We wi - Improved support for passing of array arguments to Excel function implementations to return array results (where appropriate). [Issue #2551](https://github.com/PHPOffice/PhpSpreadsheet/issues/2551) - This is the first stage in an ongoing process of adding array support to all appropriate function implementations, + This is the first stage in an ongoing process of adding array support to all appropriate function implementations, - Support for the Excel365 Math/Trig SEQUENCE() function [PR #2536](https://github.com/PHPOffice/PhpSpreadsheet/pull/2536) -- Support for the Excel365 Math/Trig RANDARRAY() function [PR #2540](https://github.com/PHPOffice/PhpSpreadsheet/pull/2540) +- Support for the Excel365 Math/Trig RANDARRAY() function [PR #2540](https://github.com/PHPOffice/PhpSpreadsheet/pull/2540) Note that the Spill Operator is not yet supported in the Calculation Engine; but this can still be useful for defining array constants. - Improved support for Conditional Formatting Rules [PR #2491](https://github.com/PHPOffice/PhpSpreadsheet/pull/2491) @@ -386,7 +422,7 @@ Note that this will be the last 1.x branch release before the 2.x release. We wi - Expression - Provision of CF Wizards (for all the above listed rule types) to help create/modify CF Rules without having to manage all the combinations of types/operators, and the complexities of formula expressions, or the text/timePeriod attributes. - See [documentation](https://phpspreadsheet.readthedocs.io/en/latest/topics/conditional-formatting/) for details + See [documentation](https://phpspreadsheet.readthedocs.io/en/latest/topics/conditional-formatting/) for details - Full support of the above CF Rules for the Xlsx Reader and Writer; even when the file being loaded has CF rules listed in the `` element for the worksheet rather than the `` element. - Provision of a CellMatcher to identify if rules are matched for a cell, and which matching style will be applied. @@ -576,7 +612,7 @@ Note that this will be the last 1.x branch release before the 2.x release. We wi - Xls Reader changing grey background to black in Excel template [Issue #2147](https://github.com/PHPOffice/PhpSpreadsheet/issues/2147) [PR #2156](https://github.com/PHPOffice/PhpSpreadsheet/pull/2156) - Column width and Row height styles in the Html Reader when the value includes a unit of measure [Issue #2145](https://github.com/PHPOffice/PhpSpreadsheet/issues/2145). - Data Validation flags not set correctly when reading XLSX files [Issue #2224](https://github.com/PHPOffice/PhpSpreadsheet/issues/2224) [PR #2225](https://github.com/PHPOffice/PhpSpreadsheet/pull/2225) -- Reading XLSX files without styles.xml throws an exception [Issue #2246](https://github.com/PHPOffice/PhpSpreadsheet/issues/2246) +- Reading XLSX files without styles.xml throws an exception [Issue #2246](https://github.com/PHPOffice/PhpSpreadsheet/issues/2246) - Improved performance of `Style::applyFromArray()` when applied to several cells [PR #1785](https://github.com/PHPOffice/PhpSpreadsheet/issues/1785). - Improve XLSX parsing speed if no readFilter is applied (again) - [#772](https://github.com/PHPOffice/PhpSpreadsheet/issues/772) @@ -641,7 +677,7 @@ Note that this will be the last 1.x branch release before the 2.x release. We wi `ABS()`, `ACOS()`, `ACOSH()`, `ASIN()`, `ASINH()`, `ATAN()`, `ATANH()`, `COS()`, `COSH()`, `DEGREES()` (rad2deg), `EXP()`, `LN()` (log), `LOG10()`, `RADIANS()` (deg2rad), `SIN()`, `SINH()`, `SQRT()`, `TAN()`, `TANH()`. - + One TextData function is also affected: `REPT()` (str_repeat). - `formatAsDate` correctly matches language metadata, reverting c55272e - Formulae that previously crashed on sub function call returning excel error value now return said value. @@ -1271,7 +1307,7 @@ Note that this will be the last 1.x branch release before the 2.x release. We wi - Ignore inlineStr type if formula element exists - @ncrypthic [#570](https://github.com/PHPOffice/PHPExcel/issues/570) - Excel 2007 Reader freezes because of conditional formatting - @rentalhost [#575](https://github.com/PHPOffice/PHPExcel/issues/575) - Readers will now parse files containing worksheet titles over 31 characters [#176](https://github.com/PHPOffice/PhpSpreadsheet/pull/176) -- Fixed PHP8 deprecation warning for libxml_disable_entity_loader() [#1625](https://github.com/phpoffice/phpspreadsheet/pull/1625) +- Fixed PHP8 deprecation warning for libxml_disable_entity_loader() [#1625](https://github.com/phpoffice/phpspreadsheet/pull/1625) ### General diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/README.md b/niucloud/vendor/phpoffice/phpspreadsheet/README.md index 77b8a3aea..d9a807326 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/README.md +++ b/niucloud/vendor/phpoffice/phpspreadsheet/README.md @@ -100,16 +100,19 @@ Supporters will receive access to articles about working with PhpSpreadsheet, an Posts already available to Patreon supporters: - The Dating Game - A look at how MS Excel (and PhpSpreadsheet) handle date and time values. +- Looping the Loop + - Advice on Iterating through the rows and cells in a worksheet. The next post (currently being written) will be: - - Looping the Loop - - Advice on Iterating through the cells in a worksheet. + - Behind the Mask + - A look at Number Format Masks. My aim is to post at least one article each month, taking a detailed look at some feature of MS Excel and how to use that feature in PhpSpreadsheet, or on how to perform different activities in PhpSpreadsheet. Planned posts for the future include topics like: - Tables - Structured References + - AutoFiltering - Array Formulae - Conditional Formatting - Data Validation diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon b/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon index a07b437fc..eff03914e 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon +++ b/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon @@ -24,1378 +24,3 @@ parameters: message: "#^Strict comparison using \\=\\=\\= between PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\FormulaToken and null will always evaluate to false\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/FormulaParser.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\:\\:CHOOSE\\(\\) has parameter \\$chooseArgs with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\:\\:OFFSET\\(\\) should return array\\|string but returns array\\|int\\|string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:sheetName\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Lookup\\:\\:verifyResultVector\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Lookup\\:\\:verifyResultVector\\(\\) has parameter \\$resultVector with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\LookupBase\\:\\:validateIndexLookup\\(\\) has parameter \\$index_number with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Matrix\\:\\:extractRowValue\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:adjustEndCellColumnForWidth\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:adjustEndCellColumnForWidth\\(\\) has parameter \\$columns with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:adjustEndCellColumnForWidth\\(\\) has parameter \\$width with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:adustEndCellRowForHeight\\(\\) has parameter \\$endCellRow with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:adustEndCellRowForHeight\\(\\) has parameter \\$height with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:adustEndCellRowForHeight\\(\\) has parameter \\$rows with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:extractRequiredCells\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:extractWorksheet\\(\\) has parameter \\$cellAddress with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Trends\\:\\:GROWTH\\(\\) should return array\\ but returns array\\\\>\\>\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Trends\\:\\:TREND\\(\\) should return array\\ but returns array\\\\>\\>\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Trends\\:\\:checkTrendArrays\\(\\) has parameter \\$array1 with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Trends\\:\\:checkTrendArrays\\(\\) has parameter \\$array2 with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Trends.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\TextData\\:\\:CONCATENATE\\(\\) has parameter \\$args with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData.php - - - - message: "#^Variable \\$value on left side of \\?\\? always exists and is not nullable\\.$#" - count: 4 - path: src/PhpSpreadsheet/Calculation/TextData/Extract.php - - - - message: "#^Variable \\$value on left side of \\?\\? always exists and is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Text.php - - - - message: "#^Call to an undefined method object\\:\\:getHashCode\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/Coordinate.php - - - - message: "#^Parameter \\#4 \\$currentRow of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:validateRange\\(\\) expects int, string given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/Coordinate.php - - - - message: "#^Parameter \\#5 \\$endRow of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:validateRange\\(\\) expects int, string given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/Coordinate.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\IOFactory\\:\\:createReader\\(\\) should return PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\IReader but returns object\\.$#" - count: 1 - path: src/PhpSpreadsheet/IOFactory.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\IOFactory\\:\\:createWriter\\(\\) should return PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\IWriter but returns object\\.$#" - count: 1 - path: src/PhpSpreadsheet/IOFactory.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\IOFactory\\:\\:\\$readers has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/IOFactory.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\IOFactory\\:\\:\\$writers has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/IOFactory.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\BaseReader\\:\\:getSecurityScanner\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/BaseReader.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\BaseReader\\:\\:\\$fileHandle has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/BaseReader.php - - - - message: "#^Offset 'percentage' does not exist on SimpleXMLElement\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php - - - - message: "#^Offset 'value' does not exist on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php - - - - message: "#^Variable \\$orientation on left side of \\?\\? always exists and is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php - - - - message: "#^Variable \\$value on left side of \\?\\? always exists and is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Html.php - - - - message: "#^Cannot call method children\\(\\) on SimpleXMLElement\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Cannot call method getAttributeNS\\(\\) on DOMElement\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Cannot call method getElementsByTagNameNS\\(\\) on DOMElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Cannot call method getNamedItem\\(\\) on DOMNamedNodeMap\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Cannot call method getNamespaces\\(\\) on SimpleXMLElement\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\:\\:listWorksheetNames\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Parameter \\#1 \\$element of method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\:\\:scanElementForText\\(\\) expects DOMNode, DOMElement\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Parameter \\#1 \\$settings of method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\:\\:lookForActiveSheet\\(\\) expects DOMElement, DOMElement\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Parameter \\#1 \\$settings of method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\:\\:lookForSelectedCells\\(\\) expects DOMElement, DOMElement\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - - - message: "#^Cannot call method getElementsByTagNameNS\\(\\) on DOMElement\\|null\\.$#" - count: 3 - path: src/PhpSpreadsheet/Reader/Ods/PageSettings.php - - - - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" - count: 6 - path: src/PhpSpreadsheet/Reader/Ods/PageSettings.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\\\PageSettings\\:\\:\\$pageLayoutStyles has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/PageSettings.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\\\Properties\\:\\:load\\(\\) has parameter \\$namespacesMeta with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/Properties.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\\\Properties\\:\\:setMetaProperties\\(\\) has parameter \\$namespacesMeta with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/Properties.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\\\Properties\\:\\:setMetaProperties\\(\\) has parameter \\$propertyName with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/Properties.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\\\Properties\\:\\:setUserDefinedProperty\\(\\) has parameter \\$propertyValue with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/Properties.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\\\Properties\\:\\:setUserDefinedProperty\\(\\) has parameter \\$propertyValueAttributes with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/Properties.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\\\Properties\\:\\:\\$spreadsheet has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/Properties.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Security\\\\XmlScanner\\:\\:__construct\\(\\) has parameter \\$pattern with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Security/XmlScanner.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Security\\\\XmlScanner\\:\\:getInstance\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Security/XmlScanner.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Security\\\\XmlScanner\\:\\:threadSafeLibxmlDisableEntityLoaderAvailability\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Security/XmlScanner.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Security\\\\XmlScanner\\:\\:\\$callback has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Security/XmlScanner.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Security\\\\XmlScanner\\:\\:\\$libxmlDisableEntityLoaderValue has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Security/XmlScanner.php - - - - message: "#^Call to an undefined method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\\\SpContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\\\BSE\\:\\:getDgContainer\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\\\SpContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\\\BSE\\:\\:getDggContainer\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getEndCoordinates\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getEndOffsetX\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getEndOffsetY\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getNestingLevel\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getOPT\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getStartCoordinates\\(\\)\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getStartOffsetX\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Call to an undefined method object\\:\\:getStartOffsetY\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Cannot access offset 1 on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:includeCellRangeFiltered\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:includeCellRangeFiltered\\(\\) has parameter \\$cellRangeAddress with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:parseRichText\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:parseRichText\\(\\) has parameter \\$is with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#1 \\$block of method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:makeKey\\(\\) expects int, float given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#1 \\$showSummaryBelow of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\:\\:setShowSummaryBelow\\(\\) expects bool, int given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#1 \\$showSummaryRight of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\:\\:setShowSummaryRight\\(\\) expects bool, int given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#2 \\$row of method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\IReadFilter\\:\\:readCell\\(\\) expects int, string given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#2 \\$row of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Xls\\:\\:sizeRow\\(\\) expects int, string given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#2 \\$startRow of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Xls\\:\\:getDistanceY\\(\\) expects int, string given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, int\\|string\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#4 \\$endRow of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Xls\\:\\:getDistanceY\\(\\) expects int, string given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:\\$data \\(string\\) does not accept string\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:\\$documentSummaryInformation \\(string\\) does not accept string\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:\\$documentSummaryInformation \\(string\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:\\$md5Ctxt is never written, only read\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:\\$summaryInformation \\(string\\) does not accept string\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\:\\:\\$summaryInformation \\(string\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 7 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xml.php - - - - message: "#^Parameter \\#1 \\$textValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:convertEncoding\\(\\) expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xml.php - - - - message: "#^Parameter \\#2 \\$subject of function preg_match expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xml.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xml\\:\\:\\$fileContents has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xml.php - - - - message: "#^Argument of an invalid type SimpleXMLElement\\|null supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xml/Properties.php - - - - message: "#^Argument of an invalid type SimpleXMLElement\\|null supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xml/Style.php - - - - message: "#^Elseif condition is always true\\.$#" - count: 1 - path: src/PhpSpreadsheet/ReferenceHelper.php - - - - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/ReferenceHelper.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\Run\\:\\:\\$font \\(PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\) does not accept PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/RichText/Run.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:getDgId\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:getLastSpId\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:getSpgrContainer\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:setDgId\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:setLastSpId\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:setSpgrContainer\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:setSpgrContainer\\(\\) has parameter \\$spgrContainer with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\:\\:\\$spgrContainer has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\:\\:getChildren\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\\\BSE\\:\\:\\$parent is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php - - - - message: "#^Cannot access offset 1 on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Cannot access offset 2 on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Cannot access offset 3 on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Cannot access offset 4 on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\:\\:getData\\(\\) should return string but returns string\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\:\\:getStream\\(\\) should return resource but returns resource\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#1 \\$No of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS constructor expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#1 \\$oleTimestamp of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\:\\:OLE2LocalDate\\(\\) expects string, string\\|false given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#2 \\$name of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS constructor expects string, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#3 \\$type of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS constructor expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#4 \\$prev of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS constructor expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#5 \\$next of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS constructor expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#6 \\$dir of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS constructor expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Parameter \\#9 \\$data of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS constructor expects string, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\:\\:\\$root \\(PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\\\Root\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:\\$_data \\(string\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:\\$startBlock \\(int\\) on left side of \\?\\? is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS.php - - - - message: "#^Parameter \\#1 \\$No of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/File.php - - - - message: "#^Parameter \\#4 \\$prev of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/File.php - - - - message: "#^Parameter \\#5 \\$next of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/File.php - - - - message: "#^Parameter \\#6 \\$dir of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/File.php - - - - message: "#^Parameter \\#1 \\$No of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/Root.php - - - - message: "#^Parameter \\#4 \\$prev of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/Root.php - - - - message: "#^Parameter \\#5 \\$next of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/Root.php - - - - message: "#^Parameter \\#6 \\$dir of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects int, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/Root.php - - - - message: "#^Parameter \\#9 \\$data of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\:\\:__construct\\(\\) expects string, null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/Root.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\\\Root\\:\\:\\$bigBlockSize \\(int\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/Root.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLE\\\\PPS\\\\Root\\:\\:\\$smallBlockSize \\(int\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLE/PPS/Root.php - - - - message: "#^Parameter \\#1 \\$data of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLERead\\:\\:getInt4d\\(\\) expects string, string\\|false given\\.$#" - count: 8 - path: src/PhpSpreadsheet/Shared/OLERead.php - - - - message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Shared/OLERead.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLERead\\:\\:\\$data has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLERead.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLERead\\:\\:\\$documentSummaryInformation has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLERead.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLERead\\:\\:\\$summaryInformation has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLERead.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\OLERead\\:\\:\\$wrkbook has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/OLERead.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$const with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$meanX with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$meanY with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$sumX with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$sumX2 with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$sumXY with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$sumY with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$sumY2 with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:getBestFitType\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:getError\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:sumSquares\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$DFResiduals has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$SSRegression has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$SSResiduals has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$correlation has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$covariance has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$f has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$goodnessOfFit has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$intersect has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$intersectSE has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$slope has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$slopeSE has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$stdevOfResiduals has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$xOffset has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:\\$yOffset has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/BestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\PolynomialBestFit\\:\\:getCoefficients\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\PolynomialBestFit\\:\\:getCoefficients\\(\\) has parameter \\$dp with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php - - - - message: "#^Call to an undefined method object\\:\\:getGoodnessOfFit\\(\\)\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\Trend\\:\\:calculate\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\Trend\\:\\:calculate\\(\\) has parameter \\$const with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\Trend\\:\\:calculate\\(\\) has parameter \\$trendType with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\Trend\\:\\:calculate\\(\\) has parameter \\$xValues with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\Trend\\:\\:calculate\\(\\) has parameter \\$yValues with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBar\\:\\:setConditionalFormattingRuleExt\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBar\\:\\:setMaximumConditionalFormatValueObject\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBar\\:\\:setMinimumConditionalFormatValueObject\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBar\\:\\:setShowValue\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBarExtension\\:\\:getXmlAttributes\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBarExtension\\:\\:getXmlElements\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBarExtension\\:\\:setMaximumConditionalFormatValueObject\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalDataBarExtension\\:\\:setMinimumConditionalFormatValueObject\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:__construct\\(\\) has parameter \\$type with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:__construct\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:setCellFormula\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:setType\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:setValue\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:\\$cellFormula has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:\\$type has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormatValueObject\\:\\:\\$value has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php - - - - message: "#^Cannot access property \\$axisPosition on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Cannot access property \\$border on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Cannot access property \\$direction on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Cannot access property \\$gradient on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Cannot access property \\$maxLength on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Cannot access property \\$minLength on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Cannot access property \\$negativeBarBorderColorSameAsPositive on SimpleXMLElement\\|null\\.$#" - count: 2 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormattingRuleExtension\\:\\:__construct\\(\\) has parameter \\$id with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormattingRuleExtension\\:\\:generateUuid\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormattingRuleExtension\\:\\:parseExtDataBarElementChildrenFromXml\\(\\) has parameter \\$ns with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormattingRuleExtension\\:\\:parseExtLstXml\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormattingRuleExtension\\:\\:parseExtLstXml\\(\\) has parameter \\$extLstXml with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Offset 'rgb' does not exist on SimpleXMLElement\\|null\\.$#" - count: 4 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Offset 'theme' does not exist on SimpleXMLElement\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Offset 'tint' does not exist on SimpleXMLElement\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\ConditionalFormatting\\\\ConditionalFormattingRuleExtension\\:\\:\\$id has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormat\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormat\\(\\) has parameter \\$sections with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormat\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormatCompare\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormatCompare\\(\\) has parameter \\$cond with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormatCompare\\(\\) has parameter \\$dfcond with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormatCompare\\(\\) has parameter \\$dfval with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormatCompare\\(\\) has parameter \\$val with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormatCompare\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:toFormattedString\\(\\) should return string but returns float\\|int\\|string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\PercentageFormatter\\:\\:format\\(\\) has parameter \\$value with no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Ods.php - - - - message: "#^If condition is always true\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Ods/Cell/Style.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Ods\\\\Cell\\\\Style\\:\\:\\$writer has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Ods/Cell/Style.php - - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:splitRange\\(\\) expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Ods/Content.php - - - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, int\\<2, max\\> given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Writer/Ods/Content.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Ods\\\\Content\\:\\:\\$formulaConvertor has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Ods/Content.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Ods\\\\Formula\\:\\:\\$definedNames has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Ods/Formula.php - - - - message: "#^Cannot call method getHashCode\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Cannot use array destructuring on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Offset 'endCoordinates' does not exist on array\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Offset 'endOffsetX' does not exist on array\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Offset 'endOffsetY' does not exist on array\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Offset 'startCoordinates' does not exist on array\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Offset 'startOffsetX' does not exist on array\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Offset 'startOffsetY' does not exist on array\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Parameter \\#1 \\$blipType of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\\\BSE\\:\\:setBlipType\\(\\) expects int, int\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Parameter \\#1 \\$data of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\\\BSE\\\\Blip\\:\\:setData\\(\\) expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Parameter \\#1 \\$font of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Workbook\\:\\:addFont\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font, PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\:\\:\\$documentSummaryInformation \\(string\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\:\\:\\$summaryInformation \\(string\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\BIFFwriter\\:\\:writeEof\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php - - - - message: "#^Static property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\BIFFwriter\\:\\:\\$byteOrder \\(int\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php - - - - message: "#^Elseif condition is always true\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Escher.php - - - - message: "#^If condition is always true\\.$#" - count: 3 - path: src/PhpSpreadsheet/Writer/Xls/Escher.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Escher\\:\\:\\$data has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Escher.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Escher\\:\\:\\$object has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Escher.php - - - - message: "#^Cannot access offset 'encoding' on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Workbook.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Workbook\\:\\:writeAllDefinedNamesBiff8\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Workbook.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Workbook\\:\\:writeExternalsheetBiff8\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Workbook.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Workbook\\:\\:writeMsoDrawingGroup\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Workbook.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Workbook\\:\\:writeSupbookInternal\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Workbook.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Workbook\\:\\:\\$biffSize is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Workbook.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Workbook\\:\\:\\$colors has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Workbook.php - - - - message: "#^Cannot access offset 'comp' on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Cannot access offset 'ident' on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Cannot access offset 'sa' on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Cannot access offset 1 on array\\|false\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Cannot access offset 2 on array\\|false\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Cannot call method getHashCode\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int\\<0, max\\>\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#4 \\$isError of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:writeBoolErr\\(\\) expects bool, int given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#5 \\$width of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:positionImage\\(\\) expects int, float given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#6 \\$height of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:positionImage\\(\\) expects int, float given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:\\$activePane \\(int\\) does not accept int\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:\\$colors has no type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:\\$countCellStyleXfs is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:\\$outlineBelow is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:\\$outlineRight is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:\\$selection is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:\\$xlsStringMaxLength is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#1 \\$textRotation of static method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Xf\\:\\:mapTextRotation\\(\\) expects int, int\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Xf.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Xf\\:\\:\\$diag is never read, only written\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Xf.php diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php b/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php index 1d0c15a9d..9b1150b34 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php @@ -79,7 +79,7 @@ if (PHP_VERSION_ID < 80000) { $config['parameters']['ignoreErrors'][] = [ 'message' => '#^Binary operation "/" between float and array[|]float[|]int[|]string results in an error.#', 'path' => __DIR__ . '/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php', - 'count' => 2, + 'count' => 1, ]; } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php index 6277694ac..6de546fa2 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php @@ -3696,15 +3696,16 @@ class Calculation * @param string $formula The formula to parse and calculate * @param string $cellID The ID (e.g. A3) of the cell that we are calculating * @param Cell $cell Cell to calculate + * @param bool $ignoreQuotePrefix If set to true, evaluate the formyla even if the referenced cell is quote prefixed * * @return mixed */ - public function _calculateFormulaValue($formula, $cellID = null, ?Cell $cell = null) + public function _calculateFormulaValue($formula, $cellID = null, ?Cell $cell = null, bool $ignoreQuotePrefix = false) { $cellValue = null; // Quote-Prefixed cell values cannot be formulae, but are treated as strings - if ($cell !== null && $cell->getStyle()->getQuotePrefix() === true) { + if ($cell !== null && $ignoreQuotePrefix === false && $cell->getStyle()->getQuotePrefix() === true) { return self::wrapResult((string) $formula); } @@ -4943,10 +4944,10 @@ class Calculation [$rows, $columns] = self::checkMatrixOperands($result, $operand2, 0); for ($row = 0; $row < $rows; ++$row) { for ($column = 0; $column < $columns; ++$column) { - if (is_numeric($result[$row][$column])) { + if (self::isNumericOrBool($result[$row][$column])) { $result[$row][$column] *= $multiplier; } else { - $result[$row][$column] = Information\ExcelError::VALUE(); + $result[$row][$column] = self::makeError($result[$row][$column]); } } } @@ -5335,15 +5336,15 @@ class Calculation for ($column = 0; $column < $columns; ++$column) { if ($operand1[$row][$column] === null) { $operand1[$row][$column] = 0; - } elseif (!is_numeric($operand1[$row][$column])) { - $operand1[$row][$column] = Information\ExcelError::VALUE(); + } elseif (!self::isNumericOrBool($operand1[$row][$column])) { + $operand1[$row][$column] = self::makeError($operand1[$row][$column]); continue; } if ($operand2[$row][$column] === null) { $operand2[$row][$column] = 0; - } elseif (!is_numeric($operand2[$row][$column])) { - $operand1[$row][$column] = Information\ExcelError::VALUE(); + } elseif (!self::isNumericOrBool($operand2[$row][$column])) { + $operand1[$row][$column] = self::makeError($operand2[$row][$column]); continue; } @@ -5720,7 +5721,7 @@ class Calculation $recursiveCalculator = new self($this->spreadsheet); $recursiveCalculator->getDebugLog()->setWriteDebugLog($this->getDebugLog()->getWriteDebugLog()); $recursiveCalculator->getDebugLog()->setEchoDebugLog($this->getDebugLog()->getEchoDebugLog()); - $result = $recursiveCalculator->_calculateFormulaValue($definedNameValue, $recursiveCalculationCellAddress, $recursiveCalculationCell); + $result = $recursiveCalculator->_calculateFormulaValue($definedNameValue, $recursiveCalculationCellAddress, $recursiveCalculationCell, true); if ($this->getDebugLog()->getWriteDebugLog()) { $this->debugLog->mergeDebugLog(array_slice($recursiveCalculator->getDebugLog()->getLog(), 3)); @@ -5763,4 +5764,16 @@ class Calculation return $operand1; } + + /** @param mixed $operand */ + private static function isNumericOrBool($operand): bool + { + return is_numeric($operand) || is_bool($operand); + } + + /** @param mixed $operand */ + private static function makeError($operand = ''): string + { + return Information\ErrorValue::isError($operand) ? $operand : Information\ExcelError::VALUE(); + } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php index 8fe7aa446..3e88ece55 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php @@ -13,6 +13,9 @@ class FormattedNumber private const STRING_REGEXP_PERCENT = '~^(?:(?: *(?[-+])? *\% *(?[-+])? *(?[0-9]+\.?[0-9*]*(?:E[-+]?[0-9]*)?) *)|(?: *(?[-+])? *(?[0-9]+\.?[0-9]*(?:E[-+]?[0-9]*)?) *\% *))$~i'; + // preg_quoted string for major currency symbols, with a %s for locale currency + private const CURRENCY_CONVERSION_LIST = '\$€£¥%s'; + private const STRING_CONVERSION_LIST = [ [self::class, 'convertToNumberIfNumeric'], [self::class, 'convertToNumberIfFraction'], @@ -45,7 +48,10 @@ class FormattedNumber */ public static function convertToNumberIfNumeric(string &$operand): bool { - $value = preg_replace(['/(\d),(\d)/u', '/([+-])\s+(\d)/u'], ['$1$2', '$1$2'], trim($operand)); + $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator()); + $value = preg_replace(['/(\d)' . $thousandsSeparator . '(\d)/u', '/([+-])\s+(\d)/u'], ['$1$2', '$1$2'], trim($operand)); + $decimalSeparator = preg_quote(StringHelper::getDecimalSeparator()); + $value = preg_replace(['/(\d)' . $decimalSeparator . '(\d)/u', '/([+-])\s+(\d)/u'], ['$1.$2', '$1$2'], $value ?? ''); if (is_numeric($value)) { $operand = (float) $value; @@ -84,7 +90,10 @@ class FormattedNumber */ public static function convertToNumberIfPercent(string &$operand): bool { - $value = preg_replace('/(\d),(\d)/u', '$1$2', $operand); + $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator()); + $value = preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', trim($operand)); + $decimalSeparator = preg_quote(StringHelper::getDecimalSeparator()); + $value = preg_replace(['/(\d)' . $decimalSeparator . '(\d)/u', '/([+-])\s+(\d)/u'], ['$1.$2', '$1$2'], $value ?? ''); $match = []; if ($value !== null && preg_match(self::STRING_REGEXP_PERCENT, $value, $match, PREG_UNMATCHED_AS_NULL)) { @@ -106,13 +115,12 @@ class FormattedNumber */ public static function convertToNumberIfCurrency(string &$operand): bool { - $quotedCurrencyCode = preg_quote(StringHelper::getCurrencyCode()); - - $value = preg_replace('/(\d),(\d)/u', '$1$2', $operand); - $regExp = '~^(?:(?: *(?[-+])? *' . $quotedCurrencyCode . ' *(?[-+])? *(?[0-9]+\.?[0-9*]*(?:E[-+]?[0-9]*)?) *)|(?: *(?[-+])? *(?[0-9]+\.?[0-9]*(?:E[-+]?[0-9]*)?) *' . $quotedCurrencyCode . ' *))$~ui'; + $currencyRegexp = self::currencyMatcherRegexp(); + $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator()); + $value = preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', $operand); $match = []; - if ($value !== null && preg_match($regExp, $value, $match, PREG_UNMATCHED_AS_NULL)) { + if ($value !== null && preg_match($currencyRegexp, $value, $match, PREG_UNMATCHED_AS_NULL)) { //Determine the sign $sign = ($match['PrefixedSign'] ?? $match['PrefixedSign2'] ?? $match['PostfixedSign']) ?? ''; //Cast to a float @@ -123,4 +131,12 @@ class FormattedNumber return false; } + + public static function currencyMatcherRegexp(): string + { + $currencyCodes = sprintf(self::CURRENCY_CONVERSION_LIST, preg_quote(StringHelper::getCurrencyCode())); + $decimalSeparator = preg_quote(StringHelper::getDecimalSeparator()); + + return '~^(?:(?: *(?[-+])? *(?[' . $currencyCodes . ']) *(?[-+])? *(?[0-9]+[' . $decimalSeparator . ']?[0-9*]*(?:E[-+]?[0-9]*)?) *)|(?: *(?[-+])? *(?[0-9]+' . $decimalSeparator . '?[0-9]*(?:E[-+]?[0-9]*)?) *(?[' . $currencyCodes . ']) *))$~ui'; + } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php index 072e66d04..266f1b2bb 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php @@ -166,7 +166,7 @@ final class StructuredReference implements Operand ->getCalculatedValue(); } - $cell = $worksheet->getCell($cellReference); + $worksheet->getCell($cellReference); return $columns; } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php index 354cb83e5..c7ddf8945 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php @@ -223,7 +223,7 @@ class LookupRef * @param mixed $width The width, in number of columns, that you want the returned reference to be. * Width must be a positive number. * - * @return array|string An array containing a cell or range of cells, or a string on error + * @return array|int|string An array containing a cell or range of cells, or a string on error */ public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $cell = null) { @@ -243,6 +243,8 @@ class LookupRef * Use the choose() method in the LookupRef\Selection class instead * @see LookupRef\Selection::choose() * + * @param array $chooseArgs + * * @return mixed The selected value */ public static function CHOOSE(...$chooseArgs) diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php index 0d2db8b20..1a0035d59 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php @@ -83,7 +83,7 @@ class Address return self::formatAsR1C1($row, $column, $relativity, $sheetName); } - private static function sheetName(string $sheetName) + private static function sheetName(string $sheetName): string { if ($sheetName > '') { if (strpos($sheetName, ' ') !== false || strpos($sheetName, '[') !== false) { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php index 76a360b4c..d836633ab 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php @@ -39,7 +39,7 @@ class Lookup $lookupColumns = self::columnCount($lookupVector); } - $resultVector = self::verifyResultVector($lookupVector, $resultVector); + $resultVector = self::verifyResultVector($resultVector ?? $lookupVector); if ($lookupRows === 2 && !$hasResultVector) { $resultVector = array_pop($lookupVector); @@ -78,12 +78,8 @@ class Lookup return $lookupVector; } - private static function verifyResultVector(array $lookupVector, $resultVector) + private static function verifyResultVector(array $resultVector): array { - if ($resultVector === null) { - $resultVector = $lookupVector; - } - $resultRows = self::rowCount($resultVector); $resultColumns = self::columnCount($resultVector); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php index 5fe1676b8..be5d81cb1 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php @@ -17,6 +17,7 @@ abstract class LookupBase } } + /** @param float|int|string $index_number */ protected static function validateIndexLookup(array $lookup_array, $index_number): int { // index_number must be a number greater than or equal to 1. diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php index d7d15d4ec..8ee759e87 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php @@ -125,6 +125,7 @@ class Matrix return $matrix[$rowNum][$columnNum]; } + /** @return mixed */ private static function extractRowValue(array $matrix, array $rowKeys, int $rowNum) { if ($rowNum === 0) { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php index 371a7a705..562d75397 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php @@ -91,15 +91,16 @@ class Offset return self::extractRequiredCells($worksheet, $cellAddress); } + /** @return mixed */ private static function extractRequiredCells(?Worksheet $worksheet, string $cellAddress) { return Calculation::getInstance($worksheet !== null ? $worksheet->getParent() : null) ->extractCellRange($cellAddress, $worksheet, false); } - private static function extractWorksheet($cellAddress, Cell $cell): array + private static function extractWorksheet(?string $cellAddress, Cell $cell): array { - $cellAddress = self::assessCellAddress($cellAddress, $cell); + $cellAddress = self::assessCellAddress($cellAddress ?? '', $cell); $sheetName = ''; if (strpos($cellAddress, '!') !== false) { @@ -123,7 +124,11 @@ class Offset return $cellAddress; } - private static function adjustEndCellColumnForWidth(string $endCellColumn, $width, int $startCellColumn, $columns) + /** + * @param mixed $width + * @param mixed $columns + */ + private static function adjustEndCellColumnForWidth(string $endCellColumn, $width, int $startCellColumn, $columns): int { $endCellColumn = Coordinate::columnIndexFromString($endCellColumn) - 1; if (($width !== null) && (!is_object($width))) { @@ -135,6 +140,11 @@ class Offset return $endCellColumn; } + /** + * @param mixed $height + * @param mixed $rows + * @param mixed $endCellRow + */ private static function adustEndCellRowForHeight($height, int $startCellRow, $rows, $endCellRow): int { if (($height !== null) && (!is_object($height))) { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php index af73519ef..705de17d8 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php @@ -21,6 +21,10 @@ class Trends } } + /** + * @param mixed $array1 should be array, but scalar is made into one + * @param mixed $array2 should be array, but scalar is made into one + */ private static function checkTrendArrays(&$array1, &$array2): void { if (!is_array($array1)) { @@ -168,7 +172,7 @@ class Trends $returnArray[0][] = [$bestFitExponential->getValueOfYForX($xValue)]; } - return $returnArray; + return $returnArray; //* @phpstan-ignore-line } /** @@ -425,6 +429,6 @@ class Trends $returnArray[0][] = [$bestFitLinear->getValueOfYForX($xValue)]; } - return $returnArray; + return $returnArray; //* @phpstan-ignore-line } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php index 97f462944..7cc1c70da 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php @@ -80,6 +80,8 @@ class TextData * Use the CONCATENATE() method in the TextData\Concatenate class instead * @see TextData\Concatenate::CONCATENATE() * + * @param array $args + * * @return string */ public static function CONCATENATE(...$args) diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php index d3668f8cd..519607c08 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php @@ -37,7 +37,7 @@ class Extract return $e->getMessage(); } - return mb_substr($value ?? '', 0, $chars, 'UTF-8'); + return mb_substr($value, 0, $chars, 'UTF-8'); } /** @@ -68,7 +68,7 @@ class Extract return $e->getMessage(); } - return mb_substr($value ?? '', --$start, $chars, 'UTF-8'); + return mb_substr($value, --$start, $chars, 'UTF-8'); } /** @@ -96,7 +96,7 @@ class Extract return $e->getMessage(); } - return mb_substr($value ?? '', mb_strlen($value ?? '', 'UTF-8') - $chars, $chars, 'UTF-8'); + return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8'); } /** diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php index 7b97f911b..8e6a575a2 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php @@ -29,7 +29,7 @@ class Text $value = Helpers::extractString($value); - return mb_strlen($value ?? '', 'UTF-8'); + return mb_strlen($value, 'UTF-8'); } /** diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php index 49631f76e..1bf73ba82 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php @@ -3,6 +3,7 @@ namespace PhpOffice\PhpSpreadsheet\Cell; use PhpOffice\PhpSpreadsheet\Calculation\Calculation; +use PhpOffice\PhpSpreadsheet\Calculation\Engine\FormattedNumber; use PhpOffice\PhpSpreadsheet\RichText\RichText; use PhpOffice\PhpSpreadsheet\Shared\Date; use PhpOffice\PhpSpreadsheet\Shared\StringHelper; @@ -33,11 +34,11 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder // Style logic - strings if ($dataType === DataType::TYPE_STRING && !$value instanceof RichText) { // Test for booleans using locale-setting - if ($value == Calculation::getTRUE()) { + if (StringHelper::strToUpper($value) === Calculation::getTRUE()) { $cell->setValueExplicit(true, DataType::TYPE_BOOL); return true; - } elseif ($value == Calculation::getFALSE()) { + } elseif (StringHelper::strToUpper($value) === Calculation::getFALSE()) { $cell->setValueExplicit(false, DataType::TYPE_BOOL); return true; @@ -50,35 +51,22 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder return $this->setImproperFraction($matches, $cell); } + $decimalSeparator = preg_quote(StringHelper::getDecimalSeparator()); + $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator()); + // Check for percentage - if (preg_match('/^\-?\d*\.?\d*\s?\%$/', $value)) { - return $this->setPercentage($value, $cell); + if (preg_match('/^\-?\d*' . $decimalSeparator . '?\d*\s?\%$/', preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', $value))) { + return $this->setPercentage(preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', $value), $cell); } // Check for currency - $currencyCode = StringHelper::getCurrencyCode(); - $decimalSeparator = StringHelper::getDecimalSeparator(); - $thousandsSeparator = StringHelper::getThousandsSeparator(); - if (preg_match('/^' . preg_quote($currencyCode, '/') . ' *(\d{1,3}(' . preg_quote($thousandsSeparator, '/') . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator, '/') . '\d{2})?$/', $value)) { + if (preg_match(FormattedNumber::currencyMatcherRegexp(), preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', $value), $matches, PREG_UNMATCHED_AS_NULL)) { // Convert value to number - $value = (float) trim(str_replace([$currencyCode, $thousandsSeparator, $decimalSeparator], ['', '', '.'], $value)); - $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); - // Set style - $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode( - str_replace('$', $currencyCode, NumberFormat::FORMAT_CURRENCY_USD_SIMPLE) - ); + $sign = ($matches['PrefixedSign'] ?? $matches['PrefixedSign2'] ?? $matches['PostfixedSign']) ?? null; + $currencyCode = $matches['PrefixedCurrency'] ?? $matches['PostfixedCurrency']; + $value = (float) ($sign . trim(str_replace([$decimalSeparator, $currencyCode, ' ', '-'], ['.', '', '', ''], preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', $value)))); // @phpstan-ignore-line - return true; - } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) { - // Convert value to number - $value = (float) trim(str_replace(['$', ','], '', $value)); - $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); - // Set style - $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); - - return true; + return $this->setCurrency($value, $cell, $currencyCode); // @phpstan-ignore-line } // Check for time without seconds e.g. '9:45', '09:45' @@ -175,6 +163,18 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder return true; } + protected function setCurrency(float $value, Cell $cell, string $currencyCode): bool + { + $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); + // Set style + $cell->getWorksheet()->getStyle($cell->getCoordinate()) + ->getNumberFormat()->setFormatCode( + str_replace('$', '[$' . $currencyCode . ']', NumberFormat::FORMAT_CURRENCY_USD) + ); + + return true; + } + protected function setTimeHoursMinutes(string $value, Cell $cell): bool { // Convert value to number diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php index aabc94f55..a53294e53 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php @@ -196,10 +196,9 @@ class Cell * @param mixed $oldValue * @param mixed $newValue */ - protected static function updateIfCellIsTableHeader(Worksheet $workSheet, self $cell, $oldValue, $newValue): void + protected static function updateIfCellIsTableHeader(?Worksheet $workSheet, self $cell, $oldValue, $newValue): void { -// var_dump('=>', $oldValue, $newValue); - if (StringHelper::strToLower($oldValue ?? '') === StringHelper::strToLower($newValue ?? '')) { + if (StringHelper::strToLower($oldValue ?? '') === StringHelper::strToLower($newValue ?? '') || $workSheet === null) { return; } @@ -222,12 +221,16 @@ class Cell * Sets the value for a cell, automatically determining the datatype using the value binder * * @param mixed $value Value + * @param null|IValueBinder $binder Value Binder to override the currently set Value Binder + * + * @throws Exception * * @return $this */ - public function setValue($value): self + public function setValue($value, ?IValueBinder $binder = null): self { - if (!self::getValueBinder()->bindValue($this, $value)) { + $binder ??= self::getValueBinder(); + if (!$binder->bindValue($this, $value)) { throw new Exception('Value could not be bound to cell.'); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php index 0c0fd0aea..db1d06d15 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php @@ -461,7 +461,7 @@ abstract class Coordinate $currentColumnIndex = $startColumnIndex; $currentRow = $startRow; - self::validateRange($cellBlock, $startColumnIndex, $endColumnIndex, $currentRow, $endRow); + self::validateRange($cellBlock, $startColumnIndex, $endColumnIndex, (int) $currentRow, (int) $endRow); // Loop cells while ($currentColumnIndex < $endColumnIndex) { @@ -508,7 +508,7 @@ abstract class Coordinate [$column, $row] = self::coordinateFromString($coord); $row = (int) (ltrim($row, '$')); - $hashCode = $column . '-' . (is_object($value) ? $value->getHashCode() : $value); + $hashCode = $column . '-' . ((is_object($value) && method_exists($value, 'getHashCode')) ? $value->getHashCode() : $value); if (!isset($hashedValues[$hashCode])) { $hashedValues[$hashCode] = (object) [ diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php index e499e77fc..edd87015a 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php @@ -52,6 +52,7 @@ class Legend * Create a new Legend. * * @param string $position + * @param ?Layout $layout * @param bool $overlay */ public function __construct($position = self::POSITION_RIGHT, ?Layout $layout = null, $overlay = false) diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php index 9b0540d89..9c99ccac1 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php @@ -13,6 +13,13 @@ class Title */ private $caption = ''; + /** + * Allow overlay of other elements? + * + * @var bool + */ + private $overlay = true; + /** * Title Layout. * @@ -24,11 +31,14 @@ class Title * Create a new Title. * * @param array|RichText|string $caption + * @param ?Layout $layout + * @param bool $overlay */ - public function __construct($caption = '', ?Layout $layout = null) + public function __construct($caption = '', ?Layout $layout = null, $overlay = false) { $this->caption = $caption; $this->layout = $layout; + $this->setOverlay($overlay); } /** @@ -78,6 +88,26 @@ class Title return $this; } + /** + * Get allow overlay of other elements? + * + * @return bool + */ + public function getOverlay() + { + return $this->overlay; + } + + /** + * Set allow overlay of other elements? + * + * @param bool $overlay + */ + public function setOverlay($overlay): void + { + $this->overlay = $overlay; + } + public function getLayout(): ?Layout { return $this->layout; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php index e7e725841..c088397d8 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php @@ -30,6 +30,7 @@ abstract class IOFactory public const WRITER_CSV = 'Csv'; public const WRITER_HTML = 'Html'; + /** @var string[] */ private static $readers = [ self::READER_XLSX => Reader\Xlsx::class, self::READER_XLS => Reader\Xls::class, @@ -41,6 +42,7 @@ abstract class IOFactory self::READER_CSV => Reader\Csv::class, ]; + /** @var string[] */ private static $writers = [ self::WRITER_XLS => Writer\Xls::class, self::WRITER_XLSX => Writer\Xlsx::class, @@ -62,6 +64,7 @@ abstract class IOFactory } // Instantiate writer + /** @var IWriter */ $className = self::$writers[$writerType]; return new $className($spreadsheet); @@ -77,6 +80,7 @@ abstract class IOFactory } // Instantiate reader + /** @var IReader */ $className = self::$readers[$readerType]; return new $className(); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php index ae46a7f77..aa380aa95 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php @@ -51,10 +51,11 @@ abstract class BaseReader implements IReader */ protected $readFilter; + /** @var resource */ protected $fileHandle; /** - * @var XmlScanner + * @var ?XmlScanner */ protected $securityScanner; @@ -134,11 +135,20 @@ abstract class BaseReader implements IReader return $this; } - public function getSecurityScanner() + public function getSecurityScanner(): ?XmlScanner { return $this->securityScanner; } + public function getSecurityScannerOrThrow(): XmlScanner + { + if ($this->securityScanner === null) { + throw new ReaderException('Security scanner is unexpectedly null'); + } + + return $this->securityScanner; + } + protected function processFlags(int $flags): void { if (((bool) ($flags & self::LOAD_WITH_CHARTS)) === true) { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php index 4f128d6f0..be9a2a32c 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php @@ -294,8 +294,9 @@ class Csv extends BaseReader if ($this->inputEncoding !== 'UTF-8') { fclose($this->fileHandle); $entireFile = file_get_contents($filename); - $this->fileHandle = fopen('php://memory', 'r+b'); - if ($this->fileHandle !== false && $entireFile !== false) { + $fileHandle = fopen('php://memory', 'r+b'); + if ($fileHandle !== false && $entireFile !== false) { + $this->fileHandle = $fileHandle; $data = StringHelper::convertEncoding($entireFile, 'UTF-8', $this->inputEncoding); fwrite($this->fileHandle, $data); $this->skipBOM(); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php index b33af242e..174553225 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php @@ -112,7 +112,7 @@ class Gnumeric extends BaseReader File::assertFile($filename); $xml = new XMLReader(); - $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($filename)), null, Settings::getLibXmlLoaderOptions()); + $xml->xml($this->getSecurityScannerOrThrow()->scanFile('compress.zlib://' . realpath($filename)), null, Settings::getLibXmlLoaderOptions()); $xml->setParserProperty(2, true); $worksheetNames = []; @@ -141,7 +141,7 @@ class Gnumeric extends BaseReader File::assertFile($filename); $xml = new XMLReader(); - $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($filename)), null, Settings::getLibXmlLoaderOptions()); + $xml->xml($this->getSecurityScannerOrThrow()->scanFile('compress.zlib://' . realpath($filename)), null, Settings::getLibXmlLoaderOptions()); $xml->setParserProperty(2, true); $worksheetInfo = []; @@ -248,7 +248,7 @@ class Gnumeric extends BaseReader $gFileData = $this->gzfileGetContents($filename); - $xml2 = simplexml_load_string($this->securityScanner->scan($gFileData), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions()); + $xml2 = simplexml_load_string($this->getSecurityScannerOrThrow()->scan($gFileData), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions()); $xml = self::testSimpleXml($xml2); $gnmXML = $xml->children(self::NAMESPACE_GNM); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php index 204c73025..0257fc9a4 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php @@ -24,19 +24,30 @@ class PageSetup { if (isset($sheet->PrintInformation, $sheet->PrintInformation[0])) { $printInformation = $sheet->PrintInformation[0]; + $setup = $this->spreadsheet->getActiveSheet()->getPageSetup(); - $scale = (string) $printInformation->Scale->attributes()['percentage']; + $attributes = $printInformation->Scale->attributes(); + if (isset($attributes['percentage'])) { + $setup->setScale((int) $attributes['percentage']); + } $pageOrder = (string) $printInformation->order; + if ($pageOrder === 'r_then_d') { + $setup->setPageOrder(WorksheetPageSetup::PAGEORDER_OVER_THEN_DOWN); + } elseif ($pageOrder === 'd_then_r') { + $setup->setPageOrder(WorksheetPageSetup::PAGEORDER_DOWN_THEN_OVER); + } $orientation = (string) $printInformation->orientation; - $horizontalCentered = (string) $printInformation->hcenter->attributes()['value']; - $verticalCentered = (string) $printInformation->vcenter->attributes()['value']; - - $this->spreadsheet->getActiveSheet()->getPageSetup() - ->setPageOrder($pageOrder === 'r_then_d' ? WorksheetPageSetup::PAGEORDER_OVER_THEN_DOWN : WorksheetPageSetup::PAGEORDER_DOWN_THEN_OVER) - ->setScale((int) $scale) - ->setOrientation($orientation ?? WorksheetPageSetup::ORIENTATION_DEFAULT) - ->setHorizontalCentered((bool) $horizontalCentered) - ->setVerticalCentered((bool) $verticalCentered); + if ($orientation !== '') { + $setup->setOrientation($orientation); + } + $attributes = $printInformation->hcenter->attributes(); + if (isset($attributes['value'])) { + $setup->setHorizontalCentered((bool) (string) $attributes['value']); + } + $attributes = $printInformation->vcenter->attributes(); + if (isset($attributes['value'])) { + $setup->setVerticalCentered((bool) (string) $attributes['value']); + } } return $this; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php index 76f128e02..b165b6c17 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php @@ -650,7 +650,7 @@ class Html extends BaseReader $dom = new DOMDocument(); // Reload the HTML file into the DOM object try { - $convert = $this->securityScanner->scanFile($filename); + $convert = $this->getSecurityScannerOrThrow()->scanFile($filename); $lowend = "\u{80}"; $highend = "\u{10ffff}"; $regexp = "/[$lowend-$highend]/u"; @@ -684,7 +684,7 @@ class Html extends BaseReader $dom = new DOMDocument(); // Reload the HTML file into the DOM object try { - $convert = $this->securityScanner->scan($content); + $convert = $this->getSecurityScannerOrThrow()->scan($content); $lowend = "\u{80}"; $highend = "\u{10ffff}"; $regexp = "/[$lowend-$highend]/u"; @@ -941,7 +941,7 @@ class Html extends BaseReader public function getStyleColor($value) { $value = (string) $value; - if (strpos($value ?? '', '#') === 0) { + if (strpos($value, '#') === 0) { return substr($value, 1); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php index 3e0d80307..250815400 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php @@ -56,20 +56,22 @@ class Ods extends BaseReader $mimeType = $zip->getFromName($stat['name']); } elseif ($zip->statName('META-INF/manifest.xml')) { $xml = simplexml_load_string( - $this->securityScanner->scan($zip->getFromName('META-INF/manifest.xml')), + $this->getSecurityScannerOrThrow()->scan($zip->getFromName('META-INF/manifest.xml')), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); - $namespacesContent = $xml->getNamespaces(true); - if (isset($namespacesContent['manifest'])) { - $manifest = $xml->children($namespacesContent['manifest']); - foreach ($manifest as $manifestDataSet) { - /** @scrutinizer ignore-call */ - $manifestAttributes = $manifestDataSet->attributes($namespacesContent['manifest']); - if ($manifestAttributes && $manifestAttributes->{'full-path'} == '/') { - $mimeType = (string) $manifestAttributes->{'media-type'}; + if ($xml !== false) { + $namespacesContent = $xml->getNamespaces(true); + if (isset($namespacesContent['manifest'])) { + $manifest = $xml->children($namespacesContent['manifest']); + foreach ($manifest as $manifestDataSet) { + /** @scrutinizer ignore-call */ + $manifestAttributes = $manifestDataSet->attributes($namespacesContent['manifest']); + if ($manifestAttributes && $manifestAttributes->{'full-path'} == '/') { + $mimeType = (string) $manifestAttributes->{'media-type'}; - break; + break; + } } } } @@ -97,7 +99,7 @@ class Ods extends BaseReader $xml = new XMLReader(); $xml->xml( - $this->securityScanner->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE), + $this->getSecurityScannerOrThrow()->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE), null, Settings::getLibXmlLoaderOptions() ); @@ -120,7 +122,10 @@ class Ods extends BaseReader if ($xmlName == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) { // Loop through each table:table node reading the table:name attribute for each worksheet name do { - $worksheetNames[] = $xml->getAttribute('table:name'); + $worksheetName = $xml->getAttribute('table:name'); + if (!empty($worksheetName)) { + $worksheetNames[] = $worksheetName; + } $xml->next(); } while (self::getXmlName($xml) == 'table:table' && $xml->nodeType == XMLReader::ELEMENT); } @@ -145,7 +150,7 @@ class Ods extends BaseReader $xml = new XMLReader(); $xml->xml( - $this->securityScanner->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE), + $this->getSecurityScannerOrThrow()->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE), null, Settings::getLibXmlLoaderOptions() ); @@ -256,7 +261,7 @@ class Ods extends BaseReader // Meta $xml = @simplexml_load_string( - $this->securityScanner->scan($zip->getFromName('meta.xml')), + $this->getSecurityScannerOrThrow()->scan($zip->getFromName('meta.xml')), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); @@ -272,7 +277,7 @@ class Ods extends BaseReader $dom = new DOMDocument('1.01', 'UTF-8'); $dom->loadXML( - $this->securityScanner->scan($zip->getFromName('styles.xml')), + $this->getSecurityScannerOrThrow()->scan($zip->getFromName('styles.xml')), Settings::getLibXmlLoaderOptions() ); @@ -282,7 +287,7 @@ class Ods extends BaseReader $dom = new DOMDocument('1.01', 'UTF-8'); $dom->loadXML( - $this->securityScanner->scan($zip->getFromName(self::INITIAL_FILE)), + $this->getSecurityScannerOrThrow()->scan($zip->getFromName(self::INITIAL_FILE)), Settings::getLibXmlLoaderOptions() ); @@ -297,9 +302,8 @@ class Ods extends BaseReader $definedNameReader = new DefinedNames($spreadsheet, $tableNs); // Content - $spreadsheets = $dom->getElementsByTagNameNS($officeNs, 'body') - ->item(0) - ->getElementsByTagNameNS($officeNs, 'spreadsheet'); + $item0 = $dom->getElementsByTagNameNS($officeNs, 'body')->item(0); + $spreadsheets = ($item0 === null) ? [] : $item0->getElementsByTagNameNS($officeNs, 'spreadsheet'); foreach ($spreadsheets as $workbookData) { /** @var DOMElement $workbookData */ @@ -402,10 +406,10 @@ class Ods extends BaseReader // Annotations $annotation = $cellData->getElementsByTagNameNS($officeNs, 'annotation'); - if ($annotation->length > 0) { + if ($annotation->length > 0 && $annotation->item(0) !== null) { $textNode = $annotation->item(0)->getElementsByTagNameNS($textNs, 'p'); - if ($textNode->length > 0) { + if ($textNode->length > 0 && $textNode->item(0) !== null) { $text = $this->scanElementForText($textNode->item(0)); $spreadsheet->getActiveSheet() @@ -452,7 +456,7 @@ class Ods extends BaseReader foreach ($paragraphs as $paragraph) { $link = $paragraph->getElementsByTagNameNS($textNs, 'a'); - if ($link->length > 0) { + if ($link->length > 0 && $link->item(0) !== null) { $hyperlink = $link->item(0)->getAttributeNS($xlinkNs, 'href'); } } @@ -481,7 +485,7 @@ class Ods extends BaseReader if (floor($dataValue) == $dataValue) { $dataValue = (int) $dataValue; } - $formatting = NumberFormat::FORMAT_CURRENCY_USD_SIMPLE; + $formatting = NumberFormat::FORMAT_CURRENCY_USD_INTEGER; break; case 'float': @@ -620,7 +624,7 @@ class Ods extends BaseReader { $dom = new DOMDocument('1.01', 'UTF-8'); $dom->loadXML( - $this->securityScanner->scan($zip->getFromName('settings.xml')), + $this->getSecurityScannerOrThrow()->scan($zip->getFromName('settings.xml')), Settings::getLibXmlLoaderOptions() ); //$xlinkNs = $dom->lookupNamespaceUri('xlink'); @@ -629,8 +633,10 @@ class Ods extends BaseReader $officeNs = $dom->lookupNamespaceUri('office'); $settings = $dom->getElementsByTagNameNS($officeNs, 'settings') ->item(0); - $this->lookForActiveSheet($settings, $spreadsheet, $configNs); - $this->lookForSelectedCells($settings, $spreadsheet, $configNs); + if ($settings !== null) { + $this->lookForActiveSheet($settings, $spreadsheet, $configNs); + $this->lookForSelectedCells($settings, $spreadsheet, $configNs); + } } private function lookForActiveSheet(DOMElement $settings, Spreadsheet $spreadsheet, string $configNs): void @@ -700,9 +706,9 @@ class Ods extends BaseReader // It's a space // Multiple spaces? - /** @var DOMAttr $cAttr */ - /** @scrutinizer ignore-call */ - $cAttr = $child->attributes->getNamedItem('c'); + $attributes = $child->attributes; + /** @var ?DOMAttr $cAttr */ + $cAttr = ($attributes === null) ? null : $attributes->getNamedItem('c'); $multiplier = self::getMultiplier($cAttr); $str .= str_repeat(' ', $multiplier); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php index 4d2fd9927..0e18af5d2 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php @@ -33,6 +33,7 @@ class PageSettings */ private $tableStylesCrossReference = []; + /** @var array */ private $pageLayoutStyles = []; /** @@ -62,9 +63,8 @@ class PageSettings private function readPageSettingStyles(DOMDocument $styleDom): void { - $styles = $styleDom->getElementsByTagNameNS($this->officeNs, 'automatic-styles') - ->item(0) - ->getElementsByTagNameNS($this->stylesNs, 'page-layout'); + $item0 = $styleDom->getElementsByTagNameNS($this->officeNs, 'automatic-styles')->item(0); + $styles = ($item0 === null) ? [] : $item0->getElementsByTagNameNS($this->stylesNs, 'page-layout'); foreach ($styles as $styleSet) { $styleName = $styleSet->getAttributeNS($this->stylesNs, 'name'); @@ -92,21 +92,20 @@ class PageSettings 'horizontalCentered' => $centered === 'horizontal' || $centered === 'both', 'verticalCentered' => $centered === 'vertical' || $centered === 'both', // margin size is already stored in inches, so no UOM conversion is required - 'marginLeft' => (float) $marginLeft ?? 0.7, - 'marginRight' => (float) $marginRight ?? 0.7, - 'marginTop' => (float) $marginTop ?? 0.3, - 'marginBottom' => (float) $marginBottom ?? 0.3, - 'marginHeader' => (float) $marginHeader ?? 0.45, - 'marginFooter' => (float) $marginFooter ?? 0.45, + 'marginLeft' => (float) ($marginLeft ?? 0.7), + 'marginRight' => (float) ($marginRight ?? 0.7), + 'marginTop' => (float) ($marginTop ?? 0.3), + 'marginBottom' => (float) ($marginBottom ?? 0.3), + 'marginHeader' => (float) ($marginHeader ?? 0.45), + 'marginFooter' => (float) ($marginFooter ?? 0.45), ]; } } private function readStyleMasterLookup(DOMDocument $styleDom): void { - $styleMasterLookup = $styleDom->getElementsByTagNameNS($this->officeNs, 'master-styles') - ->item(0) - ->getElementsByTagNameNS($this->stylesNs, 'master-page'); + $item0 = $styleDom->getElementsByTagNameNS($this->officeNs, 'master-styles')->item(0); + $styleMasterLookup = ($item0 === null) ? [] : $item0->getElementsByTagNameNS($this->stylesNs, 'master-page'); foreach ($styleMasterLookup as $styleMasterSet) { $styleMasterName = $styleMasterSet->getAttributeNS($this->stylesNs, 'name'); @@ -117,9 +116,8 @@ class PageSettings public function readStyleCrossReferences(DOMDocument $contentDom): void { - $styleXReferences = $contentDom->getElementsByTagNameNS($this->officeNs, 'automatic-styles') - ->item(0) - ->getElementsByTagNameNS($this->stylesNs, 'style'); + $item0 = $contentDom->getElementsByTagNameNS($this->officeNs, 'automatic-styles')->item(0); + $styleXReferences = ($item0 === null) ? [] : $item0->getElementsByTagNameNS($this->stylesNs, 'style'); foreach ($styleXReferences as $styleXreferenceSet) { $styleXRefName = $styleXreferenceSet->getAttributeNS($this->stylesNs, 'name'); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php index 1547a6b65..8c4ccc303 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php @@ -8,6 +8,7 @@ use SimpleXMLElement; class Properties { + /** @var Spreadsheet */ private $spreadsheet; public function __construct(Spreadsheet $spreadsheet) @@ -15,7 +16,7 @@ class Properties $this->spreadsheet = $spreadsheet; } - public function load(SimpleXMLElement $xml, $namespacesMeta): void + public function load(SimpleXMLElement $xml, array $namespacesMeta): void { $docProps = $this->spreadsheet->getProperties(); $officeProperty = $xml->children($namespacesMeta['office']); @@ -69,9 +70,9 @@ class Properties } private function setMetaProperties( - $namespacesMeta, + array $namespacesMeta, SimpleXMLElement $propertyValue, - $propertyName, + string $propertyName, DocumentProperties $docProps ): void { $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']); @@ -96,6 +97,10 @@ class Properties } } + /** + * @param mixed $propertyValueAttributes + * @param mixed $propertyValue + */ private function setUserDefinedProperty($propertyValueAttributes, $propertyValue, DocumentProperties $docProps): void { $propertyValueName = ''; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php index f4cf2db16..ad898ae41 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php @@ -13,8 +13,10 @@ class XmlScanner */ private $pattern; + /** @var ?callable */ private $callback; + /** @var ?bool */ private static $libxmlDisableEntityLoaderValue; /** @@ -22,7 +24,7 @@ class XmlScanner */ private static $shutdownRegistered = false; - public function __construct($pattern = 'pattern = $pattern; @@ -35,22 +37,17 @@ class XmlScanner } } - public static function getInstance(Reader\IReader $reader) + public static function getInstance(Reader\IReader $reader): self { - switch (true) { - case $reader instanceof Reader\Html: - return new self('disableEntityLoaderCheck(); $xml = $this->toUtf8($xml); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php index 6d82b9a05..f35e8c3b2 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php @@ -14,6 +14,7 @@ use PhpOffice\PhpSpreadsheet\RichText\RichText; use PhpOffice\PhpSpreadsheet\Shared\CodePage; use PhpOffice\PhpSpreadsheet\Shared\Date; use PhpOffice\PhpSpreadsheet\Shared\Escher; +use PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer; use PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE; use PhpOffice\PhpSpreadsheet\Shared\File; use PhpOffice\PhpSpreadsheet\Shared\OLE; @@ -161,14 +162,14 @@ class Xls extends BaseReader /** * Summary Information stream data. * - * @var string + * @var ?string */ private $summaryInformation; /** * Extended Summary Information stream data. * - * @var string + * @var ?string */ private $documentSummaryInformation; @@ -387,7 +388,7 @@ class Xls extends BaseReader /** * The current RC4 decryption object. * - * @var Xls\RC4 + * @var ?Xls\RC4 */ private $rc4Key; @@ -400,10 +401,11 @@ class Xls extends BaseReader /** * The current MD5 context state. + * It is never set in the program, so code which uses it is suspect. * * @var string */ - private $md5Ctxt; + private $md5Ctxt; // @phpstan-ignore-line /** * @var int @@ -1088,7 +1090,8 @@ class Xls extends BaseReader $escherWorksheet = $reader->load($this->drawingData); // get all spContainers in one long array, so they can be mapped to OBJ records - $allSpContainers = $escherWorksheet->getDgContainer()->getSpgrContainer()->getAllSpContainers(); + /** @var SpContainer[] */ + $allSpContainers = method_exists($escherWorksheet, 'getDgContainer') ? $escherWorksheet->getDgContainer()->getSpgrContainer()->getAllSpContainers() : []; } // treat OBJ records @@ -1103,7 +1106,9 @@ class Xls extends BaseReader } // calculate the width and height of the shape + /** @var int $startRow */ [$startColumn, $startRow] = Coordinate::coordinateFromString($spContainer->getStartCoordinates()); + /** @var int $endRow */ [$endColumn, $endRow] = Coordinate::coordinateFromString($spContainer->getEndCoordinates()); $startOffsetX = $spContainer->getStartOffsetX(); @@ -1145,7 +1150,7 @@ class Xls extends BaseReader } if ($escherWorkbook) { - $BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection(); + $BSECollection = method_exists($escherWorkbook, 'getDggContainer') ? $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection() : []; $BSE = $BSECollection[$BSEindex - 1]; $blipType = $BSE->getBlipType(); @@ -1195,6 +1200,7 @@ class Xls extends BaseReader // treat SHAREDFMLA records if ($this->version == self::XLS_BIFF8) { foreach ($this->sharedFormulaParts as $cell => $baseCell) { + /** @var int $row */ [$column, $row] = Coordinate::coordinateFromString($cell); if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) { $formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell); @@ -1335,8 +1341,8 @@ class Xls extends BaseReader $recordData = ''; if ($this->encryption == self::MS_BIFF_CRYPTO_RC4) { $oldBlock = floor($this->rc4Pos / self::REKEY_BLOCK); - $block = floor($pos / self::REKEY_BLOCK); - $endBlock = floor(($pos + $len) / self::REKEY_BLOCK); + $block = (int) floor($pos / self::REKEY_BLOCK); + $endBlock = (int) floor(($pos + $len) / self::REKEY_BLOCK); // Spin an RC4 decryptor to the right spot. If we have a decryptor sitting // at a point earlier in the current block, re-use it as we can save some time. @@ -1382,7 +1388,7 @@ class Xls extends BaseReader // get excel data, $ole->read($filename); // Get workbook data: workbook stream + sheet streams - $this->data = $ole->getStream($ole->wrkbook); + $this->data = $ole->getStream($ole->wrkbook); // @phpstan-ignore-line // Get summary information data $this->summaryInformation = $ole->getStream($ole->summaryInformation); // Get additional document summary information data @@ -1723,7 +1729,7 @@ class Xls extends BaseReader $cellAddress = array_pop($arrayKeys); } - $cellAddress = str_replace('$', '', $cellAddress); + $cellAddress = str_replace('$', '', (string) $cellAddress); $noteLength = self::getUInt2d($recordData, 4); $noteText = trim(substr($recordData, 6)); @@ -3154,11 +3160,11 @@ class Xls extends BaseReader // bit: 6; mask: 0x0040; 0 = outline buttons above outline group $isSummaryBelow = (0x0040 & self::getUInt2d($recordData, 0)) >> 6; - $this->phpSheet->setShowSummaryBelow($isSummaryBelow); + $this->phpSheet->setShowSummaryBelow((bool) $isSummaryBelow); // bit: 7; mask: 0x0080; 0 = outline buttons left of outline group $isSummaryRight = (0x0080 & self::getUInt2d($recordData, 0)) >> 7; - $this->phpSheet->setShowSummaryRight($isSummaryRight); + $this->phpSheet->setShowSummaryRight((bool) $isSummaryRight); // bit: 8; mask: 0x100; 0 = scale printout in percent, 1 = fit printout to number of pages // this corresponds to radio button setting in page setup dialog in Excel @@ -4540,7 +4546,7 @@ class Xls extends BaseReader } } - private function includeCellRangeFiltered($cellRangeAddress) + private function includeCellRangeFiltered(string $cellRangeAddress): bool { $includeCellRange = true; if ($this->getReadFilter() !== null) { @@ -5637,8 +5643,6 @@ class Xls extends BaseReader break; default: throw new Exception('Unrecognized space type in tAttrSpace token'); - - break; } // offset: 3; size: 1; number of inserted spaces/carriage returns $spacecount = ord($formulaData[3]); @@ -5648,8 +5652,6 @@ class Xls extends BaseReader break; default: throw new Exception('Unrecognized attribute flag in tAttr token'); - - break; } break; @@ -6500,8 +6502,6 @@ class Xls extends BaseReader break; default: throw new Exception('Unrecognized function in formula'); - - break; } $data = ['function' => $function, 'args' => $args]; @@ -6870,8 +6870,6 @@ class Xls extends BaseReader break; default: throw new Exception('Unrecognized function in formula'); - - break; } $data = ['function' => $function, 'args' => $args]; @@ -7004,8 +7002,6 @@ class Xls extends BaseReader // Unknown cases // don't know how to deal with default: throw new Exception('Unrecognized token ' . sprintf('%02X', $id) . ' in formula'); - - break; } return [ @@ -7413,13 +7409,9 @@ class Xls extends BaseReader } return $sheetRange; - - break; default: // TODO: external sheet support throw new Exception('Xls reader only supports internal sheets in formulas'); - - break; } } @@ -7821,7 +7813,7 @@ class Xls extends BaseReader */ public static function getInt2d($data, $pos) { - return unpack('s', $data[$pos] . $data[$pos + 1])[1]; + return unpack('s', $data[$pos] . $data[$pos + 1])[1]; // @phpstan-ignore-line } /** @@ -7848,7 +7840,7 @@ class Xls extends BaseReader return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; } - private function parseRichText($is) + private function parseRichText(string $is): RichText { $value = new RichText(); $value->createText($is); @@ -7929,7 +7921,7 @@ class Xls extends BaseReader // offset: 6; size: 4; Options $options = self::getInt4d($recordData, 6); - $style = new Style(); + $style = new Style(false, true); // non-supervisor, conditional $this->getCFStyleOptions($options, $style); $hasFontRecord = (bool) ((0x04000000 & $options) >> 26); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php index 0d769ea15..bf8908470 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php @@ -129,7 +129,7 @@ class Xlsx extends BaseReader $contents = str_replace('
', '
', $contents); } $rels = simplexml_load_string( - $this->securityScanner->scan($contents), + $this->getSecurityScannerOrThrow()->scan($contents), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions(), $ns @@ -144,7 +144,7 @@ class Xlsx extends BaseReader { $contents = $this->getFromZipArchive($this->zip, $filename); $rels = simplexml_load_string( - $this->securityScanner->scan($contents), + $this->getSecurityScannerOrThrow()->scan($contents), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions(), ($ns === '' ? $ns : '') @@ -261,7 +261,7 @@ class Xlsx extends BaseReader $xml = new XMLReader(); $xml->xml( - $this->securityScanner->scanFile( + $this->getSecurityScannerOrThrow()->scanFile( 'zip://' . File::realpath($filename) . '#' . $fileWorksheetPath ), null, @@ -472,7 +472,7 @@ class Xlsx extends BaseReader $rels = $this->loadZip(self::INITIAL_FILE, Namespaces::RELATIONSHIPS); - $propertyReader = new PropertyReader($this->securityScanner, $excel->getProperties()); + $propertyReader = new PropertyReader($this->getSecurityScannerOrThrow(), $excel->getProperties()); $chartDetails = []; foreach ($rels->Relationship as $relx) { $rel = self::getAttributes($relx); @@ -1051,7 +1051,7 @@ class Xlsx extends BaseReader // Locate VML drawings image relations $drowingImages = []; $VMLDrawingsRelations = dirname($relPath) . '/_rels/' . basename($relPath) . '.rels'; - $vmlDrawingContents[$relName] = $this->securityScanner->scan($this->getFromZipArchive($zip, $relPath)); + $vmlDrawingContents[$relName] = $this->getSecurityScannerOrThrow()->scan($this->getFromZipArchive($zip, $relPath)); if ($zip->locateName($VMLDrawingsRelations)) { $relsVMLDrawing = $this->loadZip($VMLDrawingsRelations, Namespaces::RELATIONSHIPS); foreach ($relsVMLDrawing->Relationship as $elex) { @@ -1161,7 +1161,7 @@ class Xlsx extends BaseReader $unparsedVmlDrawing[$rId] = []; $unparsedVmlDrawing[$rId]['filePath'] = self::dirAdd("$dir/$fileWorksheet", $relPath); $unparsedVmlDrawing[$rId]['relFilePath'] = $relPath; - $unparsedVmlDrawing[$rId]['content'] = $this->securityScanner->scan($this->getFromZipArchive($zip, $unparsedVmlDrawing[$rId]['filePath'])); + $unparsedVmlDrawing[$rId]['content'] = $this->getSecurityScannerOrThrow()->scan($this->getFromZipArchive($zip, $unparsedVmlDrawing[$rId]['filePath'])); unset($unparsedVmlDrawing); } } @@ -1864,7 +1864,7 @@ class Xlsx extends BaseReader if ($dataRels) { // exists and not empty if the ribbon have some pictures (other than internal MSO) $UIRels = simplexml_load_string( - $this->securityScanner->scan($dataRels), + $this->getSecurityScannerOrThrow()->scan($dataRels), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); @@ -2038,7 +2038,7 @@ class Xlsx extends BaseReader $unparsedCtrlProps[$rId] = []; $unparsedCtrlProps[$rId]['filePath'] = self::dirAdd("$dir/$fileWorksheet", $ctrlProp['Target']); $unparsedCtrlProps[$rId]['relFilePath'] = (string) $ctrlProp['Target']; - $unparsedCtrlProps[$rId]['content'] = $this->securityScanner->scan($this->getFromZipArchive($zip, $unparsedCtrlProps[$rId]['filePath'])); + $unparsedCtrlProps[$rId]['content'] = $this->getSecurityScannerOrThrow()->scan($this->getFromZipArchive($zip, $unparsedCtrlProps[$rId]['filePath'])); } unset($unparsedCtrlProps); } @@ -2068,7 +2068,7 @@ class Xlsx extends BaseReader $unparsedPrinterSettings[$rId] = []; $unparsedPrinterSettings[$rId]['filePath'] = self::dirAdd("$dir/$fileWorksheet", $printerSettings['Target']); $unparsedPrinterSettings[$rId]['relFilePath'] = (string) $printerSettings['Target']; - $unparsedPrinterSettings[$rId]['content'] = $this->securityScanner->scan($this->getFromZipArchive($zip, $unparsedPrinterSettings[$rId]['filePath'])); + $unparsedPrinterSettings[$rId]['content'] = $this->getSecurityScannerOrThrow()->scan($this->getFromZipArchive($zip, $unparsedPrinterSettings[$rId]['filePath'])); } unset($unparsedPrinterSettings); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php index d42df9a37..5230cf0d7 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php @@ -402,6 +402,7 @@ class Chart { $caption = []; $titleLayout = null; + $titleOverlay = false; foreach ($titleDetails as $titleDetailKey => $chartDetail) { $chartDetail = Xlsx::testSimpleXml($chartDetail); switch ($titleDetailKey) { @@ -424,6 +425,10 @@ class Chart } } + break; + case 'overlay': + $titleOverlay = self::getAttribute($chartDetail, 'val', 'boolean'); + break; case 'layout': $titleLayout = $this->chartLayoutDetails($chartDetail); @@ -432,7 +437,7 @@ class Chart } } - return new Title($caption, $titleLayout); + return new Title($caption, $titleLayout, (bool) $titleOverlay); } private function chartLayoutDetails(SimpleXMLElement $chartDetail): ?Layout diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php index aa6b62b26..59bf5b84e 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php @@ -163,7 +163,7 @@ class ConditionalStyles $conditionals = []; foreach ($xmlSheet->conditionalFormatting as $conditional) { foreach ($conditional->cfRule as $cfRule) { - if (Conditional::isValidConditionType((string) $cfRule['type']) && isset($this->dxfs[(int) ($cfRule['dxfId'])])) { + if (Conditional::isValidConditionType((string) $cfRule['type']) && (!isset($cfRule['dxfId']) || isset($this->dxfs[(int) ($cfRule['dxfId'])]))) { $conditionals[(string) $conditional['sqref']][(int) ($cfRule['priority'])] = $cfRule; } elseif ((string) $cfRule['type'] == Conditional::CONDITION_DATABAR) { $conditionals[(string) $conditional['sqref']][(int) ($cfRule['priority'])] = $cfRule; @@ -197,6 +197,7 @@ class ConditionalStyles $objConditional = new Conditional(); $objConditional->setConditionType((string) $cfRule['type']); $objConditional->setOperatorType((string) $cfRule['operator']); + $objConditional->setNoFormatSet(!isset($cfRule['dxfId'])); if ((string) $cfRule['text'] != '') { $objConditional->setText((string) $cfRule['text']); @@ -227,7 +228,7 @@ class ConditionalStyles $objConditional->setDataBar( $this->readDataBarOfConditionalRule($cfRule, $conditionalFormattingRuleExtensions) // @phpstan-ignore-line ); - } else { + } elseif (isset($cfRule['dxfId'])) { $objConditional->setStyle(clone $this->dxfs[(int) ($cfRule['dxfId'])]); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php index fb55cb265..ab5754884 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php @@ -151,8 +151,9 @@ class PageSetup extends BaseParserClass private function rowBreaks(SimpleXMLElement $xmlSheet, Worksheet $worksheet): void { foreach ($xmlSheet->rowBreaks->brk as $brk) { + $rowBreakMax = isset($brk['max']) ? ((int) $brk['max']) : -1; if ($brk['man']) { - $worksheet->setBreak("A{$brk['id']}", Worksheet::BREAK_ROW); + $worksheet->setBreak("A{$brk['id']}", Worksheet::BREAK_ROW, $rowBreakMax); } } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php index 5b089fa87..705b319e7 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php @@ -206,11 +206,21 @@ class Styles extends BaseParserClass $borderStyle->setDiagonalDirection(Borders::DIAGONAL_BOTH); } - $this->readBorder($borderStyle->getLeft(), $borderStyleXml->left); - $this->readBorder($borderStyle->getRight(), $borderStyleXml->right); - $this->readBorder($borderStyle->getTop(), $borderStyleXml->top); - $this->readBorder($borderStyle->getBottom(), $borderStyleXml->bottom); - $this->readBorder($borderStyle->getDiagonal(), $borderStyleXml->diagonal); + if (isset($borderStyleXml->left)) { + $this->readBorder($borderStyle->getLeft(), $borderStyleXml->left); + } + if (isset($borderStyleXml->right)) { + $this->readBorder($borderStyle->getRight(), $borderStyleXml->right); + } + if (isset($borderStyleXml->top)) { + $this->readBorder($borderStyle->getTop(), $borderStyleXml->top); + } + if (isset($borderStyleXml->bottom)) { + $this->readBorder($borderStyle->getBottom(), $borderStyleXml->bottom); + } + if (isset($borderStyleXml->diagonal)) { + $this->readBorder($borderStyle->getDiagonal(), $borderStyleXml->diagonal); + } } private function getAttribute(SimpleXMLElement $xml, string $attribute): string @@ -233,6 +243,8 @@ class Styles extends BaseParserClass $style = $this->getAttribute($borderXml, 'style'); if ($style !== '') { $border->setBorderStyle((string) $style); + } else { + $border->setBorderStyle(Border::BORDER_NONE); } if (isset($borderXml->color)) { $border->getColor()->setARGB($this->readColor($borderXml->color)); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php index 565a5af75..9cce7003f 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php @@ -42,6 +42,7 @@ class Xml extends BaseReader $this->securityScanner = XmlScanner::getInstance($this); } + /** @var string */ private $fileContents = ''; public static function xmlMappings(): array @@ -73,7 +74,7 @@ class Xml extends BaseReader ]; // Open file - $data = file_get_contents($filename); + $data = file_get_contents($filename) ?: ''; // Why? //$data = str_replace("'", '"', $data); // fix headers with single quote @@ -112,7 +113,7 @@ class Xml extends BaseReader { try { $xml = simplexml_load_string( - $this->securityScanner->scan($this->fileContents ?: file_get_contents($filename)), + $this->getSecurityScannerOrThrow()->scan($this->fileContents ?: file_get_contents($filename)), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/PageSettings.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/PageSettings.php index a12986c53..39535c3e7 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/PageSettings.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/PageSettings.php @@ -63,27 +63,25 @@ class PageSettings foreach ($pageSetupData as $pageSetupKey => $pageSetupValue) { /** @scrutinizer ignore-call */ $pageSetupAttributes = $pageSetupValue->attributes($namespaces['x']); - if (!$pageSetupAttributes) { - continue; - } + if ($pageSetupAttributes !== null) { + switch ($pageSetupKey) { + case 'Layout': + $this->setLayout($printDefaults, $pageSetupAttributes); - switch ($pageSetupKey) { - case 'Layout': - $this->setLayout($printDefaults, $pageSetupAttributes); + break; + case 'Header': + $printDefaults->headerMargin = (float) $pageSetupAttributes->Margin ?: 1.0; - break; - case 'Header': - $printDefaults->headerMargin = (float) $pageSetupAttributes->Margin ?: 1.0; + break; + case 'Footer': + $printDefaults->footerMargin = (float) $pageSetupAttributes->Margin ?: 1.0; - break; - case 'Footer': - $printDefaults->footerMargin = (float) $pageSetupAttributes->Margin ?: 1.0; + break; + case 'PageMargins': + $this->setMargins($printDefaults, $pageSetupAttributes); - break; - case 'PageMargins': - $this->setMargins($printDefaults, $pageSetupAttributes); - - break; + break; + } } } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Properties.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Properties.php index 9e10526e4..f0346ed02 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Properties.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Properties.php @@ -39,7 +39,7 @@ class Properties protected function readCustomProperties(SimpleXMLElement $xml, array $namespaces): void { - if (isset($xml->CustomDocumentProperties)) { + if (isset($xml->CustomDocumentProperties) && is_iterable($xml->CustomDocumentProperties[0])) { $docProps = $this->spreadsheet->getProperties(); foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) { @@ -150,8 +150,6 @@ class Properties private static function getAttributes(?SimpleXMLElement $simple, string $node): SimpleXMLElement { - return ($simple === null) - ? new SimpleXMLElement('') - : ($simple->attributes($node) ?? new SimpleXMLElement('')); + return ($simple === null) ? new SimpleXMLElement('') : ($simple->attributes($node) ?? new SimpleXMLElement('')); } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style.php index 0e3cd16de..774fffe8b 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style.php @@ -15,7 +15,7 @@ class Style public function parseStyles(SimpleXMLElement $xml, array $namespaces): array { - if (!isset($xml->Styles)) { + if (!isset($xml->Styles) || !is_iterable($xml->Styles[0])) { return []; } @@ -33,7 +33,7 @@ class Style $alignment = $border = $font = $fill = $numberFormat = []; foreach ($style as $styleType => $styleDatax) { - $styleData = $styleDatax ?? new SimpleXMLElement(''); + $styleData = self::getSxml($styleDatax); $styleAttributes = $styleData->attributes($namespaces['ss']); switch ($styleType) { @@ -74,10 +74,13 @@ class Style return $this->styles; } - protected static function getAttributes(?SimpleXMLElement $simple, string $node): SimpleXMLElement + private static function getAttributes(?SimpleXMLElement $simple, string $node): SimpleXMLElement { - return ($simple === null) - ? new SimpleXMLElement('') - : ($simple->attributes($node) ?? new SimpleXMLElement('')); + return ($simple === null) ? new SimpleXMLElement('') : ($simple->attributes($node) ?? new SimpleXMLElement('')); + } + + private static function getSxml(?SimpleXMLElement $simple): SimpleXMLElement + { + return ($simple !== null) ? $simple : new SimpleXMLElement(''); } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/StyleBase.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/StyleBase.php index fc9ace825..8103a71cb 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/StyleBase.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/StyleBase.php @@ -25,8 +25,6 @@ abstract class StyleBase protected static function getAttributes(?SimpleXMLElement $simple, string $node): SimpleXMLElement { - return ($simple === null) - ? new SimpleXMLElement('') - : ($simple->attributes($node) ?? new SimpleXMLElement('')); + return ($simple === null) ? new SimpleXMLElement('') : ($simple->attributes($node) ?? new SimpleXMLElement('')); } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php index 87a5075ab..b4d4d52af 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php @@ -518,7 +518,7 @@ class ReferenceHelper // Update worksheet: freeze pane if ($worksheet->getFreezePane()) { - $splitCell = $worksheet->getFreezePane() ?? ''; + $splitCell = $worksheet->getFreezePane(); $topLeftCell = $worksheet->getTopLeftCell() ?? ''; $splitCell = $this->updateCellReference($splitCell); @@ -862,17 +862,15 @@ class ReferenceHelper // Is it in another worksheet? Will not have to update anything. if (strpos($cellReference, '!') !== false) { return $cellReference; + } // Is it a range or a single cell? - } elseif (!Coordinate::coordinateIsRange($cellReference)) { + if (!Coordinate::coordinateIsRange($cellReference)) { // Single cell return $this->cellReferenceHelper->updateCellReference($cellReference, $includeAbsoluteReferences); - } elseif (Coordinate::coordinateIsRange($cellReference)) { - // Range - return $this->updateCellRange($cellReference, $includeAbsoluteReferences); } - // Return original - return $cellReference; + // Range + return $this->updateCellRange($cellReference, $includeAbsoluteReferences); } /** diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php index 9c9f80729..862cdbf92 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php @@ -9,7 +9,7 @@ class Run extends TextElement implements ITextElement /** * Font. * - * @var Font + * @var ?Font */ private $font; @@ -58,7 +58,7 @@ class Run extends TextElement implements ITextElement { return md5( $this->getText() . - $this->font->getHashCode() . + (($this->font === null) ? '' : $this->font->getHashCode()) . __CLASS__ ); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php index 0ae5f1eab..26dde93f3 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php @@ -160,7 +160,9 @@ class Date } /** - * @param mixed $value + * @param mixed $value Converts a date/time in ISO-8601 standard format date string to an Excel + * serialized timestamp. + * See https://en.wikipedia.org/wiki/ISO_8601 for details of the ISO-8601 standard format. * * @return float|int */ @@ -194,8 +196,8 @@ class Date * * @param float|int $excelTimestamp MS Excel serialized date/time value * @param null|DateTimeZone|string $timeZone The timezone to assume for the Excel timestamp, - * if you don't want to treat it as a UTC value - * Use the default (UTC) unless you absolutely need a conversion + * if you don't want to treat it as a UTC value + * Use the default (UTC) unless you absolutely need a conversion * * @return DateTime PHP date/time object */ @@ -243,8 +245,8 @@ class Date * * @param float|int $excelTimestamp MS Excel serialized date/time value * @param null|DateTimeZone|string $timeZone The timezone to assume for the Excel timestamp, - * if you don't want to treat it as a UTC value - * Use the default (UTC) unless you absolutely need a conversion + * if you don't want to treat it as a UTC value + * Use the default (UTC) unless you absolutely need a conversion * * @return int Unix timetamp for this date/time */ @@ -375,13 +377,18 @@ class Date if ($worksheet !== null && $spreadsheet !== null) { $index = $spreadsheet->getActiveSheetIndex(); $selected = $worksheet->getSelectedCells(); - $result = is_numeric($value ?? $cell->getCalculatedValue()) && - self::isDateTimeFormat( - $worksheet->getStyle( - $cell->getCoordinate() - )->getNumberFormat(), - $dateWithoutTimeOkay - ); + + try { + $result = is_numeric($value ?? $cell->getCalculatedValue()) && + self::isDateTimeFormat( + $worksheet->getStyle( + $cell->getCoordinate() + )->getNumberFormat(), + $dateWithoutTimeOkay + ); + } catch (Exception $e) { + // Result is already false, so no need to actually do anything here + } $worksheet->setSelectedCells($selected); $spreadsheet->setActiveSheetIndex($index); } @@ -390,7 +397,7 @@ class Date } /** - * Is a given number format a date/time? + * Is a given NumberFormat code a date/time format code? * * @return bool */ diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php index c6d0a6f81..466e7e825 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php @@ -7,21 +7,21 @@ class Escher /** * Drawing Group Container. * - * @var Escher\DggContainer + * @var ?Escher\DggContainer */ private $dggContainer; /** * Drawing Container. * - * @var Escher\DgContainer + * @var ?Escher\DgContainer */ private $dgContainer; /** * Get Drawing Group Container. * - * @return Escher\DggContainer + * @return ?Escher\DggContainer */ public function getDggContainer() { @@ -43,7 +43,7 @@ class Escher /** * Get Drawing Container. * - * @return Escher\DgContainer + * @return ?Escher\DgContainer */ public function getDgContainer() { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php index b0d75d783..51c6860cb 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php @@ -2,50 +2,63 @@ namespace PhpOffice\PhpSpreadsheet\Shared\Escher; +use PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException; + class DgContainer { /** * Drawing index, 1-based. * - * @var int + * @var ?int */ private $dgId; /** * Last shape index in this drawing. * - * @var int + * @var ?int */ private $lastSpId; + /** @var ?DgContainer\SpgrContainer */ private $spgrContainer; - public function getDgId() + public function getDgId(): ?int { return $this->dgId; } - public function setDgId($value): void + public function setDgId(int $value): void { $this->dgId = $value; } - public function getLastSpId() + public function getLastSpId(): ?int { return $this->lastSpId; } - public function setLastSpId($value): void + public function setLastSpId(int $value): void { $this->lastSpId = $value; } - public function getSpgrContainer() + public function getSpgrContainer(): ?DgContainer\SpgrContainer { return $this->spgrContainer; } - public function setSpgrContainer($spgrContainer) + public function getSpgrContainerOrThrow(): DgContainer\SpgrContainer + { + if ($this->spgrContainer !== null) { + return $this->spgrContainer; + } + + throw new SpreadsheetException('spgrContainer is unexpectedly null'); + } + + /** @param DgContainer\SpgrContainer $spgrContainer */ + public function setSpgrContainer($spgrContainer): DgContainer\SpgrContainer { return $this->spgrContainer = $spgrContainer; } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php index 6bdc8f7dc..260df9cd4 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php @@ -48,7 +48,7 @@ class SpgrContainer /** * Get collection of Shape Containers. */ - public function getChildren() + public function getChildren(): array { return $this->children; } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php index 36806aa68..ba5e7980b 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php @@ -28,7 +28,7 @@ class DggContainer /** * BLIP Store Container. * - * @var DggContainer\BstoreContainer + * @var ?DggContainer\BstoreContainer */ private $bstoreContainer; @@ -109,7 +109,7 @@ class DggContainer /** * Get BLIP Store Container. * - * @return DggContainer\BstoreContainer + * @return ?DggContainer\BstoreContainer */ public function getBstoreContainer() { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php index d24af3f7c..328ac6b6c 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php @@ -19,15 +19,16 @@ class BSE /** * The parent BLIP Store Entry Container. + * Property is never currently read. * * @var BstoreContainer */ - private $parent; + private $parent; // @phpstan-ignore-line /** * The BLIP (Big Large Image or Picture). * - * @var BSE\Blip + * @var ?BSE\Blip */ private $blip; @@ -49,7 +50,7 @@ class BSE /** * Get the BLIP. * - * @return BSE\Blip + * @return ?BSE\Blip */ public function getBlip() { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php index dfe9f77ae..aa3512ae3 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php @@ -200,6 +200,23 @@ class Font ], ]; + /** + * Array that can be used to supplement FONT_FILE_NAMES for calculating exact width. + * + * @var array + */ + private static $extraFontArray = []; + + public static function setExtraFontArray(array $extraFontArray): void + { + self::$extraFontArray = $extraFontArray; + } + + public static function getExtraFontArray(): array + { + return self::$extraFontArray; + } + /** * AutoSize method. * @@ -341,7 +358,7 @@ class Font ?FontStyle $defaultFont = null, bool $filterAdjustment = false, int $indentAdjustment = 0 - ): int { + ): float { // If it is rich text, use plain text if ($cellText instanceof RichText) { $cellText = $cellText->getPlainText(); @@ -395,18 +412,14 @@ class Font $columnWidth = Drawing::pixelsToCellDimension((int) $columnWidth, $defaultFont ?? new FontStyle()); // Return - return (int) round($columnWidth, 6); + return round($columnWidth, 4); } /** * Get GD text width in pixels for a string of text in a certain font at a certain rotation angle. */ - public static function getTextWidthPixelsExact(string $text, FontStyle $font, int $rotation = 0): int + public static function getTextWidthPixelsExact(string $text, FontStyle $font, int $rotation = 0): float { - if (!function_exists('imagettfbbox')) { - throw new PhpSpreadsheetException('GD library needs to be enabled'); - } - // font size should really be supplied in pixels in GD2, // but since GD2 seems to assume 72dpi, pixels and points are the same $fontFile = self::getTrueTypeFontFileFromFont($font); @@ -424,7 +437,7 @@ class Font $upperLeftCornerX = $textBox[6]; // Consider the rotation when calculating the width - return max($lowerRightCornerX - $upperLeftCornerX, $upperRightCornerX - $lowerLeftCornerX); + return round(max($lowerRightCornerX - $upperLeftCornerX, $upperRightCornerX - $lowerLeftCornerX), 4); } /** @@ -532,7 +545,8 @@ class Font } $name = $font->getName(); - if (!isset(self::FONT_FILE_NAMES[$name])) { + $fontArray = array_merge(self::FONT_FILE_NAMES, self::$extraFontArray); + if (!isset($fontArray[$name])) { throw new PhpSpreadsheetException('Unknown font name "' . $name . '". Cannot map to TrueType font file'); } $bold = $font->getBold(); @@ -544,7 +558,7 @@ class Font if ($italic) { $index .= 'i'; } - $fontFile = self::FONT_FILE_NAMES[$name][$index]; + $fontFile = $fontArray[$name][$index]; $separator = ''; if (mb_strlen(self::$trueTypeFontPath) > 1 && mb_substr(self::$trueTypeFontPath, -1) !== '/' && mb_substr(self::$trueTypeFontPath, -1) !== '\\') { @@ -554,7 +568,31 @@ class Font // Check if file actually exists if ($checkPath && !file_exists($fontFile)) { - throw new PhpSpreadsheetException('TrueType Font file not found'); + $alternateName = $name; + if ($index !== 'x' && $fontArray[$name][$index] !== $fontArray[$name]['x']) { + // Bold but no italic: + // Comic Sans + // Tahoma + // Neither bold nor italic: + // Impact + // Lucida Console + // Lucida Sans Unicode + // Microsoft Sans Serif + // Symbol + if ($index === 'xb') { + $alternateName .= ' Bold'; + } elseif ($index === 'xi') { + $alternateName .= ' Italic'; + } elseif ($fontArray[$name]['xb'] === $fontArray[$name]['xbi']) { + $alternateName .= ' Bold'; + } else { + $alternateName .= ' Bold Italic'; + } + } + $fontFile = self::$trueTypeFontPath . $separator . $alternateName . '.ttf'; + if (!file_exists($fontFile)) { + throw new PhpSpreadsheetException('TrueType Font file not found'); + } } return $fontFile; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php index 815b1c16c..c14afb2cd 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php @@ -116,7 +116,7 @@ class OLE */ public function read($filename) { - $fh = fopen($filename, 'rb'); + $fh = @fopen($filename, 'rb'); if ($fh === false) { throw new ReaderException("Can't open file $filename"); } @@ -239,7 +239,12 @@ class OLE $path .= '&blockId=' . $blockIdOrPps; } - return fopen($path, 'rb'); + $resource = fopen($path, 'rb'); + if ($resource === false) { + throw new Exception("Unable to open stream $path"); + } + + return $resource; } /** @@ -251,8 +256,7 @@ class OLE */ private static function readInt1($fileHandle) { - // @phpstan-ignore-next-line - [, $tmp] = unpack('c', fread($fileHandle, 1)); + [, $tmp] = unpack('c', fread($fileHandle, 1) ?: '') ?: [0, 0]; return $tmp; } @@ -266,14 +270,17 @@ class OLE */ private static function readInt2($fileHandle) { - // @phpstan-ignore-next-line - [, $tmp] = unpack('v', fread($fileHandle, 2)); + [, $tmp] = unpack('v', fread($fileHandle, 2) ?: '') ?: [0, 0]; return $tmp; } + private const SIGNED_4OCTET_LIMIT = 2147483648; + + private const SIGNED_4OCTET_SUBTRACT = 2 * self::SIGNED_4OCTET_LIMIT; + /** - * Reads an unsigned long (4 octets). + * Reads long (4 octets), interpreted as if signed on 32-bit system. * * @param resource $fileHandle file handle * @@ -281,8 +288,10 @@ class OLE */ private static function readInt4($fileHandle) { - // @phpstan-ignore-next-line - [, $tmp] = unpack('V', fread($fileHandle, 4)); + [, $tmp] = unpack('V', fread($fileHandle, 4) ?: '') ?: [0, 0]; + if ($tmp >= self::SIGNED_4OCTET_LIMIT) { + $tmp -= self::SIGNED_4OCTET_SUBTRACT; + } return $tmp; } @@ -300,7 +309,7 @@ class OLE $fh = $this->getStream($blockId); for ($pos = 0; true; $pos += 128) { fseek($fh, $pos, SEEK_SET); - $nameUtf16 = fread($fh, 64); + $nameUtf16 = (string) fread($fh, 64); $nameLength = self::readInt2($fh); $nameUtf16 = substr($nameUtf16, 0, $nameLength - 2); // Simple conversion from UTF-16LE to ISO-8859-1 @@ -330,15 +339,15 @@ class OLE $pps->NextPps = self::readInt4($fh); $pps->DirPps = self::readInt4($fh); fseek($fh, 20, SEEK_CUR); - $pps->Time1st = self::OLE2LocalDate(fread($fh, 8)); - $pps->Time2nd = self::OLE2LocalDate(fread($fh, 8)); + $pps->Time1st = self::OLE2LocalDate((string) fread($fh, 8)); + $pps->Time2nd = self::OLE2LocalDate((string) fread($fh, 8)); $pps->startBlock = self::readInt4($fh); $pps->Size = self::readInt4($fh); $pps->No = count($this->_list); $this->_list[] = $pps; // check if the PPS tree (starting from root) is complete - if (isset($this->root) && $this->ppsTreeComplete($this->root->No)) { + if (isset($this->root) && $this->ppsTreeComplete($this->root->No)) { //* @phpstan-ignore-line break; } } @@ -448,7 +457,7 @@ class OLE return ''; } $fh = $this->getStream($this->_list[$index]); - $data = stream_get_contents($fh, $length, $position); + $data = (string) stream_get_contents($fh, $length, $position); fclose($fh); return $data; @@ -540,7 +549,7 @@ class OLE } // convert to units of 100 ns since 1601: - $unpackedTimestamp = unpack('v4', $oleTimestamp); + $unpackedTimestamp = unpack('v4', $oleTimestamp) ?: []; $timestampHigh = (float) $unpackedTimestamp[4] * 65536 + (float) $unpackedTimestamp[3]; $timestampLow = (float) $unpackedTimestamp[2] * 65536 + (float) $unpackedTimestamp[1]; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php index ee93c05e1..c61ee2594 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php @@ -48,7 +48,7 @@ class ChainedBlockStream */ public function stream_open($path, $mode, $options, &$openedPath) // @codingStandardsIgnoreLine { - if ($mode != 'r') { + if ($mode[0] !== 'r') { if ($options & STREAM_REPORT_ERRORS) { trigger_error('Only reading is supported', E_USER_WARNING); } @@ -119,7 +119,7 @@ class ChainedBlockStream if ($this->stream_eof()) { return false; } - $s = substr($this->data, $this->pos, $count); + $s = substr($this->data, (int) $this->pos, $count); $this->pos += $count; return $s; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php index d3d86f5a5..2740a1b6d 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php @@ -88,7 +88,7 @@ class PPS /** * Starting block (small or big) for this PPS's data inside the container. * - * @var int + * @var ?int */ public $startBlock; @@ -104,7 +104,7 @@ class PPS * * @var string */ - public $_data; + public $_data = ''; /** * Array of child PPS's (only used by Root and Dir PPS's). @@ -123,34 +123,30 @@ class PPS /** * The constructor. * - * @param int $No The PPS index - * @param string $name The PPS name - * @param int $type The PPS type. Dir, Root or File - * @param int $prev The index of the previous PPS - * @param int $next The index of the next PPS - * @param int $dir The index of it's first child if this is a Dir or Root PPS + * @param ?int $No The PPS index + * @param ?string $name The PPS name + * @param ?int $type The PPS type. Dir, Root or File + * @param ?int $prev The index of the previous PPS + * @param ?int $next The index of the next PPS + * @param ?int $dir The index of it's first child if this is a Dir or Root PPS * @param null|float|int $time_1st A timestamp * @param null|float|int $time_2nd A timestamp - * @param string $data The (usually binary) source data of the PPS + * @param ?string $data The (usually binary) source data of the PPS * @param array $children Array containing children PPS for this PPS */ public function __construct($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children) { - $this->No = $No; - $this->Name = $name; - $this->Type = $type; - $this->PrevPps = $prev; - $this->NextPps = $next; - $this->DirPps = $dir; + $this->No = (int) $No; + $this->Name = (string) $name; + $this->Type = (int) $type; + $this->PrevPps = (int) $prev; + $this->NextPps = (int) $next; + $this->DirPps = (int) $dir; $this->Time1st = $time_1st ?? 0; $this->Time2nd = $time_2nd ?? 0; - $this->_data = $data; + $this->_data = (string) $data; $this->children = $children; - if ($data != '') { - $this->Size = strlen($data); - } else { - $this->Size = 0; - } + $this->Size = strlen((string) $data); } /** @@ -160,9 +156,9 @@ class PPS */ public function getDataLen() { - if (!isset($this->_data)) { - return 0; - } + //if (!isset($this->_data)) { + // return 0; + //} return strlen($this->_data); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php index 3fe8af2ac..e1cbf8c90 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php @@ -36,12 +36,12 @@ class Root extends PPS private $fileHandle; /** - * @var int + * @var ?int */ private $smallBlockSize; /** - * @var int + * @var ?int */ private $bigBlockSize; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php index b3e35c505..3d952a9c8 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php @@ -6,6 +6,7 @@ use PhpOffice\PhpSpreadsheet\Reader\Exception as ReaderException; class OLERead { + /** @var string */ private $data = ''; // Size of a sector = 512 bytes @@ -34,10 +35,13 @@ class OLERead const START_BLOCK_POS = 0x74; const SIZE_POS = 0x78; + /** @var int */ public $wrkbook; + /** @var int */ public $summaryInformation; + /** @var int */ public $documentSummaryInformation; /** @@ -99,7 +103,7 @@ class OLERead // Get the file identifier // Don't bother reading the whole file until we know it's a valid OLE file - $this->data = file_get_contents($filename, false, null, 0, 8); + $this->data = (string) file_get_contents($filename, false, null, 0, 8); // Check OLE identifier $identifierOle = pack('CCCCCCCC', 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1); @@ -108,7 +112,7 @@ class OLERead } // Get the file data - $this->data = file_get_contents($filename); + $this->data = (string) file_get_contents($filename); // Total number of sectors used for the SAT $this->numBigBlockDepotBlocks = self::getInt4d($this->data, self::NUM_BIG_BLOCK_DEPOT_BLOCKS_POS); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php index b2b0d9440..a8d7c93b7 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php @@ -53,39 +53,55 @@ abstract class BestFit */ protected $yBestFitValues = []; + /** @var float */ protected $goodnessOfFit = 1; + /** @var float */ protected $stdevOfResiduals = 0; + /** @var float */ protected $covariance = 0; + /** @var float */ protected $correlation = 0; + /** @var float */ protected $SSRegression = 0; + /** @var float */ protected $SSResiduals = 0; + /** @var float */ protected $DFResiduals = 0; + /** @var float */ protected $f = 0; + /** @var float */ protected $slope = 0; + /** @var float */ protected $slopeSE = 0; + /** @var float */ protected $intersect = 0; + /** @var float */ protected $intersectSE = 0; + /** @var float */ protected $xOffset = 0; + /** @var float */ protected $yOffset = 0; + /** @return bool */ public function getError() { return $this->error; } + /** @return string */ public function getBestFitType() { return $this->bestFitType; @@ -344,6 +360,16 @@ abstract class BestFit return $x == $y; } + /** + * @param float $sumX + * @param float $sumY + * @param float $sumX2 + * @param float $sumY2 + * @param float $sumXY + * @param float $meanX + * @param float $meanY + * @param bool|int $const + */ protected function calculateGoodnessOfFit($sumX, $sumY, $sumX2, $sumY2, $sumXY, $meanX, $meanY, $const): void { $SSres = $SScov = $SStot = $SSsex = 0.0; @@ -399,6 +425,7 @@ abstract class BestFit } } + /** @return float|int */ private function sumSquares(array $values) { return array_sum( diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php index a21635966..222a42300 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php @@ -108,6 +108,7 @@ class PolynomialBestFit extends BestFit if ($dp != 0) { $coefficients = []; // Scrutinizer is correct - $this->slope is float, not array. + //* @phpstan-ignore-next-line foreach ($this->slope as $coefficient) { $coefficients[] = round($coefficient, $dp); } @@ -119,6 +120,11 @@ class PolynomialBestFit extends BestFit return $this->slope; } + /** + * @param int $dp + * + * @return array + */ public function getCoefficients($dp = 0) { // Phpstan and Scrutinizer are both correct - getSlope returns float, not array. @@ -176,6 +182,8 @@ class PolynomialBestFit extends BestFit } $this->intersect = array_shift($coefficients); + // Phpstan (and maybe Scrutinizer) are correct + //* @phpstan-ignore-next-line $this->slope = $coefficients; $this->calculateGoodnessOfFit($x_sum, $y_sum, $xx_sum, $yy_sum, $xy_sum, 0, 0, 0); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php index 929f59b9c..b94609af7 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php @@ -48,6 +48,14 @@ class Trend */ private static $trendCache = []; + /** + * @param string $trendType + * @param array $yValues + * @param array $xValues + * @param bool $const + * + * @return mixed + */ public static function calculate($trendType = self::TREND_BEST_FIT, $yValues = [], $xValues = [], $const = true) { // Calculate number of points in each dataset @@ -72,7 +80,6 @@ class Trend case self::TREND_POWER: if (!isset(self::$trendCache[$key])) { $className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit'; - // @phpstan-ignore-next-line self::$trendCache[$key] = new $className($yValues, $xValues, $const); } @@ -96,7 +103,9 @@ class Trend $bestFitValue = []; foreach (self::$trendTypes as $trendMethod) { $className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit'; + //* @phpstan-ignore-next-line $bestFit[$trendMethod] = new $className($yValues, $xValues, $const); + //* @phpstan-ignore-next-line $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit(); } if ($trendType != self::TREND_BEST_FIT_NO_POLY) { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php index 65bd7ec61..d9f403d7a 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php @@ -2,6 +2,8 @@ namespace PhpOffice\PhpSpreadsheet\Shared; +use PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException; + class XMLWriter extends \XMLWriter { /** @var bool */ @@ -62,6 +64,13 @@ class XMLWriter extends \XMLWriter } } + public function __wakeup(): void + { + $this->tempFileName = ''; + + throw new SpreadsheetException('Unserialize not permitted'); + } + /** * Get written data. * diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php index c6fb51f15..568e1e006 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php @@ -21,6 +21,7 @@ class Border extends Supervisor const BORDER_SLANTDASHDOT = 'slantDashDot'; const BORDER_THICK = 'thick'; const BORDER_THIN = 'thin'; + const BORDER_OMIT = 'omit'; // should be used only for Conditional /** * Border style. @@ -48,7 +49,7 @@ class Border extends Supervisor * Leave this value at default unless you understand exactly what * its ramifications are */ - public function __construct($isSupervisor = false) + public function __construct($isSupervisor = false, bool $isConditional = false) { // Supervisor? parent::__construct($isSupervisor); @@ -60,6 +61,9 @@ class Border extends Supervisor if ($isSupervisor) { $this->color->bindParent($this, 'color'); } + if ($isConditional) { + $this->borderStyle = self::BORDER_OMIT; + } } /** diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php index 56a52709e..a1247e859 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php @@ -96,27 +96,27 @@ class Borders extends Supervisor * Leave this value at default unless you understand exactly what * its ramifications are */ - public function __construct($isSupervisor = false) + public function __construct($isSupervisor = false, bool $isConditional = false) { // Supervisor? parent::__construct($isSupervisor); // Initialise values - $this->left = new Border($isSupervisor); - $this->right = new Border($isSupervisor); - $this->top = new Border($isSupervisor); - $this->bottom = new Border($isSupervisor); - $this->diagonal = new Border($isSupervisor); + $this->left = new Border($isSupervisor, $isConditional); + $this->right = new Border($isSupervisor, $isConditional); + $this->top = new Border($isSupervisor, $isConditional); + $this->bottom = new Border($isSupervisor, $isConditional); + $this->diagonal = new Border($isSupervisor, $isConditional); $this->diagonalDirection = self::DIAGONAL_NONE; // Specially for supervisor if ($isSupervisor) { // Initialize pseudo-borders - $this->allBorders = new Border(true); - $this->outline = new Border(true); - $this->inside = new Border(true); - $this->vertical = new Border(true); - $this->horizontal = new Border(true); + $this->allBorders = new Border(true, $isConditional); + $this->outline = new Border(true, $isConditional); + $this->inside = new Border(true, $isConditional); + $this->vertical = new Border(true, $isConditional); + $this->horizontal = new Border(true, $isConditional); // bind parent if we are a supervisor $this->left->bindParent($this, 'left'); diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php index 019c0648d..de565d345 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php @@ -115,6 +115,9 @@ class Conditional implements IComparable */ private $style; + /** @var bool */ + private $noFormatSet = false; + /** * Create a new Conditional. */ @@ -124,6 +127,18 @@ class Conditional implements IComparable $this->style = new Style(false, true); } + public function getNoFormatSet(): bool + { + return $this->noFormatSet; + } + + public function setNoFormatSet(bool $noFormatSet): self + { + $this->noFormatSet = $noFormatSet; + + return $this; + } + /** * Get Condition type. * diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php index f7a2eee19..c5c36aeb3 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php @@ -36,7 +36,7 @@ class ConditionalDataBar /** * @param bool $showValue */ - public function setShowValue($showValue) + public function setShowValue($showValue): self { $this->showValue = $showValue; @@ -48,7 +48,7 @@ class ConditionalDataBar return $this->minimumConditionalFormatValueObject; } - public function setMinimumConditionalFormatValueObject(ConditionalFormatValueObject $minimumConditionalFormatValueObject) + public function setMinimumConditionalFormatValueObject(ConditionalFormatValueObject $minimumConditionalFormatValueObject): self { $this->minimumConditionalFormatValueObject = $minimumConditionalFormatValueObject; @@ -60,7 +60,7 @@ class ConditionalDataBar return $this->maximumConditionalFormatValueObject; } - public function setMaximumConditionalFormatValueObject(ConditionalFormatValueObject $maximumConditionalFormatValueObject) + public function setMaximumConditionalFormatValueObject(ConditionalFormatValueObject $maximumConditionalFormatValueObject): self { $this->maximumConditionalFormatValueObject = $maximumConditionalFormatValueObject; @@ -84,7 +84,7 @@ class ConditionalDataBar return $this->conditionalFormattingRuleExt; } - public function setConditionalFormattingRuleExt(ConditionalFormattingRuleExtension $conditionalFormattingRuleExt) + public function setConditionalFormattingRuleExt(ConditionalFormattingRuleExtension $conditionalFormattingRuleExt): self { $this->conditionalFormattingRuleExt = $conditionalFormattingRuleExt; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php index c709cf3e7..780713866 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php @@ -51,7 +51,7 @@ class ConditionalDataBarExtension 'tint' => null, ]; - public function getXmlAttributes() + public function getXmlAttributes(): array { $ret = []; foreach (['minLength', 'maxLength', 'direction', 'axisPosition'] as $attrKey) { @@ -68,7 +68,7 @@ class ConditionalDataBarExtension return $ret; } - public function getXmlElements() + public function getXmlElements(): array { $ret = []; $elms = ['borderColor', 'negativeFillColor', 'negativeBorderColor']; @@ -200,7 +200,7 @@ class ConditionalDataBarExtension return $this->maximumConditionalFormatValueObject; } - public function setMaximumConditionalFormatValueObject(ConditionalFormatValueObject $maximumConditionalFormatValueObject) + public function setMaximumConditionalFormatValueObject(ConditionalFormatValueObject $maximumConditionalFormatValueObject): self { $this->maximumConditionalFormatValueObject = $maximumConditionalFormatValueObject; @@ -215,7 +215,7 @@ class ConditionalDataBarExtension return $this->minimumConditionalFormatValueObject; } - public function setMinimumConditionalFormatValueObject(ConditionalFormatValueObject $minimumConditionalFormatValueObject) + public function setMinimumConditionalFormatValueObject(ConditionalFormatValueObject $minimumConditionalFormatValueObject): self { $this->minimumConditionalFormatValueObject = $minimumConditionalFormatValueObject; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php index 107969bf9..4c1344462 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php @@ -4,15 +4,20 @@ namespace PhpOffice\PhpSpreadsheet\Style\ConditionalFormatting; class ConditionalFormatValueObject { + /** @var mixed */ private $type; + /** @var mixed */ private $value; + /** @var mixed */ private $cellFormula; /** * ConditionalFormatValueObject constructor. * + * @param mixed $type + * @param mixed $value * @param null|mixed $cellFormula */ public function __construct($type, $value = null, $cellFormula = null) @@ -33,7 +38,7 @@ class ConditionalFormatValueObject /** * @param mixed $type */ - public function setType($type) + public function setType($type): self { $this->type = $type; @@ -51,7 +56,7 @@ class ConditionalFormatValueObject /** * @param mixed $value */ - public function setValue($value) + public function setValue($value): self { $this->value = $value; @@ -69,7 +74,7 @@ class ConditionalFormatValueObject /** * @param mixed $cellFormula */ - public function setCellFormula($cellFormula) + public function setCellFormula($cellFormula): self { $this->cellFormula = $cellFormula; diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php index 34c9cbc81..0cdbc3685 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php @@ -10,6 +10,8 @@ class ConditionalFormattingRuleExtension const CONDITION_EXTENSION_DATABAR = 'dataBar'; /** attributes */ + + /** @var string */ private $id; /** @var string Conditional Formatting Rule */ @@ -26,7 +28,7 @@ class ConditionalFormattingRuleExtension /** * ConditionalFormattingRuleExtension constructor. */ - public function __construct($id = null, string $cfRule = self::CONDITION_EXTENSION_DATABAR) + public function __construct(?string $id = null, string $cfRule = self::CONDITION_EXTENSION_DATABAR) { if (null === $id) { $this->id = '{' . $this->generateUuid() . '}'; @@ -36,7 +38,7 @@ class ConditionalFormattingRuleExtension $this->cfRule = $cfRule; } - private function generateUuid() + private function generateUuid(): string { $chars = str_split('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'); @@ -51,7 +53,7 @@ class ConditionalFormattingRuleExtension return implode('', /** @scrutinizer ignore-type */ $chars); } - public static function parseExtLstXml($extLstXml) + public static function parseExtLstXml(?SimpleXMLElement $extLstXml): array { $conditionalFormattingRuleExtensions = []; $conditionalFormattingRuleExtensionXml = null; @@ -96,6 +98,9 @@ class ConditionalFormattingRuleExtension SimpleXMLElement $dataBarXml ): void { $dataBarAttribute = $dataBarXml->attributes(); + if ($dataBarAttribute === null) { + return; + } if ($dataBarAttribute->minLength) { $extDataBarObj->setMinLength((int) $dataBarAttribute->minLength); } @@ -119,20 +124,32 @@ class ConditionalFormattingRuleExtension } } + /** @param array|SimpleXMLElement $ns */ private static function parseExtDataBarElementChildrenFromXml(ConditionalDataBarExtension $extDataBarObj, SimpleXMLElement $dataBarXml, $ns): void { if ($dataBarXml->borderColor) { - $extDataBarObj->setBorderColor((string) $dataBarXml->borderColor->attributes()['rgb']); + $attributes = $dataBarXml->borderColor->attributes(); + if ($attributes !== null) { + $extDataBarObj->setBorderColor((string) $attributes['rgb']); + } } if ($dataBarXml->negativeFillColor) { - $extDataBarObj->setNegativeFillColor((string) $dataBarXml->negativeFillColor->attributes()['rgb']); + $attributes = $dataBarXml->negativeFillColor->attributes(); + if ($attributes !== null) { + $extDataBarObj->setNegativeFillColor((string) $attributes['rgb']); + } } if ($dataBarXml->negativeBorderColor) { - $extDataBarObj->setNegativeBorderColor((string) $dataBarXml->negativeBorderColor->attributes()['rgb']); + $attributes = $dataBarXml->negativeBorderColor->attributes(); + if ($attributes !== null) { + $extDataBarObj->setNegativeBorderColor((string) $attributes['rgb']); + } } if ($dataBarXml->axisColor) { $axisColorAttr = $dataBarXml->axisColor->attributes(); - $extDataBarObj->setAxisColor((string) $axisColorAttr['rgb'], (string) $axisColorAttr['theme'], (string) $axisColorAttr['tint']); + if ($axisColorAttr !== null) { + $extDataBarObj->setAxisColor((string) $axisColorAttr['rgb'], (string) $axisColorAttr['theme'], (string) $axisColorAttr['tint']); + } } $cfvoIndex = 0; foreach ($dataBarXml->cfvo as $cfvo) { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php index c2b11a6f7..b605cff6e 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php @@ -79,10 +79,14 @@ class NumberFormat extends Supervisor self::FORMAT_DATE_TIME8, ]; - const FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0.00_-'; - const FORMAT_CURRENCY_USD = '$#,##0_-'; - const FORMAT_CURRENCY_EUR_SIMPLE = '#,##0.00_-"€"'; - const FORMAT_CURRENCY_EUR = '#,##0_-"€"'; + /** @deprecated 1.28 use FORMAT_CURRENCY_USD_INTEGER instead */ + const FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0_-'; + const FORMAT_CURRENCY_USD_INTEGER = '$#,##0_-'; + const FORMAT_CURRENCY_USD = '$#,##0.00_-'; + /** @deprecated 1.28 use FORMAT_CURRENCY_EUR_INTEGER instead */ + const FORMAT_CURRENCY_EUR_SIMPLE = '#,##0_-"€"'; + const FORMAT_CURRENCY_EUR_INTEGER = '#,##0_-[$€]'; + const FORMAT_CURRENCY_EUR = '#,##0.00_-[$€]'; const FORMAT_ACCOUNTING_USD = '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)'; const FORMAT_ACCOUNTING_EUR = '_("€"* #,##0.00_);_("€"* \(#,##0.00\);_("€"* "-"??_);_(@_)'; @@ -213,7 +217,7 @@ class NumberFormat extends Supervisor * * @return $this */ - public function setFormatCode($formatCode) + public function setFormatCode(string $formatCode) { if ($formatCode == '') { $formatCode = self::FORMAT_GENERAL; @@ -247,11 +251,11 @@ class NumberFormat extends Supervisor /** * Set Built-In Format Code. * - * @param int $formatCodeIndex + * @param int $formatCodeIndex Id of the built-in format code to use * * @return $this */ - public function setBuiltInFormatCode($formatCodeIndex) + public function setBuiltInFormatCode(int $formatCodeIndex) { if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['formatCode' => self::builtInFormatCode($formatCodeIndex)]); @@ -432,7 +436,8 @@ class NumberFormat extends Supervisor * Convert a value in a pre-defined format to a PHP string. * * @param mixed $value Value to format - * @param string $format Format code, see = self::FORMAT_* + * @param string $format Format code: see = self::FORMAT_* for predefined values; + * or can be any valid MS Excel custom format string * @param array $callBack Callback function for additional formatting of string * * @return string Formatted string diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php index be195a880..de3666ae1 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php @@ -2,38 +2,62 @@ namespace PhpOffice\PhpSpreadsheet\Style\NumberFormat; +use PhpOffice\PhpSpreadsheet\Calculation\Calculation; +use PhpOffice\PhpSpreadsheet\RichText\RichText; use PhpOffice\PhpSpreadsheet\Style\Color; use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class Formatter { - private static function splitFormatCompare($value, $cond, $val, $dfcond, $dfval) - { - if (!$cond) { - $cond = $dfcond; - $val = $dfval; + /** + * Matches any @ symbol that isn't enclosed in quotes. + */ + private const SYMBOL_AT = '/@(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu'; + + /** + * Matches any ; symbol that isn't enclosed in quotes, for a "section" split. + */ + private const SECTION_SPLIT = '/;(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu'; + + /** + * @param mixed $value + * @param mixed $comparisonValue + * @param mixed $defaultComparisonValue + */ + private static function splitFormatComparison( + $value, + ?string $condition, + $comparisonValue, + string $defaultCondition, + $defaultComparisonValue + ): bool { + if (!$condition) { + $condition = $defaultCondition; + $comparisonValue = $defaultComparisonValue; } - switch ($cond) { + + switch ($condition) { case '>': - return $value > $val; + return $value > $comparisonValue; case '<': - return $value < $val; + return $value < $comparisonValue; case '<=': - return $value <= $val; + return $value <= $comparisonValue; case '<>': - return $value != $val; + return $value != $comparisonValue; case '=': - return $value == $val; + return $value == $comparisonValue; } - return $value >= $val; + return $value >= $comparisonValue; } - private static function splitFormat($sections, $value) + /** @param mixed $value */ + private static function splitFormatForSectionSelection(array $sections, $value): array { // Extract the relevant section depending on whether number is positive, negative, or zero? // Text not supported yet. @@ -42,30 +66,30 @@ class Formatter // 2 sections: [POSITIVE/ZERO/TEXT] [NEGATIVE] // 3 sections: [POSITIVE/TEXT] [NEGATIVE] [ZERO] // 4 sections: [POSITIVE] [NEGATIVE] [ZERO] [TEXT] - $cnt = count($sections); + $sectionCount = count($sections); $color_regex = '/\\[(' . implode('|', Color::NAMED_COLORS) . ')\\]/mui'; $cond_regex = '/\\[(>|>=|<|<=|=|<>)([+-]?\\d+([.]\\d+)?)\\]/'; $colors = ['', '', '', '', '']; - $condops = ['', '', '', '', '']; - $condvals = [0, 0, 0, 0, 0]; - for ($idx = 0; $idx < $cnt; ++$idx) { + $conditionOperations = ['', '', '', '', '']; + $conditionComparisonValues = [0, 0, 0, 0, 0]; + for ($idx = 0; $idx < $sectionCount; ++$idx) { if (preg_match($color_regex, $sections[$idx], $matches)) { $colors[$idx] = $matches[0]; $sections[$idx] = (string) preg_replace($color_regex, '', $sections[$idx]); } if (preg_match($cond_regex, $sections[$idx], $matches)) { - $condops[$idx] = $matches[1]; - $condvals[$idx] = $matches[2]; + $conditionOperations[$idx] = $matches[1]; + $conditionComparisonValues[$idx] = $matches[2]; $sections[$idx] = (string) preg_replace($cond_regex, '', $sections[$idx]); } } $color = $colors[0]; $format = $sections[0]; $absval = $value; - switch ($cnt) { + switch ($sectionCount) { case 2: $absval = abs($value); - if (!self::splitFormatCompare($value, $condops[0], $condvals[0], '>=', 0)) { + if (!self::splitFormatComparison($value, $conditionOperations[0], $conditionComparisonValues[0], '>=', 0)) { $color = $colors[1]; $format = $sections[1]; } @@ -74,8 +98,8 @@ class Formatter case 3: case 4: $absval = abs($value); - if (!self::splitFormatCompare($value, $condops[0], $condvals[0], '>', 0)) { - if (self::splitFormatCompare($value, $condops[1], $condvals[1], '<', 0)) { + if (!self::splitFormatComparison($value, $conditionOperations[0], $conditionComparisonValues[0], '>', 0)) { + if (self::splitFormatComparison($value, $conditionOperations[1], $conditionComparisonValues[1], '<', 0)) { $color = $colors[1]; $format = $sections[1]; } else { @@ -93,23 +117,33 @@ class Formatter /** * Convert a value in a pre-defined format to a PHP string. * - * @param mixed $value Value to format - * @param string $format Format code, see = NumberFormat::FORMAT_* + * @param null|bool|float|int|RichText|string $value Value to format + * @param string $format Format code: see = self::FORMAT_* for predefined values; + * or can be any valid MS Excel custom format string * @param array $callBack Callback function for additional formatting of string * * @return string Formatted string */ public static function toFormattedString($value, $format, $callBack = null) { - // For now we do not treat strings although section 4 of a format code affects strings + if (is_bool($value)) { + return $value ? Calculation::getTRUE() : Calculation::getFALSE(); + } + // For now we do not treat strings in sections, although section 4 of a format code affects strings + // Process a single block format code containing @ for text substitution + if (preg_match(self::SECTION_SPLIT, $format) === 0 && preg_match(self::SYMBOL_AT, $format) === 1) { + return str_replace('"', '', preg_replace(self::SYMBOL_AT, (string) $value, $format) ?? ''); + } + + // If we have a text value, return it "as is" if (!is_numeric($value)) { - return $value; + return (string) $value; } // For 'General' format code, we just pass the value although this is not entirely the way Excel does it, // it seems to round numbers to a total of 10 digits. if (($format === NumberFormat::FORMAT_GENERAL) || ($format === NumberFormat::FORMAT_TEXT)) { - return $value; + return (string) $value; } // Ignore square-$-brackets prefix in format string, like "[$-411]ge.m.d", "[$-010419]0%", etc @@ -127,26 +161,28 @@ class Formatter $format = (string) preg_replace('/(\\\(((.)(?!((AM\/PM)|(A\/P))))|([^ ])))(?=(?:[^"]|"[^"]*")*$)/ui', '"${2}"', $format); // Get the sections, there can be up to four sections, separated with a semi-colon (but only if not a quoted literal) - $sections = preg_split('/(;)(?=(?:[^"]|"[^"]*")*$)/u', $format); + $sections = preg_split(self::SECTION_SPLIT, $format) ?: []; - [$colors, $format, $value] = self::splitFormat($sections, $value); + [$colors, $format, $value] = self::splitFormatForSectionSelection($sections, $value); // In Excel formats, "_" is used to add spacing, // The following character indicates the size of the spacing, which we can't do in HTML, so we just use a standard space $format = (string) preg_replace('/_.?/ui', ' ', $format); // Let's begin inspecting the format and converting the value to a formatted string - // Check for date/time characters (not inside quotes) - if (preg_match('/(\[\$[A-Z]*-[0-9A-F]*\])*[hmsdy](?=(?:[^"]|"[^"]*")*$)/miu', $format, $matches)) { + if ( + (preg_match('/(\[\$[A-Z]*-[0-9A-F]*\])*[hmsdy](?=(?:[^"]|"[^"]*")*$)/miu', $format)) && + (preg_match('/0(?![^\[]*\])/miu', $format) === 0) + ) { // datetime format $value = DateFormatter::format($value, $format); } else { if (substr($format, 0, 1) === '"' && substr($format, -1, 1) === '"' && substr_count($format, '"') === 2) { $value = substr($format, 1, -1); } elseif (preg_match('/[0#, ]%/', $format)) { - // % number format - $value = PercentageFormatter::format($value, $format); + // % number format - avoid weird '-0' problem + $value = PercentageFormatter::format(0 + (float) $value, $format); } else { $value = NumberFormatter::format($value, $format); } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php index d1fc89fd0..fdcf98329 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php @@ -26,23 +26,28 @@ class FractionFormatter extends BaseFormatter $decimalLength = strlen($decimalPart); $decimalDivisor = 10 ** $decimalLength; - /** @var float */ - $GCD = MathTrig\Gcd::evaluate($decimalPart, $decimalDivisor); - /** @var float */ - $decimalPartx = $decimalPart; + preg_match('/(#?.*\?)\/(\?+|\d+)/', $format, $matches); + $formatIntegerPart = $matches[1]; - $adjustedDecimalPart = $decimalPartx / $GCD; - $adjustedDecimalDivisor = $decimalDivisor / $GCD; + if (is_numeric($matches[2])) { + $fractionDivisor = 100 / (int) $matches[2]; + } else { + /** @var float */ + $fractionDivisor = MathTrig\Gcd::evaluate((int) $decimalPart, $decimalDivisor); + } - if ((strpos($format, '0') !== false)) { + $adjustedDecimalPart = (int) round((int) $decimalPart / $fractionDivisor, 0); + $adjustedDecimalDivisor = $decimalDivisor / $fractionDivisor; + + if ((strpos($formatIntegerPart, '0') !== false)) { return "{$sign}{$integerPart} {$adjustedDecimalPart}/{$adjustedDecimalDivisor}"; - } elseif ((strpos($format, '#') !== false)) { + } elseif ((strpos($formatIntegerPart, '#') !== false)) { if ($integerPart == 0) { return "{$sign}{$adjustedDecimalPart}/{$adjustedDecimalDivisor}"; } return "{$sign}{$integerPart} {$adjustedDecimalPart}/{$adjustedDecimalDivisor}"; - } elseif ((substr($format, 0, 3) == '? ?')) { + } elseif ((substr($formatIntegerPart, 0, 3) == '? ?')) { if ($integerPart == 0) { $integerPart = ''; } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php index 989f33abc..c03534586 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php @@ -164,7 +164,10 @@ class NumberFormatter if (preg_match('/[0#]E[+-]0/i', $format)) { // Scientific format - return sprintf('%5.2E', $valueFloat); + $decimals = strlen($right); + $size = $decimals + 3; + + return sprintf("%{$size}.{$decimals}E", $valueFloat); } elseif (preg_match('/0([^\d\.]+)0/', $format) || substr_count($format, '.') > 1) { if ($valueFloat == floor($valueFloat) && substr_count($format, '.') === 1) { $value *= 10 ** strlen(explode('.', $format)[1]); @@ -183,6 +186,7 @@ class NumberFormatter } $sprintf_pattern = "%0$minWidth." . strlen($right) . 'f'; + /** @var float */ $valueFloat = $value; $value = sprintf($sprintf_pattern, round($valueFloat, strlen($right))); @@ -198,51 +202,42 @@ class NumberFormatter // The "_" in this string has already been stripped out, // so this test is never true. Furthermore, testing // on Excel shows this format uses Euro symbol, not "EUR". - //if ($format === NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE) { - // return 'EUR ' . sprintf('%1.2f', $value); - //} + // if ($format === NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE) { + // return 'EUR ' . sprintf('%1.2f', $value); + // } - // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols - $format = self::makeString(str_replace(['"', '*'], '', $format)); + $baseFormat = $format; - // Find out if we need thousands separator - // This is indicated by a comma enclosed by a digit placeholder: - // #,# or 0,0 - $useThousands = (bool) preg_match('/(#,#|0,0)/', $format); - if ($useThousands) { - $format = self::pregReplace('/0,0/', '00', $format); - $format = self::pregReplace('/#,#/', '##', $format); - } + $useThousands = self::areThousandsRequired($format); + $scale = self::scaleThousandsMillions($format); - // Scale thousands, millions,... - // This is indicated by a number of commas after a digit placeholder: - // #, or 0.0,, - $scale = 1; // same as no scale - $matches = []; - if (preg_match('/(#|0)(,+)/', $format, $matches)) { - $scale = 1000 ** strlen($matches[2]); - - // strip the commas - $format = self::pregReplace('/0,+/', '0', $format); - $format = self::pregReplace('/#,+/', '#', $format); - } - if (preg_match('/#?.*\?\/\?/', $format, $m)) { + if (preg_match('/[#\?0]?.*[#\?0]\/(\?+|\d+|#)/', $format)) { + // It's a dirty hack; but replace # and 0 digit placeholders with ? + $format = (string) preg_replace('/[#0]+\//', '?/', $format); + $format = (string) preg_replace('/\/[#0]+/', '/?', $format); $value = FractionFormatter::format($value, $format); } else { // Handle the number itself - // scale number $value = $value / $scale; - // Strip # - $format = self::pregReplace('/\\#/', '0', $format); - // Remove locale code [$-###] + $paddingPlaceholder = (strpos($format, '?') !== false); + + // Replace # or ? with 0 + $format = self::pregReplace('/[\\#\?](?=(?:[^"]*"[^"]*")*[^"]*\Z)/', '0', $format); + // Remove locale code [$-###] for an LCID $format = self::pregReplace('/\[\$\-.*\]/', '', $format); $n = '/\\[[^\\]]+\\]/'; $m = self::pregReplace($n, '', $format); + + // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols + $format = self::makeString(str_replace(['"', '*'], '', $format)); if (preg_match(self::NUMBER_REGEX, $m, $matches)) { // There are placeholders for digits, so inject digits from the value into the mask $value = self::formatStraightNumericValue($value, $format, $matches, $useThousands); + if ($paddingPlaceholder === true) { + $value = self::padValue($value, $baseFormat); + } } elseif ($format !== NumberFormat::FORMAT_GENERAL) { // Yes, I know that this is basically just a hack; // if there's no placeholders for digits, just return the format mask "as is" @@ -260,6 +255,13 @@ class NumberFormatter $value = self::pregReplace('/\[\$([^\]]*)\]/u', $currencyCode, (string) $value); } + if ( + (strpos((string) $value, '0.') !== false) && + ((strpos($baseFormat, '#.') !== false) || (strpos($baseFormat, '?.') !== false)) + ) { + $value = preg_replace('/(\b)0\.|([^\d])0\./', '${2}.', (string) $value); + } + return (string) $value; } @@ -275,4 +277,50 @@ class NumberFormatter { return self::makeString(preg_replace($pattern, $replacement, $subject) ?? ''); } + + public static function padValue(string $value, string $baseFormat): string + { + /** @phpstan-ignore-next-line */ + [$preDecimal, $postDecimal] = preg_split('/\.(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu', $baseFormat . '.?'); + + $length = strlen($value); + if (strpos($postDecimal, '?') !== false) { + $value = str_pad(rtrim($value, '0. '), $length, ' ', STR_PAD_RIGHT); + } + if (strpos($preDecimal, '?') !== false) { + $value = str_pad(ltrim($value, '0, '), $length, ' ', STR_PAD_LEFT); + } + + return $value; + } + + /** + * Find out if we need thousands separator + * This is indicated by a comma enclosed by a digit placeholders: #, 0 or ? + */ + public static function areThousandsRequired(string &$format): bool + { + $useThousands = (bool) preg_match('/([#\?0]),([#\?0])/', $format); + if ($useThousands) { + $format = self::pregReplace('/([#\?0]),([#\?0])/', '${1}${2}', $format); + } + + return $useThousands; + } + + /** + * Scale thousands, millions,... + * This is indicated by a number of commas after a digit placeholder: #, or 0.0,, or ?,. + */ + public static function scaleThousandsMillions(string &$format): int + { + $scale = 1; // same as no scale + if (preg_match('/(#|0|\?)(,+)/', $format, $matches)) { + $scale = 1000 ** strlen($matches[2]); + // strip the commas + $format = self::pregReplace('/([#\?0]),+/', '${1}', $format); + } + + return $scale; + } } diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php index 74f3877d0..55b5971aa 100644 --- a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php @@ -6,6 +6,7 @@ use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class PercentageFormatter extends BaseFormatter { + /** @param float|int $value */ public static function format($value, string $format): string { if ($format === NumberFormat::FORMAT_PERCENTAGE) { diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Accounting.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Accounting.php new file mode 100644 index 000000000..a138ab7f1 --- /dev/null +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Accounting.php @@ -0,0 +1,102 @@ +setCurrencyCode($currencyCode); + $this->setThousandsSeparator($thousandsSeparator); + $this->setDecimals($decimals); + $this->setCurrencySymbolPosition($currencySymbolPosition); + $this->setCurrencySymbolSpacing($currencySymbolSpacing); + $this->setLocale($locale); + } + + /** + * @throws Exception if the Intl extension and ICU version don't support Accounting formats + */ + protected function getLocaleFormat(): string + { + if (version_compare(PHP_VERSION, '7.4.1', '<')) { + throw new Exception('The Intl extension does not support Accounting Formats below PHP 7.4.1'); + } + + if ($this->icuVersion() < 53.0) { + throw new Exception('The Intl extension does not support Accounting Formats without ICU 53'); + } + + // Scrutinizer does not recognize CURRENCY_ACCOUNTING + $formatter = new Locale($this->fullLocale, NumberFormatter::CURRENCY_ACCOUNTING); + $mask = $formatter->format(); + if ($this->decimals === 0) { + $mask = (string) preg_replace('/\.0+/miu', '', $mask); + } + + return str_replace('¤', $this->formatCurrencyCode(), $mask); + } + + private function icuVersion(): float + { + [$major, $minor] = explode('.', INTL_ICU_VERSION); + + return (float) "{$major}.{$minor}"; + } + + private function formatCurrencyCode(): string + { + if ($this->locale === null) { + return $this->currencyCode . '*'; + } + + return "[\${$this->currencyCode}-{$this->locale}]"; + } + + public function format(): string + { + if ($this->localeFormat !== null) { + return $this->localeFormat; + } + + return sprintf( + '_-%s%s%s0%s%s%s_-', + $this->currencySymbolPosition === self::LEADING_SYMBOL ? $this->formatCurrencyCode() : null, + ( + $this->currencySymbolPosition === self::LEADING_SYMBOL && + $this->currencySymbolSpacing === self::SYMBOL_WITH_SPACING + ) ? ' ' : '', + $this->thousandsSeparator ? '#,##' : null, + $this->decimals > 0 ? '.' . str_repeat('0', $this->decimals) : null, + ( + $this->currencySymbolPosition === self::TRAILING_SYMBOL && + $this->currencySymbolSpacing === self::SYMBOL_WITH_SPACING + ) ? ' ' : '', + $this->currencySymbolPosition === self::TRAILING_SYMBOL ? $this->formatCurrencyCode() : null + ); + } +} diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Currency.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Currency.php new file mode 100644 index 000000000..2fcd10838 --- /dev/null +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Currency.php @@ -0,0 +1,112 @@ +setCurrencyCode($currencyCode); + $this->setThousandsSeparator($thousandsSeparator); + $this->setDecimals($decimals); + $this->setCurrencySymbolPosition($currencySymbolPosition); + $this->setCurrencySymbolSpacing($currencySymbolSpacing); + $this->setLocale($locale); + } + + public function setCurrencyCode(string $currencyCode): void + { + $this->currencyCode = $currencyCode; + } + + public function setCurrencySymbolPosition(bool $currencySymbolPosition = self::LEADING_SYMBOL): void + { + $this->currencySymbolPosition = $currencySymbolPosition; + } + + public function setCurrencySymbolSpacing(bool $currencySymbolSpacing = self::SYMBOL_WITHOUT_SPACING): void + { + $this->currencySymbolSpacing = $currencySymbolSpacing; + } + + protected function getLocaleFormat(): string + { + $formatter = new Locale($this->fullLocale, NumberFormatter::CURRENCY); + $mask = $formatter->format(); + if ($this->decimals === 0) { + $mask = (string) preg_replace('/\.0+/miu', '', $mask); + } + + return str_replace('¤', $this->formatCurrencyCode(), $mask); + } + + private function formatCurrencyCode(): string + { + if ($this->locale === null) { + return $this->currencyCode; + } + + return "[\${$this->currencyCode}-{$this->locale}]"; + } + + public function format(): string + { + if ($this->localeFormat !== null) { + return $this->localeFormat; + } + + return sprintf( + '%s%s%s0%s%s%s', + $this->currencySymbolPosition === self::LEADING_SYMBOL ? $this->formatCurrencyCode() : null, + ( + $this->currencySymbolPosition === self::LEADING_SYMBOL && + $this->currencySymbolSpacing === self::SYMBOL_WITH_SPACING + ) ? "\u{a0}" : '', + $this->thousandsSeparator ? '#,##' : null, + $this->decimals > 0 ? '.' . str_repeat('0', $this->decimals) : null, + ( + $this->currencySymbolPosition === self::TRAILING_SYMBOL && + $this->currencySymbolSpacing === self::SYMBOL_WITH_SPACING + ) ? "\u{a0}" : '', + $this->currencySymbolPosition === self::TRAILING_SYMBOL ? $this->formatCurrencyCode() : null + ); + } +} diff --git a/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Locale.php b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Locale.php new file mode 100644 index 000000000..9f0336274 --- /dev/null +++ b/niucloud/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Locale.php @@ -0,0 +1,37 @@ +[a-z]{2})([-_](?P