diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index 23316bebe..c4dafb1cd 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -17,7 +17,7 @@ jobs: - name: Run Security Check id: test - uses: anchore/scan-action@v4 + uses: anchore/scan-action@v6 with: path: . output-format: table diff --git a/changelog.txt b/changelog.txt index 5d46d9872..6907e2082 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,10 +1,15 @@ == Changelog == += 4.2.0 = +* ENHANCEMENT - Updated Client library for Google APIs from 2.18.2 to 2.18.3. +* ENHANCEMENT - updated `firebase/php-jwt` library from 6.10.2 to 6.11.1. +* ENHANCEMENT - updated `wpmetabox/meta-box` library from 5.10.1 to 5.10.11. +* DEPRECATED - Setup Assistant removed. + = 4.1.3 = * COMPATIBILITY - PolyLang Compatibility replaced with [WP-Stateless – Polylang Pro Addon](https://wordpress.org/plugins/wp-stateless-polylang-pro-addon/). * ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.7. * ENHANCEMENT - updated `Meta Box Tabs` library from 1.1.18 to 1.2.0. * ENHANCEMENT - updated `firebase/php-jwt` library from from 6.10.1 to 6.10.2. -* ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.2. * ENHANCEMENT - Updated Client library for Google APIs from 2.17.0 to 2.18.2. * FIX - apply `Cache Control` setting to all files (previously applied only to images). diff --git a/changes.md b/changes.md index 7a018627b..715fb611f 100644 --- a/changes.md +++ b/changes.md @@ -1,9 +1,14 @@ +#### 4.2.0 +* ENHANCEMENT - Updated Client library for Google APIs from 2.18.2 to 2.18.3. +* ENHANCEMENT - updated `firebase/php-jwt` library from 6.10.2 to 6.11.1. +* ENHANCEMENT - updated `wpmetabox/meta-box` library from 5.10.1 to 5.10.11. +* DEPRECATED - Setup Assistant removed. + #### 4.1.3 * COMPATIBILITY - PolyLang Compatibility replaced with [WP-Stateless – Polylang Pro Addon](https://wordpress.org/plugins/wp-stateless-polylang-pro-addon/). * ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.7. * ENHANCEMENT - updated `Meta Box Tabs` library from 1.1.18 to 1.2.0. * ENHANCEMENT - updated `firebase/php-jwt` library from from 6.10.1 to 6.10.2. -* ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.2. * ENHANCEMENT - Updated Client library for Google APIs from 2.17.0 to 2.18.2. * FIX - apply `Cache Control` setting to all files (previously applied only to images). diff --git a/composer.lock b/composer.lock index a93789102..e58ec2b09 100644 --- a/composer.lock +++ b/composer.lock @@ -201,16 +201,16 @@ }, { "name": "firebase/php-jwt", - "version": "v6.10.2", + "version": "v6.11.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b" + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", "shasum": "" }, "require": { @@ -258,9 +258,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.2" + "source": "https://github.com/firebase/php-jwt/tree/v6.11.1" }, - "time": "2024-11-24T11:22:49+00:00" + "time": "2025-04-09T20:32:01+00:00" }, { "name": "udx/lib-ud-api-client", @@ -340,15 +340,15 @@ }, { "name": "wpackagist-plugin/meta-box", - "version": "5.10.7", + "version": "5.10.11", "source": { "type": "svn", "url": "https://plugins.svn.wordpress.org/meta-box/", - "reference": "tags/5.10.7" + "reference": "tags/5.10.11" }, "dist": { "type": "zip", - "url": "https://downloads.wordpress.org/plugin/meta-box.5.10.7.zip" + "url": "https://downloads.wordpress.org/plugin/meta-box.5.10.11.zip" }, "require": { "composer/installers": "^1.0 || ^2.0" @@ -900,7 +900,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -959,7 +959,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -979,7 +979,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -1037,7 +1037,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -1057,7 +1057,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -1118,7 +1118,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -1138,19 +1138,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -1198,7 +1199,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -1214,11 +1215,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -1274,7 +1275,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" }, "funding": [ { @@ -1294,16 +1295,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -1354,7 +1355,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -1370,7 +1371,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { "name": "symfony/service-contracts", diff --git a/lib/Google/README.md b/lib/Google/README.md index 93b52cacb..7bac1824f 100644 --- a/lib/Google/README.md +++ b/lib/Google/README.md @@ -44,7 +44,7 @@ composer installed. Once composer is installed, execute the following command in your project root to install this library: ```sh -composer require google/apiclient:^2.15.0 +composer require google/apiclient ``` If you're facing a timeout error then either increase the timeout for composer by adding the env flag as `COMPOSER_PROCESS_TIMEOUT=600 composer install` or you can put this in the `config` section of the composer schema: diff --git a/lib/Google/composer.json b/lib/Google/composer.json index 363efcf26..d9b165f42 100644 --- a/lib/Google/composer.json +++ b/lib/Google/composer.json @@ -14,7 +14,7 @@ "phpseclib/phpseclib": "^3.0.36", "guzzlehttp/guzzle": "^7.4.5", "guzzlehttp/psr7": "^2.6", - "google/cloud-storage": "^1.45", + "google/cloud-storage": "^1.48", "google/cloud-core": "^1.60" }, "require-dev": { @@ -22,7 +22,7 @@ "symfony/dom-crawler": "~2.1", "symfony/css-selector": "~2.1", "phpcompatibility/php-compatibility": "^9.2", - "composer/composer": "^2.0.0", + "composer/composer": "^1.10.23", "phpspec/prophecy-phpunit": "^2.1", "phpunit/phpunit": "^9.6" }, diff --git a/lib/Google/composer.lock b/lib/Google/composer.lock index 4d2661567..4d755c492 100644 --- a/lib/Google/composer.lock +++ b/lib/Google/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "87c129ac8420ebb85af071226ee62b25", + "content-hash": "ec2e2b541c95b7d592511c65e81a0226", "packages": [ { "name": "brick/math", @@ -63,16 +63,16 @@ }, { "name": "firebase/php-jwt", - "version": "v6.10.2", + "version": "v6.11.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b" + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", "shasum": "" }, "require": { @@ -120,22 +120,22 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.2" + "source": "https://github.com/firebase/php-jwt/tree/v6.11.1" }, - "time": "2024-11-24T11:22:49+00:00" + "time": "2025-04-09T20:32:01+00:00" }, { "name": "google/apiclient-services", - "version": "v0.389.0", + "version": "v0.396.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8" + "reference": "ceb2e432e4326c6775d24f62d554395a1a9ad3dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/6274e67ee52b1a416ccee0a4eaf337d1139cdaf8", - "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ceb2e432e4326c6775d24f62d554395a1a9ad3dd", + "reference": "ceb2e432e4326c6775d24f62d554395a1a9ad3dd", "shasum": "" }, "require": { @@ -164,22 +164,22 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.389.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.396.0" }, - "time": "2025-01-05T01:04:21+00:00" + "time": "2025-02-24T01:10:27+00:00" }, { "name": "google/auth", - "version": "v1.45.0", + "version": "v1.42.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad" + "reference": "0c25599a91530b5847f129b271c536f75a7563f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/cfcb93162341ed5022fa976e621f0fa2b05ba6ad", - "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/0c25599a91530b5847f129b271c536f75a7563f5", + "reference": "0c25599a91530b5847f129b271c536f75a7563f5", "shasum": "" }, "require": { @@ -188,8 +188,7 @@ "guzzlehttp/psr7": "^2.4.5", "php": "^8.0", "psr/cache": "^2.0||^3.0", - "psr/http-message": "^1.1||^2.0", - "psr/log": "^3.0" + "psr/http-message": "^1.1||^2.0" }, "require-dev": { "guzzlehttp/promises": "^2.0", @@ -225,27 +224,27 @@ "support": { "docs": "https://googleapis.github.io/google-auth-library-php/main/", "issues": "https://github.com/googleapis/google-auth-library-php/issues", - "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.45.0" + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.42.0" }, - "time": "2024-12-11T02:10:48+00:00" + "time": "2024-08-26T18:33:48+00:00" }, { "name": "google/cloud-core", - "version": "v1.60.1", + "version": "v1.60.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd" + "reference": "7d63ba4295b799dc63227b6c9daf9dc207650eb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/c149dd075a77bc8555a0eff46267522f1c4e0bfd", - "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/7d63ba4295b799dc63227b6c9daf9dc207650eb4", + "reference": "7d63ba4295b799dc63227b6c9daf9dc207650eb4", "shasum": "" }, "require": { "google/auth": "^1.34", - "google/gax": "^1.36.0", + "google/gax": "^1.34.0", "guzzlehttp/guzzle": "^6.5.8|^7.4.4", "guzzlehttp/promises": "^1.4||^2.0", "guzzlehttp/psr7": "^2.6", @@ -258,7 +257,7 @@ "erusev/parsedown": "^1.6", "google/cloud-common-protos": "~0.5", "opis/closure": "^3", - "phpdocumentor/reflection": "^5.3.3||^6.0", + "phpdocumentor/reflection": "^5.3.3", "phpdocumentor/reflection-docblock": "^5.3", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.0", @@ -291,22 +290,22 @@ ], "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", "support": { - "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.60.1" + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.60.0" }, - "time": "2024-12-12T21:15:35+00:00" + "time": "2024-09-28T04:24:22+00:00" }, { "name": "google/cloud-storage", - "version": "v1.45.0", + "version": "v1.48.1", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-storage.git", - "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6" + "reference": "509b095c3ea44db92c9e62a94b5773563c831821" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/9873cb5a27f4adc20909329d0eae85f2b3b0dba6", - "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/509b095c3ea44db92c9e62a94b5773563c831821", + "reference": "509b095c3ea44db92c9e62a94b5773563c831821", "shasum": "" }, "require": { @@ -348,22 +347,22 @@ ], "description": "Cloud Storage Client for PHP", "support": { - "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.45.0" + "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.48.1" }, - "time": "2024-12-12T21:15:35+00:00" + "time": "2025-05-20T19:49:54+00:00" }, { "name": "google/common-protos", - "version": "4.8.3", + "version": "4.12.1", "source": { "type": "git", "url": "https://github.com/googleapis/common-protos-php.git", - "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d" + "reference": "70c4eb1abab5484a23c17a43b0d455259f5d8c1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/38a9a8bb459fa618da797d25d7bf36bb21d1103d", - "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d", + "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/70c4eb1abab5484a23c17a43b0d455259f5d8c1b", + "reference": "70c4eb1abab5484a23c17a43b0d455259f5d8c1b", "shasum": "" }, "require": { @@ -407,26 +406,26 @@ "google" ], "support": { - "source": "https://github.com/googleapis/common-protos-php/tree/v4.8.3" + "source": "https://github.com/googleapis/common-protos-php/tree/v4.12.1" }, - "time": "2024-09-07T01:37:15+00:00" + "time": "2025-05-20T19:49:54+00:00" }, { "name": "google/gax", - "version": "v1.36.0", + "version": "v1.35.1", "source": { "type": "git", "url": "https://github.com/googleapis/gax-php.git", - "reference": "140599cf5eae2432363ce6198e9fdff851625a7a" + "reference": "336005867c0ca3e2ad95183cf9dd74fa67915dd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/gax-php/zipball/140599cf5eae2432363ce6198e9fdff851625a7a", - "reference": "140599cf5eae2432363ce6198e9fdff851625a7a", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/336005867c0ca3e2ad95183cf9dd74fa67915dd9", + "reference": "336005867c0ca3e2ad95183cf9dd74fa67915dd9", "shasum": "" }, "require": { - "google/auth": "^1.45", + "google/auth": "^1.34.0", "google/common-protos": "^4.4", "google/grpc-gcp": "^0.4", "google/longrunning": "~0.4", @@ -442,7 +441,7 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.1", - "phpstan/phpstan": "^2.0", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "3.*" }, @@ -464,22 +463,22 @@ ], "support": { "issues": "https://github.com/googleapis/gax-php/issues", - "source": "https://github.com/googleapis/gax-php/tree/v1.36.0" + "source": "https://github.com/googleapis/gax-php/tree/v1.35.1" }, - "time": "2024-12-11T02:47:43+00:00" + "time": "2024-12-04T15:32:12+00:00" }, { "name": "google/grpc-gcp", - "version": "v0.4.0", + "version": "v0.4.1", "source": { "type": "git", "url": "https://github.com/GoogleCloudPlatform/grpc-gcp-php.git", - "reference": "2a80dbf690922aa52bb6bb79b9a32a9637a5c2d9" + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/2a80dbf690922aa52bb6bb79b9a32a9637a5c2d9", - "reference": "2a80dbf690922aa52bb6bb79b9a32a9637a5c2d9", + "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/e585b7721bbe806ef45b5c52ae43dfc2bff89968", + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968", "shasum": "" }, "require": { @@ -509,22 +508,22 @@ "description": "gRPC GCP library for channel management", "support": { "issues": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/issues", - "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.4.0" + "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.4.1" }, - "time": "2024-04-03T16:37:55+00:00" + "time": "2025-02-19T21:53:22+00:00" }, { "name": "google/longrunning", - "version": "0.4.6", + "version": "0.4.7", "source": { "type": "git", "url": "https://github.com/googleapis/php-longrunning.git", - "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6" + "reference": "624cabb874c10e5ddc9034c999f724894b70a3d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/4eb04d47bba8095d5a47f75334b9204c2a4a7ac6", - "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6", + "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/624cabb874c10e5ddc9034c999f724894b70a3d3", + "reference": "624cabb874c10e5ddc9034c999f724894b70a3d3", "shasum": "" }, "require-dev": { @@ -553,22 +552,22 @@ ], "description": "Google LongRunning Client for PHP", "support": { - "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.6" + "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.7" }, - "time": "2024-12-12T21:15:35+00:00" + "time": "2025-01-24T21:24:06+00:00" }, { "name": "google/protobuf", - "version": "v4.29.3", + "version": "v4.31.1", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7" + "reference": "2b028ce8876254e2acbeceea7d9b573faad41864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", - "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/2b028ce8876254e2acbeceea7d9b573faad41864", + "reference": "2b028ce8876254e2acbeceea7d9b573faad41864", "shasum": "" }, "require": { @@ -597,9 +596,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.31.1" }, - "time": "2025-01-08T21:00:13+00:00" + "time": "2025-05-28T18:52:35+00:00" }, { "name": "grpc/grpc", @@ -647,16 +646,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.9.2", + "version": "7.9.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "d281ed313b989f213357e3be1a179f02196ac99b" + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", - "reference": "d281ed313b989f213357e3be1a179f02196ac99b", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", "shasum": "" }, "require": { @@ -753,7 +752,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.9.2" + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" }, "funding": [ { @@ -769,20 +768,20 @@ "type": "tidelift" } ], - "time": "2024-07-24T11:22:20+00:00" + "time": "2025-03-27T13:37:11+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.4", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", "shasum": "" }, "require": { @@ -836,7 +835,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.4" + "source": "https://github.com/guzzle/promises/tree/2.2.0" }, "funding": [ { @@ -852,20 +851,20 @@ "type": "tidelift" } ], - "time": "2024-10-17T10:06:22+00:00" + "time": "2025-03-27T13:27:01+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.7.0", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", "shasum": "" }, "require": { @@ -952,7 +951,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.7.0" + "source": "https://github.com/guzzle/psr7/tree/2.7.1" }, "funding": [ { @@ -968,7 +967,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T11:15:46+00:00" + "time": "2025-03-27T12:30:47+00:00" }, { "name": "monolog/monolog", @@ -1510,30 +1509,30 @@ }, { "name": "psr/log", - "version": "3.0.2", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1554,9 +1553,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2024-09-11T13:17:53+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "ralouphie/getallheaders", @@ -1694,21 +1693,20 @@ }, { "name": "ramsey/uuid", - "version": "4.7.6", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + "reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/4e0e23cc785f0724a0e838279a9eb03f28b092a0", + "reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", - "ext-json": "*", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -1716,26 +1714,23 @@ "rhumsaa/uuid": "self.version" }, "require-dev": { - "captainhook/captainhook": "^5.10", + "captainhook/captainhook": "^5.25", "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", @@ -1770,19 +1765,9 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.6" + "source": "https://github.com/ramsey/uuid/tree/4.9.0" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "time": "2024-04-27T21:32:50+00:00" + "time": "2025-06-25T14:20:11+00:00" }, { "name": "rize/uri-template", @@ -1915,7 +1900,7 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -1971,7 +1956,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" }, "funding": [ { @@ -1993,16 +1978,16 @@ "packages-dev": [ { "name": "composer/ca-bundle", - "version": "1.5.5", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6" + "reference": "f65c239c970e7f072f067ab78646e9f0b2935175" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/08c50d5ec4c6ced7d0271d2862dec8c1033283e6", - "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/f65c239c970e7f072f067ab78646e9f0b2935175", + "reference": "f65c239c970e7f072f067ab78646e9f0b2935175", "shasum": "" }, "require": { @@ -2049,80 +2034,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2025-01-08T16:17:16+00:00" - }, - { - "name": "composer/class-map-generator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/composer/class-map-generator.git", - "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915", - "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915", - "shasum": "" - }, - "require": { - "composer/pcre": "^2.1 || ^3.1", - "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" - }, - "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-deprecation-rules": "^1 || ^2", - "phpstan/phpstan-phpunit": "^1 || ^2", - "phpstan/phpstan-strict-rules": "^1.1 || ^2", - "phpunit/phpunit": "^8", - "symfony/filesystem": "^5.4 || ^6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\ClassMapGenerator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Utilities to scan PHP code and generate class maps.", - "keywords": [ - "classmap" - ], - "support": { - "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.5.0" + "source": "https://github.com/composer/ca-bundle/tree/1.5.6" }, "funding": [ { @@ -2138,52 +2050,43 @@ "type": "tidelift" } ], - "time": "2024-11-25T16:11:06+00:00" + "time": "2025-03-06T14:30:56+00:00" }, { "name": "composer/composer", - "version": "2.7.7", + "version": "1.10.27", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "291942978f39435cf904d33739f98d7d4eca7b23" + "reference": "f8f49191eec76f039b466aa1f161406fe43aff50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/291942978f39435cf904d33739f98d7d4eca7b23", - "reference": "291942978f39435cf904d33739f98d7d4eca7b23", + "url": "https://api.github.com/repos/composer/composer/zipball/f8f49191eec76f039b466aa1f161406fe43aff50", + "reference": "f8f49191eec76f039b466aa1f161406fe43aff50", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", - "composer/class-map-generator": "^1.3.3", - "composer/metadata-minifier": "^1.0", - "composer/pcre": "^2.1 || ^3.1", - "composer/semver": "^3.3", - "composer/spdx-licenses": "^1.5.7", - "composer/xdebug-handler": "^2.0.2 || ^3.0.3", - "justinrainbow/json-schema": "^5.2.11", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "react/promise": "^2.8 || ^3", + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.2", + "composer/xdebug-handler": "^1.1", + "justinrainbow/json-schema": "^5.2.10", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0", "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.2", - "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.11 || ^6.0.11 || ^7", - "symfony/filesystem": "^5.4 || ^6.0 || ^7", - "symfony/finder": "^5.4 || ^6.0 || ^7", - "symfony/polyfill-php73": "^1.24", - "symfony/polyfill-php80": "^1.24", - "symfony/polyfill-php81": "^1.24", - "symfony/process": "^5.4 || ^6.0 || ^7" + "seld/phar-utils": "^1.0", + "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" + }, + "conflict": { + "symfony/console": "2.8.38" }, "require-dev": { - "phpstan/phpstan": "^1.11.0", - "phpstan/phpstan-deprecation-rules": "^1.2.0", - "phpstan/phpstan-phpunit": "^1.4.0", - "phpstan/phpstan-strict-rules": "^1.6.0", - "phpstan/phpstan-symfony": "^1.4.0", - "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1" + "phpspec/prophecy": "^1.10", + "symfony/phpunit-bridge": "^4.2" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -2195,18 +2098,13 @@ ], "type": "library", "extra": { - "phpstan": { - "includes": [ - "phpstan/rules.neon" - ] - }, "branch-alias": { - "dev-main": "2.7-dev" + "dev-master": "1.10-dev" } }, "autoload": { "psr-4": { - "Composer\\": "src/Composer/" + "Composer\\": "src/Composer" } }, "notification-url": "https://packagist.org/downloads/", @@ -2217,12 +2115,12 @@ { "name": "Nils Adermann", "email": "naderman@naderman.de", - "homepage": "https://www.naderman.de" + "homepage": "http://www.naderman.de" }, { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" + "homepage": "http://seld.be" } ], "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", @@ -2233,10 +2131,9 @@ "package" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", + "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.7.7" + "source": "https://github.com/composer/composer/tree/1.10.27" }, "funding": [ { @@ -2252,181 +2149,32 @@ "type": "tidelift" } ], - "time": "2024-06-10T20:11:12+00:00" - }, - { - "name": "composer/metadata-minifier", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/metadata-minifier.git", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "composer/composer": "^2", - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\MetadataMinifier\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Small utility library that handles metadata minification and expansion.", - "keywords": [ - "composer", - "compression" - ], - "support": { - "issues": "https://github.com/composer/metadata-minifier/issues", - "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-04-07T13:37:33+00:00" - }, - { - "name": "composer/pcre", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<1.11.10" - }, - "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-strict-rules": "^1 || ^2", - "phpunit/phpunit": "^8 || ^9" - }, - "type": "library", - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - }, - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-11-12T16:29:46+00:00" + "time": "2023-09-29T08:50:23+00:00" }, { "name": "composer/semver", - "version": "3.4.3", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.11", - "symfony/phpunit-bridge": "^3 || ^7" + "phpunit/phpunit": "^4.5 || ^5.0.5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -2463,9 +2211,9 @@ "versioning" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", + "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" + "source": "https://github.com/composer/semver/tree/1.7.2" }, "funding": [ { @@ -2481,7 +2229,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T14:15:21+00:00" + "time": "2020-12-03T15:47:16+00:00" }, { "name": "composer/spdx-licenses", @@ -2565,27 +2313,25 @@ }, { "name": "composer/xdebug-handler", - "version": "3.0.5", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + "reference": "f27e06cd9675801df441b3656569b328e04aa37c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", + "reference": "f27e06cd9675801df441b3656569b328e04aa37c", "shasum": "" }, "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" }, "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "autoload": { @@ -2609,9 +2355,9 @@ "performance" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", + "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" }, "funding": [ { @@ -2627,30 +2373,33 @@ "type": "tidelift" } ], - "time": "2024-05-06T16:37:16+00:00" + "time": "2021-03-25T17:01:18+00:00" }, { "name": "doctrine/deprecations", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "1.4.10 || 2.0.3", + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", "psr/log": "^1 || ^2 || ^3" }, "suggest": { @@ -2670,9 +2419,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.4" + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" }, - "time": "2024-12-07T21:18:45+00:00" + "time": "2025-04-07T20:06:18+00:00" }, { "name": "doctrine/instantiator", @@ -2811,16 +2560,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", "shasum": "" }, "require": { @@ -2859,7 +2608,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" }, "funding": [ { @@ -2867,7 +2616,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2025-04-29T12:36:36+00:00" }, { "name": "nikic/php-parser", @@ -3162,16 +2911,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.1", + "version": "5.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" + "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", - "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", + "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", "shasum": "" }, "require": { @@ -3220,9 +2969,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" }, - "time": "2024-12-07T09:39:29+00:00" + "time": "2025-04-13T19:20:35+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -3284,29 +3033,29 @@ }, { "name": "phpspec/prophecy", - "version": "v1.20.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93" + "reference": "35f1adb388946d92e6edab2aa2cb2b60e132ebd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93", - "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/35f1adb388946d92e6edab2aa2cb2b60e132ebd5", + "reference": "35f1adb388946d92e6edab2aa2cb2b60e132ebd5", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", + "php": "^7.4 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", - "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" + "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.40", "phpspec/phpspec": "^6.0 || ^7.0", - "phpstan/phpstan": "^1.9", + "phpstan/phpstan": "^2.1.13", "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" }, "type": "library", @@ -3348,9 +3097,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.20.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.22.0" }, - "time": "2024-11-19T13:12:41+00:00" + "time": "2025-04-29T14:58:06+00:00" }, { "name": "phpspec/prophecy-phpunit", @@ -3409,16 +3158,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" + "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", - "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", + "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", "shasum": "" }, "require": { @@ -3450,9 +3199,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.1.0" }, - "time": "2024-10-13T11:29:49+00:00" + "time": "2025-02-19T13:28:12+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3775,16 +3524,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "9.6.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", "shasum": "" }, "require": { @@ -3795,7 +3544,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -3858,7 +3607,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23" }, "funding": [ { @@ -3869,12 +3618,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2025-05-02T06:40:34+00:00" }, { "name": "psr/container", @@ -3929,79 +3686,6 @@ }, "time": "2021-11-05T16:47:00+00:00" }, - { - "name": "react/promise", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-05-24T10:39:05+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.2", @@ -5077,79 +4761,18 @@ }, "time": "2022-08-31T10:31:18+00:00" }, - { - "name": "seld/signal-handler", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/signal-handler.git", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "require-dev": { - "phpstan/phpstan": "^1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^7.5.20 || ^8.5.23", - "psr/log": "^1 || ^2 || ^3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\Signal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", - "keywords": [ - "posix", - "sigint", - "signal", - "sigterm", - "unix" - ], - "support": { - "issues": "https://github.com/Seldaek/signal-handler/issues", - "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" - }, - "time": "2023-09-03T09:24:00+00:00" - }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.2", + "version": "3.12.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079" + "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079", - "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa", + "reference": "6d4cf6032d4b718f168c90a96e36c7d0eaacb2aa", "shasum": "" }, "require": { @@ -5214,48 +4837,56 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-12-11T16:04:26+00:00" + "time": "2025-04-13T04:10:18+00:00" }, { "name": "symfony/console", - "version": "v6.0.19", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed", - "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^5.1|^6.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -5290,12 +4921,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.19" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -5311,7 +4942,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/css-selector", @@ -5431,22 +5062,26 @@ }, { "name": "symfony/filesystem", - "version": "v6.0.19", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214" + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214", - "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "symfony/process": "^5.4|^6.4" }, "type": "library", "autoload": { @@ -5474,7 +5109,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.0.19" + "source": "https://github.com/symfony/filesystem/tree/v5.4.45" }, "funding": [ { @@ -5490,24 +5125,26 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:44:14+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/finder", - "version": "v6.0.19", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11" + "reference": "63741784cd7b9967975eec610b256eed3ede022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/5cc9cac6586fc0c28cd173780ca696e419fefa11", - "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -5535,7 +5172,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.0.19" + "source": "https://github.com/symfony/finder/tree/v5.4.45" }, "funding": [ { @@ -5551,11 +5188,11 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:44:14+00:00" + "time": "2024-09-28T13:32:08+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -5614,7 +5251,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -5634,7 +5271,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -5692,7 +5329,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -5712,7 +5349,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -5773,7 +5410,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -5793,19 +5430,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -5853,7 +5491,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -5869,11 +5507,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -5929,7 +5567,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" }, "funding": [ { @@ -5949,16 +5587,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -6009,7 +5647,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -6025,24 +5663,25 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { "name": "symfony/process", - "version": "v6.0.19", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2114fd60f26a296cc403a7939ab91478475a33d4" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2114fd60f26a296cc403a7939ab91478475a33d4", - "reference": "2114fd60f26a296cc403a7939ab91478475a33d4", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6070,7 +5709,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.0.19" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -6086,7 +5725,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/service-contracts", diff --git a/lib/Google/vendor/composer/autoload_psr4.php b/lib/Google/vendor/composer/autoload_psr4.php index 941b62a92..a6b60b0d6 100644 --- a/lib/Google/vendor/composer/autoload_psr4.php +++ b/lib/Google/vendor/composer/autoload_psr4.php @@ -11,7 +11,7 @@ 'Rize\\' => array($vendorDir . '/rize/uri-template/src/Rize'), 'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'), 'Ramsey\\Collection\\' => array($vendorDir . '/ramsey/collection/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), diff --git a/lib/Google/vendor/composer/autoload_static.php b/lib/Google/vendor/composer/autoload_static.php index a87ff2e68..2cad9318a 100644 --- a/lib/Google/vendor/composer/autoload_static.php +++ b/lib/Google/vendor/composer/autoload_static.php @@ -108,7 +108,7 @@ class ComposerStaticInitbd131085cfdbf47b26d7ae00fe412ae4 ), 'Psr\\Log\\' => array ( - 0 => __DIR__ . '/..' . '/psr/log/src', + 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', ), 'Psr\\Http\\Message\\' => array ( diff --git a/lib/Google/vendor/composer/installed.json b/lib/Google/vendor/composer/installed.json index 0243111ea..c21cb26d5 100644 --- a/lib/Google/vendor/composer/installed.json +++ b/lib/Google/vendor/composer/installed.json @@ -60,17 +60,17 @@ }, { "name": "firebase/php-jwt", - "version": "v6.10.2", - "version_normalized": "6.10.2.0", + "version": "v6.11.1", + "version_normalized": "6.11.1.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b" + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", "shasum": "" }, "require": { @@ -88,7 +88,7 @@ "ext-sodium": "Support EdDSA (Ed25519) signatures", "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" }, - "time": "2024-11-24T11:22:49+00:00", + "time": "2025-04-09T20:32:01+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -120,23 +120,23 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.2" + "source": "https://github.com/firebase/php-jwt/tree/v6.11.1" }, "install-path": "../firebase/php-jwt" }, { "name": "google/apiclient-services", - "version": "v0.389.0", - "version_normalized": "0.389.0.0", + "version": "v0.396.0", + "version_normalized": "0.396.0.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8" + "reference": "ceb2e432e4326c6775d24f62d554395a1a9ad3dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/6274e67ee52b1a416ccee0a4eaf337d1139cdaf8", - "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ceb2e432e4326c6775d24f62d554395a1a9ad3dd", + "reference": "ceb2e432e4326c6775d24f62d554395a1a9ad3dd", "shasum": "" }, "require": { @@ -145,7 +145,7 @@ "require-dev": { "phpunit/phpunit": "^9.6" }, - "time": "2025-01-05T01:04:21+00:00", + "time": "2025-02-24T01:10:27+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -167,23 +167,23 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.389.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.396.0" }, "install-path": "../google/apiclient-services" }, { "name": "google/auth", - "version": "v1.45.0", - "version_normalized": "1.45.0.0", + "version": "v1.42.0", + "version_normalized": "1.42.0.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad" + "reference": "0c25599a91530b5847f129b271c536f75a7563f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/cfcb93162341ed5022fa976e621f0fa2b05ba6ad", - "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/0c25599a91530b5847f129b271c536f75a7563f5", + "reference": "0c25599a91530b5847f129b271c536f75a7563f5", "shasum": "" }, "require": { @@ -192,8 +192,7 @@ "guzzlehttp/psr7": "^2.4.5", "php": "^8.0", "psr/cache": "^2.0||^3.0", - "psr/http-message": "^1.1||^2.0", - "psr/log": "^3.0" + "psr/http-message": "^1.1||^2.0" }, "require-dev": { "guzzlehttp/promises": "^2.0", @@ -209,7 +208,7 @@ "suggest": { "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." }, - "time": "2024-12-11T02:10:48+00:00", + "time": "2024-08-26T18:33:48+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -231,28 +230,28 @@ "support": { "docs": "https://googleapis.github.io/google-auth-library-php/main/", "issues": "https://github.com/googleapis/google-auth-library-php/issues", - "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.45.0" + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.42.0" }, "install-path": "../google/auth" }, { "name": "google/cloud-core", - "version": "v1.60.1", - "version_normalized": "1.60.1.0", + "version": "v1.60.0", + "version_normalized": "1.60.0.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd" + "reference": "7d63ba4295b799dc63227b6c9daf9dc207650eb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/c149dd075a77bc8555a0eff46267522f1c4e0bfd", - "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/7d63ba4295b799dc63227b6c9daf9dc207650eb4", + "reference": "7d63ba4295b799dc63227b6c9daf9dc207650eb4", "shasum": "" }, "require": { "google/auth": "^1.34", - "google/gax": "^1.36.0", + "google/gax": "^1.34.0", "guzzlehttp/guzzle": "^6.5.8|^7.4.4", "guzzlehttp/promises": "^1.4||^2.0", "guzzlehttp/psr7": "^2.6", @@ -265,7 +264,7 @@ "erusev/parsedown": "^1.6", "google/cloud-common-protos": "~0.5", "opis/closure": "^3", - "phpdocumentor/reflection": "^5.3.3||^6.0", + "phpdocumentor/reflection": "^5.3.3", "phpdocumentor/reflection-docblock": "^5.3", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.0", @@ -275,7 +274,7 @@ "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", "symfony/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9" }, - "time": "2024-12-12T21:15:35+00:00", + "time": "2024-09-28T04:24:22+00:00", "bin": [ "bin/google-cloud-batch" ], @@ -300,23 +299,23 @@ ], "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", "support": { - "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.60.1" + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.60.0" }, "install-path": "../google/cloud-core" }, { "name": "google/cloud-storage", - "version": "v1.45.0", - "version_normalized": "1.45.0.0", + "version": "v1.48.1", + "version_normalized": "1.48.1.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-storage.git", - "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6" + "reference": "509b095c3ea44db92c9e62a94b5773563c831821" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/9873cb5a27f4adc20909329d0eae85f2b3b0dba6", - "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/509b095c3ea44db92c9e62a94b5773563c831821", + "reference": "509b095c3ea44db92c9e62a94b5773563c831821", "shasum": "" }, "require": { @@ -338,7 +337,7 @@ "google/cloud-pubsub": "May be used to register a topic to receive bucket notifications.", "phpseclib/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2." }, - "time": "2024-12-12T21:15:35+00:00", + "time": "2025-05-20T19:49:54+00:00", "type": "library", "extra": { "component": { @@ -360,23 +359,23 @@ ], "description": "Cloud Storage Client for PHP", "support": { - "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.45.0" + "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.48.1" }, "install-path": "../google/cloud-storage" }, { "name": "google/common-protos", - "version": "4.8.3", - "version_normalized": "4.8.3.0", + "version": "4.12.1", + "version_normalized": "4.12.1.0", "source": { "type": "git", "url": "https://github.com/googleapis/common-protos-php.git", - "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d" + "reference": "70c4eb1abab5484a23c17a43b0d455259f5d8c1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/38a9a8bb459fa618da797d25d7bf36bb21d1103d", - "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d", + "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/70c4eb1abab5484a23c17a43b0d455259f5d8c1b", + "reference": "70c4eb1abab5484a23c17a43b0d455259f5d8c1b", "shasum": "" }, "require": { @@ -386,7 +385,7 @@ "require-dev": { "phpunit/phpunit": "^9.6" }, - "time": "2024-09-07T01:37:15+00:00", + "time": "2025-05-20T19:49:54+00:00", "type": "library", "extra": { "component": { @@ -422,27 +421,27 @@ "google" ], "support": { - "source": "https://github.com/googleapis/common-protos-php/tree/v4.8.3" + "source": "https://github.com/googleapis/common-protos-php/tree/v4.12.1" }, "install-path": "../google/common-protos" }, { "name": "google/gax", - "version": "v1.36.0", - "version_normalized": "1.36.0.0", + "version": "v1.35.1", + "version_normalized": "1.35.1.0", "source": { "type": "git", "url": "https://github.com/googleapis/gax-php.git", - "reference": "140599cf5eae2432363ce6198e9fdff851625a7a" + "reference": "336005867c0ca3e2ad95183cf9dd74fa67915dd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/gax-php/zipball/140599cf5eae2432363ce6198e9fdff851625a7a", - "reference": "140599cf5eae2432363ce6198e9fdff851625a7a", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/336005867c0ca3e2ad95183cf9dd74fa67915dd9", + "reference": "336005867c0ca3e2ad95183cf9dd74fa67915dd9", "shasum": "" }, "require": { - "google/auth": "^1.45", + "google/auth": "^1.34.0", "google/common-protos": "^4.4", "google/grpc-gcp": "^0.4", "google/longrunning": "~0.4", @@ -458,11 +457,11 @@ }, "require-dev": { "phpspec/prophecy-phpunit": "^2.1", - "phpstan/phpstan": "^2.0", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "3.*" }, - "time": "2024-12-11T02:47:43+00:00", + "time": "2024-12-04T15:32:12+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -482,23 +481,23 @@ ], "support": { "issues": "https://github.com/googleapis/gax-php/issues", - "source": "https://github.com/googleapis/gax-php/tree/v1.36.0" + "source": "https://github.com/googleapis/gax-php/tree/v1.35.1" }, "install-path": "../google/gax" }, { "name": "google/grpc-gcp", - "version": "v0.4.0", - "version_normalized": "0.4.0.0", + "version": "v0.4.1", + "version_normalized": "0.4.1.0", "source": { "type": "git", "url": "https://github.com/GoogleCloudPlatform/grpc-gcp-php.git", - "reference": "2a80dbf690922aa52bb6bb79b9a32a9637a5c2d9" + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/2a80dbf690922aa52bb6bb79b9a32a9637a5c2d9", - "reference": "2a80dbf690922aa52bb6bb79b9a32a9637a5c2d9", + "url": "https://api.github.com/repos/GoogleCloudPlatform/grpc-gcp-php/zipball/e585b7721bbe806ef45b5c52ae43dfc2bff89968", + "reference": "e585b7721bbe806ef45b5c52ae43dfc2bff89968", "shasum": "" }, "require": { @@ -512,7 +511,7 @@ "google/cloud-spanner": "^1.7", "phpunit/phpunit": "^9.0" }, - "time": "2024-04-03T16:37:55+00:00", + "time": "2025-02-19T21:53:22+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -530,30 +529,30 @@ "description": "gRPC GCP library for channel management", "support": { "issues": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/issues", - "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.4.0" + "source": "https://github.com/GoogleCloudPlatform/grpc-gcp-php/tree/v0.4.1" }, "install-path": "../google/grpc-gcp" }, { "name": "google/longrunning", - "version": "0.4.6", - "version_normalized": "0.4.6.0", + "version": "0.4.7", + "version_normalized": "0.4.7.0", "source": { "type": "git", "url": "https://github.com/googleapis/php-longrunning.git", - "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6" + "reference": "624cabb874c10e5ddc9034c999f724894b70a3d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/4eb04d47bba8095d5a47f75334b9204c2a4a7ac6", - "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6", + "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/624cabb874c10e5ddc9034c999f724894b70a3d3", + "reference": "624cabb874c10e5ddc9034c999f724894b70a3d3", "shasum": "" }, "require-dev": { "google/gax": "^1.36.0", "phpunit/phpunit": "^9.0" }, - "time": "2024-12-12T21:15:35+00:00", + "time": "2025-01-24T21:24:06+00:00", "type": "library", "extra": { "component": { @@ -577,23 +576,23 @@ ], "description": "Google LongRunning Client for PHP", "support": { - "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.6" + "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.7" }, "install-path": "../google/longrunning" }, { "name": "google/protobuf", - "version": "v4.29.3", - "version_normalized": "4.29.3.0", + "version": "v4.31.1", + "version_normalized": "4.31.1.0", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7" + "reference": "2b028ce8876254e2acbeceea7d9b573faad41864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", - "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/2b028ce8876254e2acbeceea7d9b573faad41864", + "reference": "2b028ce8876254e2acbeceea7d9b573faad41864", "shasum": "" }, "require": { @@ -605,7 +604,7 @@ "suggest": { "ext-bcmath": "Need to support JSON deserialization" }, - "time": "2025-01-08T21:00:13+00:00", + "time": "2025-05-28T18:52:35+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -624,7 +623,7 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.31.1" }, "install-path": "../google/protobuf" }, @@ -677,17 +676,17 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.9.2", - "version_normalized": "7.9.2.0", + "version": "7.9.3", + "version_normalized": "7.9.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "d281ed313b989f213357e3be1a179f02196ac99b" + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", - "reference": "d281ed313b989f213357e3be1a179f02196ac99b", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", "shasum": "" }, "require": { @@ -714,7 +713,7 @@ "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, - "time": "2024-07-24T11:22:20+00:00", + "time": "2025-03-27T13:37:11+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -786,7 +785,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.9.2" + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" }, "funding": [ { @@ -806,17 +805,17 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.4", - "version_normalized": "2.0.4.0", + "version": "2.2.0", + "version_normalized": "2.2.0.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", - "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", "shasum": "" }, "require": { @@ -826,7 +825,7 @@ "bamarni/composer-bin-plugin": "^1.8.2", "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, - "time": "2024-10-17T10:06:22+00:00", + "time": "2025-03-27T13:27:01+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -872,7 +871,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.4" + "source": "https://github.com/guzzle/promises/tree/2.2.0" }, "funding": [ { @@ -892,17 +891,17 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.7.0", - "version_normalized": "2.7.0.0", + "version": "2.7.1", + "version_normalized": "2.7.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", "shasum": "" }, "require": { @@ -923,7 +922,7 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2024-07-18T11:15:46+00:00", + "time": "2025-03-27T12:30:47+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -991,7 +990,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.7.0" + "source": "https://github.com/guzzle/psr7/tree/2.7.1" }, "funding": [ { @@ -1573,33 +1572,33 @@ }, { "name": "psr/log", - "version": "3.0.2", - "version_normalized": "3.0.2.0", + "version": "1.1.4", + "version_normalized": "1.1.4.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, - "time": "2024-09-11T13:17:53+00:00", + "time": "2021-05-03T11:20:27+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1620,7 +1619,7 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, "install-path": "../psr/log" }, @@ -1766,22 +1765,21 @@ }, { "name": "ramsey/uuid", - "version": "4.7.6", - "version_normalized": "4.7.6.0", + "version": "4.9.0", + "version_normalized": "4.9.0.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + "reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/4e0e23cc785f0724a0e838279a9eb03f28b092a0", + "reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", - "ext-json": "*", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -1789,26 +1787,23 @@ "rhumsaa/uuid": "self.version" }, "require-dev": { - "captainhook/captainhook": "^5.10", + "captainhook/captainhook": "^5.25", "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", @@ -1817,7 +1812,7 @@ "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, - "time": "2024-04-27T21:32:50+00:00", + "time": "2025-06-25T14:20:11+00:00", "type": "library", "extra": { "captainhook": { @@ -1845,18 +1840,8 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.6" + "source": "https://github.com/ramsey/uuid/tree/4.9.0" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], "install-path": "../ramsey/uuid" }, { @@ -1945,12 +1930,12 @@ "time": "2022-01-02T09:55:41+00:00", "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "installation-source": "dist", @@ -1996,8 +1981,8 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.31.0", - "version_normalized": "1.31.0.0", + "version": "v1.32.0", + "version_normalized": "1.32.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -2055,7 +2040,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" }, "funding": [ { diff --git a/lib/Google/vendor/composer/installed.php b/lib/Google/vendor/composer/installed.php index b1531f40b..751d577c6 100644 --- a/lib/Google/vendor/composer/installed.php +++ b/lib/Google/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'google/apiclient', 'pretty_version' => 'dev-latest', 'version' => 'dev-latest', - 'reference' => '37c3d25a1eb876a65a1b147acd45aa3cfc7a266b', + 'reference' => 'e9bccc39abc840b90f13f5054b669f3d2d2fe0df', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -20,9 +20,9 @@ 'dev_requirement' => false, ), 'firebase/php-jwt' => array( - 'pretty_version' => 'v6.10.2', - 'version' => '6.10.2.0', - 'reference' => '30c19ed0f3264cb660ea496895cfb6ef7ee3653b', + 'pretty_version' => 'v6.11.1', + 'version' => '6.11.1.0', + 'reference' => 'd1e91ecf8c598d073d0995afa8cd5c75c6e19e66', 'type' => 'library', 'install_path' => __DIR__ . '/../firebase/php-jwt', 'aliases' => array(), @@ -31,88 +31,88 @@ 'google/apiclient' => array( 'pretty_version' => 'dev-latest', 'version' => 'dev-latest', - 'reference' => '37c3d25a1eb876a65a1b147acd45aa3cfc7a266b', + 'reference' => 'e9bccc39abc840b90f13f5054b669f3d2d2fe0df', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'google/apiclient-services' => array( - 'pretty_version' => 'v0.389.0', - 'version' => '0.389.0.0', - 'reference' => '6274e67ee52b1a416ccee0a4eaf337d1139cdaf8', + 'pretty_version' => 'v0.396.0', + 'version' => '0.396.0.0', + 'reference' => 'ceb2e432e4326c6775d24f62d554395a1a9ad3dd', 'type' => 'library', 'install_path' => __DIR__ . '/../google/apiclient-services', 'aliases' => array(), 'dev_requirement' => false, ), 'google/auth' => array( - 'pretty_version' => 'v1.45.0', - 'version' => '1.45.0.0', - 'reference' => 'cfcb93162341ed5022fa976e621f0fa2b05ba6ad', + 'pretty_version' => 'v1.42.0', + 'version' => '1.42.0.0', + 'reference' => '0c25599a91530b5847f129b271c536f75a7563f5', 'type' => 'library', 'install_path' => __DIR__ . '/../google/auth', 'aliases' => array(), 'dev_requirement' => false, ), 'google/cloud-core' => array( - 'pretty_version' => 'v1.60.1', - 'version' => '1.60.1.0', - 'reference' => 'c149dd075a77bc8555a0eff46267522f1c4e0bfd', + 'pretty_version' => 'v1.60.0', + 'version' => '1.60.0.0', + 'reference' => '7d63ba4295b799dc63227b6c9daf9dc207650eb4', 'type' => 'library', 'install_path' => __DIR__ . '/../google/cloud-core', 'aliases' => array(), 'dev_requirement' => false, ), 'google/cloud-storage' => array( - 'pretty_version' => 'v1.45.0', - 'version' => '1.45.0.0', - 'reference' => '9873cb5a27f4adc20909329d0eae85f2b3b0dba6', + 'pretty_version' => 'v1.48.1', + 'version' => '1.48.1.0', + 'reference' => '509b095c3ea44db92c9e62a94b5773563c831821', 'type' => 'library', 'install_path' => __DIR__ . '/../google/cloud-storage', 'aliases' => array(), 'dev_requirement' => false, ), 'google/common-protos' => array( - 'pretty_version' => '4.8.3', - 'version' => '4.8.3.0', - 'reference' => '38a9a8bb459fa618da797d25d7bf36bb21d1103d', + 'pretty_version' => '4.12.1', + 'version' => '4.12.1.0', + 'reference' => '70c4eb1abab5484a23c17a43b0d455259f5d8c1b', 'type' => 'library', 'install_path' => __DIR__ . '/../google/common-protos', 'aliases' => array(), 'dev_requirement' => false, ), 'google/gax' => array( - 'pretty_version' => 'v1.36.0', - 'version' => '1.36.0.0', - 'reference' => '140599cf5eae2432363ce6198e9fdff851625a7a', + 'pretty_version' => 'v1.35.1', + 'version' => '1.35.1.0', + 'reference' => '336005867c0ca3e2ad95183cf9dd74fa67915dd9', 'type' => 'library', 'install_path' => __DIR__ . '/../google/gax', 'aliases' => array(), 'dev_requirement' => false, ), 'google/grpc-gcp' => array( - 'pretty_version' => 'v0.4.0', - 'version' => '0.4.0.0', - 'reference' => '2a80dbf690922aa52bb6bb79b9a32a9637a5c2d9', + 'pretty_version' => 'v0.4.1', + 'version' => '0.4.1.0', + 'reference' => 'e585b7721bbe806ef45b5c52ae43dfc2bff89968', 'type' => 'library', 'install_path' => __DIR__ . '/../google/grpc-gcp', 'aliases' => array(), 'dev_requirement' => false, ), 'google/longrunning' => array( - 'pretty_version' => '0.4.6', - 'version' => '0.4.6.0', - 'reference' => '4eb04d47bba8095d5a47f75334b9204c2a4a7ac6', + 'pretty_version' => '0.4.7', + 'version' => '0.4.7.0', + 'reference' => '624cabb874c10e5ddc9034c999f724894b70a3d3', 'type' => 'library', 'install_path' => __DIR__ . '/../google/longrunning', 'aliases' => array(), 'dev_requirement' => false, ), 'google/protobuf' => array( - 'pretty_version' => 'v4.29.3', - 'version' => '4.29.3.0', - 'reference' => 'ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7', + 'pretty_version' => 'v4.31.1', + 'version' => '4.31.1.0', + 'reference' => '2b028ce8876254e2acbeceea7d9b573faad41864', 'type' => 'library', 'install_path' => __DIR__ . '/../google/protobuf', 'aliases' => array(), @@ -128,27 +128,27 @@ 'dev_requirement' => false, ), 'guzzlehttp/guzzle' => array( - 'pretty_version' => '7.9.2', - 'version' => '7.9.2.0', - 'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b', + 'pretty_version' => '7.9.3', + 'version' => '7.9.3.0', + 'reference' => '7b2f29fe81dc4da0ca0ea7d42107a0845946ea77', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/promises' => array( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455', + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'reference' => '7c69f28996b0a6920945dd20b3857e499d9ca96c', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.7.0', - 'version' => '2.7.0.0', - 'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201', + 'pretty_version' => '2.7.1', + 'version' => '2.7.1.0', + 'reference' => 'c2270caaabe631b3b44c85f99e5a04bbb8060d16', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), @@ -245,9 +245,9 @@ ), ), 'psr/log' => array( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', - 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), @@ -278,9 +278,9 @@ 'dev_requirement' => false, ), 'ramsey/uuid' => array( - 'pretty_version' => '4.7.6', - 'version' => '4.7.6.0', - 'reference' => '91039bc1faa45ba123c4328958e620d382ec7088', + 'pretty_version' => '4.9.0', + 'version' => '4.9.0.0', + 'reference' => '4e0e23cc785f0724a0e838279a9eb03f28b092a0', 'type' => 'library', 'install_path' => __DIR__ . '/../ramsey/uuid', 'aliases' => array(), @@ -289,7 +289,7 @@ 'rhumsaa/uuid' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.7.6', + 0 => '4.9.0', ), ), 'rize/uri-template' => array( @@ -311,8 +311,8 @@ 'dev_requirement' => false, ), 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.31.0', - 'version' => '1.31.0.0', + 'pretty_version' => 'v1.32.0', + 'version' => '1.32.0.0', 'reference' => '4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php81', diff --git a/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md b/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md index 5feeb5a67..7b5f6ce40 100644 --- a/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md +++ b/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [6.11.1](https://github.com/firebase/php-jwt/compare/v6.11.0...v6.11.1) (2025-04-09) + + +### Bug Fixes + +* update error text for consistency ([#528](https://github.com/firebase/php-jwt/issues/528)) ([c11113a](https://github.com/firebase/php-jwt/commit/c11113afa13265e016a669e75494b9203b8a7775)) + +## [6.11.0](https://github.com/firebase/php-jwt/compare/v6.10.2...v6.11.0) (2025-01-23) + + +### Features + +* support octet typed JWK ([#587](https://github.com/firebase/php-jwt/issues/587)) ([7cb8a26](https://github.com/firebase/php-jwt/commit/7cb8a265fa81edf2fa6ef8098f5bc5ae573c33ad)) + + +### Bug Fixes + +* refactor constructor Key to use PHP 8.0 syntax ([#577](https://github.com/firebase/php-jwt/issues/577)) ([29fa2ce](https://github.com/firebase/php-jwt/commit/29fa2ce9e0582cd397711eec1e80c05ce20fabca)) + ## [6.10.2](https://github.com/firebase/php-jwt/compare/v6.10.1...v6.10.2) (2024-11-24) diff --git a/lib/Google/vendor/firebase/php-jwt/README.md b/lib/Google/vendor/firebase/php-jwt/README.md index 4fd140745..e45ccb808 100644 --- a/lib/Google/vendor/firebase/php-jwt/README.md +++ b/lib/Google/vendor/firebase/php-jwt/README.md @@ -48,7 +48,8 @@ $decoded = JWT::decode($jwt, new Key($key, 'HS256')); print_r($decoded); // Pass a stdClass in as the third parameter to get the decoded header values -$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers = new stdClass()); +$headers = new stdClass(); +$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers); print_r($headers); /* @@ -290,7 +291,7 @@ $jwks = ['keys' => []]; // JWK::parseKeySet($jwks) returns an associative array of **kid** to Firebase\JWT\Key // objects. Pass this as the second parameter to JWT::decode. -JWT::decode($payload, JWK::parseKeySet($jwks)); +JWT::decode($jwt, JWK::parseKeySet($jwks)); ``` Using Cached Key Sets @@ -349,7 +350,7 @@ use InvalidArgumentException; use UnexpectedValueException; try { - $decoded = JWT::decode($payload, $keys); + $decoded = JWT::decode($jwt, $keys); } catch (InvalidArgumentException $e) { // provided key/key-array is empty or malformed. } catch (DomainException $e) { @@ -379,7 +380,7 @@ like this: use Firebase\JWT\JWT; use UnexpectedValueException; try { - $decoded = JWT::decode($payload, $keys); + $decoded = JWT::decode($jwt, $keys); } catch (LogicException $e) { // errors having to do with environmental setup or malformed JWT Keys } catch (UnexpectedValueException $e) { @@ -394,7 +395,7 @@ instead, you can do the following: ```php // return type is stdClass -$decoded = JWT::decode($payload, $keys); +$decoded = JWT::decode($jwt, $keys); // cast to array $decoded = json_decode(json_encode($decoded), true); diff --git a/lib/Google/vendor/firebase/php-jwt/src/JWK.php b/lib/Google/vendor/firebase/php-jwt/src/JWK.php index 6efc2fe38..405dcc49b 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/JWK.php +++ b/lib/Google/vendor/firebase/php-jwt/src/JWK.php @@ -172,6 +172,12 @@ public static function parseKey(array $jwk, ?string $defaultAlg = null): ?Key // This library works internally with EdDSA keys (Ed25519) encoded in standard base64. $publicKey = JWT::convertBase64urlToBase64($jwk['x']); return new Key($publicKey, $jwk['alg']); + case 'oct': + if (!isset($jwk['k'])) { + throw new UnexpectedValueException('k not set'); + } + + return new Key(JWT::urlsafeB64Decode($jwk['k']), $jwk['alg']); default: break; } diff --git a/lib/Google/vendor/firebase/php-jwt/src/JWT.php b/lib/Google/vendor/firebase/php-jwt/src/JWT.php index dd9292a43..833a415e6 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/JWT.php +++ b/lib/Google/vendor/firebase/php-jwt/src/JWT.php @@ -154,7 +154,7 @@ public static function decode( // token can actually be used. If it's not yet that time, abort. if (isset($payload->nbf) && floor($payload->nbf) > ($timestamp + static::$leeway)) { $ex = new BeforeValidException( - 'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) $payload->nbf) + 'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) floor($payload->nbf)) ); $ex->setPayload($payload); throw $ex; @@ -165,7 +165,7 @@ public static function decode( // correctly used the nbf claim). if (!isset($payload->nbf) && isset($payload->iat) && floor($payload->iat) > ($timestamp + static::$leeway)) { $ex = new BeforeValidException( - 'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) $payload->iat) + 'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) floor($payload->iat)) ); $ex->setPayload($payload); throw $ex; diff --git a/lib/Google/vendor/firebase/php-jwt/src/Key.php b/lib/Google/vendor/firebase/php-jwt/src/Key.php index 00cf7f2ed..b34eae258 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/Key.php +++ b/lib/Google/vendor/firebase/php-jwt/src/Key.php @@ -9,18 +9,13 @@ class Key { - /** @var string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate */ - private $keyMaterial; - /** @var string */ - private $algorithm; - /** * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial * @param string $algorithm */ public function __construct( - $keyMaterial, - string $algorithm + private $keyMaterial, + private string $algorithm ) { if ( !\is_string($keyMaterial) @@ -38,10 +33,6 @@ public function __construct( if (empty($algorithm)) { throw new InvalidArgumentException('Algorithm must not be empty'); } - - // TODO: Remove in PHP 8.0 in favor of class constructor property promotion - $this->keyMaterial = $keyMaterial; - $this->algorithm = $algorithm; } /** diff --git a/lib/Google/vendor/google/auth/VERSION b/lib/Google/vendor/google/auth/VERSION index 50aceaa7b..a50908ca3 100644 --- a/lib/Google/vendor/google/auth/VERSION +++ b/lib/Google/vendor/google/auth/VERSION @@ -1 +1 @@ -1.45.0 +1.42.0 diff --git a/lib/Google/vendor/google/auth/composer.json b/lib/Google/vendor/google/auth/composer.json index 33428c5fa..41a1d0532 100644 --- a/lib/Google/vendor/google/auth/composer.json +++ b/lib/Google/vendor/google/auth/composer.json @@ -14,8 +14,7 @@ "guzzlehttp/guzzle": "^7.4.5", "guzzlehttp/psr7": "^2.4.5", "psr/http-message": "^1.1||^2.0", - "psr/cache": "^2.0||^3.0", - "psr/log": "^3.0" + "psr/cache": "^2.0||^3.0" }, "require-dev": { "guzzlehttp/promises": "^2.0", diff --git a/lib/Google/vendor/google/auth/src/AccessToken.php b/lib/Google/vendor/google/auth/src/AccessToken.php index 9e27b692e..630b27961 100644 --- a/lib/Google/vendor/google/auth/src/AccessToken.php +++ b/lib/Google/vendor/google/auth/src/AccessToken.php @@ -65,12 +65,12 @@ class AccessToken private $cache; /** - * @param callable|null $httpHandler [optional] An HTTP Handler to deliver PSR-7 requests. - * @param CacheItemPoolInterface|null $cache [optional] A PSR-6 compatible cache implementation. + * @param callable $httpHandler [optional] An HTTP Handler to deliver PSR-7 requests. + * @param CacheItemPoolInterface $cache [optional] A PSR-6 compatible cache implementation. */ public function __construct( - ?callable $httpHandler = null, - ?CacheItemPoolInterface $cache = null + callable $httpHandler = null, + CacheItemPoolInterface $cache = null ) { $this->httpHandler = $httpHandler ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); diff --git a/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php b/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php index 39107c790..80437c8c9 100644 --- a/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php +++ b/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php @@ -21,17 +21,14 @@ use Google\Auth\Credentials\AppIdentityCredentials; use Google\Auth\Credentials\GCECredentials; use Google\Auth\Credentials\ServiceAccountCredentials; -use Google\Auth\Credentials\UserRefreshCredentials; use Google\Auth\HttpHandler\HttpClientCache; use Google\Auth\HttpHandler\HttpHandlerFactory; -use Google\Auth\Logging\StdOutLogger; use Google\Auth\Middleware\AuthTokenMiddleware; use Google\Auth\Middleware\ProxyAuthTokenMiddleware; use Google\Auth\Subscriber\AuthTokenSubscriber; use GuzzleHttp\Client; use InvalidArgumentException; use Psr\Cache\CacheItemPoolInterface; -use Psr\Log\LoggerInterface; /** * ApplicationDefaultCredentials obtains the default credentials for @@ -72,8 +69,6 @@ */ class ApplicationDefaultCredentials { - private const SDK_DEBUG_ENV_VAR = 'GOOGLE_SDK_PHP_LOGGING'; - /** * @deprecated * @@ -85,18 +80,18 @@ class ApplicationDefaultCredentials * * @param string|string[] $scope the scope of the access request, expressed * either as an Array or as a space-delimited String. - * @param callable|null $httpHandler callback which delivers psr7 request - * @param array|null $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be * provided if you have one already available for use. * @return AuthTokenSubscriber * @throws DomainException if no implementation can be obtained. */ public static function getSubscriber(// @phpstan-ignore-line $scope = null, - ?callable $httpHandler = null, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null ) { $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache); @@ -113,9 +108,9 @@ public static function getSubscriber(// @phpstan-ignore-line * * @param string|string[] $scope the scope of the access request, expressed * either as an Array or as a space-delimited String. - * @param callable|null $httpHandler callback which delivers psr7 request - * @param array|null $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be * provided if you have one already available for use. * @param string $quotaProject specifies a project to bill for access * charges associated with the request. @@ -124,9 +119,9 @@ public static function getSubscriber(// @phpstan-ignore-line */ public static function getMiddleware( $scope = null, - ?callable $httpHandler = null, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null, $quotaProject = null ) { $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache, $quotaProject); @@ -140,31 +135,29 @@ public static function getMiddleware( * * @param string|string[] $scope the scope of the access request, expressed * either as an Array or as a space-delimited String. - * @param callable|null $httpHandler callback which delivers psr7 request - * @param array|null $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be * provided if you have one already available for use. - * @param string|null $quotaProject specifies a project to bill for access + * @param string $quotaProject specifies a project to bill for access * charges associated with the request. - * @param string|string[]|null $defaultScope The default scope to use if no + * @param string|string[] $defaultScope The default scope to use if no * user-defined scopes exist, expressed either as an Array or as a * space-delimited string. - * @param string|null $universeDomain Specifies a universe domain to use for the - * calling client library. - * @param null|false|LoggerInterface $logger A PSR3 compliant LoggerInterface. + * @param string $universeDomain Specifies a universe domain to use for the + * calling client library * * @return FetchAuthTokenInterface * @throws DomainException if no implementation can be obtained. */ public static function getCredentials( $scope = null, - ?callable $httpHandler = null, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null, $quotaProject = null, $defaultScope = null, - ?string $universeDomain = null, - null|false|LoggerInterface $logger = null, + string $universeDomain = null ) { $creds = null; $jsonKey = CredentialsLoader::fromEnv() @@ -177,7 +170,7 @@ public static function getCredentials( HttpClientCache::setHttpClient($client); } - $httpHandler = HttpHandlerFactory::build($client, $logger); + $httpHandler = HttpHandlerFactory::build($client); } if (is_null($quotaProject)) { @@ -222,18 +215,18 @@ public static function getCredentials( * ID token. * * @param string $targetAudience The audience for the ID token. - * @param callable|null $httpHandler callback which delivers psr7 request - * @param array|null $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be * provided if you have one already available for use. * @return AuthTokenMiddleware * @throws DomainException if no implementation can be obtained. */ public static function getIdTokenMiddleware( $targetAudience, - ?callable $httpHandler = null, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null ) { $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); @@ -249,18 +242,18 @@ public static function getIdTokenMiddleware( * ID token. * * @param string $targetAudience The audience for the ID token. - * @param callable|null $httpHandler callback which delivers psr7 request - * @param array|null $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be * provided if you have one already available for use. * @return ProxyAuthTokenMiddleware * @throws DomainException if no implementation can be obtained. */ public static function getProxyIdTokenMiddleware( $targetAudience, - ?callable $httpHandler = null, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null ) { $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); @@ -273,9 +266,9 @@ public static function getProxyIdTokenMiddleware( * token. * * @param string $targetAudience The audience for the ID token. - * @param callable|null $httpHandler callback which delivers psr7 request - * @param array|null $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface|null $cache A cache implementation, may be + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be * provided if you have one already available for use. * @return FetchAuthTokenInterface * @throws DomainException if no implementation can be obtained. @@ -283,9 +276,9 @@ public static function getProxyIdTokenMiddleware( */ public static function getIdTokenCredentials( $targetAudience, - ?callable $httpHandler = null, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null ) { $creds = null; $jsonKey = CredentialsLoader::fromEnv() @@ -305,11 +298,15 @@ public static function getIdTokenCredentials( throw new \InvalidArgumentException('json key is missing the type field'); } - $creds = match ($jsonKey['type']) { - 'authorized_user' => new UserRefreshCredentials(null, $jsonKey, $targetAudience), - 'service_account' => new ServiceAccountCredentials(null, $jsonKey, null, $targetAudience), - default => throw new InvalidArgumentException('invalid value in the type field') - }; + if ($jsonKey['type'] == 'authorized_user') { + throw new InvalidArgumentException('ID tokens are not supported for end user credentials'); + } + + if ($jsonKey['type'] != 'service_account') { + throw new InvalidArgumentException('invalid value in the type field'); + } + + $creds = new ServiceAccountCredentials(null, $jsonKey, null, $targetAudience); } elseif (self::onGce($httpHandler, $cacheConfig, $cache)) { $creds = new GCECredentials(null, null, $targetAudience); $creds->setIsOnGce(true); // save the credentials a trip to the metadata server @@ -324,36 +321,6 @@ public static function getIdTokenCredentials( return $creds; } - /** - * Returns a StdOutLogger instance - * - * @internal - * - * @return null|LoggerInterface - */ - public static function getDefaultLogger(): null|LoggerInterface - { - $loggingFlag = getenv(self::SDK_DEBUG_ENV_VAR); - - // Env var is not set - if (empty($loggingFlag)) { - return null; - } - - $loggingFlag = strtolower($loggingFlag); - - // Env Var is not true - if ($loggingFlag !== 'true') { - if ($loggingFlag !== 'false') { - trigger_error('The ' . self::SDK_DEBUG_ENV_VAR . ' is set, but it is set to another value than false or true. Logging is disabled'); - } - - return null; - } - - return new StdOutLogger(); - } - /** * @return string */ @@ -367,15 +334,15 @@ private static function notFound() } /** - * @param callable|null $httpHandler - * @param array|null $cacheConfig - * @param CacheItemPoolInterface|null $cache + * @param callable $httpHandler + * @param array $cacheConfig + * @param CacheItemPoolInterface $cache * @return bool */ private static function onGce( - ?callable $httpHandler = null, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null ) { $gceCacheConfig = []; foreach (['lifetime', 'prefix'] as $key) { diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php index 880ca1001..6d9244ba2 100644 --- a/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php +++ b/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php @@ -50,9 +50,9 @@ class AwsNativeSource implements ExternalAccountCredentialSourceInterface public function __construct( string $audience, string $regionalCredVerificationUrl, - ?string $regionUrl = null, - ?string $securityCredentialsUrl = null, - ?string $imdsv2SessionTokenUrl = null + string $regionUrl = null, + string $securityCredentialsUrl = null, + string $imdsv2SessionTokenUrl = null ) { $this->audience = $audience; $this->regionalCredVerificationUrl = $regionalCredVerificationUrl; @@ -61,7 +61,7 @@ public function __construct( $this->imdsv2SessionTokenUrl = $imdsv2SessionTokenUrl; } - public function fetchSubjectToken(?callable $httpHandler = null): string + public function fetchSubjectToken(callable $httpHandler = null): string { if (is_null($httpHandler)) { $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); @@ -103,7 +103,7 @@ public function fetchSubjectToken(?callable $httpHandler = null): string $headers['x-goog-cloud-target-resource'] = $this->audience; // Format headers as they're expected in the subject token - $formattedHeaders = array_map( + $formattedHeaders= array_map( fn ($k, $v) => ['key' => $k, 'value' => $v], array_keys($headers), $headers, diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php index f6255bec9..ce3bd9fda 100644 --- a/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php +++ b/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php @@ -88,12 +88,12 @@ class ExecutableSource implements ExternalAccountCredentialSourceInterface /** * @param string $command The string command to run to get the subject token. - * @param string|null $outputFile + * @param string $outputFile */ public function __construct( string $command, ?string $outputFile, - ?ExecutableHandler $executableHandler = null, + ExecutableHandler $executableHandler = null, ) { $this->command = $command; $this->outputFile = $outputFile; @@ -113,12 +113,12 @@ public function getCacheKey(): ?string } /** - * @param callable|null $httpHandler unused. + * @param callable $httpHandler unused. * @return string * @throws RuntimeException if the executable is not allowed to run. * @throws ExecutableResponseError if the executable response is invalid. */ - public function fetchSubjectToken(?callable $httpHandler = null): string + public function fetchSubjectToken(callable $httpHandler = null): string { // Check if the executable is allowed to run. if (getenv(self::GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES) !== '1') { diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php index 2e79119b8..00ac835a8 100644 --- a/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php +++ b/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php @@ -31,15 +31,15 @@ class FileSource implements ExternalAccountCredentialSourceInterface private ?string $subjectTokenFieldName; /** - * @param string $file The file to read the subject token from. - * @param string|null $format The format of the token in the file. Can be null or "json". - * @param string|null $subjectTokenFieldName The name of the field containing the token in the file. This is required - * when format is "json". + * @param string $file The file to read the subject token from. + * @param string $format The format of the token in the file. Can be null or "json". + * @param string $subjectTokenFieldName The name of the field containing the token in the file. This is required + * when format is "json". */ public function __construct( string $file, - ?string $format = null, - ?string $subjectTokenFieldName = null + string $format = null, + string $subjectTokenFieldName = null ) { $this->file = $file; @@ -53,7 +53,7 @@ public function __construct( $this->subjectTokenFieldName = $subjectTokenFieldName; } - public function fetchSubjectToken(?callable $httpHandler = null): string + public function fetchSubjectToken(callable $httpHandler = null): string { $contents = file_get_contents($this->file); if ($this->format === 'json') { diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php index d2f875ebf..6046d52fa 100644 --- a/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php +++ b/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php @@ -39,17 +39,17 @@ class UrlSource implements ExternalAccountCredentialSourceInterface private ?array $headers; /** - * @param string $url The URL to fetch the subject token from. - * @param string|null $format The format of the token in the response. Can be null or "json". - * @param string|null $subjectTokenFieldName The name of the field containing the token in the response. This is required + * @param string $url The URL to fetch the subject token from. + * @param string $format The format of the token in the response. Can be null or "json". + * @param string $subjectTokenFieldName The name of the field containing the token in the response. This is required * when format is "json". - * @param array|null $headers Request headers to send in with the request to the URL. + * @param array $headers Request headers to send in with the request to the URL. */ public function __construct( string $url, - ?string $format = null, - ?string $subjectTokenFieldName = null, - ?array $headers = null + string $format = null, + string $subjectTokenFieldName = null, + array $headers = null ) { $this->url = $url; @@ -64,7 +64,7 @@ public function __construct( $this->headers = $headers; } - public function fetchSubjectToken(?callable $httpHandler = null): string + public function fetchSubjectToken(callable $httpHandler = null): string { if (is_null($httpHandler)) { $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); diff --git a/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php index 5e4cfa53a..db29438ab 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php @@ -116,7 +116,7 @@ public static function onAppEngine() * As the AppIdentityService uses protobufs to fetch the access token, * the GuzzleHttp\ClientInterface instance passed in will not be used. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array { * A set of auth related metadata, containing the following * @@ -124,7 +124,7 @@ public static function onAppEngine() * @type string $expiration_time * } */ - public function fetchAuthToken(?callable $httpHandler = null) + public function fetchAuthToken(callable $httpHandler = null) { try { $this->checkAppEngineContext(); @@ -161,10 +161,10 @@ public function signBlob($stringToSign, $forceOpenSsl = false) * * Returns null if AppIdentityService is unavailable. * - * @param callable|null $httpHandler Not used by this type. + * @param callable $httpHandler Not used by this type. * @return string|null */ - public function getProjectId(?callable $httpHandler = null) + public function getProjectId(callable $httpHandler = null) { try { $this->checkAppEngineContext(); @@ -181,11 +181,11 @@ public function getProjectId(?callable $httpHandler = null) * * Subsequent calls to this method will return a cached value. * - * @param callable|null $httpHandler Not used in this implementation. + * @param callable $httpHandler Not used in this implementation. * @return string * @throws \Exception If AppEngine SDK or mock is not available. */ - public function getClientName(?callable $httpHandler = null) + public function getClientName(callable $httpHandler = null) { $this->checkAppEngineContext(); diff --git a/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php index 478063be1..3614d24d0 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php @@ -211,7 +211,7 @@ private static function buildCredentialSource(array $jsonKey): ExternalAccountCr /** * @param string $stsToken - * @param callable|null $httpHandler + * @param callable $httpHandler * * @return array { * A set of auth related metadata, containing the following @@ -220,7 +220,7 @@ private static function buildCredentialSource(array $jsonKey): ExternalAccountCr * @type int $expires_at * } */ - private function getImpersonatedAccessToken(string $stsToken, ?callable $httpHandler = null): array + private function getImpersonatedAccessToken(string $stsToken, callable $httpHandler = null): array { if (!isset($this->serviceAccountImpersonationUrl)) { throw new InvalidArgumentException( @@ -251,9 +251,7 @@ private function getImpersonatedAccessToken(string $stsToken, ?callable $httpHan } /** - * @param callable|null $httpHandler - * @param array $headers [optional] Metrics headers to be inserted - * into the token endpoint request present. + * @param callable $httpHandler * * @return array { * A set of auth related metadata, containing the following @@ -265,9 +263,9 @@ private function getImpersonatedAccessToken(string $stsToken, ?callable $httpHan * @type string $token_type (identity pool only) * } */ - public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + public function fetchAuthToken(callable $httpHandler = null) { - $stsToken = $this->auth->fetchAuthToken($httpHandler, $headers); + $stsToken = $this->auth->fetchAuthToken($httpHandler); if (isset($this->serviceAccountImpersonationUrl)) { return $this->getImpersonatedAccessToken($stsToken['access_token'], $httpHandler); @@ -327,13 +325,13 @@ public function getUniverseDomain(): string /** * Get the project ID. * - * @param callable|null $httpHandler Callback which delivers psr7 request - * @param string|null $accessToken The access token to use to sign the blob. If + * @param callable $httpHandler Callback which delivers psr7 request + * @param string $accessToken The access token to use to sign the blob. If * provided, saves a call to the metadata server for a new access * token. **Defaults to** `null`. * @return string|null */ - public function getProjectId(?callable $httpHandler = null, ?string $accessToken = null) + public function getProjectId(callable $httpHandler = null, string $accessToken = null) { if (isset($this->projectId)) { return $this->projectId; diff --git a/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php b/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php index ab6753bd8..8b7547816 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php @@ -100,7 +100,7 @@ class GCECredentials extends CredentialsLoader implements /** * The metadata path of the project ID. */ - const UNIVERSE_DOMAIN_URI_PATH = 'v1/universe/universe-domain'; + const UNIVERSE_DOMAIN_URI_PATH = 'v1/universe/universe_domain'; /** * The header whose presence indicates GCE presence. @@ -199,7 +199,7 @@ class GCECredentials extends CredentialsLoader implements private ?string $universeDomain; /** - * @param Iam|null $iam [optional] An IAM instance. + * @param Iam $iam [optional] An IAM instance. * @param string|string[] $scope [optional] the scope of the access request, * expressed either as an array or as a space-delimited string. * @param string $targetAudience [optional] The audience for the ID token. @@ -207,16 +207,16 @@ class GCECredentials extends CredentialsLoader implements * charges associated with the request. * @param string $serviceAccountIdentity [optional] Specify a service * account identity name to use instead of "default". - * @param string|null $universeDomain [optional] Specify a universe domain to use + * @param string $universeDomain [optional] Specify a universe domain to use * instead of fetching one from the metadata server. */ public function __construct( - ?Iam $iam = null, + Iam $iam = null, $scope = null, $targetAudience = null, $quotaProject = null, $serviceAccountIdentity = null, - ?string $universeDomain = null + string $universeDomain = null ) { $this->iam = $iam; @@ -355,10 +355,10 @@ public static function onAppEngineFlexible() * host. * If $httpHandler is not specified a the default HttpHandler is used. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return bool True if this a GCEInstance, false otherwise */ - public static function onGce(?callable $httpHandler = null) + public static function onGce(callable $httpHandler = null) { $httpHandler = $httpHandler ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); @@ -426,12 +426,12 @@ private static function detectResidencyWindows(string $registryProductKey): bool try { $productName = $shell->regRead($registryProductKey); - } catch (com_exception) { + } catch(com_exception) { // This means that we tried to read a key that doesn't exist on the registry // which might mean that it is a windows instance that is not on GCE return false; } - + return 0 === strpos($productName, self::PRODUCT_NAME); } @@ -441,9 +441,7 @@ private static function detectResidencyWindows(string $registryProductKey): bool * Fetches the auth tokens from the GCE metadata host if it is available. * If $httpHandler is not specified a the default HttpHandler is used. * - * @param callable|null $httpHandler callback which delivers psr7 request - * @param array $headers [optional] Headers to be inserted - * into the token endpoint request present. + * @param callable $httpHandler callback which delivers psr7 request * * @return array { * A set of auth related metadata, based on the token type. @@ -455,7 +453,7 @@ private static function detectResidencyWindows(string $registryProductKey): bool * } * @throws \Exception */ - public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + public function fetchAuthToken(callable $httpHandler = null) { $httpHandler = $httpHandler ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); @@ -471,7 +469,7 @@ public function fetchAuthToken(?callable $httpHandler = null, array $headers = [ $response = $this->getFromMetadata( $httpHandler, $this->tokenUri, - $this->applyTokenEndpointMetrics($headers, $this->targetAudience ? 'it' : 'at') + $this->applyTokenEndpointMetrics([], $this->targetAudience ? 'it' : 'at') ); if ($this->targetAudience) { @@ -526,10 +524,10 @@ public function getLastReceivedToken() * * Subsequent calls will return a cached value. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return string */ - public function getClientName(?callable $httpHandler = null) + public function getClientName(callable $httpHandler = null) { if ($this->clientName) { return $this->clientName; @@ -560,10 +558,10 @@ public function getClientName(?callable $httpHandler = null) * * Returns null if called outside GCE. * - * @param callable|null $httpHandler Callback which delivers psr7 request + * @param callable $httpHandler Callback which delivers psr7 request * @return string|null */ - public function getProjectId(?callable $httpHandler = null) + public function getProjectId(callable $httpHandler = null) { if ($this->projectId) { return $this->projectId; @@ -588,10 +586,10 @@ public function getProjectId(?callable $httpHandler = null) /** * Fetch the default universe domain from the metadata server. * - * @param callable|null $httpHandler Callback which delivers psr7 request + * @param callable $httpHandler Callback which delivers psr7 request * @return string */ - public function getUniverseDomain(?callable $httpHandler = null): string + public function getUniverseDomain(callable $httpHandler = null): string { if (null !== $this->universeDomain) { return $this->universeDomain; diff --git a/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php index 96d1df734..98780c6e0 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php @@ -71,7 +71,7 @@ public function getUpdateMetadataFunc() * * @param array $metadata metadata hashmap * @param string $unusedAuthUri optional auth uri - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * Note: this param is unused here, only included here for * consistency with other credentials class * @@ -80,7 +80,7 @@ public function getUpdateMetadataFunc() public function updateMetadata( $metadata, $unusedAuthUri = null, - ?callable $httpHandler = null + callable $httpHandler = null ) { $metadata_copy = $metadata; $metadata_copy[self::SELECTOR_KEY] = $this->selector; diff --git a/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php index b907d8d96..5d3522827 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php @@ -18,20 +18,12 @@ namespace Google\Auth\Credentials; -use Google\Auth\CacheTrait; use Google\Auth\CredentialsLoader; -use Google\Auth\FetchAuthTokenInterface; -use Google\Auth\HttpHandler\HttpClientCache; -use Google\Auth\HttpHandler\HttpHandlerFactory; use Google\Auth\IamSignerTrait; use Google\Auth\SignBlobInterface; -use GuzzleHttp\Psr7\Request; -use InvalidArgumentException; -use LogicException; class ImpersonatedServiceAccountCredentials extends CredentialsLoader implements SignBlobInterface { - use CacheTrait; use IamSignerTrait; private const CRED_TYPE = 'imp'; @@ -41,36 +33,19 @@ class ImpersonatedServiceAccountCredentials extends CredentialsLoader implements */ protected $impersonatedServiceAccountName; - protected FetchAuthTokenInterface $sourceCredentials; - - private string $serviceAccountImpersonationUrl; - /** - * @var string[] + * @var UserRefreshCredentials */ - private array $delegates; - - /** - * @var string|string[] - */ - private string|array $targetScope; - - private int $lifetime; + protected $sourceCredentials; /** * Instantiate an instance of ImpersonatedServiceAccountCredentials from a credentials file that - * has be created with the --impersonate-service-account flag. - * - * @param string|string[]|null $scope The scope of the access request, expressed either as an - * array or as a space-delimited string. - * @param string|array $jsonKey JSON credential file path or JSON array credentials { - * JSON credentials as an associative array. + * has be created with the --impersonated-service-account flag. * - * @type string $service_account_impersonation_url The URL to the service account - * @type string|FetchAuthTokenInterface $source_credentials The source credentials to impersonate - * @type int $lifetime The lifetime of the impersonated credentials - * @type string[] $delegates The delegates to impersonate - * } + * @param string|string[] $scope The scope of the access request, expressed either as an + * array or as a space-delimited string. + * @param string|array $jsonKey JSON credential file path or JSON credentials + * as an associative array. */ public function __construct( $scope, @@ -78,38 +53,30 @@ public function __construct( ) { if (is_string($jsonKey)) { if (!file_exists($jsonKey)) { - throw new InvalidArgumentException('file does not exist'); + throw new \InvalidArgumentException('file does not exist'); } $json = file_get_contents($jsonKey); if (!$jsonKey = json_decode((string) $json, true)) { - throw new LogicException('invalid json for auth config'); + throw new \LogicException('invalid json for auth config'); } } if (!array_key_exists('service_account_impersonation_url', $jsonKey)) { - throw new LogicException( + throw new \LogicException( 'json key is missing the service_account_impersonation_url field' ); } if (!array_key_exists('source_credentials', $jsonKey)) { - throw new LogicException('json key is missing the source_credentials field'); - } - if (is_array($jsonKey['source_credentials'])) { - if (!array_key_exists('type', $jsonKey['source_credentials'])) { - throw new InvalidArgumentException('json key source credentials are missing the type field'); - } - $jsonKey['source_credentials'] = CredentialsLoader::makeCredentials($scope, $jsonKey['source_credentials']); + throw new \LogicException('json key is missing the source_credentials field'); } - $this->targetScope = $scope ?? []; - $this->lifetime = $jsonKey['lifetime'] ?? 3600; - $this->delegates = $jsonKey['delegates'] ?? []; - - $this->serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url']; $this->impersonatedServiceAccountName = $this->getImpersonatedServiceAccountNameFromUrl( - $this->serviceAccountImpersonationUrl + $jsonKey['service_account_impersonation_url'] ); - $this->sourceCredentials = $jsonKey['source_credentials']; + $this->sourceCredentials = new UserRefreshCredentials( + $scope, + $jsonKey['source_credentials'] + ); } /** @@ -136,13 +103,13 @@ private function getImpersonatedServiceAccountNameFromUrl( * @param callable|null $unusedHttpHandler not used by this credentials type. * @return string Token issuer email */ - public function getClientName(?callable $unusedHttpHandler = null) + public function getClientName(callable $unusedHttpHandler = null) { return $this->impersonatedServiceAccountName; } /** - * @param callable|null $httpHandler + * @param callable $httpHandler * * @return array { * A set of auth related metadata, containing the following @@ -154,45 +121,13 @@ public function getClientName(?callable $unusedHttpHandler = null) * @type string $id_token * } */ - public function fetchAuthToken(?callable $httpHandler = null) + public function fetchAuthToken(callable $httpHandler = null) { - $httpHandler = $httpHandler ?? HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - - // The FetchAuthTokenInterface technically does not have a "headers" argument, but all of - // the implementations do. Additionally, passing in more parameters than the function has - // defined is allowed in PHP. So we'll just ignore the phpstan error here. - // @phpstan-ignore-next-line - $authToken = $this->sourceCredentials->fetchAuthToken( + // We don't support id token endpoint requests as of now for Impersonated Cred + return $this->sourceCredentials->fetchAuthToken( $httpHandler, $this->applyTokenEndpointMetrics([], 'at') ); - - $headers = $this->applyTokenEndpointMetrics([ - 'Content-Type' => 'application/json', - 'Cache-Control' => 'no-store', - 'Authorization' => sprintf('Bearer %s', $authToken['access_token'] ?? $authToken['id_token']), - ], 'at'); - - $body = [ - 'scope' => $this->targetScope, - 'delegates' => $this->delegates, - 'lifetime' => sprintf('%ss', $this->lifetime), - ]; - - $request = new Request( - 'POST', - $this->serviceAccountImpersonationUrl, - $headers, - (string) json_encode($body) - ); - - $response = $httpHandler($request); - $body = json_decode((string) $response->getBody(), true); - - return [ - 'access_token' => $body['accessToken'], - 'expires_at' => strtotime($body['expireTime']), - ]; } /** @@ -203,9 +138,7 @@ public function fetchAuthToken(?callable $httpHandler = null) */ public function getCacheKey() { - return $this->getFullCacheKey( - $this->serviceAccountImpersonationUrl . $this->sourceCredentials->getCacheKey() - ); + return $this->sourceCredentials->getCacheKey(); } /** diff --git a/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php index 5a2bef1c5..9b9e24b11 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php @@ -36,10 +36,10 @@ class InsecureCredentials implements FetchAuthTokenInterface /** * Fetches the auth token. In this case it returns an empty string. * - * @param callable|null $httpHandler + * @param callable $httpHandler * @return array{access_token:string} A set of auth related metadata */ - public function fetchAuthToken(?callable $httpHandler = null) + public function fetchAuthToken(callable $httpHandler = null) { return $this->token; } diff --git a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php index 3d23f71af..5e7915333 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php @@ -17,10 +17,8 @@ namespace Google\Auth\Credentials; -use Firebase\JWT\JWT; use Google\Auth\CredentialsLoader; use Google\Auth\GetQuotaProjectInterface; -use Google\Auth\Iam; use Google\Auth\OAuth2; use Google\Auth\ProjectIdProviderInterface; use Google\Auth\ServiceAccountSignerTrait; @@ -73,7 +71,6 @@ class ServiceAccountCredentials extends CredentialsLoader implements * @var string */ private const CRED_TYPE = 'sa'; - private const IAM_SCOPE = 'https://www.googleapis.com/auth/iam'; /** * The OAuth2 instance used to conduct authorization. @@ -114,12 +111,6 @@ class ServiceAccountCredentials extends CredentialsLoader implements */ private string $universeDomain; - /** - * Whether this is an ID token request or an access token request. Used when - * building the metric header. - */ - private bool $isIdTokenRequest = false; - /** * Create a new ServiceAccountCredentials. * @@ -167,7 +158,6 @@ public function __construct( $additionalClaims = []; if ($targetAudience) { $additionalClaims = ['target_audience' => $targetAudience]; - $this->isIdTokenRequest = true; } $this->auth = new OAuth2([ 'audience' => self::TOKEN_CREDENTIAL_URI, @@ -175,7 +165,6 @@ public function __construct( 'scope' => $scope, 'signingAlgorithm' => 'RS256', 'signingKey' => $jsonKey['private_key'], - 'signingKeyId' => $jsonKey['private_key_id'] ?? null, 'sub' => $sub, 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, 'additionalClaims' => $additionalClaims, @@ -200,9 +189,7 @@ public function useJwtAccessWithScope() } /** - * @param callable|null $httpHandler - * @param array $headers [optional] Headers to be inserted - * into the token endpoint request present. + * @param callable $httpHandler * * @return array { * A set of auth related metadata, containing the following @@ -212,7 +199,7 @@ public function useJwtAccessWithScope() * @type string $token_type * } */ - public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + public function fetchAuthToken(callable $httpHandler = null) { if ($this->useSelfSignedJwt()) { $jwtCreds = $this->createJwtAccessCredentials(); @@ -226,34 +213,9 @@ public function fetchAuthToken(?callable $httpHandler = null, array $headers = [ return $accessToken; } - - if ($this->isIdTokenRequest && $this->getUniverseDomain() !== self::DEFAULT_UNIVERSE_DOMAIN) { - $now = time(); - $jwt = Jwt::encode( - [ - 'iss' => $this->auth->getIssuer(), - 'sub' => $this->auth->getIssuer(), - 'scope' => self::IAM_SCOPE, - 'exp' => ($now + $this->auth->getExpiry()), - 'iat' => ($now - OAuth2::DEFAULT_SKEW_SECONDS), - ], - $this->auth->getSigningKey(), - $this->auth->getSigningAlgorithm(), - $this->auth->getSigningKeyId() - ); - // We create a new instance of Iam each time because the `$httpHandler` might change. - $idToken = (new Iam($httpHandler, $this->getUniverseDomain()))->generateIdToken( - $this->auth->getIssuer(), - $this->auth->getAdditionalClaims()['target_audience'], - $jwt, - $this->applyTokenEndpointMetrics($headers, 'it') - ); - return ['id_token' => $idToken]; - } - return $this->auth->fetchAuthToken( - $httpHandler, - $this->applyTokenEndpointMetrics($headers, $this->isIdTokenRequest ? 'it' : 'at') - ); + $authRequestType = empty($this->auth->getAdditionalClaims()['target_audience']) + ? 'at' : 'it'; + return $this->auth->fetchAuthToken($httpHandler, $this->applyTokenEndpointMetrics([], $authRequestType)); } /** @@ -296,10 +258,10 @@ public function getLastReceivedToken() * * Returns null if the project ID does not exist in the keyfile. * - * @param callable|null $httpHandler Not used by this credentials type. + * @param callable $httpHandler Not used by this credentials type. * @return string|null */ - public function getProjectId(?callable $httpHandler = null) + public function getProjectId(callable $httpHandler = null) { return $this->projectId; } @@ -309,13 +271,13 @@ public function getProjectId(?callable $httpHandler = null) * * @param array $metadata metadata hashmap * @param string $authUri optional auth uri - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array updated metadata hashmap */ public function updateMetadata( $metadata, $authUri = null, - ?callable $httpHandler = null + callable $httpHandler = null ) { // scope exists. use oauth implementation if (!$this->useSelfSignedJwt()) { @@ -373,10 +335,10 @@ public function setSub($sub) * * In this case, it returns the keyfile's client_email key. * - * @param callable|null $httpHandler Not used by this credentials type. + * @param callable $httpHandler Not used by this credentials type. * @return string */ - public function getClientName(?callable $httpHandler = null) + public function getClientName(callable $httpHandler = null) { return $this->auth->getIssuer(); } @@ -437,8 +399,8 @@ private function useSelfSignedJwt() return false; } - // Do not use self-signed JWT for ID tokens - if ($this->isIdTokenRequest) { + // If claims are set, this call is for "id_tokens" + if ($this->auth->getAdditionalClaims()) { return false; } diff --git a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php index 50373760b..7bdc21848 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php @@ -114,13 +114,13 @@ public function __construct($jsonKey, $scope = null) * * @param array $metadata metadata hashmap * @param string $authUri optional auth uri - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array updated metadata hashmap */ public function updateMetadata( $metadata, $authUri = null, - ?callable $httpHandler = null + callable $httpHandler = null ) { $scope = $this->auth->getScope(); if (empty($authUri) && empty($scope)) { @@ -135,11 +135,11 @@ public function updateMetadata( /** * Implements FetchAuthTokenInterface#fetchAuthToken. * - * @param callable|null $httpHandler + * @param callable $httpHandler * * @return null|array{access_token:string} A set of auth related metadata */ - public function fetchAuthToken(?callable $httpHandler = null) + public function fetchAuthToken(callable $httpHandler = null) { $audience = $this->auth->getAudience(); $scope = $this->auth->getScope(); @@ -196,10 +196,10 @@ public function getLastReceivedToken() * * Returns null if the project ID does not exist in the keyfile. * - * @param callable|null $httpHandler Not used by this credentials type. + * @param callable $httpHandler Not used by this credentials type. * @return string|null */ - public function getProjectId(?callable $httpHandler = null) + public function getProjectId(callable $httpHandler = null) { return $this->projectId; } @@ -209,10 +209,10 @@ public function getProjectId(?callable $httpHandler = null) * * In this case, it returns the keyfile's client_email key. * - * @param callable|null $httpHandler Not used by this credentials type. + * @param callable $httpHandler Not used by this credentials type. * @return string */ - public function getClientName(?callable $httpHandler = null) + public function getClientName(callable $httpHandler = null) { return $this->auth->getIssuer(); } diff --git a/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php index 326f6cd86..d40055562 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php @@ -20,8 +20,6 @@ use Google\Auth\CredentialsLoader; use Google\Auth\GetQuotaProjectInterface; use Google\Auth\OAuth2; -use InvalidArgumentException; -use LogicException; /** * Authenticates requests using User Refresh credentials. @@ -57,67 +55,48 @@ class UserRefreshCredentials extends CredentialsLoader implements GetQuotaProjec */ protected $quotaProject; - /** - * Whether this is an ID token request or an access token request. Used when - * building the metric header. - */ - private bool $isIdTokenRequest = false; - /** * Create a new UserRefreshCredentials. * - * @param string|string[]|null $scope the scope of the access request, expressed + * @param string|string[] $scope the scope of the access request, expressed * either as an Array or as a space-delimited String. * @param string|array $jsonKey JSON credential file path or JSON credentials * as an associative array - * @param string|null $targetAudience The audience for the ID token. */ public function __construct( $scope, - $jsonKey, - ?string $targetAudience = null + $jsonKey ) { if (is_string($jsonKey)) { if (!file_exists($jsonKey)) { - throw new InvalidArgumentException('file does not exist or is unreadable'); + throw new \InvalidArgumentException('file does not exist'); } $json = file_get_contents($jsonKey); if (!$jsonKey = json_decode((string) $json, true)) { - throw new LogicException('invalid json for auth config'); + throw new \LogicException('invalid json for auth config'); } } if (!array_key_exists('client_id', $jsonKey)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'json key is missing the client_id field' ); } if (!array_key_exists('client_secret', $jsonKey)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'json key is missing the client_secret field' ); } if (!array_key_exists('refresh_token', $jsonKey)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'json key is missing the refresh_token field' ); } - if ($scope && $targetAudience) { - throw new InvalidArgumentException( - 'Scope and targetAudience cannot both be supplied' - ); - } - $additionalClaims = []; - if ($targetAudience) { - $additionalClaims = ['target_audience' => $targetAudience]; - $this->isIdTokenRequest = true; - } $this->auth = new OAuth2([ 'clientId' => $jsonKey['client_id'], 'clientSecret' => $jsonKey['client_secret'], 'refresh_token' => $jsonKey['refresh_token'], 'scope' => $scope, 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, - 'additionalClaims' => $additionalClaims, ]); if (array_key_exists('quota_project_id', $jsonKey)) { $this->quotaProject = (string) $jsonKey['quota_project_id']; @@ -125,8 +104,8 @@ public function __construct( } /** - * @param callable|null $httpHandler - * @param array $headers [optional] Metrics headers to be inserted + * @param callable $httpHandler + * @param array $metricsHeader [optional] Metrics headers to be inserted * into the token endpoint request present. * This could be passed from ImersonatedServiceAccountCredentials as it uses * UserRefreshCredentials as source credentials. @@ -141,11 +120,12 @@ public function __construct( * @type string $id_token * } */ - public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + public function fetchAuthToken(callable $httpHandler = null, array $metricsHeader = []) { + // We don't support id token endpoint requests as of now for User Cred return $this->auth->fetchAuthToken( $httpHandler, - $this->applyTokenEndpointMetrics($headers, $this->isIdTokenRequest ? 'it' : 'at') + $this->applyTokenEndpointMetrics($metricsHeader, 'at') ); } diff --git a/lib/Google/vendor/google/auth/src/CredentialsLoader.php b/lib/Google/vendor/google/auth/src/CredentialsLoader.php index 6e21a27c0..746b957a9 100644 --- a/lib/Google/vendor/google/auth/src/CredentialsLoader.php +++ b/lib/Google/vendor/google/auth/src/CredentialsLoader.php @@ -85,7 +85,6 @@ public static function fromEnv() throw new \DomainException(self::unableToReadEnv($cause)); } $jsonKey = file_get_contents($path); - return json_decode((string) $jsonKey, true); } @@ -166,15 +165,15 @@ public static function makeCredentials( * * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token * @param array $httpClientOptions (optional) Array of request options to apply. - * @param callable|null $httpHandler (optional) http client to fetch the token. - * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched. + * @param callable $httpHandler (optional) http client to fetch the token. + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. * @return \GuzzleHttp\Client */ public static function makeHttpClient( FetchAuthTokenInterface $fetcher, array $httpClientOptions = [], - ?callable $httpHandler = null, - ?callable $tokenCallback = null + callable $httpHandler = null, + callable $tokenCallback = null ) { $middleware = new Middleware\AuthTokenMiddleware( $fetcher, diff --git a/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php b/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php index 1492c6991..041b18d51 100644 --- a/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php +++ b/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php @@ -1,5 +1,5 @@ |null $cacheConfig Configuration for the cache + * @param array $cacheConfig Configuration for the cache * @param CacheItemPoolInterface $cache */ public function __construct( FetchAuthTokenInterface $fetcher, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + array $cacheConfig = null, + CacheItemPoolInterface $cache ) { $this->fetcher = $fetcher; $this->cache = $cache; @@ -76,11 +76,11 @@ public function getFetcher() * Checks the cache for a valid auth token and fetches the auth tokens * from the supplied fetcher. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array the response * @throws \Exception */ - public function fetchAuthToken(?callable $httpHandler = null) + public function fetchAuthToken(callable $httpHandler = null) { if ($cached = $this->fetchAuthTokenFromCache()) { return $cached; @@ -112,10 +112,10 @@ public function getLastReceivedToken() /** * Get the client name from the fetcher. * - * @param callable|null $httpHandler An HTTP handler to deliver PSR7 requests. + * @param callable $httpHandler An HTTP handler to deliver PSR7 requests. * @return string */ - public function getClientName(?callable $httpHandler = null) + public function getClientName(callable $httpHandler = null) { if (!$this->fetcher instanceof SignBlobInterface) { throw new \RuntimeException( @@ -176,15 +176,15 @@ public function getQuotaProject() return null; } - /** + /* * Get the Project ID from the fetcher. * - * @param callable|null $httpHandler Callback which delivers psr7 request + * @param callable $httpHandler Callback which delivers psr7 request * @return string|null * @throws \RuntimeException If the fetcher does not implement * `Google\Auth\ProvidesProjectIdInterface`. */ - public function getProjectId(?callable $httpHandler = null) + public function getProjectId(callable $httpHandler = null) { if (!$this->fetcher instanceof ProjectIdProviderInterface) { throw new \RuntimeException( @@ -227,7 +227,7 @@ public function getUniverseDomain(): string * * @param array $metadata metadata hashmap * @param string $authUri optional auth uri - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array updated metadata hashmap * @throws \RuntimeException If the fetcher does not implement * `Google\Auth\UpdateMetadataInterface`. @@ -235,7 +235,7 @@ public function getUniverseDomain(): string public function updateMetadata( $metadata, $authUri = null, - ?callable $httpHandler = null + callable $httpHandler = null ) { if (!$this->fetcher instanceof UpdateMetadataInterface) { throw new \RuntimeException( diff --git a/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php b/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php index fbbd8b0c9..64659550b 100644 --- a/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php +++ b/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php @@ -25,10 +25,10 @@ interface FetchAuthTokenInterface /** * Fetches the auth tokens based on the current state. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array a hash of auth tokens */ - public function fetchAuthToken(?callable $httpHandler = null); + public function fetchAuthToken(callable $httpHandler = null); /** * Obtains a key that can used to cache the results of #fetchAuthToken. diff --git a/lib/Google/vendor/google/auth/src/GCECache.php b/lib/Google/vendor/google/auth/src/GCECache.php index d3dcd8c6c..804abdbe2 100644 --- a/lib/Google/vendor/google/auth/src/GCECache.php +++ b/lib/Google/vendor/google/auth/src/GCECache.php @@ -46,8 +46,8 @@ class GCECache * @param CacheItemPoolInterface $cache */ public function __construct( - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + array $cacheConfig = null, + CacheItemPoolInterface $cache = null ) { $this->cache = $cache; $this->cacheConfig = array_merge([ @@ -60,10 +60,10 @@ public function __construct( * Caches the result of onGce so the metadata server is not called multiple * times. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return bool True if this a GCEInstance, false otherwise */ - public function onGce(?callable $httpHandler = null) + public function onGce(callable $httpHandler = null) { if (is_null($this->cache)) { return GCECredentials::onGce($httpHandler); diff --git a/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php b/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php index ee2739eca..53a8865fd 100644 --- a/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php +++ b/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php @@ -16,35 +16,23 @@ */ namespace Google\Auth\HttpHandler; -use Google\Auth\Logging\LoggingTrait; -use Google\Auth\Logging\RpcLogEvent; use GuzzleHttp\ClientInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use Psr\Log\LoggerInterface; class Guzzle6HttpHandler { - use LoggingTrait; - /** * @var ClientInterface */ private $client; - /** - * @var null|LoggerInterface - */ - private $logger; - /** * @param ClientInterface $client - * @param null|LoggerInterface $logger */ - public function __construct(ClientInterface $client, ?LoggerInterface $logger = null) + public function __construct(ClientInterface $client) { $this->client = $client; - $this->logger = $logger; } /** @@ -56,19 +44,7 @@ public function __construct(ClientInterface $client, ?LoggerInterface $logger = */ public function __invoke(RequestInterface $request, array $options = []) { - $requestEvent = null; - - if ($this->logger) { - $requestEvent = $this->requestLog($request, $options); - } - - $response = $this->client->send($request, $options); - - if ($this->logger) { - $this->responseLog($response, $requestEvent); - } - - return $response; + return $this->client->send($request, $options); } /** @@ -81,60 +57,6 @@ public function __invoke(RequestInterface $request, array $options = []) */ public function async(RequestInterface $request, array $options = []) { - $requestEvent = null; - - if ($this->logger) { - $requestEvent = $this->requestLog($request, $options); - } - - $promise = $this->client->sendAsync($request, $options); - - if ($this->logger) { - $promise->then(function (ResponseInterface $response) use ($requestEvent) { - $this->responseLog($response, $requestEvent); - return $response; - }); - } - - return $promise; - } - - /** - * @internal - * @param RequestInterface $request - * @param array $options - */ - public function requestLog(RequestInterface $request, array $options): RpcLogEvent - { - $requestEvent = new RpcLogEvent(); - - $requestEvent->method = $request->getMethod(); - $requestEvent->url = (string) $request->getUri(); - $requestEvent->headers = $request->getHeaders(); - $requestEvent->payload = $request->getBody()->getContents(); - $requestEvent->retryAttempt = $options['retryAttempt'] ?? null; - $requestEvent->serviceName = $options['serviceName'] ?? null; - $requestEvent->processId = (int) getmypid(); - $requestEvent->requestId = $options['requestId'] ?? crc32((string) spl_object_id($request) . getmypid()); - - $this->logRequest($requestEvent); - - return $requestEvent; - } - - /** - * @internal - */ - public function responseLog(ResponseInterface $response, RpcLogEvent $requestEvent): void - { - $responseEvent = new RpcLogEvent($requestEvent->milliseconds); - - $responseEvent->headers = $response->getHeaders(); - $responseEvent->payload = $response->getBody()->getContents(); - $responseEvent->status = $response->getStatusCode(); - $responseEvent->processId = $requestEvent->processId; - $responseEvent->requestId = $requestEvent->requestId; - - $this->logResponse($responseEvent); + return $this->client->sendAsync($request, $options); } } diff --git a/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php b/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php index 0159c8d09..f4a62b967 100644 --- a/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php +++ b/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php @@ -37,7 +37,7 @@ class HttpClientCache * @param ClientInterface|null $client * @return void */ - public static function setHttpClient(?ClientInterface $client = null) + public static function setHttpClient(ClientInterface $client = null) { self::$httpClient = $client; } diff --git a/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php b/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php index 7b1bf045d..f19f87443 100644 --- a/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php +++ b/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php @@ -16,28 +16,23 @@ */ namespace Google\Auth\HttpHandler; -use Google\Auth\ApplicationDefaultCredentials; use GuzzleHttp\BodySummarizer; use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; use GuzzleHttp\HandlerStack; use GuzzleHttp\Middleware; -use Psr\Log\LoggerInterface; class HttpHandlerFactory { /** * Builds out a default http handler for the installed version of guzzle. * - * @param ClientInterface|null $client - * @param null|false|LoggerInterface $logger + * @param ClientInterface $client * @return Guzzle6HttpHandler|Guzzle7HttpHandler * @throws \Exception */ - public static function build( - ?ClientInterface $client = null, - null|false|LoggerInterface $logger = null, - ) { + public static function build(ClientInterface $client = null) + { if (is_null($client)) { $stack = null; if (class_exists(BodySummarizer::class)) { @@ -50,10 +45,6 @@ public static function build( $client = new Client(['handler' => $stack]); } - $logger = ($logger === false) - ? null - : $logger ?? ApplicationDefaultCredentials::getDefaultLogger(); - $version = null; if (defined('GuzzleHttp\ClientInterface::MAJOR_VERSION')) { $version = ClientInterface::MAJOR_VERSION; @@ -63,9 +54,9 @@ public static function build( switch ($version) { case 6: - return new Guzzle6HttpHandler($client, $logger); + return new Guzzle6HttpHandler($client); case 7: - return new Guzzle7HttpHandler($client, $logger); + return new Guzzle7HttpHandler($client); default: throw new \Exception('Version not supported'); } diff --git a/lib/Google/vendor/google/auth/src/Iam.php b/lib/Google/vendor/google/auth/src/Iam.php index b32ac6065..2f67f0009 100644 --- a/lib/Google/vendor/google/auth/src/Iam.php +++ b/lib/Google/vendor/google/auth/src/Iam.php @@ -36,7 +36,6 @@ class Iam const SIGN_BLOB_PATH = '%s:signBlob?alt=json'; const SERVICE_ACCOUNT_NAME = 'projects/-/serviceAccounts/%s'; private const IAM_API_ROOT_TEMPLATE = 'https://iamcredentials.UNIVERSE_DOMAIN/v1'; - private const GENERATE_ID_TOKEN_PATH = '%s:generateIdToken'; /** * @var callable @@ -46,10 +45,10 @@ class Iam private string $universeDomain; /** - * @param callable|null $httpHandler [optional] The HTTP Handler to send requests. + * @param callable $httpHandler [optional] The HTTP Handler to send requests. */ public function __construct( - ?callable $httpHandler = null, + callable $httpHandler = null, string $universeDomain = GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN ) { $this->httpHandler = $httpHandler @@ -74,6 +73,7 @@ public function __construct( */ public function signBlob($email, $accessToken, $stringToSign, array $delegates = []) { + $httpHandler = $this->httpHandler; $name = sprintf(self::SERVICE_ACCOUNT_NAME, $email); $apiRoot = str_replace('UNIVERSE_DOMAIN', $this->universeDomain, self::IAM_API_ROOT_TEMPLATE); $uri = $apiRoot . '/' . sprintf(self::SIGN_BLOB_PATH, $name); @@ -102,54 +102,9 @@ public function signBlob($email, $accessToken, $stringToSign, array $delegates = Utils::streamFor(json_encode($body)) ); - $res = ($this->httpHandler)($request); + $res = $httpHandler($request); $body = json_decode((string) $res->getBody(), true); return $body['signedBlob']; } - - /** - * Sign a string using the IAM signBlob API. - * - * Note that signing using IAM requires your service account to have the - * `iam.serviceAccounts.signBlob` permission, part of the "Service Account - * Token Creator" IAM role. - * - * @param string $clientEmail The service account email. - * @param string $targetAudience The audience for the ID token. - * @param string $bearerToken The token to authenticate the IAM request. - * @param array $headers [optional] Additional headers to send with the request. - * - * @return string The signed string, base64-encoded. - */ - public function generateIdToken( - string $clientEmail, - string $targetAudience, - string $bearerToken, - array $headers = [] - ): string { - $name = sprintf(self::SERVICE_ACCOUNT_NAME, $clientEmail); - $apiRoot = str_replace('UNIVERSE_DOMAIN', $this->universeDomain, self::IAM_API_ROOT_TEMPLATE); - $uri = $apiRoot . '/' . sprintf(self::GENERATE_ID_TOKEN_PATH, $name); - - $headers['Authorization'] = 'Bearer ' . $bearerToken; - - $body = [ - 'audience' => $targetAudience, - 'includeEmail' => true, - 'useEmailAzp' => true, - ]; - - $request = new Psr7\Request( - 'POST', - $uri, - $headers, - Utils::streamFor(json_encode($body)) - ); - - $res = ($this->httpHandler)($request); - $body = json_decode((string) $res->getBody(), true); - - return $body['token']; - } } diff --git a/lib/Google/vendor/google/auth/src/Logging/LoggingTrait.php b/lib/Google/vendor/google/auth/src/Logging/LoggingTrait.php deleted file mode 100644 index 2441a9bd7..000000000 --- a/lib/Google/vendor/google/auth/src/Logging/LoggingTrait.php +++ /dev/null @@ -1,137 +0,0 @@ - $event->timestamp, - 'severity' => strtoupper(LogLevel::DEBUG), - 'processId' => $event->processId ?? null, - 'requestId' => $event->requestId ?? null, - ]; - - $debugEvent = array_filter($debugEvent, fn ($value) => !is_null($value)); - - $jsonPayload = [ - 'request.method' => $event->method, - 'request.url' => $event->url, - 'request.headers' => $event->headers, - 'request.payload' => $this->truncatePayload($event->payload), - 'request.jwt' => $this->getJwtToken($event->headers ?? []), - 'retryAttempt' => $event->retryAttempt - ]; - - // Remove null values - $debugEvent['jsonPayload'] = array_filter($jsonPayload, fn ($value) => !is_null($value)); - - $stringifiedEvent = json_encode($debugEvent, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - - // There was an error stringifying the event, return to not break execution - if ($stringifiedEvent === false) { - return; - } - - $this->logger->debug($stringifiedEvent); - } - - /** - * @param RpcLogEvent $event - */ - private function logResponse(RpcLogEvent $event): void - { - $debugEvent = [ - 'timestamp' => $event->timestamp, - 'severity' => strtoupper(LogLevel::DEBUG), - 'processId' => $event->processId ?? null, - 'requestId' => $event->requestId ?? null, - 'jsonPayload' => [ - 'response.status' => $event->status, - 'response.headers' => $event->headers, - 'response.payload' => $this->truncatePayload($event->payload), - 'latencyMillis' => $event->latency, - ] - ]; - - // Remove null values - $debugEvent = array_filter($debugEvent, fn ($value) => !is_null($value)); - $debugEvent['jsonPayload'] = array_filter( - $debugEvent['jsonPayload'], - fn ($value) => !is_null($value) - ); - - $stringifiedEvent = json_encode($debugEvent, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - - // There was an error stringifying the event, return to not break execution - if ($stringifiedEvent !== false) { - $this->logger->debug($stringifiedEvent); - } - } - - /** - * @param array $headers - * @return null|array - */ - private function getJwtToken(array $headers): null|array - { - if (empty($headers)) { - return null; - } - - $tokenHeader = $headers['Authorization'] ?? ''; - $token = str_replace('Bearer ', '', $tokenHeader); - - if (substr_count($token, '.') !== 2) { - return null; - } - - [$header, $token, $_] = explode('.', $token); - - return [ - 'header' => base64_decode($header), - 'token' => base64_decode($token) - ]; - } - - /** - * @param null|string $payload - * @return string - */ - private function truncatePayload(null|string $payload): null|string - { - $maxLength = 500; - - if (is_null($payload) || strlen($payload) <= $maxLength) { - return $payload; - } - - return substr($payload, 0, $maxLength) . '...'; - } -} diff --git a/lib/Google/vendor/google/auth/src/Logging/RpcLogEvent.php b/lib/Google/vendor/google/auth/src/Logging/RpcLogEvent.php deleted file mode 100644 index 50e89fe2f..000000000 --- a/lib/Google/vendor/google/auth/src/Logging/RpcLogEvent.php +++ /dev/null @@ -1,136 +0,0 @@ - - */ - public null|array $headers = null; - - /** - * An array representation of JSON for the response or request - * - * @var null|string - */ - public null|string $payload = null; - - /** - * Status code for REST or gRPC methods - * - * @var null|int|string - */ - public null|int|string $status = null; - - /** - * The latency in milliseconds - * - * @var null|int - */ - public null|int $latency = null; - - /** - * The retry attempt number - * - * @var null|int - */ - public null|int $retryAttempt = null; - - /** - * The name of the gRPC method being called - * - * @var null|string - */ - public null|string $rpcName = null; - - /** - * The Service Name of the gRPC - * - * @var null|string $serviceName - */ - public null|string $serviceName = null; - - /** - * The Process ID for tracing logs - * - * @var null|int $processId - */ - public null|int $processId = null; - - /** - * The Request id for tracing logs - * - * @var null|int $requestId; - */ - public null|int $requestId = null; - - /** - * Creates an object with all the fields required for logging - * Passing a string representation of a timestamp calculates the difference between - * these two times and sets the latency field with the result. - * - * @param null|float $startTime (Optional) Parameter to calculate the latency - */ - public function __construct(null|float $startTime = null) - { - $this->timestamp = date(DATE_RFC3339); - - // Takes the micro time and convets it to millis - $this->milliseconds = round(microtime(true) * 1000); - - if ($startTime) { - $this->latency = (int) round($this->milliseconds - $startTime); - } - } -} diff --git a/lib/Google/vendor/google/auth/src/Logging/StdOutLogger.php b/lib/Google/vendor/google/auth/src/Logging/StdOutLogger.php deleted file mode 100644 index 27b1f0eb3..000000000 --- a/lib/Google/vendor/google/auth/src/Logging/StdOutLogger.php +++ /dev/null @@ -1,85 +0,0 @@ - - */ - private array $levelMapping = [ - LogLevel::EMERGENCY => 7, - LogLevel::ALERT => 6, - LogLevel::CRITICAL => 5, - LogLevel::ERROR => 4, - LogLevel::WARNING => 3, - LogLevel::NOTICE => 2, - LogLevel::INFO => 1, - LogLevel::DEBUG => 0, - ]; - private int $level; - - /** - * Constructs a basic PSR-3 logger class that logs into StdOut for GCP Logging - * - * @param string $level The level of the logger instance. - */ - public function __construct(string $level = LogLevel::DEBUG) - { - $this->level = $this->getLevelFromName($level); - } - - /** - * {@inheritdoc} - */ - public function log($level, string|Stringable $message, array $context = []): void - { - if ($this->getLevelFromName($level) < $this->level) { - return; - } - - print($message . "\n"); - } - - /** - * @param string $levelName - * @return int - * @throws InvalidArgumentException - */ - private function getLevelFromName(string $levelName): int - { - if (!array_key_exists($levelName, $this->levelMapping)) { - throw new InvalidArgumentException('The level supplied to the Logger is not valid'); - } - - return $this->levelMapping[$levelName]; - } -} diff --git a/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php b/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php index b8f2c514c..798766efa 100644 --- a/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php +++ b/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php @@ -59,13 +59,13 @@ class AuthTokenMiddleware * Creates a new AuthTokenMiddleware. * * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token - * @param callable|null $httpHandler (optional) callback which delivers psr7 request - * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched. + * @param callable $httpHandler (optional) callback which delivers psr7 request + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. */ public function __construct( FetchAuthTokenInterface $fetcher, - ?callable $httpHandler = null, - ?callable $tokenCallback = null + callable $httpHandler = null, + callable $tokenCallback = null ) { $this->fetcher = $fetcher; $this->httpHandler = $httpHandler; @@ -132,8 +132,7 @@ private function addAuthHeaders(RequestInterface $request) ) { $token = $this->fetcher->fetchAuthToken(); $request = $request->withHeader( - 'authorization', - 'Bearer ' . ($token['access_token'] ?? $token['id_token'] ?? '') + 'authorization', 'Bearer ' . ($token['access_token'] ?? $token['id_token'] ?? '') ); } else { $headers = $this->fetcher->updateMetadata($request->getHeaders(), null, $this->httpHandler); diff --git a/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php b/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php index 2c44871f9..0f9ee429f 100644 --- a/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php +++ b/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php @@ -53,13 +53,13 @@ class ProxyAuthTokenMiddleware * Creates a new ProxyAuthTokenMiddleware. * * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token - * @param callable|null $httpHandler (optional) callback which delivers psr7 request - * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched. + * @param callable $httpHandler (optional) callback which delivers psr7 request + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. */ public function __construct( FetchAuthTokenInterface $fetcher, - ?callable $httpHandler = null, - ?callable $tokenCallback = null + callable $httpHandler = null, + callable $tokenCallback = null ) { $this->fetcher = $fetcher; $this->httpHandler = $httpHandler; diff --git a/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php b/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php index f2f85cc16..8bb1d7a0b 100644 --- a/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php +++ b/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php @@ -54,14 +54,14 @@ class ScopedAccessTokenMiddleware * * @param callable $tokenFunc a token generator function * @param array|string $scopes the token authentication scopes - * @param array|null $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface|null $cache an implementation of CacheItemPoolInterface + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface */ public function __construct( callable $tokenFunc, $scopes, - ?array $cacheConfig = null, - ?CacheItemPoolInterface $cache = null + array $cacheConfig = null, + CacheItemPoolInterface $cache = null ) { $this->tokenFunc = $tokenFunc; if (!(is_string($scopes) || is_array($scopes))) { diff --git a/lib/Google/vendor/google/auth/src/OAuth2.php b/lib/Google/vendor/google/auth/src/OAuth2.php index c60b8827f..4019e258a 100644 --- a/lib/Google/vendor/google/auth/src/OAuth2.php +++ b/lib/Google/vendor/google/auth/src/OAuth2.php @@ -581,12 +581,12 @@ public function toJwt(array $config = []) /** * Generates a request for token credentials. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @param array $headers [optional] Additional headers to pass to * the token endpoint request. * @return RequestInterface the authorization Url. */ - public function generateCredentialsRequest(?callable $httpHandler = null, array $headers = []) + public function generateCredentialsRequest(callable $httpHandler = null, $headers = []) { $uri = $this->getTokenCredentialUri(); if (is_null($uri)) { @@ -611,9 +611,6 @@ public function generateCredentialsRequest(?callable $httpHandler = null, array break; case 'refresh_token': $params['refresh_token'] = $this->getRefreshToken(); - if (isset($this->getAdditionalClaims()['target_audience'])) { - $params['target_audience'] = $this->getAdditionalClaims()['target_audience']; - } $this->addClientCredentials($params); break; case self::JWT_URN: @@ -664,12 +661,12 @@ public function generateCredentialsRequest(?callable $httpHandler = null, array /** * Fetches the auth tokens based on the current state. * - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @param array $headers [optional] If present, add these headers to the token * endpoint request. * @return array the response */ - public function fetchAuthToken(?callable $httpHandler = null, array $headers = []) + public function fetchAuthToken(callable $httpHandler = null, $headers = []) { if (is_null($httpHandler)) { $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); @@ -727,7 +724,7 @@ public function getSubjectTokenFetcher(): ?ExternalAccountCredentialSourceInterf */ public function parseTokenResponse(ResponseInterface $resp) { - $body = (string) $resp->getBody(); + $body = (string)$resp->getBody(); if ($resp->hasHeader('Content-Type') && $resp->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded' ) { @@ -1012,13 +1009,13 @@ public function setRedirectUri($uri) if (!$this->isAbsoluteUri($uri)) { // "postmessage" is a reserved URI string in Google-land // @see https://developers.google.com/identity/sign-in/web/server-side-flow - if ('postmessage' !== (string) $uri) { + if ('postmessage' !== (string)$uri) { throw new InvalidArgumentException( 'Redirect URI must be absolute' ); } } - $this->redirectUri = (string) $uri; + $this->redirectUri = (string)$uri; } /** @@ -1130,7 +1127,7 @@ public function setGrantType($grantType) 'invalid grant type' ); } - $this->grantType = (string) $grantType; + $this->grantType = (string)$grantType; } } @@ -1463,7 +1460,7 @@ public function setExpiresIn($expiresIn) $this->issuedAt = null; } else { $this->issuedAt = time(); - $this->expiresIn = (int) $expiresIn; + $this->expiresIn = (int)$expiresIn; } } @@ -1686,11 +1683,11 @@ public function getLastReceivedToken() * * Alias of {@see Google\Auth\OAuth2::getClientId()}. * - * @param callable|null $httpHandler + * @param callable $httpHandler * @return string * @access private */ - public function getClientName(?callable $httpHandler = null) + public function getClientName(callable $httpHandler = null) { return $this->getClientId(); } @@ -1771,8 +1768,7 @@ private function getFirebaseJwtKeys($publicKey, $allowedAlgs) throw new \InvalidArgumentException( 'To have multiple allowed algorithms, You must provide an' . ' array of Firebase\JWT\Key objects.' - . ' See https://github.com/firebase/php-jwt for more information.' - ); + . ' See https://github.com/firebase/php-jwt for more information.'); } $allowedAlg = array_pop($allowedAlgs); } else { diff --git a/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php b/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php index 8d10c293a..0a41f7832 100644 --- a/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php +++ b/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php @@ -25,8 +25,8 @@ interface ProjectIdProviderInterface /** * Get the project ID. * - * @param callable|null $httpHandler Callback which delivers psr7 request + * @param callable $httpHandler Callback which delivers psr7 request * @return string|null */ - public function getProjectId(?callable $httpHandler = null); + public function getProjectId(callable $httpHandler = null); } diff --git a/lib/Google/vendor/google/auth/src/SignBlobInterface.php b/lib/Google/vendor/google/auth/src/SignBlobInterface.php index b3c2b0505..5f2c94414 100644 --- a/lib/Google/vendor/google/auth/src/SignBlobInterface.php +++ b/lib/Google/vendor/google/auth/src/SignBlobInterface.php @@ -36,9 +36,9 @@ public function signBlob($stringToSign, $forceOpenssl = false); /** * Returns the current Client Name. * - * @param callable|null $httpHandler callback which delivers psr7 request, if + * @param callable $httpHandler callback which delivers psr7 request, if * one is required to obtain a client name. * @return string */ - public function getClientName(?callable $httpHandler = null); + public function getClientName(callable $httpHandler = null); } diff --git a/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php b/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php index 5cf5b42cc..6d2e7d5d5 100644 --- a/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php +++ b/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php @@ -30,12 +30,12 @@ interface UpdateMetadataInterface * * @param array $metadata metadata hashmap * @param string $authUri optional auth uri - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array updated metadata hashmap */ public function updateMetadata( $metadata, $authUri = null, - ?callable $httpHandler = null + callable $httpHandler = null ); } diff --git a/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php b/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php index 486ec72a5..30d4060cf 100644 --- a/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php +++ b/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php @@ -44,13 +44,13 @@ public function getUpdateMetadataFunc() * * @param array $metadata metadata hashmap * @param string $authUri optional auth uri - * @param callable|null $httpHandler callback which delivers psr7 request + * @param callable $httpHandler callback which delivers psr7 request * @return array updated metadata hashmap */ public function updateMetadata( $metadata, $authUri = null, - ?callable $httpHandler = null + callable $httpHandler = null ) { $metadata_copy = $metadata; diff --git a/lib/Google/vendor/google/cloud-core/README.md b/lib/Google/vendor/google/cloud-core/README.md index 0f9dde29c..8c5e4b332 100644 --- a/lib/Google/vendor/google/cloud-core/README.md +++ b/lib/Google/vendor/google/cloud-core/README.md @@ -17,11 +17,6 @@ to the rest of the Google Cloud PHP components. $ composer require google/cloud-core ``` -### Debugging - -Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md) -for more information about the debugging tools. - ### Version This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in diff --git a/lib/Google/vendor/google/cloud-core/VERSION b/lib/Google/vendor/google/cloud-core/VERSION index f6c9d766c..4d5fde5bd 100644 --- a/lib/Google/vendor/google/cloud-core/VERSION +++ b/lib/Google/vendor/google/cloud-core/VERSION @@ -1 +1 @@ -1.60.1 +1.60.0 diff --git a/lib/Google/vendor/google/cloud-core/composer.json b/lib/Google/vendor/google/cloud-core/composer.json index 5c526a903..f84a2979e 100644 --- a/lib/Google/vendor/google/cloud-core/composer.json +++ b/lib/Google/vendor/google/cloud-core/composer.json @@ -12,13 +12,13 @@ "guzzlehttp/psr7": "^2.6", "monolog/monolog": "^2.9|^3.0", "psr/http-message": "^1.0|^2.0", - "google/gax": "^1.36.0" + "google/gax": "^1.34.0" }, "require-dev": { "phpunit/phpunit": "^9.0", "phpspec/prophecy-phpunit": "^2.0", "squizlabs/php_codesniffer": "2.*", - "phpdocumentor/reflection": "^5.3.3||^6.0", + "phpdocumentor/reflection": "^5.3.3", "phpdocumentor/reflection-docblock": "^5.3", "erusev/parsedown": "^1.6", "opis/closure": "^3", diff --git a/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php b/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php index 39897661f..156f1a322 100644 --- a/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php +++ b/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php @@ -1,7 +1,7 @@ token; } @@ -81,7 +81,7 @@ public function getLastReceivedToken() public function updateMetadata( $metadata, $authUri = null, - ?callable $httpHandler = null + callable $httpHandler = null ) { return $metadata; } diff --git a/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php b/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php index 245b7e962..d9900ea22 100644 --- a/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php @@ -20,6 +20,7 @@ use Google\ApiCore\ArrayTrait; use Google\ApiCore\Options\CallOptions; use Google\Protobuf\NullValue; +use Google\Cloud\Core\Duration; /** * @internal @@ -175,7 +176,7 @@ private function formatTimestampFromApi(array $timestamp) */ private function formatTimestampForApi($value) { - list($dt, $nanos) = $this->parseTimeString($value); + list ($dt, $nanos) = $this->parseTimeString($value); return [ 'seconds' => (int) $dt->format('U'), @@ -238,11 +239,11 @@ protected function constructGapic($gapicName, array $config) * * @return array The modified array */ - private function convertDataToProtos(array $input, array $map): array + private function convertDataToProtos(array $input, array $map) : array { foreach ($map as $key => $className) { if (isset($input[$key])) { - $input[$key] = $this->serializer->decodeMessage(new $className(), $input[$key]); + $input[$key] = $this->serializer->decodeMessage(new $className, $input[$key]); } } @@ -255,7 +256,7 @@ private function convertDataToProtos(array $input, array $map): array * We strictly treat the parameters allowed by `CallOptions` in GAX as the optional params * and everything else that is passed is passed to the Proto message constructor. */ - private function splitOptionalArgs(array $input, array $extraAllowedKeys = []): array + private function splitOptionalArgs(array $input, array $extraAllowedKeys = []) : array { $callOptionFields = array_keys((new CallOptions([]))->toArray()); $keys = array_merge($callOptionFields, $extraAllowedKeys); diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php b/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php index 0ee47ca57..b2b55983e 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php @@ -57,8 +57,8 @@ class BatchRunner * to use. **Defaults to** null. This is only for testing purpose. */ public function __construct( - ?ConfigStorageInterface $configStorage = null, - ?ProcessItemInterface $processor = null + ConfigStorageInterface $configStorage = null, + ProcessItemInterface $processor = null ) { if ($configStorage === null || $processor === null) { if ($this->isSysvIPCLoaded() && $this->isDaemonRunning()) { diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php index 591410e62..3ac284cf1 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php @@ -17,6 +17,8 @@ namespace Google\Cloud\Core\Batch; +use Opis\Closure\SerializableClosure; + /** * A trait to assist in the registering and processing of batch jobs. * diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php index 88ef74be6..dae64456f 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php @@ -32,10 +32,10 @@ trait InterruptTrait private function setupSignalHandlers() { // setup signal handlers - pcntl_signal(SIGTERM, [$this, 'sigHandler']); - pcntl_signal(SIGINT, [$this, 'sigHandler']); - pcntl_signal(SIGHUP, [$this, 'sigHandler']); - pcntl_signal(SIGALRM, [$this, 'sigHandler']); + pcntl_signal(SIGTERM, [$this, "sigHandler"]); + pcntl_signal(SIGINT, [$this, "sigHandler"]); + pcntl_signal(SIGHUP, [$this, "sigHandler"]); + pcntl_signal(SIGALRM, [$this, "sigHandler"]); } /** diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php b/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php index 8f66863ec..483c7eb3d 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php @@ -37,7 +37,7 @@ class Retry * * @param BatchRunner $runner [optional] **Defaults to** a new BatchRunner. */ - public function __construct(?BatchRunner $runner = null) + public function __construct(BatchRunner $runner = null) { $this->runner = $runner ?: new BatchRunner(); $this->initFailureFile(); diff --git a/lib/Google/vendor/google/cloud-core/src/ClientTrait.php b/lib/Google/vendor/google/cloud-core/src/ClientTrait.php index 2bd86cc1c..5df03e152 100644 --- a/lib/Google/vendor/google/cloud-core/src/ClientTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/ClientTrait.php @@ -17,8 +17,8 @@ namespace Google\Cloud\Core; -use Google\Auth\Credentials\GCECredentials; use Google\Auth\CredentialsLoader; +use Google\Auth\Credentials\GCECredentials; use Google\Cloud\Core\Compute\Metadata; use Google\Cloud\Core\Exception\GoogleException; @@ -256,7 +256,7 @@ protected function onGce($httpHandler) */ protected function getMetaData() { - return new Metadata(); + return new Metadata; } /** diff --git a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php index 15a5eea02..0f34adb5e 100644 --- a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php +++ b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php @@ -59,7 +59,7 @@ class Metadata /** * @param ReaderInterface $reader [optional] A metadata reader implementation. */ - public function __construct(?ReaderInterface $reader = null) + public function __construct(ReaderInterface $reader = null) { $this->reader = $reader ?: new HttpHandlerReader(); } @@ -142,7 +142,7 @@ public function getNumericProjectId() */ public function getProjectMetadata($key) { - $path = 'project/attributes/' . $key; + $path = 'project/attributes/'.$key; return $this->get($path); } @@ -159,7 +159,7 @@ public function getProjectMetadata($key) */ public function getInstanceMetadata($key) { - $path = 'instance/attributes/' . $key; + $path = 'instance/attributes/'.$key; return $this->get($path); } } diff --git a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php index a057b138c..d1d7b1530 100644 --- a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php +++ b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php @@ -36,7 +36,7 @@ class HttpHandlerReader implements ReaderInterface * @param callable $httpHandler [optional] An HTTP Handler capable of * accepting PSR7 requests and returning PSR7 responses. */ - public function __construct(?callable $httpHandler = null) + public function __construct(callable $httpHandler = null) { $this->httpHandler = $httpHandler ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); diff --git a/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php b/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php index f0ce26db9..8cd853076 100644 --- a/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php @@ -71,7 +71,7 @@ private function detectProjectId(array $config) if ($config['credentials'] && $config['credentials'] instanceof ProjectIdProviderInterface && $projectId = $config['credentials']->getProjectId()) { - return $projectId; + return $projectId; } if (getenv('GOOGLE_CLOUD_PROJECT')) { diff --git a/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php b/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php index 0db353d6f..b601eb677 100644 --- a/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php +++ b/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php @@ -65,7 +65,7 @@ class ServiceException extends GoogleException public function __construct( $message = null, $code = 0, - ?Exception $serviceException = null, + Exception $serviceException = null, array $metadata = [] ) { $this->serviceException = $serviceException; diff --git a/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php b/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php index 58eea5ee7..e5a041311 100644 --- a/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php +++ b/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php @@ -64,8 +64,8 @@ class ExponentialBackoff */ public function __construct( $retries = null, - ?callable $retryFunction = null, - ?callable $retryListener = null + callable $retryFunction = null, + callable $retryListener = null ) { $this->retries = $retries !== null ? (int) $retries : 3; $this->retryFunction = $retryFunction; diff --git a/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php b/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php index 7bcfa7601..9f8d3b50b 100644 --- a/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php +++ b/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php @@ -17,9 +17,10 @@ namespace Google\Cloud\Core; +use Google\Auth\HttpHandler\HttpHandlerFactory; +use Google\Cloud\Core\Exception; use Google\ApiCore\ApiException; use Google\ApiCore\Serializer; -use Google\Auth\HttpHandler\HttpHandlerFactory; use Google\Rpc\Code; /** @@ -76,7 +77,7 @@ public function __construct(array $config = []) $config += [ 'authHttpHandler' => null, - 'serializer' => new Serializer(), + 'serializer' => new Serializer, 'grpcOptions' => [] ]; diff --git a/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php b/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php index fac9527d7..bab9d6d32 100644 --- a/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php @@ -17,11 +17,13 @@ namespace Google\Cloud\Core; -use Google\ApiCore\CredentialsWrapper; use Google\Auth\GetUniverseDomainInterface; +use Google\ApiCore\CredentialsWrapper; use Google\Cloud\Core\Exception\NotFoundException; use Google\Cloud\Core\Exception\ServiceException; +use Google\Cloud\Core\GrpcRequestWrapper; use Google\Protobuf\NullValue; +use Google\Cloud\Core\Duration; /** * Provides shared functionality for gRPC service implementations. @@ -96,8 +98,8 @@ public function send(callable $request, array $args, $whitelisted = false) */ private function getGaxConfig( $version, - ?callable $authHttpHandler = null, - ?string $universeDomain = null + callable $authHttpHandler = null, + string $universeDomain = null ) { $config = [ 'libName' => 'gccl', @@ -276,7 +278,7 @@ private function formatTimestampFromApi(array $timestamp) */ private function formatTimestampForApi($value) { - list($dt, $nanos) = $this->parseTimeString($value); + list ($dt, $nanos) = $this->parseTimeString($value); return [ 'seconds' => (int) $dt->format('U'), diff --git a/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php b/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php index 7e1670a6e..a9e373fe7 100644 --- a/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php +++ b/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php @@ -19,10 +19,11 @@ use Google\ApiCore\Serializer; use Google\Cloud\Core\ArrayTrait; +use Google\Cloud\Core\Iam\PolicyBuilder; +use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Core\RequestHandler; use Google\Cloud\Iam\V1\GetIamPolicyRequest; use Google\Cloud\Iam\V1\GetPolicyOptions; -use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use InvalidArgumentException; @@ -151,7 +152,7 @@ public function setPolicy($policy, array $options = []) } $policy = $this->serializer->decodeMessage( - new Policy(), + new Policy, $policy ); diff --git a/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php b/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php index 3de89eb19..d22962e7c 100644 --- a/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php +++ b/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php @@ -17,8 +17,8 @@ namespace Google\Cloud\Core\Iam; -use BadMethodCallException; use InvalidArgumentException; +use BadMethodCallException; /** * Helper class for creating valid IAM policies @@ -284,7 +284,7 @@ public function result() private function validatePolicyVersion() { if (isset($this->version) && $this->version > 1) { - throw new BadMethodCallException('Helper methods cannot be ' . + throw new BadMethodCallException("Helper methods cannot be " . "invoked on policies with version {$this->version}."); } @@ -299,8 +299,8 @@ private function validateConditions() foreach ($this->bindings as $binding) { if (isset($binding['condition'])) { - throw new BadMethodCallException('Helper methods cannot ' . - 'be invoked on policies containing conditions.'); + throw new BadMethodCallException("Helper methods cannot " . + "be invoked on policies containing conditions."); } } } diff --git a/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php b/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php index 329a507e5..095228ed2 100644 --- a/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php @@ -36,12 +36,12 @@ protected function formatPayload($record, $message) } list($usec, $sec) = explode(' ', microtime()); - $usec = (int) (((float) $usec) * 1000000000); - $sec = (int) $sec; + $usec = (int)(((float)$usec)*1000000000); + $sec = (int)$sec; $payload = [ 'message' => $message, - 'timestamp' => ['seconds' => $sec, 'nanos' => $usec], + 'timestamp'=> ['seconds' => $sec, 'nanos' => $usec], 'thread' => '', 'severity' => $record['level_name'], ]; diff --git a/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php b/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php index ac9a04893..477d5f3ea 100644 --- a/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php @@ -19,6 +19,7 @@ use Google\Cloud\Core\Iterator\ItemIterator; use Google\Cloud\Core\Iterator\PageIterator; +use Google\Cloud\Core\LongRunning\LongRunningConnectionInterface; /** * Provide Long Running Operation support to Google Cloud PHP Clients. @@ -108,7 +109,7 @@ public function longRunningOperations(array $options = []) $resultLimit = $this->pluck('resultLimit', $options, false) ?: 0; - $options['name'] = $this->lroResource . '/operations'; + $options['name'] = $this->lroResource .'/operations'; return new ItemIterator( new PageIterator( diff --git a/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php b/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php index 90e133936..2c5cad0b6 100644 --- a/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php @@ -20,6 +20,7 @@ use Google\ApiCore\OperationResponse; use Google\ApiCore\Serializer; use Google\GAX\OperationResponse as GaxOperationResponse; +use Google\GAX\Serializer as GaxSerialzer; /** * Serializes and deserializes ApiCore LRO Response objects. diff --git a/lib/Google/vendor/google/cloud-core/src/PhpArray.php b/lib/Google/vendor/google/cloud-core/src/PhpArray.php index efd722657..f456e70da 100644 --- a/lib/Google/vendor/google/cloud-core/src/PhpArray.php +++ b/lib/Google/vendor/google/cloud-core/src/PhpArray.php @@ -18,10 +18,10 @@ namespace Google\Cloud\Core; use DrSlump\Protobuf; +use google\protobuf\Value; use google\protobuf\ListValue; use google\protobuf\NullValue; use google\protobuf\Struct; -use google\protobuf\Value; /** * Extend the Protobuf-PHP array codec to allow messages to match the format @@ -86,7 +86,7 @@ protected function encodeMessage(Protobuf\Message $message) if ($field->isRepeated()) { // Make sure the value is an array of values - $v = is_array($v) ? $v : [$v]; + $v = is_array($v) ? $v : array($v); $arr = []; foreach ($v as $k => $vv) { @@ -145,7 +145,7 @@ protected function decodeMessage(Protobuf\Message $message, $data) if ($field->isRepeated()) { // Make sure the value is an array of values - $v = is_array($v) && is_int(key($v)) ? $v : [$v]; + $v = is_array($v) && is_int(key($v)) ? $v : array($v); foreach ($v as $k => $vv) { $v[$k] = $this->filterValue($vv, $field); } diff --git a/lib/Google/vendor/google/cloud-core/src/RequestHandler.php b/lib/Google/vendor/google/cloud-core/src/RequestHandler.php index f650b942b..6e11b4d61 100644 --- a/lib/Google/vendor/google/cloud-core/src/RequestHandler.php +++ b/lib/Google/vendor/google/cloud-core/src/RequestHandler.php @@ -17,12 +17,15 @@ namespace Google\Cloud\Core; -use \Google\Protobuf\Internal\Message; -use Google\ApiCore\ApiException; -use Google\ApiCore\OperationResponse; use Google\ApiCore\Serializer; +use Google\Cloud\Core\ArrayTrait; use Google\Cloud\Core\Exception\NotFoundException; use Google\Cloud\Core\Exception\ServiceException; +use Google\Cloud\Core\TimeTrait; +use Google\Cloud\Core\WhitelistTrait; +use \Google\Protobuf\Internal\Message; +use Google\ApiCore\ApiException; +use Google\ApiCore\OperationResponse; /** * @internal @@ -73,7 +76,7 @@ public function __construct( ); } //@codeCoverageIgnoreEnd - + // Initialize the client classes and store them in memory $this->clients = []; foreach ($clientClasses as $className) { diff --git a/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php b/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php index 0f7c28afe..72440cd91 100644 --- a/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php @@ -17,14 +17,14 @@ namespace Google\Cloud\Core; -use \Google\Protobuf\Internal\Message; -use Google\ApiCore\OperationResponse; -use Google\ApiCore\PagedListResponse; use Google\ApiCore\ServerStream; -use Google\Cloud\Core\Exception\ServiceException; -use Google\Rpc\BadRequest; use Google\Rpc\Code; +use Google\ApiCore\PagedListResponse; +use Google\Cloud\Core\Exception\ServiceException; +use Google\ApiCore\OperationResponse; +use \Google\Protobuf\Internal\Message; use Google\Rpc\RetryInfo; +use Google\Rpc\BadRequest; /** * @internal @@ -140,7 +140,7 @@ private function convertToGoogleException(\Exception $ex): ServiceException if (!isset($this->metadataTypes[$type])) { continue; } - $metadataElement = new $this->metadataTypes[$type](); + $metadataElement = new $this->metadataTypes[$type]; $metadataElement->mergeFromString($binaryValue[0]); $metadata[] = $this->serializer->encodeMessage($metadataElement); } diff --git a/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php b/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php index 849d15f2b..eb8f76502 100644 --- a/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php +++ b/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php @@ -24,13 +24,15 @@ use Google\Auth\HttpHandler\Guzzle6HttpHandler; use Google\Auth\HttpHandler\HttpHandlerFactory; use Google\Auth\UpdateMetadataInterface; -use Google\Cloud\Core\Exception\GoogleException; use Google\Cloud\Core\Exception\ServiceException; +use Google\Cloud\Core\RequestWrapperTrait; +use Google\Cloud\Core\Exception\GoogleException; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Psr7\Utils; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; /** * The RequestWrapper is responsible for delivering and signing requests. @@ -368,8 +370,7 @@ private function addAuthHeaders(RequestInterface $request, FetchAuthTokenInterfa return $backoff->execute( function () use ($request, $fetcher) { if (!$fetcher instanceof UpdateMetadataInterface || - ( - $fetcher instanceof FetchAuthTokenCache && + ($fetcher instanceof FetchAuthTokenCache && !$fetcher->getFetcher() instanceof UpdateMetadataInterface ) ) { @@ -510,7 +511,7 @@ private function buildDefaultAsyncHandler() /** * Verify that the expected universe domain matches the universe domain from the credentials. */ - private function checkUniverseDomain(?FetchAuthTokenInterface $credentialsFetcher = null) + private function checkUniverseDomain(FetchAuthTokenInterface $credentialsFetcher = null) { if (false === $this->hasCheckedUniverse) { if ($this->universeDomain === '') { diff --git a/lib/Google/vendor/google/cloud-core/src/RestTrait.php b/lib/Google/vendor/google/cloud-core/src/RestTrait.php index 20b61cc00..70966a8a0 100644 --- a/lib/Google/vendor/google/cloud-core/src/RestTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/RestTrait.php @@ -122,7 +122,7 @@ public function send($resource, $method, array $options = [], $whitelisted = fal * @param string $apiEndpointTemplate * @return string */ - private function getApiEndpoint($default, array $config, ?string $apiEndpointTemplate = null) + private function getApiEndpoint($default, array $config, string $apiEndpointTemplate = null) { // If the $default parameter is provided, or the user has set an "apiEndoint" config option, // fall back to the previous behavior. diff --git a/lib/Google/vendor/google/cloud-core/src/Retry.php b/lib/Google/vendor/google/cloud-core/src/Retry.php index 6083b5857..67b6000b4 100644 --- a/lib/Google/vendor/google/cloud-core/src/Retry.php +++ b/lib/Google/vendor/google/cloud-core/src/Retry.php @@ -54,7 +54,7 @@ class Retry public function __construct( $retries, callable $delayFunction, - ?callable $retryFunction = null + callable $retryFunction = null ) { $this->retries = $retries !== null ? (int) $retries : 3; $this->delayFunction = $delayFunction; diff --git a/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php b/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php index a3824fa43..9a5ac3f4f 100644 --- a/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php +++ b/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php @@ -49,8 +49,6 @@ * * Please note that unless otherwise noted the examples below take advantage of * [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). - * - * @deprecated */ class ServiceBuilder { @@ -317,6 +315,7 @@ public function storage(array $config = []) return $this->createClient(StorageClient::class, 'storage', $config); } + /** * Google Stackdriver Trace allows you to collect latency data from your applications * and display it in the Google Cloud Platform Console. Find more information at diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php b/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php index 213dd6dde..d6acbca9c 100644 --- a/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php +++ b/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php @@ -25,7 +25,7 @@ class ArrayHasSameValuesToken implements TokenInterface * @experimental * @internal */ - public function __construct($value, ?StringUtil $util = null) + public function __construct($value, StringUtil $util = null) { $this->value = $value; $this->util = $util ?: new StringUtil(); diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php index 7adc137e2..6c4b7b427 100644 --- a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php +++ b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php @@ -17,8 +17,6 @@ namespace Google\Cloud\Core\Testing\Reflection; -use phpDocumentor\Reflection\Php\Factory\Argument; - /** * Class for determining which verison of phpdocumentor/reflection is being used. * @internal @@ -30,8 +28,6 @@ class ReflectionHandlerFactory */ public static function create() { - return class_exists(Argument::class) - ? new ReflectionHandlerV5() - : new ReflectionHandlerV6(); + return new ReflectionHandlerV5(); } } diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php index ea4e2b001..9f61f3938 100644 --- a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php +++ b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php @@ -99,33 +99,14 @@ public function classes(array $files) } /** - * Split this into a separate method because ReflectionHandler V6 looks - * different + * @return ProjectFactory */ - protected function createParser() + public function createProjectFactory() { - return (new ParserFactory())->create( + $parser = (new ParserFactory())->create( ParserFactory::ONLY_PHP7, new Lexer\Emulative(['phpVersion' => Lexer\Emulative::PHP_8_0]) ); - } - - /** - * Split this into a separate method because V6 does not support it - */ - protected function getAdditionalStrategies() - { - return [ - new Factory\Argument(new PrettyPrinter()) // @phpstan-ignore-line - ]; - } - - /** - * @return ProjectFactory - */ - public function createProjectFactory() - { - $parser = $this->createParser(); $nodeTraverser = new NodeTraverser(); $nodeTraverser->addVisitor(new NameResolver()); $nodeTraverser->addVisitor(new ElementNameResolver()); @@ -138,6 +119,7 @@ public function createProjectFactory() $strategies = new ProjectFactoryStrategies( [ new Factory\Namespace_(), + new Factory\Argument(new PrettyPrinter()), new Factory\Class_($docblockFactory), new Factory\Enum_($docblockFactory), new Factory\EnumCase($docblockFactory, new PrettyPrinter()), @@ -152,7 +134,7 @@ public function createProjectFactory() new Factory\Trait_($docblockFactory), new Factory\IfStatement(), new TraitUse(), - ] + $this->getAdditionalStrategies() + ] ); $strategies->addStrategy( diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV6.php b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV6.php deleted file mode 100644 index b04a9efe0..000000000 --- a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV6.php +++ /dev/null @@ -1,46 +0,0 @@ -createForVersion($phpVersion); - } - - /** - * @see ReflectionHandlerV5 - */ - protected function getAdditionalStrategies() - { - return []; - } -} diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php b/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php index 820d9f194..f29bda287 100644 --- a/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php +++ b/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php @@ -90,7 +90,7 @@ public function add($toDelete) * @experimental * @internal */ - public function process(?callable $action = null) + public function process(callable $action = null) { if ($action) { $action($this->queue); diff --git a/lib/Google/vendor/google/cloud-core/src/TimeTrait.php b/lib/Google/vendor/google/cloud-core/src/TimeTrait.php index 6e6a650d2..773729b8b 100644 --- a/lib/Google/vendor/google/cloud-core/src/TimeTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/TimeTrait.php @@ -38,7 +38,7 @@ private function parseTimeString($timestamp) $subSeconds = $matches[1] ?? '0'; if (strlen($subSeconds) > 6) { - $timestamp = str_replace('.' . $subSeconds, '.' . substr($subSeconds, 0, 6), $timestamp); + $timestamp = str_replace('.'. $subSeconds, '.' . substr($subSeconds, 0, 6), $timestamp); } $dt = new \DateTimeImmutable($timestamp); diff --git a/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php b/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php index 78ea1d355..4ed589e2f 100644 --- a/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php @@ -18,6 +18,8 @@ namespace Google\Cloud\Core; +use Google\Cloud\Core\Timestamp; + /** * Helper methods to work on Google\Cloud\Core\Timestamp. * @internal diff --git a/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php b/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php index ecea6703f..220a2a165 100644 --- a/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php +++ b/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php @@ -19,6 +19,7 @@ use Google\Cloud\Core\Exception\GoogleException; use Google\Cloud\Core\Exception\ServiceException; +use Google\Cloud\Core\Exception\UploadException; use Google\Cloud\Core\JsonTrait; use Google\Cloud\Core\RequestWrapper; use GuzzleHttp\Promise\PromiseInterface; diff --git a/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php b/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php index 1e9f913c0..f1582702f 100644 --- a/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php @@ -37,7 +37,7 @@ trait ValidateTrait private function validateBatch( array $input, $type, - ?callable $additionalCheck = null + callable $additionalCheck = null ) { foreach ($input as $element) { if (!($element instanceof $type)) { diff --git a/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php b/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php index c9cd904bb..ddb39b390 100644 --- a/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php @@ -47,7 +47,7 @@ public function createTimestampWithNanos($timestamp, $returnType = Timestamp::cl $dt = $this->createDateTimeFromSeconds($timestamp['seconds']); $nanos = $timestamp['nanos']; } else { - list($dt, $nanos) = $this->parseTimeString($timestamp); + list ($dt, $nanos) = $this->parseTimeString($timestamp); } return new $returnType($dt, $nanos); diff --git a/lib/Google/vendor/google/cloud-core/unit-bootstrap.php b/lib/Google/vendor/google/cloud-core/unit-bootstrap.php index 001e59dd2..864cd9436 100644 --- a/lib/Google/vendor/google/cloud-core/unit-bootstrap.php +++ b/lib/Google/vendor/google/cloud-core/unit-bootstrap.php @@ -1,9 +1,9 @@ register(new MessageAwareArrayComparator()); diff --git a/lib/Google/vendor/google/cloud-storage/VERSION b/lib/Google/vendor/google/cloud-storage/VERSION index 50aceaa7b..5525f03fa 100644 --- a/lib/Google/vendor/google/cloud-storage/VERSION +++ b/lib/Google/vendor/google/cloud-storage/VERSION @@ -1 +1 @@ -1.45.0 +1.48.1 diff --git a/lib/Google/vendor/google/cloud-storage/src/Bucket.php b/lib/Google/vendor/google/cloud-storage/src/Bucket.php index 450c2aa47..6abec40c8 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Bucket.php +++ b/lib/Google/vendor/google/cloud-storage/src/Bucket.php @@ -707,7 +707,7 @@ public function restore($name, $generation, array $options = []) * value must be UTF-8 encoded. See: * https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-object-glob * } - * @return ObjectIterator + * @return ObjectIterator */ public function objects(array $options = []) { @@ -902,6 +902,7 @@ public function notifications(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false); + /** @var ItemIterator */ return new ItemIterator( new PageIterator( function (array $notification) { @@ -1177,6 +1178,9 @@ public function compose(array $sourceObjects, $name, array $options = []) * @param array $options [optional] { * Configuration options. * + * @type string $generation If present, selects a specific soft-deleted + * version of this bucket instead of the live version. + * This parameter is required if softDeleted is set to true. * @type string $ifMetagenerationMatch Makes the return of the bucket * metadata conditional on whether the bucket's current * metageneration matches the given value. @@ -1185,6 +1189,8 @@ public function compose(array $sourceObjects, $name, array $options = []) * metageneration does not match the given value. * @type string $projection Determines which properties to return. May * be either `"full"` or `"noAcl"`. + * @type bool $softDeleted If true, returns the soft-deleted bucket. + * This parameter is required if generation is specified. * } * @return array */ @@ -1208,6 +1214,9 @@ public function info(array $options = []) * @param array $options [optional] { * Configuration options. * + * @type string $generation If present, selects a specific soft-deleted + * version of this bucket instead of the live version. + * This parameter is required if softDeleted is set to true. * @type string $ifMetagenerationMatch Makes the return of the bucket * metadata conditional on whether the bucket's current * metageneration matches the given value. @@ -1216,6 +1225,8 @@ public function info(array $options = []) * metageneration does not match the given value. * @type string $projection Determines which properties to return. May * be either `"full"` or `"noAcl"`. + * @type bool $softDeleted If true, returns the soft-deleted bucket. + * This parameter is required if generation is specified. * } * @return array */ diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php b/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php index ea429f5bc..5173b21c0 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php +++ b/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php @@ -55,6 +55,11 @@ public function patchAcl(array $args = []); */ public function deleteBucket(array $args = []); + /** + * @param array $args + */ + public function restoreBucket(array $args = []); + /** * @param array $args */ @@ -110,6 +115,11 @@ public function copyObject(array $args = []); */ public function rewriteObject(array $args = []); + /** + * @param array $args + */ + public function moveObject(array $args = []); + /** * @param array $args */ diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php b/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php index 2f89fe309..928087478 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php +++ b/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php @@ -186,6 +186,14 @@ public function deleteBucket(array $args = []) return $this->send('buckets', 'delete', $args); } + /** + * @param array $args + */ + public function restoreBucket(array $args = []) + { + return $this->send('buckets', 'restore', $args); + } + /** * @param array $args */ @@ -250,6 +258,14 @@ public function rewriteObject(array $args = []) return $this->send('objects', 'rewrite', $args); } + /** + * @param array $args + */ + public function moveObject(array $args = []) + { + return $this->send('objects', 'move', $args); + } + /** * @param array $args */ @@ -316,7 +332,11 @@ public function downloadObject(array $args = []) &$attempt, ) { // if the exception has a response for us to use - if ($e instanceof RequestException && $e->hasResponse()) { + if ($e instanceof RequestException + && $e->hasResponse() + && $e->getResponse()->getStatusCode() >= 200 + && $e->getResponse()->getStatusCode() < 300 + ) { $msg = (string) $e->getResponse()->getBody(); $fetchedStream = Utils::streamFor($msg); diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json b/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json index 3a625cc96..431263d70 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json +++ b/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json @@ -428,6 +428,11 @@ ] } }, + "generation": { + "type": "string", + "description": "The version of the bucket.", + "format": "int64" + }, "owner": { "type": "object", "description": "The owner of the bucket. This is always the project team's owner group.", @@ -501,6 +506,16 @@ } } }, + "softDeleteTime": { + "type": "string", + "description": "The time at which the bucket was soft-deleted.", + "format": "date-time" + }, + "hardDeleteTime": { + "type": "string", + "description": "The time when a soft-deleted bucket is permanently deleted and can no longer be restored.", + "format": "date-time" + }, "storageClass": { "type": "string", "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes." @@ -2277,6 +2292,12 @@ "required": true, "location": "path" }, + "generation": { + "type": "string", + "description": "If present, selects a specific soft-deleted version of this bucket instead of the live version. This parameter is required if softDeleted is set to true.", + "format": "int64", + "location": "query" + }, "ifMetagenerationMatch": { "type": "string", "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", @@ -2306,6 +2327,11 @@ "type": "string", "description": "The project to be billed for this request. Required for Requester Pays buckets.", "location": "query" + }, + "softDeleted": { + "type": "boolean", + "description": "If true, returns the soft-deleted bucket. This parameter is required if generation is specified.", + "location": "query" } }, "parameterOrder": [ @@ -2497,6 +2523,11 @@ "type": "string", "description": "The project to be billed for this request.", "location": "query" + }, + "softDeleted": { + "type": "boolean", + "description": "If set to true, only soft-deleted bucket versions are listed as distinct results in order of bucket name and generation number. The default value is false.", + "location": "query" } }, "parameterOrder": [ @@ -2816,6 +2847,51 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.full_control" ] + }, + "restore": { + "id": "storage.buckets.restore", + "path": "b/{bucket}/restore", + "httpMethod": "POST", + "description": "Restores a soft-deleted bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket to be restored.", + "required": true, + "location": "path" + }, + "generation": { + "type": "string", + "description": "The specific version of the bucket to be restored.", + "required": true, + "format": "int64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "generation" + ], + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] } } }, @@ -4905,6 +4981,101 @@ "https://www.googleapis.com/auth/devstorage.full_control" ] }, + "move": { + "id": "storage.objects.move", + "path": "b/{bucket}/o/{sourceObject}/moveTo/o/{destinationObject}", + "httpMethod": "POST", + "description": "Moves a source object to a destination object. Optionally overrides metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to find the source object.", + "required": true, + "location": "path" + }, + "sourceObject": { + "type": "string", + "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "destinationObject": { + "type": "string", + "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "sourceObject", + "destinationObject" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, "rewrite": { "id": "storage.objects.rewrite", "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", diff --git a/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php b/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php index 254bc5e70..ece53f7a0 100644 --- a/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php +++ b/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php @@ -23,6 +23,8 @@ * ObjectIterator * * Iterates over a set of {@see StorageObject} items. + * + * @implements \Iterator */ class ObjectIterator implements \Iterator { diff --git a/lib/Google/vendor/google/cloud-storage/src/StorageClient.php b/lib/Google/vendor/google/cloud-storage/src/StorageClient.php index b14e52c28..23355325c 100644 --- a/lib/Google/vendor/google/cloud-storage/src/StorageClient.php +++ b/lib/Google/vendor/google/cloud-storage/src/StorageClient.php @@ -47,7 +47,7 @@ class StorageClient use ArrayTrait; use ClientTrait; - const VERSION = '1.45.0'; + const VERSION = '1.48.1'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/devstorage.full_control'; const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only'; @@ -148,9 +148,19 @@ public function __construct(array $config = []) * will be used. If a string, that string will be used as the * userProject argument, and that project will be billed for the * request. **Defaults to** `false`. + * @param array $options [optional] { + * Configuration Options. + * + * @type bool $softDeleted If set to true, only soft-deleted bucket versions + * are listed as distinct results in order of bucket name and generation + * number. The default value is false. + * @type string $generation If present, selects a specific soft-deleted version + * of this bucket instead of the live version. This parameter is required if + * softDeleted is set to true. + * } * @return Bucket */ - public function bucket($name, $userProject = false) + public function bucket($name, $userProject = false, array $options = []) { if (!$userProject) { $userProject = null; @@ -158,7 +168,7 @@ public function bucket($name, $userProject = false) $userProject = $this->projectId; } - return new Bucket($this->connection, $name, [ + return new Bucket($this->connection, $name, $options + [ 'requesterProjectId' => $userProject ]); } @@ -200,6 +210,9 @@ public function bucket($name, $userProject = false) * return the specified fields. * @type string $userProject If set, this is the ID of the project which * will be billed for the request. + * @type bool $softDeleted If set to true, only soft-deleted bucket versions + * are listed as distinct results in order of bucket name and generation + * number. The default value is false. * @type bool $bucketUserProject If true, each returned instance will * have `$userProject` set to the value of `$options.userProject`. * If false, `$options.userProject` will be used ONLY for the @@ -238,6 +251,38 @@ function (array $bucket) use ($userProject) { ); } + /** + * Restores a soft-deleted bucket. + * + * Example: + * ``` + * $bucket = $storage->bucket->restore('my-bucket'); + * ``` + * + * @param string $name The name of the bucket to restore. + * @param string $generation The specific version of the bucket to be restored. + * @param array $options [optional] { + * Configuration Options. + * + * @type string $projection Determines which properties to return. May + * be either `"full"` or `"noAcl"`. **Defaults to** `"noAcl"`, + * unless the bucket resource specifies acl or defaultObjectAcl + * properties, when it defaults to `"full"`. + * } + * @return Bucket + */ + public function restore(string $name, string $generation, array $options = []) + { + $res = $this->connection->restoreBucket([ + 'bucket' => $name, + 'generation' => $generation, + ] + $options); + return new Bucket( + $this->connection, + $name + ); + } + /** * Create a bucket. Bucket names must be unique as Cloud Storage uses a flat * namespace. For more information please see diff --git a/lib/Google/vendor/google/cloud-storage/src/StorageObject.php b/lib/Google/vendor/google/cloud-storage/src/StorageObject.php index e2c207a12..5aa126002 100644 --- a/lib/Google/vendor/google/cloud-storage/src/StorageObject.php +++ b/lib/Google/vendor/google/cloud-storage/src/StorageObject.php @@ -477,6 +477,76 @@ public function rewrite($destination, array $options = []) ); } + /** + * Move an object within a bucket with HNS enabled. + * + * This method copies data using multiple requests so large objects can be + * copied with a normal length timeout per request rather than one very long + * timeout for a single request. + * + * Example: + * ``` + * // Provide your destination object as a string. + * $moveObject = $object->move('newObject.txt'); + * ``` + * + * @see https://cloud.google.com/storage/docs/json_api/v1/objects/move Objects move API documentation. + * + * @param string $destinationObject The destination object. + * @param array $options [optional] + * Configuration options. + * + * @type string $ifGenerationMatch Makes the operation conditional on + * whether the destination object's current generation matches the + * given value. + * @type string $ifGenerationNotMatch Makes the operation conditional on + * whether the destination object's current generation does not + * match the given value. + * @type string $ifMetagenerationMatch Makes the operation conditional + * on whether the destination object's current metageneration + * matches the given value. + * @type string $ifMetagenerationNotMatch Makes the operation + * conditional on whether the destination object's current + * metageneration does not match the given value. + * @type string $ifSourceGenerationMatch Makes the operation conditional + * on whether the source object's current generation matches the + * given value. + * @type string $ifSourceGenerationNotMatch Makes the operation + * conditional on whether the source object's current generation + * does not match the given value. + * @type string $ifSourceMetagenerationMatch Makes the operation + * conditional on whether the source object's current + * metageneration matches the given value. + * @type string $ifSourceMetagenerationNotMatch Makes the operation + * conditional on whether the source object's current + * metageneration does not match the given value. + * + * @return StorageObject + * @throws \InvalidArgumentException + */ + public function move($destinationObject, array $options = []) + { + if (!is_string($destinationObject)) { + throw new \InvalidArgumentException( + '$destinationObject must be a string.' + ); + } + $options['bucket'] = $this->identity['bucket']; + $options['sourceObject'] = $this->identity['object']; + $options['destinationObject'] = $destinationObject; + $options['userProject'] = $this->identity['userProject']; + + $response = $this->connection->moveObject($options); + + return new StorageObject( + $this->connection, + $response['name'], + $response['bucket'], + $response['generation'], + $response + ['requesterProjectId' => $this->identity['userProject']] + ); + } + /** * Renames the object. * diff --git a/lib/Google/vendor/google/common-protos/VERSION b/lib/Google/vendor/google/common-protos/VERSION index f99c6583c..53cf85e17 100644 --- a/lib/Google/vendor/google/common-protos/VERSION +++ b/lib/Google/vendor/google/common-protos/VERSION @@ -1 +1 @@ -4.8.3 +4.12.1 diff --git a/lib/Google/vendor/google/common-protos/composer.json b/lib/Google/vendor/google/common-protos/composer.json index a9a4384ad..7af87dcf4 100644 --- a/lib/Google/vendor/google/common-protos/composer.json +++ b/lib/Google/vendor/google/common-protos/composer.json @@ -2,7 +2,7 @@ "name": "google/common-protos", "type": "library", "description": "Google API Common Protos for PHP", - "version": "4.8.3", + "version": "4.12.1", "keywords": [ "google" ], diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Client.php b/lib/Google/vendor/google/common-protos/metadata/Api/Client.php index 8ff39b070..28f846302 100644 Binary files a/lib/Google/vendor/google/common-protos/metadata/Api/Client.php and b/lib/Google/vendor/google/common-protos/metadata/Api/Client.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/ErrorReason.php b/lib/Google/vendor/google/common-protos/metadata/Api/ErrorReason.php index 22bd2d622..49f233ae3 100644 Binary files a/lib/Google/vendor/google/common-protos/metadata/Api/ErrorReason.php and b/lib/Google/vendor/google/common-protos/metadata/Api/ErrorReason.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Http.php b/lib/Google/vendor/google/common-protos/metadata/Api/Http.php index a1e0edca4..d0b9c683a 100644 Binary files a/lib/Google/vendor/google/common-protos/metadata/Api/Http.php and b/lib/Google/vendor/google/common-protos/metadata/Api/Http.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Httpbody.php b/lib/Google/vendor/google/common-protos/metadata/Api/Httpbody.php index 382fd83a6..88417c291 100644 --- a/lib/Google/vendor/google/common-protos/metadata/Api/Httpbody.php +++ b/lib/Google/vendor/google/common-protos/metadata/Api/Httpbody.php @@ -17,15 +17,15 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Any::initOnce(); $pool->internalAddGeneratedFile( ' - + google/api/httpbody.proto google.api"X HttpBody content_type (  data ( ( -extensions ( 2.google.protobuf.AnyBh -com.google.apiB HttpBodyProtoPZ;google.golang.org/genproto/googleapis/api/httpbody;httpbodyGAPIbproto3' +extensions ( 2.google.protobuf.AnyBe +com.google.apiB HttpBodyProtoPZ;google.golang.org/genproto/googleapis/api/httpbody;httpbodyGAPIbproto3' , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Label.php b/lib/Google/vendor/google/common-protos/metadata/Api/Label.php index 62f887293..3dd6ebb15 100644 Binary files a/lib/Google/vendor/google/common-protos/metadata/Api/Label.php and b/lib/Google/vendor/google/common-protos/metadata/Api/Label.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Metric.php b/lib/Google/vendor/google/common-protos/metadata/Api/Metric.php index 7a348b03f..93c38242c 100644 Binary files a/lib/Google/vendor/google/common-protos/metadata/Api/Metric.php and b/lib/Google/vendor/google/common-protos/metadata/Api/Metric.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/MonitoredResource.php b/lib/Google/vendor/google/common-protos/metadata/Api/MonitoredResource.php index f8c023964..311dfb202 100644 --- a/lib/Google/vendor/google/common-protos/metadata/Api/MonitoredResource.php +++ b/lib/Google/vendor/google/common-protos/metadata/Api/MonitoredResource.php @@ -19,7 +19,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Struct::initOnce(); $pool->internalAddGeneratedFile( ' - + #google/api/monitored_resource.proto google.apigoogle/api/launch_stage.protogoogle/protobuf/struct.proto" MonitoredResourceDescriptor @@ -40,8 +40,8 @@ public static function initOnce() { user_labels ( 25.google.api.MonitoredResourceMetadata.UserLabelsEntry1 UserLabelsEntry key (  -value ( :8By -com.google.apiBMonitoredResourceProtoPZCgoogle.golang.org/genproto/googleapis/api/monitoredres;monitoredresGAPIbproto3' +value ( :8Bv +com.google.apiBMonitoredResourceProtoPZCgoogle.golang.org/genproto/googleapis/api/monitoredres;monitoredresGAPIbproto3' , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Policy.php b/lib/Google/vendor/google/common-protos/metadata/Api/Policy.php index 9d3ce0f48..c7d3fee46 100644 --- a/lib/Google/vendor/google/common-protos/metadata/Api/Policy.php +++ b/lib/Google/vendor/google/common-protos/metadata/Api/Policy.php @@ -16,7 +16,7 @@ public static function initOnce() { } $pool->internalAddGeneratedFile( ' - + google/api/policy.proto google.api google/protobuf/descriptor.proto"S FieldPolicy @@ -25,8 +25,8 @@ public static function initOnce() { resource_type ( "S MethodPolicy selector ( 1 -request_policies ( 2.google.api.FieldPolicyBp -com.google.apiB PolicyProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' +request_policies ( 2.google.api.FieldPolicyBm +com.google.apiB PolicyProtoPZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;serviceconfigGAPIbproto3' , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Resource.php b/lib/Google/vendor/google/common-protos/metadata/Api/Resource.php index b6021bed6..3e175ea87 100644 Binary files a/lib/Google/vendor/google/common-protos/metadata/Api/Resource.php and b/lib/Google/vendor/google/common-protos/metadata/Api/Resource.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Api/Visibility.php b/lib/Google/vendor/google/common-protos/metadata/Api/Visibility.php index e1cc138c7..e9dd98b58 100644 --- a/lib/Google/vendor/google/common-protos/metadata/Api/Visibility.php +++ b/lib/Google/vendor/google/common-protos/metadata/Api/Visibility.php @@ -16,7 +16,7 @@ public static function initOnce() { } $pool->internalAddGeneratedFile( ' - + google/api/visibility.proto google.api google/protobuf/descriptor.proto"7 @@ -24,8 +24,8 @@ public static function initOnce() { rules ( 2.google.api.VisibilityRule"7 VisibilityRule selector (  - restriction ( Bn -com.google.apiBVisibilityProtoPZ?google.golang.org/genproto/googleapis/api/visibility;visibilityGAPIbproto3' + restriction ( Bk +com.google.apiBVisibilityProtoPZ?google.golang.org/genproto/googleapis/api/visibility;visibilityGAPIbproto3' , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/IamPolicy.php b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/IamPolicy.php new file mode 100644 index 000000000..05b9b1274 --- /dev/null +++ b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/IamPolicy.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + +google/iam/v1/iam_policy.proto google.iam.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/options.protogoogle/iam/v1/policy.proto google/protobuf/field_mask.proto" +SetIamPolicyRequest +resource ( B AA +** +policy ( 2.google.iam.v1.PolicyBA/ + update_mask ( 2.google.protobuf.FieldMask"d +GetIamPolicyRequest +resource ( B AA +*0 +options ( 2.google.iam.v1.GetPolicyOptions"R +TestIamPermissionsRequest +resource ( B AA +* + permissions ( BA"1 +TestIamPermissionsResponse + permissions ( 2 + IAMPolicyt + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:setIamPolicy:*t + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:getIamPolicy:* +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"/)"$/v1/{resource=**}:testIamPermissions:*Aiam-meta-api.googleapis.comB| +com.google.iam.v1BIamPolicyProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Logging/AuditData.php b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Logging/AuditData.php new file mode 100644 index 000000000..3dcb651db --- /dev/null +++ b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Logging/AuditData.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' + +&google/iam/v1/logging/audit_data.protogoogle.iam.v1.logging"= + AuditData0 + policy_delta ( 2.google.iam.v1.PolicyDeltaB +com.google.iam.v1.loggingBAuditDataProtoPZ9cloud.google.com/go/iam/apiv1/logging/loggingpb;loggingpbGoogle.Cloud.Iam.V1.Loggingbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Options.php b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Options.php new file mode 100644 index 000000000..630ae5b65 --- /dev/null +++ b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Options.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' + +google/iam/v1/options.proto google.iam.v1"4 +GetPolicyOptions +requested_policy_version (B} +com.google.iam.v1B OptionsProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Policy.php b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Policy.php new file mode 100644 index 000000000..ed5ae8178 Binary files /dev/null and b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/Policy.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/ResourcePolicyMember.php b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/ResourcePolicyMember.php new file mode 100644 index 000000000..aa0d5616d --- /dev/null +++ b/lib/Google/vendor/google/common-protos/metadata/Google/Iam/V1/ResourcePolicyMember.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' + +*google/iam/v1/resource_policy_member.proto google.iam.v1"e +ResourcePolicyMember& +iam_policy_name_principal ( BA% +iam_policy_uid_principal ( BAB +com.google.iam.v1BResourcePolicyMemberProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/lib/Google/vendor/google/common-protos/metadata/Google/Logging/Type/HttpRequest.php b/lib/Google/vendor/google/common-protos/metadata/Google/Logging/Type/HttpRequest.php new file mode 100644 index 000000000..3c51368ee --- /dev/null +++ b/lib/Google/vendor/google/common-protos/metadata/Google/Logging/Type/HttpRequest.php @@ -0,0 +1,46 @@ +internalAddGeneratedFile( + ' + +&google/logging/type/http_request.protogoogle.logging.type" + HttpRequest +request_method (  + request_url (  + request_size ( +status ( + response_size ( + +user_agent (  + remote_ip (  + server_ip (  +referer ( * +latency ( 2.google.protobuf.Duration + cache_lookup ( + cache_hit (* +"cache_validated_with_origin_server + ( +cache_fill_bytes ( +protocol ( B +com.google.logging.typeBHttpRequestProtoPZ8google.golang.org/genproto/googleapis/logging/type;ltypeGoogle.Cloud.Logging.TypeGoogle\\Cloud\\Logging\\TypeGoogle::Cloud::Logging::Typebproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/lib/Google/vendor/google/common-protos/metadata/Google/Logging/Type/LogSeverity.php b/lib/Google/vendor/google/common-protos/metadata/Google/Logging/Type/LogSeverity.php new file mode 100644 index 000000000..6acaa6953 Binary files /dev/null and b/lib/Google/vendor/google/common-protos/metadata/Google/Logging/Type/LogSeverity.php differ diff --git a/lib/Google/vendor/google/common-protos/metadata/Iam/V1/IamPolicy.php b/lib/Google/vendor/google/common-protos/metadata/Iam/V1/IamPolicy.php index 02fa586e7..05b9b1274 100644 --- a/lib/Google/vendor/google/common-protos/metadata/Iam/V1/IamPolicy.php +++ b/lib/Google/vendor/google/common-protos/metadata/Iam/V1/IamPolicy.php @@ -23,7 +23,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( ' - + google/iam/v1/iam_policy.proto google.iam.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/iam/v1/options.protogoogle/iam/v1/policy.proto google/protobuf/field_mask.proto" SetIamPolicyRequest resource ( B AA @@ -43,8 +43,8 @@ public static function initOnce() { IAMPolicyt SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:setIamPolicy:*t GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy")#"/v1/{resource=**}:getIamPolicy:* -TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"/)"$/v1/{resource=**}:testIamPermissions:*Aiam-meta-api.googleapis.comB -com.google.iam.v1BIamPolicyProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"/)"$/v1/{resource=**}:testIamPermissions:*Aiam-meta-api.googleapis.comB| +com.google.iam.v1BIamPolicyProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/common-protos/metadata/Iam/V1/ResourcePolicyMember.php b/lib/Google/vendor/google/common-protos/metadata/Iam/V1/ResourcePolicyMember.php new file mode 100644 index 000000000..aa0d5616d --- /dev/null +++ b/lib/Google/vendor/google/common-protos/metadata/Iam/V1/ResourcePolicyMember.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' + +*google/iam/v1/resource_policy_member.proto google.iam.v1"e +ResourcePolicyMember& +iam_policy_name_principal ( BA% +iam_policy_uid_principal ( BAB +com.google.iam.v1BResourcePolicyMemberProtoPZ)cloud.google.com/go/iam/apiv1/iampb;iampbGoogle.Cloud.Iam.V1Google\\Cloud\\Iam\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/lib/Google/vendor/google/common-protos/metadata/Rpc/Context/AuditContext.php b/lib/Google/vendor/google/common-protos/metadata/Rpc/Context/AuditContext.php index 40b9c0642..085e04b2f 100644 --- a/lib/Google/vendor/google/common-protos/metadata/Rpc/Context/AuditContext.php +++ b/lib/Google/vendor/google/common-protos/metadata/Rpc/Context/AuditContext.php @@ -17,15 +17,15 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Struct::initOnce(); $pool->internalAddGeneratedFile( ' - + &google/rpc/context/audit_context.protogoogle.rpc.context" AuditContext audit_log ( 1 scrubbed_request ( 2.google.protobuf.Struct2 scrubbed_response ( 2.google.protobuf.Struct$ scrubbed_response_item_count ( -target_resource ( Bk -com.google.rpc.contextBAuditContextProtoPZ9google.golang.org/genproto/googleapis/rpc/context;contextbproto3' +target_resource ( Bh +com.google.rpc.contextBAuditContextProtoPZ9google.golang.org/genproto/googleapis/rpc/context;contextbproto3' , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/common-protos/metadata/Rpc/ErrorDetails.php b/lib/Google/vendor/google/common-protos/metadata/Rpc/ErrorDetails.php index 37c002f18..c377e86ef 100644 Binary files a/lib/Google/vendor/google/common-protos/metadata/Rpc/ErrorDetails.php and b/lib/Google/vendor/google/common-protos/metadata/Rpc/ErrorDetails.php differ diff --git a/lib/Google/vendor/google/common-protos/src/Api/BackendRule.php b/lib/Google/vendor/google/common-protos/src/Api/BackendRule.php index 37745f1c6..fa4535324 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/BackendRule.php +++ b/lib/Google/vendor/google/common-protos/src/Api/BackendRule.php @@ -288,7 +288,9 @@ public function setDeadline($var) */ public function getMinDeadline() { - @trigger_error('min_deadline is deprecated.', E_USER_DEPRECATED); + if ($this->min_deadline !== 0.0) { + @trigger_error('min_deadline is deprecated.', E_USER_DEPRECATED); + } return $this->min_deadline; } diff --git a/lib/Google/vendor/google/common-protos/src/Api/CommonLanguageSettings.php b/lib/Google/vendor/google/common-protos/src/Api/CommonLanguageSettings.php index f5b09853b..07f823007 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/CommonLanguageSettings.php +++ b/lib/Google/vendor/google/common-protos/src/Api/CommonLanguageSettings.php @@ -29,6 +29,12 @@ class CommonLanguageSettings extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.api.ClientLibraryDestination destinations = 2; */ private $destinations; + /** + * Configuration for which RPCs should be generated in the GAPIC client. + * + * Generated from protobuf field .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + protected $selective_gapic_generation = null; /** * Constructor. @@ -41,6 +47,8 @@ class CommonLanguageSettings extends \Google\Protobuf\Internal\Message * https://cloud.google.com/nodejs/docs/reference/asset/latest * @type array|\Google\Protobuf\Internal\RepeatedField $destinations * The destination where API teams want this client library to be published. + * @type \Google\Api\SelectiveGapicGeneration $selective_gapic_generation + * Configuration for which RPCs should be generated in the GAPIC client. * } */ public function __construct($data = NULL) { @@ -58,7 +66,9 @@ public function __construct($data = NULL) { */ public function getReferenceDocsUri() { - @trigger_error('reference_docs_uri is deprecated.', E_USER_DEPRECATED); + if ($this->reference_docs_uri !== '') { + @trigger_error('reference_docs_uri is deprecated.', E_USER_DEPRECATED); + } return $this->reference_docs_uri; } @@ -106,5 +116,41 @@ public function setDestinations($var) return $this; } + /** + * Configuration for which RPCs should be generated in the GAPIC client. + * + * Generated from protobuf field .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * @return \Google\Api\SelectiveGapicGeneration|null + */ + public function getSelectiveGapicGeneration() + { + return $this->selective_gapic_generation; + } + + public function hasSelectiveGapicGeneration() + { + return isset($this->selective_gapic_generation); + } + + public function clearSelectiveGapicGeneration() + { + unset($this->selective_gapic_generation); + } + + /** + * Configuration for which RPCs should be generated in the GAPIC client. + * + * Generated from protobuf field .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * @param \Google\Api\SelectiveGapicGeneration $var + * @return $this + */ + public function setSelectiveGapicGeneration($var) + { + GPBUtil::checkMessage($var, \Google\Api\SelectiveGapicGeneration::class); + $this->selective_gapic_generation = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/common-protos/src/Api/ErrorReason.php b/lib/Google/vendor/google/common-protos/src/Api/ErrorReason.php index b582e3633..04641c220 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/ErrorReason.php +++ b/lib/Google/vendor/google/common-protos/src/Api/ErrorReason.php @@ -595,6 +595,41 @@ class ErrorReason * Generated from protobuf enum LOCATION_POLICY_VIOLATED = 31; */ const LOCATION_POLICY_VIOLATED = 31; + /** + * The request is denied because origin request header is missing. + * Example of an ErrorInfo when + * accessing "pubsub.googleapis.com" service with an empty "Origin" request + * header. + * { + * reason: "MISSING_ORIGIN" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } + * } + * + * Generated from protobuf enum MISSING_ORIGIN = 33; + */ + const MISSING_ORIGIN = 33; + /** + * The request is denied because the request contains more than one credential + * type that are individually acceptable, but not together. The customer + * should retry their request with only one set of credentials. + * Example of an ErrorInfo when + * accessing "pubsub.googleapis.com" service with overloaded credentials. + * { + * reason: "OVERLOADED_CREDENTIALS" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } + * } + * + * Generated from protobuf enum OVERLOADED_CREDENTIALS = 34; + */ + const OVERLOADED_CREDENTIALS = 34; private static $valueToName = [ self::ERROR_REASON_UNSPECIFIED => 'ERROR_REASON_UNSPECIFIED', @@ -628,6 +663,8 @@ class ErrorReason self::SERVICE_NOT_VISIBLE => 'SERVICE_NOT_VISIBLE', self::GCP_SUSPENDED => 'GCP_SUSPENDED', self::LOCATION_POLICY_VIOLATED => 'LOCATION_POLICY_VIOLATED', + self::MISSING_ORIGIN => 'MISSING_ORIGIN', + self::OVERLOADED_CREDENTIALS => 'OVERLOADED_CREDENTIALS', ]; public static function name($value) diff --git a/lib/Google/vendor/google/common-protos/src/Api/GoSettings.php b/lib/Google/vendor/google/common-protos/src/Api/GoSettings.php index 10817e885..f70db3cdc 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/GoSettings.php +++ b/lib/Google/vendor/google/common-protos/src/Api/GoSettings.php @@ -21,6 +21,18 @@ class GoSettings extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; */ protected $common = null; + /** + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin + * + * Generated from protobuf field map renamed_services = 2; + */ + private $renamed_services; /** * Constructor. @@ -30,6 +42,14 @@ class GoSettings extends \Google\Protobuf\Internal\Message * * @type \Google\Api\CommonLanguageSettings $common * Some settings. + * @type array|\Google\Protobuf\Internal\MapField $renamed_services + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin * } */ public function __construct($data = NULL) { @@ -73,5 +93,43 @@ public function setCommon($var) return $this; } + /** + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin + * + * Generated from protobuf field map renamed_services = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getRenamedServices() + { + return $this->renamed_services; + } + + /** + * Map of service names to renamed services. Keys are the package relative + * service names and values are the name to be used for the service client + * and call options. + * publishing: + * go_settings: + * renamed_services: + * Publisher: TopicAdmin + * + * Generated from protobuf field map renamed_services = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setRenamedServices($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->renamed_services = $arr; + + return $this; + } + } diff --git a/lib/Google/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata.php b/lib/Google/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata.php index e1fe49d02..d4ce06e49 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata.php +++ b/lib/Google/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata.php @@ -41,6 +41,12 @@ class MetricDescriptorMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Duration ingest_delay = 3; */ protected $ingest_delay = null; + /** + * The scope of the timeseries data of the metric. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + */ + private $time_series_resource_hierarchy_level; /** * Constructor. @@ -61,6 +67,8 @@ class MetricDescriptorMetadata extends \Google\Protobuf\Internal\Message * The delay of data points caused by ingestion. Data points older than this * age are guaranteed to be ingested and available to be read, excluding * data loss due to errors. + * @type array|\Google\Protobuf\Internal\RepeatedField $time_series_resource_hierarchy_level + * The scope of the timeseries data of the metric. * } */ public function __construct($data = NULL) { @@ -79,7 +87,9 @@ public function __construct($data = NULL) { */ public function getLaunchStage() { - @trigger_error('launch_stage is deprecated.', E_USER_DEPRECATED); + if ($this->launch_stage !== 0) { + @trigger_error('launch_stage is deprecated.', E_USER_DEPRECATED); + } return $this->launch_stage; } @@ -184,6 +194,32 @@ public function setIngestDelay($var) return $this; } + /** + * The scope of the timeseries data of the metric. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimeSeriesResourceHierarchyLevel() + { + return $this->time_series_resource_hierarchy_level; + } + + /** + * The scope of the timeseries data of the metric. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimeSeriesResourceHierarchyLevel($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Api\MetricDescriptor\MetricDescriptorMetadata\TimeSeriesResourceHierarchyLevel::class); + $this->time_series_resource_hierarchy_level = $arr; + + return $this; + } + } diff --git a/lib/Google/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata/TimeSeriesResourceHierarchyLevel.php b/lib/Google/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata/TimeSeriesResourceHierarchyLevel.php new file mode 100644 index 000000000..c621598dd --- /dev/null +++ b/lib/Google/vendor/google/common-protos/src/Api/MetricDescriptor/MetricDescriptorMetadata/TimeSeriesResourceHierarchyLevel.php @@ -0,0 +1,69 @@ +google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + */ +class TimeSeriesResourceHierarchyLevel +{ + /** + * Do not use this default value. + * + * Generated from protobuf enum TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0; + */ + const TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0; + /** + * Scopes a metric to a project. + * + * Generated from protobuf enum PROJECT = 1; + */ + const PROJECT = 1; + /** + * Scopes a metric to an organization. + * + * Generated from protobuf enum ORGANIZATION = 2; + */ + const ORGANIZATION = 2; + /** + * Scopes a metric to a folder. + * + * Generated from protobuf enum FOLDER = 3; + */ + const FOLDER = 3; + + private static $valueToName = [ + self::TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED => 'TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED', + self::PROJECT => 'PROJECT', + self::ORGANIZATION => 'ORGANIZATION', + self::FOLDER => 'FOLDER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/lib/Google/vendor/google/common-protos/src/Api/Page.php b/lib/Google/vendor/google/common-protos/src/Api/Page.php index 2812764c0..07097454d 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/Page.php +++ b/lib/Google/vendor/google/common-protos/src/Api/Page.php @@ -36,9 +36,9 @@ class Page extends \Google\Protobuf\Internal\Message */ protected $name = ''; /** - * The Markdown content of the page. You can use (== include {path} - * ==) to include content from a Markdown file. The content can be - * used to produce the documentation page such as HTML format page. + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. * * Generated from protobuf field string content = 2; */ @@ -73,9 +73,9 @@ class Page extends \Google\Protobuf\Internal\Message * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. * @type string $content - * The Markdown content of the page. You can use (== include {path} - * ==) to include content from a Markdown file. The content can be - * used to produce the documentation page such as HTML format page. + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. * @type array<\Google\Api\Page>|\Google\Protobuf\Internal\RepeatedField $subpages * Subpages of this page. The order of subpages specified here will be * honored in the generated docset. @@ -139,9 +139,9 @@ public function setName($var) } /** - * The Markdown content of the page. You can use (== include {path} - * ==) to include content from a Markdown file. The content can be - * used to produce the documentation page such as HTML format page. + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. * * Generated from protobuf field string content = 2; * @return string @@ -152,9 +152,9 @@ public function getContent() } /** - * The Markdown content of the page. You can use (== include {path} - * ==) to include content from a Markdown file. The content can be - * used to produce the documentation page such as HTML format page. + * The Markdown content of the page. You can use ```(== include {path} + * ==)``` to include content from a Markdown file. The content can be used + * to produce the documentation page such as HTML format page. * * Generated from protobuf field string content = 2; * @param string $var diff --git a/lib/Google/vendor/google/common-protos/src/Api/PythonSettings.php b/lib/Google/vendor/google/common-protos/src/Api/PythonSettings.php index a86a02261..e502c7450 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/PythonSettings.php +++ b/lib/Google/vendor/google/common-protos/src/Api/PythonSettings.php @@ -21,6 +21,12 @@ class PythonSettings extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.api.CommonLanguageSettings common = 1; */ protected $common = null; + /** + * Experimental features to be included during client library generation. + * + * Generated from protobuf field .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + protected $experimental_features = null; /** * Constructor. @@ -30,6 +36,8 @@ class PythonSettings extends \Google\Protobuf\Internal\Message * * @type \Google\Api\CommonLanguageSettings $common * Some settings. + * @type \Google\Api\PythonSettings\ExperimentalFeatures $experimental_features + * Experimental features to be included during client library generation. * } */ public function __construct($data = NULL) { @@ -73,5 +81,41 @@ public function setCommon($var) return $this; } + /** + * Experimental features to be included during client library generation. + * + * Generated from protobuf field .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * @return \Google\Api\PythonSettings\ExperimentalFeatures|null + */ + public function getExperimentalFeatures() + { + return $this->experimental_features; + } + + public function hasExperimentalFeatures() + { + return isset($this->experimental_features); + } + + public function clearExperimentalFeatures() + { + unset($this->experimental_features); + } + + /** + * Experimental features to be included during client library generation. + * + * Generated from protobuf field .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * @param \Google\Api\PythonSettings\ExperimentalFeatures $var + * @return $this + */ + public function setExperimentalFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Api\PythonSettings\ExperimentalFeatures::class); + $this->experimental_features = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/common-protos/src/Api/PythonSettings/ExperimentalFeatures.php b/lib/Google/vendor/google/common-protos/src/Api/PythonSettings/ExperimentalFeatures.php new file mode 100644 index 000000000..200d47737 --- /dev/null +++ b/lib/Google/vendor/google/common-protos/src/Api/PythonSettings/ExperimentalFeatures.php @@ -0,0 +1,174 @@ +google.api.PythonSettings.ExperimentalFeatures + */ +class ExperimentalFeatures extends \Google\Protobuf\Internal\Message +{ + /** + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * + * Generated from protobuf field bool rest_async_io_enabled = 1; + */ + protected $rest_async_io_enabled = false; + /** + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * + * Generated from protobuf field bool protobuf_pythonic_types_enabled = 2; + */ + protected $protobuf_pythonic_types_enabled = false; + /** + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * + * Generated from protobuf field bool unversioned_package_disabled = 3; + */ + protected $unversioned_package_disabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $rest_async_io_enabled + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * @type bool $protobuf_pythonic_types_enabled + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * @type bool $unversioned_package_disabled + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * + * Generated from protobuf field bool rest_async_io_enabled = 1; + * @return bool + */ + public function getRestAsyncIoEnabled() + { + return $this->rest_async_io_enabled; + } + + /** + * Enables generation of asynchronous REST clients if `rest` transport is + * enabled. By default, asynchronous REST clients will not be generated. + * This feature will be enabled by default 1 month after launching the + * feature in preview packages. + * + * Generated from protobuf field bool rest_async_io_enabled = 1; + * @param bool $var + * @return $this + */ + public function setRestAsyncIoEnabled($var) + { + GPBUtil::checkBool($var); + $this->rest_async_io_enabled = $var; + + return $this; + } + + /** + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * + * Generated from protobuf field bool protobuf_pythonic_types_enabled = 2; + * @return bool + */ + public function getProtobufPythonicTypesEnabled() + { + return $this->protobuf_pythonic_types_enabled; + } + + /** + * Enables generation of protobuf code using new types that are more + * Pythonic which are included in `protobuf>=5.29.x`. This feature will be + * enabled by default 1 month after launching the feature in preview + * packages. + * + * Generated from protobuf field bool protobuf_pythonic_types_enabled = 2; + * @param bool $var + * @return $this + */ + public function setProtobufPythonicTypesEnabled($var) + { + GPBUtil::checkBool($var); + $this->protobuf_pythonic_types_enabled = $var; + + return $this; + } + + /** + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * + * Generated from protobuf field bool unversioned_package_disabled = 3; + * @return bool + */ + public function getUnversionedPackageDisabled() + { + return $this->unversioned_package_disabled; + } + + /** + * Disables generation of an unversioned Python package for this client + * library. This means that the module names will need to be versioned in + * import statements. For example `import google.cloud.library_v2` instead + * of `import google.cloud.library`. + * + * Generated from protobuf field bool unversioned_package_disabled = 3; + * @param bool $var + * @return $this + */ + public function setUnversionedPackageDisabled($var) + { + GPBUtil::checkBool($var); + $this->unversioned_package_disabled = $var; + + return $this; + } + +} + + diff --git a/lib/Google/vendor/google/common-protos/src/Api/QuotaLimit.php b/lib/Google/vendor/google/common-protos/src/Api/QuotaLimit.php index f34ffb4b0..977cd0156 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/QuotaLimit.php +++ b/lib/Google/vendor/google/common-protos/src/Api/QuotaLimit.php @@ -88,8 +88,8 @@ class QuotaLimit extends \Google\Protobuf\Internal\Message protected $metric = ''; /** * Specify the unit of the quota limit. It uses the same syntax as - * [Metric.unit][]. The supported unit kinds are determined by the quota - * backend system. + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. * Here are some examples: * * "1/min/{project}" for quota per minute per project. * Note: the order of unit components is insignificant. @@ -165,8 +165,8 @@ class QuotaLimit extends \Google\Protobuf\Internal\Message * defined within the service config. * @type string $unit * Specify the unit of the quota limit. It uses the same syntax as - * [Metric.unit][]. The supported unit kinds are determined by the quota - * backend system. + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. * Here are some examples: * * "1/min/{project}" for quota per minute per project. * Note: the order of unit components is insignificant. @@ -425,8 +425,8 @@ public function setMetric($var) /** * Specify the unit of the quota limit. It uses the same syntax as - * [Metric.unit][]. The supported unit kinds are determined by the quota - * backend system. + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. * Here are some examples: * * "1/min/{project}" for quota per minute per project. * Note: the order of unit components is insignificant. @@ -442,8 +442,8 @@ public function getUnit() /** * Specify the unit of the quota limit. It uses the same syntax as - * [Metric.unit][]. The supported unit kinds are determined by the quota - * backend system. + * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported + * unit kinds are determined by the quota backend system. * Here are some examples: * * "1/min/{project}" for quota per minute per project. * Note: the order of unit components is insignificant. diff --git a/lib/Google/vendor/google/common-protos/src/Api/RoutingRule.php b/lib/Google/vendor/google/common-protos/src/Api/RoutingRule.php index c47012d87..b5dab1873 100644 --- a/lib/Google/vendor/google/common-protos/src/Api/RoutingRule.php +++ b/lib/Google/vendor/google/common-protos/src/Api/RoutingRule.php @@ -35,7 +35,7 @@ * The routing header consists of one or multiple key-value pairs. Every key * and value must be percent-encoded, and joined together in the format of * `key1=value1&key2=value2`. - * In the examples below I am skipping the percent-encoding for readablity. + * The examples below skip the percent-encoding for readability. * Example 1 * Extracting a field from the request to put into the routing header * unchanged, with the key equal to the field name. diff --git a/lib/Google/vendor/google/common-protos/src/Api/SelectiveGapicGeneration.php b/lib/Google/vendor/google/common-protos/src/Api/SelectiveGapicGeneration.php new file mode 100644 index 000000000..c6ababaac --- /dev/null +++ b/lib/Google/vendor/google/common-protos/src/Api/SelectiveGapicGeneration.php @@ -0,0 +1,126 @@ +google.api.SelectiveGapicGeneration + */ +class SelectiveGapicGeneration extends \Google\Protobuf\Internal\Message +{ + /** + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * + * Generated from protobuf field repeated string methods = 1; + */ + private $methods; + /** + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * + * Generated from protobuf field bool generate_omitted_as_internal = 2; + */ + protected $generate_omitted_as_internal = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $methods + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * @type bool $generate_omitted_as_internal + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Api\Client::initOnce(); + parent::__construct($data); + } + + /** + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * + * Generated from protobuf field repeated string methods = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethods() + { + return $this->methods; + } + + /** + * An allowlist of the fully qualified names of RPCs that should be included + * on public client surfaces. + * + * Generated from protobuf field repeated string methods = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->methods = $arr; + + return $this; + } + + /** + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * + * Generated from protobuf field bool generate_omitted_as_internal = 2; + * @return bool + */ + public function getGenerateOmittedAsInternal() + { + return $this->generate_omitted_as_internal; + } + + /** + * Setting this to true indicates to the client generators that methods + * that would be excluded from the generation should instead be generated + * in a way that indicates these methods should not be consumed by + * end users. How this is expressed is up to individual language + * implementations to decide. Some examples may be: added annotations, + * obfuscated identifiers, or other language idiomatic patterns. + * + * Generated from protobuf field bool generate_omitted_as_internal = 2; + * @param bool $var + * @return $this + */ + public function setGenerateOmittedAsInternal($var) + { + GPBUtil::checkBool($var); + $this->generate_omitted_as_internal = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/common-protos/src/Cloud/Iam/V1/ResourcePolicyMember.php b/lib/Google/vendor/google/common-protos/src/Cloud/Iam/V1/ResourcePolicyMember.php new file mode 100644 index 000000000..88fbd7b3c --- /dev/null +++ b/lib/Google/vendor/google/common-protos/src/Cloud/Iam/V1/ResourcePolicyMember.php @@ -0,0 +1,142 @@ +google.iam.v1.ResourcePolicyMember + */ +class ResourcePolicyMember extends \Google\Protobuf\Internal\Message +{ + /** + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * + * Generated from protobuf field string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $iam_policy_name_principal = ''; + /** + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * + * Generated from protobuf field string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $iam_policy_uid_principal = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $iam_policy_name_principal + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * @type string $iam_policy_uid_principal + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Iam\V1\ResourcePolicyMember::initOnce(); + parent::__construct($data); + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * + * Generated from protobuf field string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIamPolicyNamePrincipal() + { + return $this->iam_policy_name_principal; + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * user-assigned name (https://google.aip.dev/122). If a resource is deleted + * and recreated with the same name, the binding will be applicable to the new + * resource. + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + * + * Generated from protobuf field string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIamPolicyNamePrincipal($var) + { + GPBUtil::checkString($var, True); + $this->iam_policy_name_principal = $var; + + return $this; + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * + * Generated from protobuf field string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIamPolicyUidPrincipal() + { + return $this->iam_policy_uid_principal; + } + + /** + * IAM policy binding member referring to a Google Cloud resource by + * system-assigned unique identifier (https://google.aip.dev/148#uid). If a + * resource is deleted and recreated with the same name, the binding will not + * be applicable to the new resource + * Example: + * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + * + * Generated from protobuf field string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIamPolicyUidPrincipal($var) + { + GPBUtil::checkString($var, True); + $this->iam_policy_uid_principal = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/common-protos/src/Rpc/BadRequest/FieldViolation.php b/lib/Google/vendor/google/common-protos/src/Rpc/BadRequest/FieldViolation.php index fd245f68b..51d5843e9 100644 --- a/lib/Google/vendor/google/common-protos/src/Rpc/BadRequest/FieldViolation.php +++ b/lib/Google/vendor/google/common-protos/src/Rpc/BadRequest/FieldViolation.php @@ -55,6 +55,24 @@ class FieldViolation extends \Google\Protobuf\Internal\Message * Generated from protobuf field string description = 2; */ protected $description = ''; + /** + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 3; + */ + protected $reason = ''; + /** + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. + * + * Generated from protobuf field .google.rpc.LocalizedMessage localized_message = 4; + */ + protected $localized_message = null; /** * Constructor. @@ -94,6 +112,16 @@ class FieldViolation extends \Google\Protobuf\Internal\Message * value in the third `emailAddresses` message. * @type string $description * A description of why the request element is bad. + * @type string $reason + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * @type \Google\Rpc\LocalizedMessage $localized_message + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. * } */ public function __construct($data = NULL) { @@ -209,6 +237,80 @@ public function setDescription($var) return $this; } + /** + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 3; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * The reason of the field-level error. This is a constant value that + * identifies the proximate cause of the field-level error. It should + * uniquely identify the type of the FieldViolation within the scope of the + * google.rpc.ErrorInfo.domain. This should be at most 63 + * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + * which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field string reason = 3; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. + * + * Generated from protobuf field .google.rpc.LocalizedMessage localized_message = 4; + * @return \Google\Rpc\LocalizedMessage|null + */ + public function getLocalizedMessage() + { + return $this->localized_message; + } + + public function hasLocalizedMessage() + { + return isset($this->localized_message); + } + + public function clearLocalizedMessage() + { + unset($this->localized_message); + } + + /** + * Provides a localized error message for field-level errors that is safe to + * return to the API consumer. + * + * Generated from protobuf field .google.rpc.LocalizedMessage localized_message = 4; + * @param \Google\Rpc\LocalizedMessage $var + * @return $this + */ + public function setLocalizedMessage($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\LocalizedMessage::class); + $this->localized_message = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Resource.php b/lib/Google/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Resource.php index 6cf4b69e5..4c1042436 100644 --- a/lib/Google/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Resource.php +++ b/lib/Google/vendor/google/common-protos/src/Rpc/Context/AttributeContext/Resource.php @@ -70,7 +70,8 @@ class Resource extends \Google\Protobuf\Internal\Message * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * Generated from protobuf field map annotations = 6; */ @@ -163,7 +164,8 @@ class Resource extends \Google\Protobuf\Internal\Message * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * @type string $display_name * Mutable. The display name set by clients. Must be <= 63 characters. * @type \Google\Protobuf\Timestamp $create_time @@ -367,7 +369,8 @@ public function setUid($var) * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * Generated from protobuf field map annotations = 6; * @return \Google\Protobuf\Internal\MapField @@ -381,7 +384,8 @@ public function getAnnotations() * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * Generated from protobuf field map annotations = 6; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/lib/Google/vendor/google/common-protos/src/Rpc/ErrorInfo.php b/lib/Google/vendor/google/common-protos/src/Rpc/ErrorInfo.php index 8c2e0ec0b..83c969ca8 100644 --- a/lib/Google/vendor/google/common-protos/src/Rpc/ErrorInfo.php +++ b/lib/Google/vendor/google/common-protos/src/Rpc/ErrorInfo.php @@ -56,11 +56,12 @@ class ErrorInfo extends \Google\Protobuf\Internal\Message protected $domain = ''; /** * Additional structured details about this error. - * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in * length. When identifying the current value of an exceeded limit, the units * should be contained in the key, not the value. For example, rather than - * {"instanceLimit": "100/request"}, should be returned as, - * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of * instances that can be created in a single (batch) request. * * Generated from protobuf field map metadata = 3; @@ -88,11 +89,12 @@ class ErrorInfo extends \Google\Protobuf\Internal\Message * infrastructure, the error domain is "googleapis.com". * @type array|\Google\Protobuf\Internal\MapField $metadata * Additional structured details about this error. - * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in * length. When identifying the current value of an exceeded limit, the units * should be contained in the key, not the value. For example, rather than - * {"instanceLimit": "100/request"}, should be returned as, - * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of * instances that can be created in a single (batch) request. * } */ @@ -173,11 +175,12 @@ public function setDomain($var) /** * Additional structured details about this error. - * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in * length. When identifying the current value of an exceeded limit, the units * should be contained in the key, not the value. For example, rather than - * {"instanceLimit": "100/request"}, should be returned as, - * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of * instances that can be created in a single (batch) request. * * Generated from protobuf field map metadata = 3; @@ -190,11 +193,12 @@ public function getMetadata() /** * Additional structured details about this error. - * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in + * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + * ideally be lowerCamelCase. Also, they must be limited to 64 characters in * length. When identifying the current value of an exceeded limit, the units * should be contained in the key, not the value. For example, rather than - * {"instanceLimit": "100/request"}, should be returned as, - * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of + * `{"instanceLimit": "100/request"}`, should be returned as, + * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of * instances that can be created in a single (batch) request. * * Generated from protobuf field map metadata = 3; diff --git a/lib/Google/vendor/google/common-protos/src/Rpc/QuotaFailure/Violation.php b/lib/Google/vendor/google/common-protos/src/Rpc/QuotaFailure/Violation.php index 3a7cc9f92..576034846 100644 --- a/lib/Google/vendor/google/common-protos/src/Rpc/QuotaFailure/Violation.php +++ b/lib/Google/vendor/google/common-protos/src/Rpc/QuotaFailure/Violation.php @@ -35,6 +35,81 @@ class Violation extends \Google\Protobuf\Internal\Message * Generated from protobuf field string description = 2; */ protected $description = ''; + /** + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * + * Generated from protobuf field string api_service = 3; + */ + protected $api_service = ''; + /** + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * + * Generated from protobuf field string quota_metric = 4; + */ + protected $quota_metric = ''; + /** + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * + * Generated from protobuf field string quota_id = 5; + */ + protected $quota_id = ''; + /** + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * Generated from protobuf field map quota_dimensions = 6; + */ + private $quota_dimensions; + /** + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * + * Generated from protobuf field int64 quota_value = 7; + */ + protected $quota_value = 0; + /** + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. + * + * Generated from protobuf field optional int64 future_quota_value = 8; + */ + protected $future_quota_value = null; /** * Constructor. @@ -53,6 +128,57 @@ class Violation extends \Google\Protobuf\Internal\Message * developer console. * For example: "Service disabled" or "Daily Limit for read operations * exceeded". + * @type string $api_service + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * @type string $quota_metric + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * @type string $quota_id + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * @type array|\Google\Protobuf\Internal\MapField $quota_dimensions + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * @type int|string $quota_value + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * @type int|string $future_quota_value + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. * } */ public function __construct($data = NULL) { @@ -126,6 +252,250 @@ public function setDescription($var) return $this; } + /** + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * + * Generated from protobuf field string api_service = 3; + * @return string + */ + public function getApiService() + { + return $this->api_service; + } + + /** + * The API Service from which the `QuotaFailure.Violation` orginates. In + * some cases, Quota issues originate from an API Service other than the one + * that was called. In other words, a dependency of the called API Service + * could be the cause of the `QuotaFailure`, and this field would have the + * dependency API service name. + * For example, if the called API is Kubernetes Engine API + * (container.googleapis.com), and a quota violation occurs in the + * Kubernetes Engine API itself, this field would be + * "container.googleapis.com". On the other hand, if the quota violation + * occurs when the Kubernetes Engine API creates VMs in the Compute Engine + * API (compute.googleapis.com), this field would be + * "compute.googleapis.com". + * + * Generated from protobuf field string api_service = 3; + * @param string $var + * @return $this + */ + public function setApiService($var) + { + GPBUtil::checkString($var, True); + $this->api_service = $var; + + return $this; + } + + /** + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * + * Generated from protobuf field string quota_metric = 4; + * @return string + */ + public function getQuotaMetric() + { + return $this->quota_metric; + } + + /** + * The metric of the violated quota. A quota metric is a named counter to + * measure usage, such as API requests or CPUs. When an activity occurs in a + * service, such as Virtual Machine allocation, one or more quota metrics + * may be affected. + * For example, "compute.googleapis.com/cpus_per_vm_family", + * "storage.googleapis.com/internet_egress_bandwidth". + * + * Generated from protobuf field string quota_metric = 4; + * @param string $var + * @return $this + */ + public function setQuotaMetric($var) + { + GPBUtil::checkString($var, True); + $this->quota_metric = $var; + + return $this; + } + + /** + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * + * Generated from protobuf field string quota_id = 5; + * @return string + */ + public function getQuotaId() + { + return $this->quota_id; + } + + /** + * The id of the violated quota. Also know as "limit name", this is the + * unique identifier of a quota in the context of an API service. + * For example, "CPUS-PER-VM-FAMILY-per-project-region". + * + * Generated from protobuf field string quota_id = 5; + * @param string $var + * @return $this + */ + public function setQuotaId($var) + { + GPBUtil::checkString($var, True); + $this->quota_id = $var; + + return $this; + } + + /** + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * Generated from protobuf field map quota_dimensions = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getQuotaDimensions() + { + return $this->quota_dimensions; + } + + /** + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * Generated from protobuf field map quota_dimensions = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setQuotaDimensions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->quota_dimensions = $arr; + + return $this; + } + + /** + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * + * Generated from protobuf field int64 quota_value = 7; + * @return int|string + */ + public function getQuotaValue() + { + return $this->quota_value; + } + + /** + * The enforced quota value at the time of the `QuotaFailure`. + * For example, if the enforced quota value at the time of the + * `QuotaFailure` on the number of CPUs is "10", then the value of this + * field would reflect this quantity. + * + * Generated from protobuf field int64 quota_value = 7; + * @param int|string $var + * @return $this + */ + public function setQuotaValue($var) + { + GPBUtil::checkInt64($var); + $this->quota_value = $var; + + return $this; + } + + /** + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. + * + * Generated from protobuf field optional int64 future_quota_value = 8; + * @return int|string + */ + public function getFutureQuotaValue() + { + return isset($this->future_quota_value) ? $this->future_quota_value : 0; + } + + public function hasFutureQuotaValue() + { + return isset($this->future_quota_value); + } + + public function clearFutureQuotaValue() + { + unset($this->future_quota_value); + } + + /** + * The new quota value being rolled out at the time of the violation. At the + * completion of the rollout, this value will be enforced in place of + * quota_value. If no rollout is in progress at the time of the violation, + * this field is not set. + * For example, if at the time of the violation a rollout is in progress + * changing the number of CPUs quota from 10 to 20, 20 would be the value of + * this field. + * + * Generated from protobuf field optional int64 future_quota_value = 8; + * @param int|string $var + * @return $this + */ + public function setFutureQuotaValue($var) + { + GPBUtil::checkInt64($var); + $this->future_quota_value = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/gax/CHANGELOG.md b/lib/Google/vendor/google/gax/CHANGELOG.md index 8a8db4ae6..10d92869c 100644 --- a/lib/Google/vendor/google/gax/CHANGELOG.md +++ b/lib/Google/vendor/google/gax/CHANGELOG.md @@ -1,12 +1,5 @@ # Changelog -## [1.36.0](https://github.com/googleapis/gax-php/compare/v1.35.1...v1.36.0) (2024-12-11) - - -### Features - -* Add logging to the supported transports ([#585](https://github.com/googleapis/gax-php/issues/585)) ([819a677](https://github.com/googleapis/gax-php/commit/819a677e0d89d75662b30a1dbdd45f6a610d9f0c)) - ## [1.35.1](https://github.com/googleapis/gax-php/compare/v1.35.0...v1.35.1) (2024-12-04) diff --git a/lib/Google/vendor/google/gax/VERSION b/lib/Google/vendor/google/gax/VERSION index 39fc130ef..7eee78574 100644 --- a/lib/Google/vendor/google/gax/VERSION +++ b/lib/Google/vendor/google/gax/VERSION @@ -1 +1 @@ -1.36.0 +1.35.1 diff --git a/lib/Google/vendor/google/gax/composer.json b/lib/Google/vendor/google/gax/composer.json index 06152f6ed..2806aeb22 100644 --- a/lib/Google/vendor/google/gax/composer.json +++ b/lib/Google/vendor/google/gax/composer.json @@ -7,7 +7,7 @@ "license": "BSD-3-Clause", "require": { "php": "^8.0", - "google/auth": "^1.45", + "google/auth": "^1.34.0", "google/grpc-gcp": "^0.4", "grpc/grpc": "^1.13", "google/protobuf": "^v3.25.3||^4.26.1", @@ -21,7 +21,7 @@ "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "3.*", "phpspec/prophecy-phpunit": "^2.1", - "phpstan/phpstan": "^2.0" + "phpstan/phpstan": "^1.10" }, "conflict": { "ext-protobuf": "<3.7.0" @@ -35,7 +35,7 @@ "autoload-dev": { "psr-4": { "Google\\ApiCore\\Dev\\": "dev/src", - "Google\\ApiCore\\Tests\\": "tests", + "Google\\ApiCore\\": "tests", "GPBMetadata\\Google\\": "metadata/Google" } }, diff --git a/lib/Google/vendor/google/gax/phpunit.xml.dist b/lib/Google/vendor/google/gax/phpunit.xml.dist index 825f7f706..3112d3d95 100644 --- a/lib/Google/vendor/google/gax/phpunit.xml.dist +++ b/lib/Google/vendor/google/gax/phpunit.xml.dist @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - tests/Unit + tests/Tests/Unit diff --git a/lib/Google/vendor/google/gax/src/BidiStream.php b/lib/Google/vendor/google/gax/src/BidiStream.php index e4d6718b2..daf81a570 100644 --- a/lib/Google/vendor/google/gax/src/BidiStream.php +++ b/lib/Google/vendor/google/gax/src/BidiStream.php @@ -31,44 +31,32 @@ */ namespace Google\ApiCore; -use Google\Auth\Logging\LoggingTrait; -use Google\Auth\Logging\RpcLogEvent; -use Google\Protobuf\Internal\Message; use Google\Rpc\Code; use Grpc\BidiStreamingCall; -use Psr\Log\LoggerInterface; /** * BidiStream is the response object from a gRPC bidirectional streaming API call. */ class BidiStream { - use LoggingTrait; - private $call; private $isComplete = false; private $writesClosed = false; private $resourcesGetMethod = null; private $pendingResources = []; - private null|LoggerInterface $logger = null; /** * BidiStream constructor. * * @param BidiStreamingCall $bidiStreamingCall The gRPC bidirectional streaming call object * @param array $streamingDescriptor - * @param null|LoggerInterface $logger */ - public function __construct( - BidiStreamingCall $bidiStreamingCall, - array $streamingDescriptor = [], - null|LoggerInterface $logger = null, - ) { + public function __construct(BidiStreamingCall $bidiStreamingCall, array $streamingDescriptor = []) + { $this->call = $bidiStreamingCall; if (array_key_exists('resourcesGetMethod', $streamingDescriptor)) { $this->resourcesGetMethod = $streamingDescriptor['resourcesGetMethod']; } - $this->logger = $logger; } /** @@ -85,18 +73,6 @@ public function write($request) if ($this->writesClosed) { throw new ValidationException('Cannot call write() after calling closeWrite().'); } - - if ($this->logger && $request instanceof Message) { - $logEvent = new RpcLogEvent(); - - $logEvent->headers = null; - $logEvent->payload = $request->serializeToJsonString(); - $logEvent->processId = (int) getmypid(); - $logEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); - - $this->logRequest($logEvent); - } - $this->call->write($request); } @@ -168,22 +144,6 @@ public function read() throw ApiException::createFromStdClass($status); } } - - if ($this->logger) { - $responseEvent = new RpcLogEvent(); - - $responseEvent->headers = $this->call->getMetadata(); - $responseEvent->status = $status->code ?? null; - $responseEvent->processId = (int) getmypid(); - $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); - - if ($result instanceof Message) { - $responseEvent->payload = $result->serializeToJsonString(); - } - - $this->logResponse($responseEvent); - } - return $result; } diff --git a/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php b/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php index 62ea0ec36..ece1a41a6 100644 --- a/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php +++ b/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php @@ -32,15 +32,11 @@ namespace Google\ApiCore; -use Google\Auth\ApplicationDefaultCredentials; use Google\Auth\CredentialsLoader; use Google\Auth\FetchAuthTokenInterface; use Google\Auth\GetUniverseDomainInterface; -use Google\Auth\HttpHandler\HttpHandlerFactory; use Grpc\Gcp\ApiConfig; use Grpc\Gcp\Config; -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; /** * Common functions used to work with various clients. @@ -102,7 +98,6 @@ private function buildClientOptions(array $options) 'apiEndpoint' => null, 'clientCertSource' => null, 'universeDomain' => null, - 'logger' => null, ]; $supportedTransports = $this->supportedTransports(); @@ -120,51 +115,18 @@ private function buildClientOptions(array $options) // Keep track of the API Endpoint $apiEndpoint = $options['apiEndpoint'] ?? null; - // Keep track of the original user supplied options for logging the configuration - $clientSuppliedOptions = $options; - // Merge defaults into $options starting from top level // variables, then going into deeper nesting, so that // we will not encounter missing keys $options += $defaultOptions; - - // If logger is explicitly set to false, logging is disabled - if (is_null($options['logger'])) { - $options['logger'] = ApplicationDefaultCredentials::getDefaultLogger(); - } - - if ( - $options['logger'] !== null - && $options['logger'] !== false - && !$options['logger'] instanceof LoggerInterface - ) { - throw new ValidationException( - 'The "logger" option in the options array should be PSR-3 LoggerInterface compatible' - ); - } - - // Log the user supplied configuration. - $this->logConfiguration($options['logger'], $clientSuppliedOptions); - - if (isset($options['logger'])) { - $options['credentialsConfig']['authHttpHandler'] = HttpHandlerFactory::build( - logger: $options['logger'] - ); - } - $options['credentialsConfig'] += $defaultOptions['credentialsConfig']; $options['transportConfig'] += $defaultOptions['transportConfig']; // @phpstan-ignore-line if (isset($options['transportConfig']['grpc'])) { $options['transportConfig']['grpc'] += $defaultOptions['transportConfig']['grpc']; $options['transportConfig']['grpc']['stubOpts'] += $defaultOptions['transportConfig']['grpc']['stubOpts']; - $options['transportConfig']['grpc']['logger'] = $options['logger'] ?? null; } if (isset($options['transportConfig']['rest'])) { $options['transportConfig']['rest'] += $defaultOptions['transportConfig']['rest']; - $options['transportConfig']['rest']['logger'] = $options['logger'] ?? null; - } - if (isset($options['transportConfig']['grpc-fallback'])) { - $options['transportConfig']['grpc-fallback']['logger'] = $options['logger'] ?? null; } // These calls do not apply to "New Surface" clients. @@ -355,27 +317,4 @@ private function isBackwardsCompatibilityMode(): bool { return false; } - - /** - * @param null|false|LoggerInterface $logger - * @param string $options - */ - private function logConfiguration(null|false|LoggerInterface $logger, array $options): void - { - if (!$logger) { - return; - } - - $configurationLog = [ - 'timestamp' => date(DATE_RFC3339), - 'severity' => strtoupper(LogLevel::DEBUG), - 'processId' => getmypid(), - 'jsonPayload' => [ - 'serviceName' => self::SERVICE_NAME, // @phpstan-ignore-line - 'clientConfiguration' => $options, - ] - ]; - - $logger->debug(json_encode($configurationLog)); - } } diff --git a/lib/Google/vendor/google/gax/src/ClientStream.php b/lib/Google/vendor/google/gax/src/ClientStream.php index 6c249551c..7e08b1327 100644 --- a/lib/Google/vendor/google/gax/src/ClientStream.php +++ b/lib/Google/vendor/google/gax/src/ClientStream.php @@ -31,37 +31,27 @@ */ namespace Google\ApiCore; -use Google\Auth\Logging\LoggingTrait; -use Google\Auth\Logging\RpcLogEvent; -use Google\Protobuf\Internal\Message; use Google\Rpc\Code; use Grpc\ClientStreamingCall; -use Psr\Log\LoggerInterface; /** * ClientStream is the response object from a gRPC client streaming API call. */ class ClientStream { - use LoggingTrait; - private $call; - private null|LoggerInterface $logger; /** * ClientStream constructor. * * @param ClientStreamingCall $clientStreamingCall The gRPC client streaming call object * @param array $streamingDescriptor - * @param null|LoggerInterface $logger A PSR-3 compliant logger. */ public function __construct(// @phpstan-ignore-line ClientStreamingCall $clientStreamingCall, - array $streamingDescriptor = [], - null|LoggerInterface $logger = null, + array $streamingDescriptor = [] ) { $this->call = $clientStreamingCall; - $this->logger = $logger; } /** @@ -71,17 +61,6 @@ public function __construct(// @phpstan-ignore-line */ public function write($request) { - // In some cases, $request can be a string - if ($this->logger && $request instanceof Message) { - $requestEvent = new RpcLogEvent(); - - $requestEvent->payload = $request->serializeToJsonString(); - $requestEvent->processId = (int) getmypid(); - $requestEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); - - $this->logRequest($requestEvent); - } - $this->call->write($request); } @@ -95,21 +74,6 @@ public function readResponse() { list($response, $status) = $this->call->wait(); if ($status->code == Code::OK) { - if ($this->logger) { - $responseEvent = new RpcLogEvent(); - - $responseEvent->headers = $status->metadata; - $responseEvent->status = $status->code; - $responseEvent->processId = (int) getmypid(); - $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); - - if ($response instanceof Message) { - $response->serializeToJsonString(); - } - - $this->logResponse($responseEvent); - } - return $response; } else { throw ApiException::createFromStdClass($status); diff --git a/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php index 4e8f6e79d..4a791cd71 100644 --- a/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php +++ b/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php @@ -84,11 +84,6 @@ public function __invoke(Call $call, array $options) } } - // Setting the retry attempt for logging - if ($this->retryAttempts > 0) { - $options['retryAttempt'] = $this->retryAttempts; - } - // Call the handler immediately if retry settings are disabled. if (!$this->retrySettings->retriesEnabled()) { return $nextHandler($call, $options); diff --git a/lib/Google/vendor/google/gax/src/Options/ClientOptions.php b/lib/Google/vendor/google/gax/src/Options/ClientOptions.php index 797749891..5ad4268c2 100644 --- a/lib/Google/vendor/google/gax/src/Options/ClientOptions.php +++ b/lib/Google/vendor/google/gax/src/Options/ClientOptions.php @@ -38,7 +38,6 @@ use Google\ApiCore\Transport\TransportInterface; use Google\Auth\FetchAuthTokenInterface; use InvalidArgumentException; -use Psr\Log\LoggerInterface; /** * The ClientOptions class adds typing to the associative array of options @@ -97,8 +96,6 @@ class ClientOptions implements ArrayAccess private ?string $apiKey; - private null|false|LoggerInterface $logger; - /** * @param array $options { * @type string $apiEndpoint @@ -157,10 +154,8 @@ class ClientOptions implements ArrayAccess * A callable which returns the client cert as a string. * @type string $universeDomain * The default service domain for a given Cloud universe. - * @type string $apiKey + * @type string $apiKey * The API key to be used for the client. - * @type null|false|LoggerInterface - * A PSR-3 compliant logger. * } */ public function __construct(array $options) @@ -191,7 +186,6 @@ private function fromArray(array $arr): void $this->setClientCertSource($arr['clientCertSource'] ?? null); $this->setUniverseDomain($arr['universeDomain'] ?? null); $this->setApiKey($arr['apiKey'] ?? null); - $this->setLogger($arr['logger'] ?? null); } /** @@ -334,12 +328,4 @@ public function setApiKey(?string $apiKey) { $this->apiKey = $apiKey; } - - /** - * @param null|false|LoggerInterface $logger - */ - public function setLogger(null|false|LoggerInterface $logger) - { - $this->logger = $logger; - } } diff --git a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php index 285a9803d..73ac2267c 100644 --- a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php +++ b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php @@ -35,7 +35,6 @@ use ArrayAccess; use Closure; use Google\ApiCore\Options\OptionsTrait; -use Psr\Log\LoggerInterface; /** * The GrpcFallbackTransportOptions class provides typing to the associative array of options used @@ -49,8 +48,6 @@ class GrpcFallbackTransportOptions implements ArrayAccess private ?Closure $httpHandler; - private null|false|LoggerInterface $logger; - /** * @param array $options { * Config options used to construct the gRPC Fallback transport. @@ -59,8 +56,6 @@ class GrpcFallbackTransportOptions implements ArrayAccess * A callable which returns the client cert as a string. * @type callable $httpHandler * A handler used to deliver PSR-7 requests. - * @type null|false|LoggerInterface - * A PSR-3 logger interface instance. * } */ public function __construct(array $options) @@ -77,7 +72,6 @@ private function fromArray(array $arr): void { $this->setClientCertSource($arr['clientCertSource'] ?? null); $this->setHttpHandler($arr['httpHandler'] ?? null); - $this->setLogger($arr['logger'] ?? null); } public function setHttpHandler(?callable $httpHandler) @@ -98,12 +92,4 @@ public function setClientCertSource(?callable $clientCertSource) } $this->clientCertSource = $clientCertSource; } - - /** - * @param null|false|LoggerInterface $logger - */ - public function setLogger(null|false|LoggerInterface $logger) - { - $this->logger = $logger; - } } diff --git a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php index 65fdda5fe..3a7d45015 100644 --- a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php +++ b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php @@ -38,7 +38,6 @@ use Google\ApiCore\Transport\Grpc\UnaryInterceptorInterface; use Grpc\Channel; use Grpc\Interceptor; -use Psr\Log\LoggerInterface; /** * The GrpcTransportOptions class provides typing to the associative array of options used to @@ -52,8 +51,6 @@ class GrpcTransportOptions implements ArrayAccess private ?Channel $channel; - private null|false|LoggerInterface $logger; - /** * @var Interceptor[]|UnaryInterceptorInterface[] */ @@ -77,7 +74,6 @@ class GrpcTransportOptions implements ArrayAccess * `UnaryInterceptorInterface` implementations over to a class which * extends {@see Grpc\Interceptor}. * @type callable $clientCertSource A callable which returns the client cert as a string. - * @type null|false|LoggerInterface A PSR-3 Logger Interface. * } */ public function __construct(array $options) @@ -96,7 +92,6 @@ private function fromArray(array $arr): void $this->setChannel($arr['channel'] ?? null); $this->setInterceptors($arr['interceptors'] ?? []); $this->setClientCertSource($arr['clientCertSource'] ?? null); - $this->setLogger($arr['logger'] ?? null); } /** @@ -133,12 +128,4 @@ public function setClientCertSource(?callable $clientCertSource) } $this->clientCertSource = $clientCertSource; } - - /** - * @param null|false|LoggerInterface $logger - */ - public function setLogger(null|false|LoggerInterface $logger) - { - $this->logger = $logger; - } } diff --git a/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php b/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php index 0f0fd3a92..4bb4b53f8 100644 --- a/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php +++ b/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php @@ -35,7 +35,6 @@ use ArrayAccess; use Closure; use Google\ApiCore\Options\OptionsTrait; -use Psr\Log\LoggerInterface; /** * The RestTransportOptions class provides typing to the associative array of options used to @@ -51,8 +50,6 @@ class RestTransportOptions implements ArrayAccess private ?string $restClientConfigPath; - private null|false|LoggerInterface $logger; - /** * @param array $options { * Config options used to construct the REST transport. @@ -63,8 +60,6 @@ class RestTransportOptions implements ArrayAccess * A callable which returns the client cert as a string. * @type string $restClientConfigPath * The path to the REST client config file. - * @typo null|false|LoggerInterface - * A PSR-3 compliant logger instance. * } */ public function __construct(array $options) @@ -82,7 +77,6 @@ private function fromArray(array $arr): void $this->setHttpHandler($arr['httpHandler'] ?? null); $this->setClientCertSource($arr['clientCertSource'] ?? null); $this->setRestClientConfigPath($arr['restClientConfigPath'] ?? null); - $this->setLogger($arr['logger'] ?? null); } /** @@ -114,12 +108,4 @@ public function setRestClientConfigPath(?string $restClientConfigPath) { $this->restClientConfigPath = $restClientConfigPath; } - - /** - * @param null|false|LoggerInterface $logger - */ - public function setLogger(null|false|LoggerInterface $logger) - { - $this->logger = $logger; - } } diff --git a/lib/Google/vendor/google/gax/src/ServerStream.php b/lib/Google/vendor/google/gax/src/ServerStream.php index 548b6b48c..b9c632591 100644 --- a/lib/Google/vendor/google/gax/src/ServerStream.php +++ b/lib/Google/vendor/google/gax/src/ServerStream.php @@ -31,40 +31,28 @@ */ namespace Google\ApiCore; -use Google\Auth\Logging\LoggingTrait; -use Google\Auth\Logging\RpcLogEvent; -use Google\Protobuf\Internal\Message; use Google\Rpc\Code; -use Psr\Log\LoggerInterface; /** * ServerStream is the response object from a server streaming API call. */ class ServerStream { - use LoggingTrait; - private $call; private $resourcesGetMethod; - private null|LoggerInterface $logger; /** * ServerStream constructor. * * @param ServerStreamingCallInterface $serverStreamingCall The server streaming call object * @param array $streamingDescriptor - * @param null|LoggerInterface $logger A PSR-3 compliant logger. */ - public function __construct( - $serverStreamingCall, - array $streamingDescriptor = [], - null|LoggerInterface $logger = null - ) { + public function __construct($serverStreamingCall, array $streamingDescriptor = []) + { $this->call = $serverStreamingCall; if (array_key_exists('resourcesGetMethod', $streamingDescriptor)) { $this->resourcesGetMethod = $streamingDescriptor['resourcesGetMethod']; } - $this->logger = $logger; } /** @@ -77,21 +65,14 @@ public function __construct( public function readAll() { $resourcesGetMethod = $this->resourcesGetMethod; - foreach ($this->call->responses() as $response) { - if ($this->logger && $response instanceof Message) { - $responseEvent = new RpcLogEvent(); - $responseEvent->payload = $response->serializeToJsonString(); - $responseEvent->processId = (int) getmypid(); - $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); - - $this->logResponse($responseEvent); - } - - if (!is_null($resourcesGetMethod)) { + if (!is_null($resourcesGetMethod)) { + foreach ($this->call->responses() as $response) { foreach ($response->$resourcesGetMethod() as $resource) { yield $resource; } - } else { + } + } else { + foreach ($this->call->responses() as $response) { yield $response; } } @@ -99,16 +80,6 @@ public function readAll() // Errors in the REST transport will be thrown from there and not reach // this handling. Successful REST server-streams will have an OK status. $status = $this->call->getStatus(); - - if ($this->logger) { - $statusEvent = new RpcLogEvent(); - $statusEvent->status = $status->code; - $statusEvent->processId = (int) getmypid(); - $statusEvent->requestId = crc32((string) spl_object_id($this) . getmypid()); - - $this->logResponse($statusEvent); - } - if ($status->code !== Code::OK) { throw ApiException::createFromStdClass($status); } diff --git a/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php b/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php index b248b052e..808c176c7 100644 --- a/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php +++ b/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php @@ -62,7 +62,7 @@ class GrpcFallbackTransport implements TransportInterface */ public function __construct( string $baseUri, - callable $httpHandler, + callable $httpHandler ) { $this->baseUri = $baseUri; $this->httpHandler = $httpHandler; @@ -87,10 +87,9 @@ public static function build(string $apiEndpoint, array $config = []) $config += [ 'httpHandler' => null, 'clientCertSource' => null, - 'logger' => null, ]; list($baseUri, $port) = self::normalizeServiceAddress($apiEndpoint); - $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync(logger: $config['logger']); + $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync(); $transport = new GrpcFallbackTransport("$baseUri:$port", $httpHandler); if ($config['clientCertSource']) { $transport->configureMtlsChannel($config['clientCertSource']); @@ -104,9 +103,6 @@ public static function build(string $apiEndpoint, array $config = []) public function startUnaryCall(Call $call, array $options) { $httpHandler = $this->httpHandler; - - $options['requestId'] = crc32((string) spl_object_id($call) . getmypid()); - return $httpHandler( $this->buildRequest($call, $options), $this->getCallOptions($options) @@ -180,14 +176,6 @@ private function getCallOptions(array $options) $callOptions['timeout'] = $options['timeoutMillis'] / 1000; } - if (isset($options['retryAttempt'])) { - $callOptions['retryAttempt'] = $options['retryAttempt']; - } - - if (isset($options['requestId'])) { - $callOptions['requestId'] = $options['requestId']; - } - if ($this->clientCertSource) { list($cert, $key) = self::loadClientCertSource($this->clientCertSource); $callOptions['cert'] = $cert; diff --git a/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php b/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php index ebcbc07b2..816de0c78 100644 --- a/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php +++ b/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php @@ -44,15 +44,12 @@ use Google\ApiCore\Transport\Grpc\UnaryInterceptorInterface; use Google\ApiCore\ValidationException; use Google\ApiCore\ValidationTrait; -use Google\Auth\Logging\LoggingTrait; -use Google\Auth\Logging\RpcLogEvent; use Google\Rpc\Code; use Grpc\BaseStub; use Grpc\Channel; use Grpc\ChannelCredentials; use Grpc\Interceptor; use GuzzleHttp\Promise\Promise; -use Psr\Log\LoggerInterface; /** * A gRPC based transport implementation. @@ -62,9 +59,6 @@ class GrpcTransport extends BaseStub implements TransportInterface use ValidationTrait; use GrpcSupportTrait; use ServiceAddressTrait; - use LoggingTrait; - - private null|LoggerInterface $logger; /** * @param string $hostname @@ -81,16 +75,10 @@ class GrpcTransport extends BaseStub implements TransportInterface * release. To prepare for this, please take the time to convert * `UnaryInterceptorInterface` implementations over to a class which * extends {@see Grpc\Interceptor}. - * @param null|false|LoggerInterface $logger A PSR-3 Compliant logger. * @throws Exception */ - public function __construct( - string $hostname, - array $opts, - ?Channel $channel = null, - array $interceptors = [], - null|false|LoggerInterface $logger = null - ) { + public function __construct(string $hostname, array $opts, ?Channel $channel = null, array $interceptors = []) + { if ($interceptors) { $channel = Interceptor::intercept( $channel ?: new Channel($hostname, $opts), @@ -99,7 +87,6 @@ public function __construct( } parent::__construct($hostname, $opts, $channel); - $this->logger = $logger; } /** @@ -135,7 +122,6 @@ public static function build(string $apiEndpoint, array $config = []) 'channel' => null, 'interceptors' => [], 'clientCertSource' => null, - 'logger' => null, ]; list($addr, $port) = self::normalizeServiceAddress($apiEndpoint); $host = "$addr:$port"; @@ -158,10 +144,7 @@ public static function build(string $apiEndpoint, array $config = []) ); } try { - if ($config['logger'] === false) { - $config['logger'] = null; - } - return new GrpcTransport($host, $stubOpts, $channel, $config['interceptors'], $config['logger']); + return new GrpcTransport($host, $stubOpts, $channel, $config['interceptors']); } catch (Exception $ex) { throw new ValidationException( 'Failed to build GrpcTransport: ' . $ex->getMessage(), @@ -185,8 +168,7 @@ public function startBidiStreamingCall(Call $call, array $options) isset($options['headers']) ? $options['headers'] : [], $this->getCallOptions($options) ), - $call->getDescriptor(), - $this->logger + $call->getDescriptor() ); } @@ -205,8 +187,7 @@ public function startClientStreamingCall(Call $call, array $options) isset($options['headers']) ? $options['headers'] : [], $this->getCallOptions($options) ), - $call->getDescriptor(), - $this->logger + $call->getDescriptor() ); } @@ -231,28 +212,10 @@ public function startServerStreamingCall(Call $call, array $options) isset($options['headers']) ? $options['headers'] : [], $this->getCallOptions($options) ); - - $serverStream = new ServerStream( + return new ServerStream( new ServerStreamingCallWrapper($stream), - $call->getDescriptor(), - $this->logger + $call->getDescriptor() ); - - if ($this->logger) { - $requestEvent = new RpcLogEvent(); - - $requestEvent->headers = $options['headers']; - $requestEvent->payload = $call->getMessage()->serializeToJsonString(); - $requestEvent->retryAttempt = $options['retryAttempt'] ?? null; - $requestEvent->serviceName = $options['serviceName'] ?? null; - $requestEvent->rpcName = $call->getMethod(); - $requestEvent->processId = (int) getmypid(); - $requestEvent->requestId = crc32((string) spl_object_id($serverStream) . getmypid()); - - $this->logRequest($requestEvent); - } - - return $serverStream; } /** @@ -261,8 +224,6 @@ public function startServerStreamingCall(Call $call, array $options) public function startUnaryCall(Call $call, array $options) { $this->verifyUniverseDomain($options); - $headers = $options['headers'] ?? []; - $requestEvent = null; $unaryCall = $this->_simpleRequest( '/' . $call->getMethod(), @@ -272,37 +233,11 @@ public function startUnaryCall(Call $call, array $options) $this->getCallOptions($options) ); - if ($this->logger) { - $requestEvent = new RpcLogEvent(); - - $requestEvent->headers = $headers; - $requestEvent->payload = $call->getMessage()->serializeToJsonString(); - $requestEvent->retryAttempt = $options['retryAttempt'] ?? null; - $requestEvent->serviceName = $options['serviceName'] ?? null; - $requestEvent->rpcName = $call->getMethod(); - $requestEvent->processId = (int) getmypid(); - $requestEvent->requestId = crc32((string) spl_object_id($call) . getmypid()); - - $this->logRequest($requestEvent); - } - /** @var Promise $promise */ $promise = new Promise( - function () use ($unaryCall, $options, &$promise, $requestEvent) { + function () use ($unaryCall, $options, &$promise) { list($response, $status) = $unaryCall->wait(); - if ($this->logger) { - $responseEvent = new RpcLogEvent($requestEvent->milliseconds); - - $responseEvent->headers = $status->metadata; - $responseEvent->payload = ($response) ? $response->serializeToJsonString() : null; - $responseEvent->status = $status->code; - $responseEvent->processId = $requestEvent->processId; - $responseEvent->requestId = $requestEvent->requestId; - - $this->logResponse($responseEvent); - } - if ($status->code == Code::OK) { if (isset($options['metadataCallback'])) { $metadataCallback = $options['metadataCallback']; diff --git a/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php b/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php index 38c4ca1f5..fd082d5b3 100644 --- a/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php +++ b/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php @@ -35,7 +35,6 @@ use Google\ApiCore\Call; use Google\ApiCore\ValidationException; use Google\Auth\HttpHandler\HttpHandlerFactory; -use Psr\Log\LoggerInterface; /** * A trait for shared functionality between transports that support only unary RPCs using simple @@ -127,10 +126,10 @@ private static function buildCommonHeaders(array $options) * @return callable * @throws ValidationException */ - private static function buildHttpHandlerAsync(null|false|LoggerInterface $logger = null) + private static function buildHttpHandlerAsync() { try { - return [HttpHandlerFactory::build(logger: $logger), 'async']; + return [HttpHandlerFactory::build(), 'async']; } catch (Exception $ex) { throw new ValidationException('Failed to build HttpHandler', $ex->getCode(), $ex); } diff --git a/lib/Google/vendor/google/gax/src/Transport/RestTransport.php b/lib/Google/vendor/google/gax/src/Transport/RestTransport.php index 296937fa4..39ef012ba 100644 --- a/lib/Google/vendor/google/gax/src/Transport/RestTransport.php +++ b/lib/Google/vendor/google/gax/src/Transport/RestTransport.php @@ -95,13 +95,12 @@ public static function build(string $apiEndpoint, string $restConfigPath, array 'httpHandler' => null, 'clientCertSource' => null, 'hasEmulator' => false, - 'logger' => null, ]; list($baseUri, $port) = self::normalizeServiceAddress($apiEndpoint); $requestBuilder = $config['hasEmulator'] ? new InsecureRequestBuilder("$baseUri:$port", $restConfigPath) : new RequestBuilder("$baseUri:$port", $restConfigPath); - $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync($config['logger']); + $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync(); $transport = new RestTransport($requestBuilder, $httpHandler); if ($config['clientCertSource']) { $transport->configureMtlsChannel($config['clientCertSource']); @@ -116,9 +115,6 @@ public function startUnaryCall(Call $call, array $options) { $headers = self::buildCommonHeaders($options); - // Add the $call object ID for logging - $options['requestId'] = crc32((string) spl_object_id($call) . getmypid()); - // call the HTTP handler $httpHandler = $this->httpHandler; return $httpHandler( @@ -270,14 +266,6 @@ private function getCallOptions(array $options) $callOptions['key'] = $key; } - if (isset($options['retryAttempt'])) { - $callOptions['retryAttempt'] = $options['retryAttempt']; - } - - if (isset($options['requestId'])) { - $callOptions['requestId'] = $options['requestId']; - } - return $callOptions; } } diff --git a/lib/Google/vendor/google/grpc-gcp/.github/workflows/tests.yml b/lib/Google/vendor/google/grpc-gcp/.github/workflows/tests.yml index 426701d74..fe47b44c0 100644 --- a/lib/Google/vendor/google/grpc-gcp/.github/workflows/tests.yml +++ b/lib/Google/vendor/google/grpc-gcp/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [ "8.0", "8.1", "8.2", "8.3" ] + php: [ "8.0", "8.1", "8.2", "8.3", "8.4" ] name: "PHP ${{ matrix.php }} Unit Test" steps: - uses: actions/checkout@v2 diff --git a/lib/Google/vendor/google/grpc-gcp/src/Config.php b/lib/Google/vendor/google/grpc-gcp/src/Config.php index dedc21b72..397047b2d 100644 --- a/lib/Google/vendor/google/grpc-gcp/src/Config.php +++ b/lib/Google/vendor/google/grpc-gcp/src/Config.php @@ -37,7 +37,7 @@ class Config * cross requests within a single worker process. * @throws \RuntimeException When a failure occurs while attempting to attach to shared memory. */ - public function __construct($target, $conf = null, CacheItemPoolInterface $cacheItemPool = null) + public function __construct($target, $conf = null, ?CacheItemPoolInterface $cacheItemPool = null) { if ($conf == null) { // If there is no configure file, use the default gRPC channel. diff --git a/lib/Google/vendor/google/longrunning/VERSION b/lib/Google/vendor/google/longrunning/VERSION index ef52a6480..f90568270 100644 --- a/lib/Google/vendor/google/longrunning/VERSION +++ b/lib/Google/vendor/google/longrunning/VERSION @@ -1 +1 @@ -0.4.6 +0.4.7 diff --git a/lib/Google/vendor/google/longrunning/composer.json b/lib/Google/vendor/google/longrunning/composer.json index bec78c5d0..df405a30d 100644 --- a/lib/Google/vendor/google/longrunning/composer.json +++ b/lib/Google/vendor/google/longrunning/composer.json @@ -3,7 +3,7 @@ "description": "Google LongRunning Client for PHP", "license": "Apache-2.0", "minimum-stability": "stable", - "version": "0.4.6", + "version": "0.4.7", "autoload": { "psr-4": { "Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning", diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php b/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php index e275b18af..b5f5acafd 100644 --- a/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php +++ b/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php @@ -123,6 +123,12 @@ private static function getClientDefaults() * {@see \Google\Auth\FetchAuthTokenInterface} object or * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these * objects are provided, any settings in $credentialsConfig will be ignored. + * *Important*: If you accept a credential configuration (credential + * JSON/File/Stream) from an external source for authentication to Google Cloud + * Platform, you must validate it before providing it to any Google API or library. + * Providing an unvalidated credential configuration to Google APIs can compromise + * the security of your systems and data. For more information {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} * @type array $credentialsConfig * Options used to configure credentials, including auth token caching, for the * client. For a full list of supporting configuration options, see diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php index fbce4bfdb..c9a295201 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Any.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -google/protobuf/any.protogoogle.protobuf"& -Any -type_url (  -value ( Bv -com.google.protobufBAnyProtoPZ,google.golang.org/protobuf/types/known/anypbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xD4\x01\x0A\x19google/protobuf/any.proto\x12\x0Fgoogle.protobuf\"&\x0A\x03Any\x12\x10\x0A\x08type_url\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x0CBv\x0A\x13com.google.protobufB\x08AnyProtoP\x01Z,google.golang.org/protobuf/types/known/anypb\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php index 75e0ec631..4485d3d0b 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Api.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -google/protobuf/api.protogoogle.protobufgoogle/protobuf/type.proto" -Api -name ( ( -methods ( 2.google.protobuf.Method( -options ( 2.google.protobuf.Option -version ( 6 -source_context ( 2.google.protobuf.SourceContext& -mixins ( 2.google.protobuf.Mixin\' -syntax (2.google.protobuf.Syntax" -Method -name (  -request_type_url (  -request_streaming ( -response_type_url (  -response_streaming (( -options ( 2.google.protobuf.Option\' -syntax (2.google.protobuf.Syntax"# -Mixin -name (  -root ( Bv -com.google.protobufBApiProtoPZ,google.golang.org/protobuf/types/known/apipbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xC9\x05\x0A\x19google/protobuf/api.proto\x12\x0Fgoogle.protobuf\x1A\x1Agoogle/protobuf/type.proto\"\x81\x02\x0A\x03Api\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12(\x0A\x07methods\x18\x02 \x03(\x0B2\x17.google.protobuf.Method\x12(\x0A\x07options\x18\x03 \x03(\x0B2\x17.google.protobuf.Option\x12\x0F\x0A\x07version\x18\x04 \x01(\x09\x126\x0A\x0Esource_context\x18\x05 \x01(\x0B2\x1E.google.protobuf.SourceContext\x12&\x0A\x06mixins\x18\x06 \x03(\x0B2\x16.google.protobuf.Mixin\x12'\x0A\x06syntax\x18\x07 \x01(\x0E2\x17.google.protobuf.Syntax\"\xD5\x01\x0A\x06Method\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x18\x0A\x10request_type_url\x18\x02 \x01(\x09\x12\x19\x0A\x11request_streaming\x18\x03 \x01(\x08\x12\x19\x0A\x11response_type_url\x18\x04 \x01(\x09\x12\x1A\x0A\x12response_streaming\x18\x05 \x01(\x08\x12(\x0A\x07options\x18\x06 \x03(\x0B2\x17.google.protobuf.Option\x12'\x0A\x06syntax\x18\x07 \x01(\x0E2\x17.google.protobuf.Syntax\"#\x0A\x05Mixin\x12\x0C\x0A\x04name\x18\x01 \x01(\x09\x12\x0C\x0A\x04root\x18\x02 \x01(\x09Bv\x0A\x13com.google.protobufB\x08ApiProtoP\x01Z,google.golang.org/protobuf/types/known/apipb\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php index 5d8023e4d..29e02a845 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Duration.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -google/protobuf/duration.protogoogle.protobuf"* -Duration -seconds ( -nanos (B -com.google.protobufB DurationProtoPZ1google.golang.org/protobuf/types/known/durationpbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xEB\x01\x0A\x1Egoogle/protobuf/duration.proto\x12\x0Fgoogle.protobuf\"*\x0A\x08Duration\x12\x0F\x0A\x07seconds\x18\x01 \x01(\x03\x12\x0D\x0A\x05nanos\x18\x02 \x01(\x05B\x83\x01\x0A\x13com.google.protobufB\x0DDurationProtoP\x01Z1google.golang.org/protobuf/types/known/durationpb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php index f31bcc001..394e41043 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/FieldMask.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - - google/protobuf/field_mask.protogoogle.protobuf" - FieldMask -paths ( B -com.google.protobufBFieldMaskProtoPZ2google.golang.org/protobuf/types/known/fieldmaskpbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xDF\x01\x0A google/protobuf/field_mask.proto\x12\x0Fgoogle.protobuf\"\x1A\x0A\x09FieldMask\x12\x0D\x0A\x05paths\x18\x01 \x03(\x09B\x85\x01\x0A\x13com.google.protobufB\x0EFieldMaskProtoP\x01Z2google.golang.org/protobuf/types/known/fieldmaskpb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php index 5e42536f2..2842d0e99 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/GPBEmpty.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -google/protobuf/empty.protogoogle.protobuf" -EmptyB} -com.google.protobufB -EmptyProtoPZ.google.golang.org/protobuf/types/known/emptypbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xBE\x01\x0A\x1Bgoogle/protobuf/empty.proto\x12\x0Fgoogle.protobuf\"\x07\x0A\x05EmptyB}\x0A\x13com.google.protobufB\x0AEmptyProtoP\x01Z.google.golang.org/protobuf/types/known/emptypb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php index 4247c0954..84486a90b 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php @@ -1,5 +1,6 @@ repeated('dependency', \Google\Protobuf\Internal\GPBType::STRING, 3) ->repeated('public_dependency', \Google\Protobuf\Internal\GPBType::INT32, 10) ->repeated('weak_dependency', \Google\Protobuf\Internal\GPBType::INT32, 11) + ->repeated('option_dependency', \Google\Protobuf\Internal\GPBType::STRING, 15) ->repeated('message_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.DescriptorProto') ->repeated('enum_type', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.EnumDescriptorProto') ->repeated('service', \Google\Protobuf\Internal\GPBType::MESSAGE, 6, 'google.protobuf.internal.ServiceDescriptorProto') @@ -31,7 +33,7 @@ public static function initOnce() { ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 8, 'google.protobuf.internal.FileOptions') ->optional('source_code_info', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.SourceCodeInfo') ->optional('syntax', \Google\Protobuf\Internal\GPBType::STRING, 12) - ->optional('edition', \Google\Protobuf\Internal\GPBType::STRING, 13) + ->optional('edition', \Google\Protobuf\Internal\GPBType::ENUM, 14, 'google.protobuf.internal.Edition') ->finalizeToPool(); $pool->addMessage('google.protobuf.internal.DescriptorProto', \Google\Protobuf\Internal\DescriptorProto::class) @@ -45,6 +47,7 @@ public static function initOnce() { ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.MessageOptions') ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 9, 'google.protobuf.internal.DescriptorProto.ReservedRange') ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 10) + ->optional('visibility', \Google\Protobuf\Internal\GPBType::ENUM, 11, 'google.protobuf.internal.SymbolVisibility') ->finalizeToPool(); $pool->addMessage('google.protobuf.internal.DescriptorProto.ExtensionRange', \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class) @@ -60,6 +63,22 @@ public static function initOnce() { $pool->addMessage('google.protobuf.internal.ExtensionRangeOptions', \Google\Protobuf\Internal\ExtensionRangeOptions::class) ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') + ->repeated('declaration', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.ExtensionRangeOptions.Declaration') + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 50, 'google.protobuf.internal.FeatureSet') + ->optional('verification', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.ExtensionRangeOptions.VerificationState') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.ExtensionRangeOptions.Declaration', \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration::class) + ->optional('number', \Google\Protobuf\Internal\GPBType::INT32, 1) + ->optional('full_name', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->optional('type', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('reserved', \Google\Protobuf\Internal\GPBType::BOOL, 5) + ->optional('repeated', \Google\Protobuf\Internal\GPBType::BOOL, 6) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.ExtensionRangeOptions.VerificationState', \Google\Protobuf\Internal\VerificationState::class) + ->value("DECLARATION", 0) + ->value("UNVERIFIED", 1) ->finalizeToPool(); $pool->addMessage('google.protobuf.internal.FieldDescriptorProto', \Google\Protobuf\Internal\FieldDescriptorProto::class) @@ -99,8 +118,8 @@ public static function initOnce() { $pool->addEnum('google.protobuf.internal.FieldDescriptorProto.Label', \Google\Protobuf\Internal\Label::class) ->value("LABEL_OPTIONAL", 1) - ->value("LABEL_REQUIRED", 2) ->value("LABEL_REPEATED", 3) + ->value("LABEL_REQUIRED", 2) ->finalizeToPool(); $pool->addMessage('google.protobuf.internal.OneofDescriptorProto', \Google\Protobuf\Internal\OneofDescriptorProto::class) @@ -114,6 +133,7 @@ public static function initOnce() { ->optional('options', \Google\Protobuf\Internal\GPBType::MESSAGE, 3, 'google.protobuf.internal.EnumOptions') ->repeated('reserved_range', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.EnumDescriptorProto.EnumReservedRange') ->repeated('reserved_name', \Google\Protobuf\Internal\GPBType::STRING, 5) + ->optional('visibility', \Google\Protobuf\Internal\GPBType::ENUM, 6, 'google.protobuf.internal.SymbolVisibility') ->finalizeToPool(); $pool->addMessage('google.protobuf.internal.EnumDescriptorProto.EnumReservedRange', \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class) @@ -153,7 +173,6 @@ public static function initOnce() { ->optional('cc_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 16) ->optional('java_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 17) ->optional('py_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 18) - ->optional('php_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 42) ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 23) ->optional('cc_enable_arenas', \Google\Protobuf\Internal\GPBType::BOOL, 31) ->optional('objc_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 36) @@ -163,6 +182,7 @@ public static function initOnce() { ->optional('php_namespace', \Google\Protobuf\Internal\GPBType::STRING, 41) ->optional('php_metadata_namespace', \Google\Protobuf\Internal\GPBType::STRING, 44) ->optional('ruby_package', \Google\Protobuf\Internal\GPBType::STRING, 45) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 50, 'google.protobuf.internal.FeatureSet') ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); @@ -178,6 +198,7 @@ public static function initOnce() { ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) ->optional('map_entry', \Google\Protobuf\Internal\GPBType::BOOL, 7) ->optional('deprecated_legacy_json_field_conflicts', \Google\Protobuf\Internal\GPBType::BOOL, 11) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 12, 'google.protobuf.internal.FeatureSet') ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); @@ -189,9 +210,27 @@ public static function initOnce() { ->optional('unverified_lazy', \Google\Protobuf\Internal\GPBType::BOOL, 15) ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) ->optional('weak', \Google\Protobuf\Internal\GPBType::BOOL, 10) + ->optional('debug_redact', \Google\Protobuf\Internal\GPBType::BOOL, 16) + ->optional('retention', \Google\Protobuf\Internal\GPBType::ENUM, 17, 'google.protobuf.internal.FieldOptions.OptionRetention') + ->repeated('targets', \Google\Protobuf\Internal\GPBType::ENUM, 19, 'google.protobuf.internal.FieldOptions.OptionTargetType') + ->repeated('edition_defaults', \Google\Protobuf\Internal\GPBType::MESSAGE, 20, 'google.protobuf.internal.FieldOptions.EditionDefault') + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 21, 'google.protobuf.internal.FeatureSet') + ->optional('feature_support', \Google\Protobuf\Internal\GPBType::MESSAGE, 22, 'google.protobuf.internal.FieldOptions.FeatureSupport') ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); + $pool->addMessage('google.protobuf.internal.FieldOptions.EditionDefault', \Google\Protobuf\Internal\FieldOptions\EditionDefault::class) + ->optional('edition', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.Edition') + ->optional('value', \Google\Protobuf\Internal\GPBType::STRING, 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FieldOptions.FeatureSupport', \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class) + ->optional('edition_introduced', \Google\Protobuf\Internal\GPBType::ENUM, 1, 'google.protobuf.internal.Edition') + ->optional('edition_deprecated', \Google\Protobuf\Internal\GPBType::ENUM, 2, 'google.protobuf.internal.Edition') + ->optional('deprecation_warning', \Google\Protobuf\Internal\GPBType::STRING, 3) + ->optional('edition_removed', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.Edition') + ->finalizeToPool(); + $pool->addEnum('google.protobuf.internal.FieldOptions.CType', \Google\Protobuf\Internal\CType::class) ->value("STRING", 0) ->value("CORD", 1) @@ -204,7 +243,27 @@ public static function initOnce() { ->value("JS_NUMBER", 2) ->finalizeToPool(); + $pool->addEnum('google.protobuf.internal.FieldOptions.OptionRetention', \Google\Protobuf\Internal\OptionRetention::class) + ->value("RETENTION_UNKNOWN", 0) + ->value("RETENTION_RUNTIME", 1) + ->value("RETENTION_SOURCE", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FieldOptions.OptionTargetType', \Google\Protobuf\Internal\OptionTargetType::class) + ->value("TARGET_TYPE_UNKNOWN", 0) + ->value("TARGET_TYPE_FILE", 1) + ->value("TARGET_TYPE_EXTENSION_RANGE", 2) + ->value("TARGET_TYPE_MESSAGE", 3) + ->value("TARGET_TYPE_FIELD", 4) + ->value("TARGET_TYPE_ONEOF", 5) + ->value("TARGET_TYPE_ENUM", 6) + ->value("TARGET_TYPE_ENUM_ENTRY", 7) + ->value("TARGET_TYPE_SERVICE", 8) + ->value("TARGET_TYPE_METHOD", 9) + ->finalizeToPool(); + $pool->addMessage('google.protobuf.internal.OneofOptions', \Google\Protobuf\Internal\OneofOptions::class) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.FeatureSet') ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); @@ -212,15 +271,20 @@ public static function initOnce() { ->optional('allow_alias', \Google\Protobuf\Internal\GPBType::BOOL, 2) ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 3) ->optional('deprecated_legacy_json_field_conflicts', \Google\Protobuf\Internal\GPBType::BOOL, 6) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 7, 'google.protobuf.internal.FeatureSet') ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); $pool->addMessage('google.protobuf.internal.EnumValueOptions', \Google\Protobuf\Internal\EnumValueOptions::class) ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 1) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 2, 'google.protobuf.internal.FeatureSet') + ->optional('debug_redact', \Google\Protobuf\Internal\GPBType::BOOL, 3) + ->optional('feature_support', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.FieldOptions.FeatureSupport') ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); $pool->addMessage('google.protobuf.internal.ServiceOptions', \Google\Protobuf\Internal\ServiceOptions::class) + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 34, 'google.protobuf.internal.FeatureSet') ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33) ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); @@ -228,6 +292,7 @@ public static function initOnce() { $pool->addMessage('google.protobuf.internal.MethodOptions', \Google\Protobuf\Internal\MethodOptions::class) ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 33) ->optional('idempotency_level', \Google\Protobuf\Internal\GPBType::ENUM, 34, 'google.protobuf.internal.MethodOptions.IdempotencyLevel') + ->optional('features', \Google\Protobuf\Internal\GPBType::MESSAGE, 35, 'google.protobuf.internal.FeatureSet') ->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption') ->finalizeToPool(); @@ -252,6 +317,83 @@ public static function initOnce() { ->required('is_extension', \Google\Protobuf\Internal\GPBType::BOOL, 2) ->finalizeToPool(); + $pool->addMessage('google.protobuf.internal.FeatureSet', \Google\Protobuf\Internal\FeatureSet::class) + ->optional('field_presence', \Google\Protobuf\Internal\GPBType::ENUM, 1, 'google.protobuf.internal.FeatureSet.FieldPresence') + ->optional('enum_type', \Google\Protobuf\Internal\GPBType::ENUM, 2, 'google.protobuf.internal.FeatureSet.EnumType') + ->optional('repeated_field_encoding', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.FeatureSet.RepeatedFieldEncoding') + ->optional('utf8_validation', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.FeatureSet.Utf8Validation') + ->optional('message_encoding', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.FeatureSet.MessageEncoding') + ->optional('json_format', \Google\Protobuf\Internal\GPBType::ENUM, 6, 'google.protobuf.internal.FeatureSet.JsonFormat') + ->optional('enforce_naming_style', \Google\Protobuf\Internal\GPBType::ENUM, 7, 'google.protobuf.internal.FeatureSet.EnforceNamingStyle') + ->optional('default_symbol_visibility', \Google\Protobuf\Internal\GPBType::ENUM, 8, 'google.protobuf.internal.FeatureSet.VisibilityFeature.DefaultSymbolVisibility') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FeatureSet.VisibilityFeature', \Google\Protobuf\Internal\FeatureSet\VisibilityFeature::class) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.VisibilityFeature.DefaultSymbolVisibility', \Google\Protobuf\Internal\DefaultSymbolVisibility::class) + ->value("DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", 0) + ->value("EXPORT_ALL", 1) + ->value("EXPORT_TOP_LEVEL", 2) + ->value("LOCAL_ALL", 3) + ->value("STRICT", 4) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.FieldPresence', \Google\Protobuf\Internal\FieldPresence::class) + ->value("FIELD_PRESENCE_UNKNOWN", 0) + ->value("EXPLICIT", 1) + ->value("IMPLICIT", 2) + ->value("LEGACY_REQUIRED", 3) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.EnumType', \Google\Protobuf\Internal\EnumType::class) + ->value("ENUM_TYPE_UNKNOWN", 0) + ->value("OPEN", 1) + ->value("CLOSED", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.RepeatedFieldEncoding', \Google\Protobuf\Internal\RepeatedFieldEncoding::class) + ->value("REPEATED_FIELD_ENCODING_UNKNOWN", 0) + ->value("PACKED", 1) + ->value("EXPANDED", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.Utf8Validation', \Google\Protobuf\Internal\Utf8Validation::class) + ->value("UTF8_VALIDATION_UNKNOWN", 0) + ->value("VERIFY", 2) + ->value("NONE", 3) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.MessageEncoding', \Google\Protobuf\Internal\MessageEncoding::class) + ->value("MESSAGE_ENCODING_UNKNOWN", 0) + ->value("LENGTH_PREFIXED", 1) + ->value("DELIMITED", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.JsonFormat', \Google\Protobuf\Internal\JsonFormat::class) + ->value("JSON_FORMAT_UNKNOWN", 0) + ->value("ALLOW", 1) + ->value("LEGACY_BEST_EFFORT", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.FeatureSet.EnforceNamingStyle', \Google\Protobuf\Internal\EnforceNamingStyle::class) + ->value("ENFORCE_NAMING_STYLE_UNKNOWN", 0) + ->value("STYLE2024", 1) + ->value("STYLE_LEGACY", 2) + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FeatureSetDefaults', \Google\Protobuf\Internal\FeatureSetDefaults::class) + ->repeated('defaults', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.FeatureSetDefaults.FeatureSetEditionDefault') + ->optional('minimum_edition', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.Edition') + ->optional('maximum_edition', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.Edition') + ->finalizeToPool(); + + $pool->addMessage('google.protobuf.internal.FeatureSetDefaults.FeatureSetEditionDefault', \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault::class) + ->optional('edition', \Google\Protobuf\Internal\GPBType::ENUM, 3, 'google.protobuf.internal.Edition') + ->optional('overridable_features', \Google\Protobuf\Internal\GPBType::MESSAGE, 4, 'google.protobuf.internal.FeatureSet') + ->optional('fixed_features', \Google\Protobuf\Internal\GPBType::MESSAGE, 5, 'google.protobuf.internal.FeatureSet') + ->finalizeToPool(); + $pool->addMessage('google.protobuf.internal.SourceCodeInfo', \Google\Protobuf\Internal\SourceCodeInfo::class) ->repeated('location', \Google\Protobuf\Internal\GPBType::MESSAGE, 1, 'google.protobuf.internal.SourceCodeInfo.Location') ->finalizeToPool(); @@ -273,6 +415,34 @@ public static function initOnce() { ->optional('source_file', \Google\Protobuf\Internal\GPBType::STRING, 2) ->optional('begin', \Google\Protobuf\Internal\GPBType::INT32, 3) ->optional('end', \Google\Protobuf\Internal\GPBType::INT32, 4) + ->optional('semantic', \Google\Protobuf\Internal\GPBType::ENUM, 5, 'google.protobuf.internal.GeneratedCodeInfo.Annotation.Semantic') + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.GeneratedCodeInfo.Annotation.Semantic', \Google\Protobuf\Internal\Semantic::class) + ->value("NONE", 0) + ->value("SET", 1) + ->value("ALIAS", 2) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.Edition', \Google\Protobuf\Internal\Edition::class) + ->value("EDITION_UNKNOWN", 0) + ->value("EDITION_LEGACY", 900) + ->value("EDITION_PROTO2", 998) + ->value("EDITION_PROTO3", 999) + ->value("EDITION_2023", 1000) + ->value("EDITION_2024", 1001) + ->value("EDITION_1_TEST_ONLY", 1) + ->value("EDITION_2_TEST_ONLY", 2) + ->value("EDITION_99997_TEST_ONLY", 99997) + ->value("EDITION_99998_TEST_ONLY", 99998) + ->value("EDITION_99999_TEST_ONLY", 99999) + ->value("EDITION_MAX", 2147483647) + ->finalizeToPool(); + + $pool->addEnum('google.protobuf.internal.SymbolVisibility', \Google\Protobuf\Internal\SymbolVisibility::class) + ->value("VISIBILITY_UNSET", 0) + ->value("VISIBILITY_LOCAL", 1) + ->value("VISIBILITY_EXPORT", 2) ->finalizeToPool(); $pool->finish(); diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php index 797732d9f..8d1566c05 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/SourceContext.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -$google/protobuf/source_context.protogoogle.protobuf"" - SourceContext - file_name ( B -com.google.protobufBSourceContextProtoPZ6google.golang.org/protobuf/types/known/sourcecontextpbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xF0\x01\x0A\$google/protobuf/source_context.proto\x12\x0Fgoogle.protobuf\"\"\x0A\x0DSourceContext\x12\x11\x0A\x09file_name\x18\x01 \x01(\x09B\x8A\x01\x0A\x13com.google.protobufB\x12SourceContextProtoP\x01Z6google.golang.org/protobuf/types/known/sourcecontextpb\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php index 888a81ade..6fad5d9a8 100644 Binary files a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php and b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Struct.php differ diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php index 09437271a..fd4eaacc9 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Timestamp.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -google/protobuf/timestamp.protogoogle.protobuf"+ - Timestamp -seconds ( -nanos (B -com.google.protobufBTimestampProtoPZ2google.golang.org/protobuf/types/known/timestamppbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xEF\x01\x0A\x1Fgoogle/protobuf/timestamp.proto\x12\x0Fgoogle.protobuf\"+\x0A\x09Timestamp\x12\x0F\x0A\x07seconds\x18\x01 \x01(\x03\x12\x0D\x0A\x05nanos\x18\x02 \x01(\x05B\x85\x01\x0A\x13com.google.protobufB\x0ETimestampProtoP\x01Z2google.golang.org/protobuf/types/known/timestamppb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php index 7d0bfbb53..6bec20ded 100644 Binary files a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php and b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Type.php differ diff --git a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php index e7ea1a3b9..49f84252b 100644 --- a/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php +++ b/lib/Google/vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Wrappers.php @@ -1,5 +1,6 @@ internalAddGeneratedFile( - ' - -google/protobuf/wrappers.protogoogle.protobuf" - DoubleValue -value (" - -FloatValue -value (" - -Int64Value -value (" - UInt64Value -value (" - -Int32Value -value (" - UInt32Value -value ( " - BoolValue -value (" - StringValue -value ( " - -BytesValue -value ( B -com.google.protobufB WrappersProtoPZ1google.golang.org/protobuf/types/known/wrapperspbGPBGoogle.Protobuf.WellKnownTypesbproto3' + "\x0A\xC7\x03\x0A\x1Egoogle/protobuf/wrappers.proto\x12\x0Fgoogle.protobuf\"\x1C\x0A\x0BDoubleValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x01\"\x1B\x0A\x0AFloatValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x02\"\x1B\x0A\x0AInt64Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x03\"\x1C\x0A\x0BUInt64Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x04\"\x1B\x0A\x0AInt32Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x05\"\x1C\x0A\x0BUInt32Value\x12\x0D\x0A\x05value\x18\x01 \x01(\x0D\"\x1A\x0A\x09BoolValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x08\"\x1C\x0A\x0BStringValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x09\"\x1B\x0A\x0ABytesValue\x12\x0D\x0A\x05value\x18\x01 \x01(\x0CB\x83\x01\x0A\x13com.google.protobufB\x0DWrappersProtoP\x01Z1google.golang.org/protobuf/types/known/wrapperspb\xF8\x01\x01\xA2\x02\x03GPB\xAA\x02\x1EGoogle.Protobuf.WellKnownTypesb\x06proto3" , true); static::$is_initialized = true; diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Any.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Any.php index feea41aad..3f8180832 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Any.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Any.php @@ -1,12 +1,13 @@ , * "lastName": * } * If the embedded message type is well-known and has a custom JSON * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` + * `value` which holds the custom JSON in addition to the `\@type` * field. Example (for message [google.protobuf.Duration][]): * { - * "@type": "type.googleapis.com/google.protobuf.Duration", + * "\@type": "type.googleapis.com/google.protobuf.Duration", * "value": "1.212s" * } * @@ -104,7 +106,8 @@ class Any extends \Google\Protobuf\Internal\AnyBase * breaking changes.) * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * @@ -145,7 +148,8 @@ class Any extends \Google\Protobuf\Internal\AnyBase * breaking changes.) * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * @type string $value @@ -178,7 +182,8 @@ public function __construct($data = NULL) { * breaking changes.) * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * @@ -211,7 +216,8 @@ public function getTypeUrl() * breaking changes.) * Note: this functionality is not currently available in the official * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. * diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Api.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Api.php index 3784263cb..341c56984 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Api.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Api.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $methods + * @type \Google\Protobuf\Method[] $methods * The methods of this interface, in unspecified order. - * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * @type \Google\Protobuf\Option[] $options * Any metadata attached to the interface. * @type string $version * A version string for this interface. If specified, must have the form @@ -117,7 +118,7 @@ class Api extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\SourceContext $source_context * Source context for the protocol buffer service represented by this * message. - * @type array<\Google\Protobuf\Mixin>|\Google\Protobuf\Internal\RepeatedField $mixins + * @type \Google\Protobuf\Mixin[] $mixins * Included interfaces. See [Mixin][]. * @type int $syntax * The source syntax of the service. @@ -160,7 +161,7 @@ public function setName($var) * The methods of this interface, in unspecified order. * * Generated from protobuf field repeated .google.protobuf.Method methods = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Method> */ public function getMethods() { @@ -171,7 +172,7 @@ public function getMethods() * The methods of this interface, in unspecified order. * * Generated from protobuf field repeated .google.protobuf.Method methods = 2; - * @param array<\Google\Protobuf\Method>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Method[] $var * @return $this */ public function setMethods($var) @@ -186,7 +187,7 @@ public function setMethods($var) * Any metadata attached to the interface. * * Generated from protobuf field repeated .google.protobuf.Option options = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Option> */ public function getOptions() { @@ -197,7 +198,7 @@ public function getOptions() * Any metadata attached to the interface. * * Generated from protobuf field repeated .google.protobuf.Option options = 3; - * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Option[] $var * @return $this */ public function setOptions($var) @@ -308,7 +309,7 @@ public function setSourceContext($var) * Included interfaces. See [Mixin][]. * * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Mixin> */ public function getMixins() { @@ -319,7 +320,7 @@ public function getMixins() * Included interfaces. See [Mixin][]. * * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; - * @param array<\Google\Protobuf\Mixin>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Mixin[] $var * @return $this */ public function setMixins($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php index ecdbf4dcc..c575d7a9c 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BoolValue.php @@ -1,16 +1,19 @@ google.protobuf.BoolValue */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php index 1582e14ac..c840b460a 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/BytesValue.php @@ -1,16 +1,19 @@ google.protobuf.BytesValue */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php index b72399f46..7619938d9 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php @@ -1,16 +1,19 @@ google.protobuf.DoubleValue */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Duration.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Duration.php index 531cd50b5..62d7d8769 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Duration.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Duration.php @@ -1,12 +1,13 @@ .google.protobuf.Syntax syntax = 5; */ protected $syntax = 0; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 6; + */ + protected $edition = ''; /** * Constructor. @@ -54,14 +61,16 @@ class Enum extends \Google\Protobuf\Internal\Message * * @type string $name * Enum type name. - * @type array<\Google\Protobuf\EnumValue>|\Google\Protobuf\Internal\RepeatedField $enumvalue + * @type \Google\Protobuf\EnumValue[] $enumvalue * Enum value definitions. - * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * @type \Google\Protobuf\Option[] $options * Protocol buffer options. * @type \Google\Protobuf\SourceContext $source_context * The source context. * @type int $syntax * The source syntax. + * @type string $edition + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * } */ public function __construct($data = NULL) { @@ -99,7 +108,7 @@ public function setName($var) * Enum value definitions. * * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\EnumValue> */ public function getEnumvalue() { @@ -110,7 +119,7 @@ public function getEnumvalue() * Enum value definitions. * * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; - * @param array<\Google\Protobuf\EnumValue>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\EnumValue[] $var * @return $this */ public function setEnumvalue($var) @@ -125,7 +134,7 @@ public function setEnumvalue($var) * Protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Option> */ public function getOptions() { @@ -136,7 +145,7 @@ public function getOptions() * Protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 3; - * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Option[] $var * @return $this */ public function setOptions($var) @@ -209,5 +218,31 @@ public function setSyntax($var) return $this; } + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 6; + * @return string + */ + public function getEdition() + { + return $this->edition; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 6; + * @param string $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkString($var, True); + $this->edition = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php index 93c20f967..a782640b8 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/EnumValue.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $options + * @type \Google\Protobuf\Option[] $options * Protocol buffer options. * } */ @@ -109,7 +110,7 @@ public function setNumber($var) * Protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Option> */ public function getOptions() { @@ -120,7 +121,7 @@ public function getOptions() * Protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 3; - * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Option[] $var * @return $this */ public function setOptions($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field.php index ddae570c2..405a2c0ad 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $options + * @type \Google\Protobuf\Option[] $options * The protocol buffer options. * @type string $json_name * The field JSON name. @@ -303,7 +304,7 @@ public function setPacked($var) * The protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 9; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Option> */ public function getOptions() { @@ -314,7 +315,7 @@ public function getOptions() * The protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 9; - * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Option[] $var * @return $this */ public function setOptions($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php index a42219957..72a11e37f 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Field/Cardinality.php @@ -1,5 +1,6 @@ internal_desc->getLabel(); } + /** + * @return boolean + */ + public function isRequired() + { + return $this->internal_desc->isRequired(); + } + + /** + * @return boolean + */ + public function isRepeated() + { + return $this->internal_desc->isRepeated(); + } + /** * @return int */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php index a8e5243f8..f0b734e61 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FieldMask.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $paths + * @type string[] $paths * The set of field mask paths. * } */ @@ -191,7 +192,7 @@ public function __construct($data = NULL) { * The set of field mask paths. * * Generated from protobuf field repeated string paths = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getPaths() { @@ -202,7 +203,7 @@ public function getPaths() * The set of field mask paths. * * Generated from protobuf field repeated string paths = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ public function setPaths($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FloatValue.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FloatValue.php index 4285358d5..8b1e16e60 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FloatValue.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/FloatValue.php @@ -1,16 +1,19 @@ google.protobuf.FloatValue */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php index 4db69238b..e3a3e015c 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/GPBEmpty.php @@ -1,12 +1,13 @@ google.protobuf.Int32Value */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php index 143474fcd..ec2464419 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php @@ -1,16 +1,19 @@ google.protobuf.Int64Value */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php index 6bdb6d993..46064fbdb 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/CodedOutputStream.php @@ -15,14 +15,16 @@ class CodedOutputStream private $buffer; private $buffer_size; private $current; + private $options; const MAX_VARINT64_BYTES = 10; - public function __construct($size) + public function __construct($size, $options = 0) { $this->current = 0; $this->buffer_size = $size; $this->buffer = str_repeat(chr(0), $this->buffer_size); + $this->options = $options; } public function getData() @@ -30,6 +32,11 @@ public function getData() return $this->buffer; } + public function getOptions() + { + return $this->options; + } + public function writeVarint32($value, $trim) { $bytes = str_repeat(chr(0), self::MAX_VARINT64_BYTES); diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php index 621e2e6b1..4f01180d7 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php @@ -20,6 +20,7 @@ class DescriptorPool private static $pool; // Map from message names to sub-maps, which are maps from field numbers to // field descriptors. + private $unique_descs = []; private $class_to_desc = []; private $class_to_enum_desc = []; private $proto_to_class = []; @@ -71,6 +72,8 @@ public function addDescriptor($descriptor) { $this->proto_to_class[$descriptor->getFullName()] = $descriptor->getClass(); + $this->unique_descs[$descriptor->getFullName()] = + $descriptor; $this->class_to_desc[$descriptor->getClass()] = $descriptor; $this->class_to_desc[$descriptor->getLegacyClass()] = $descriptor; $this->class_to_desc[$descriptor->getPreviouslyUnreservedClass()] = $descriptor; @@ -163,7 +166,7 @@ private function crossLink(Descriptor $desc) public function finish() { - foreach ($this->class_to_desc as $klass => $desc) { + foreach ($this->unique_descs as $klass => $desc) { $this->crossLink($desc); } unset($desc); diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php index 2937c5a7c..884100f33 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto.php @@ -1,14 +1,15 @@ repeated string reserved_name = 10; */ private $reserved_name; + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 11; + */ + protected $visibility = null; /** * Constructor. @@ -68,17 +75,19 @@ class DescriptorProto extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * @type array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $field - * @type array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $extension - * @type array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $nested_type - * @type array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $enum_type - * @type array<\Google\Protobuf\Internal\DescriptorProto\ExtensionRange>|\Google\Protobuf\Internal\RepeatedField $extension_range - * @type array<\Google\Protobuf\Internal\OneofDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $oneof_decl + * @type \Google\Protobuf\Internal\FieldDescriptorProto[] $field + * @type \Google\Protobuf\Internal\FieldDescriptorProto[] $extension + * @type \Google\Protobuf\Internal\DescriptorProto[] $nested_type + * @type \Google\Protobuf\Internal\EnumDescriptorProto[] $enum_type + * @type \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[] $extension_range + * @type \Google\Protobuf\Internal\OneofDescriptorProto[] $oneof_decl * @type \Google\Protobuf\Internal\MessageOptions $options - * @type array<\Google\Protobuf\Internal\DescriptorProto\ReservedRange>|\Google\Protobuf\Internal\RepeatedField $reserved_range - * @type array|\Google\Protobuf\Internal\RepeatedField $reserved_name + * @type \Google\Protobuf\Internal\DescriptorProto\ReservedRange[] $reserved_range + * @type string[] $reserved_name * Reserved field names, which may not be used by fields in the same message. * A given name may only be reserved once. + * @type int $visibility + * Support for `export` and `local` keywords on enums. * } */ public function __construct($data = NULL) { @@ -120,7 +129,7 @@ public function setName($var) /** * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\FieldDescriptorProto> */ public function getField() { @@ -129,7 +138,7 @@ public function getField() /** * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2; - * @param array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var * @return $this */ public function setField($var) @@ -142,7 +151,7 @@ public function setField($var) /** * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\FieldDescriptorProto> */ public function getExtension() { @@ -151,7 +160,7 @@ public function getExtension() /** * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6; - * @param array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var * @return $this */ public function setExtension($var) @@ -164,7 +173,7 @@ public function setExtension($var) /** * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto> */ public function getNestedType() { @@ -173,7 +182,7 @@ public function getNestedType() /** * Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3; - * @param array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\DescriptorProto[] $var * @return $this */ public function setNestedType($var) @@ -186,7 +195,7 @@ public function setNestedType($var) /** * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\EnumDescriptorProto> */ public function getEnumType() { @@ -195,7 +204,7 @@ public function getEnumType() /** * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4; - * @param array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\EnumDescriptorProto[] $var * @return $this */ public function setEnumType($var) @@ -208,7 +217,7 @@ public function setEnumType($var) /** * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto\ExtensionRange> */ public function getExtensionRange() { @@ -217,7 +226,7 @@ public function getExtensionRange() /** * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; - * @param array<\Google\Protobuf\Internal\DescriptorProto\ExtensionRange>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[] $var * @return $this */ public function setExtensionRange($var) @@ -230,7 +239,7 @@ public function setExtensionRange($var) /** * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\OneofDescriptorProto> */ public function getOneofDecl() { @@ -239,7 +248,7 @@ public function getOneofDecl() /** * Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; - * @param array<\Google\Protobuf\Internal\OneofDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\OneofDescriptorProto[] $var * @return $this */ public function setOneofDecl($var) @@ -284,7 +293,7 @@ public function setOptions($var) /** * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto\ReservedRange> */ public function getReservedRange() { @@ -293,7 +302,7 @@ public function getReservedRange() /** * Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; - * @param array<\Google\Protobuf\Internal\DescriptorProto\ReservedRange>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\DescriptorProto\ReservedRange[] $var * @return $this */ public function setReservedRange($var) @@ -309,7 +318,7 @@ public function setReservedRange($var) * A given name may only be reserved once. * * Generated from protobuf field repeated string reserved_name = 10; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getReservedName() { @@ -321,7 +330,7 @@ public function getReservedName() * A given name may only be reserved once. * * Generated from protobuf field repeated string reserved_name = 10; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ public function setReservedName($var) @@ -332,5 +341,41 @@ public function setReservedName($var) return $this; } + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 11; + * @return int + */ + public function getVisibility() + { + return isset($this->visibility) ? $this->visibility : 0; + } + + public function hasVisibility() + { + return isset($this->visibility); + } + + public function clearVisibility() + { + unset($this->visibility); + } + + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 11; + * @param int $var + * @return $this + */ + public function setVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\SymbolVisibility::class); + $this->visibility = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php index 43c33c4a9..a2e142df1 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php @@ -1,14 +1,15 @@ google.protobuf.DescriptorProto.ExtensionRange @@ -156,6 +157,3 @@ public function setOptions($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ExtensionRange::class, \Google\Protobuf\Internal\DescriptorProto_ExtensionRange::class); - diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php index f099cc345..61a1e7be7 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php @@ -1,14 +1,15 @@ google.protobuf.Edition + */ +class Edition +{ + /** + * A placeholder for an unknown edition value. + * + * Generated from protobuf enum EDITION_UNKNOWN = 0; + */ + const EDITION_UNKNOWN = 0; + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * Generated from protobuf enum EDITION_LEGACY = 900; + */ + const EDITION_LEGACY = 900; + /** + * Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + * + * Generated from protobuf enum EDITION_PROTO2 = 998; + */ + const EDITION_PROTO2 = 998; + /** + * Generated from protobuf enum EDITION_PROTO3 = 999; + */ + const EDITION_PROTO3 = 999; + /** + * Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + * + * Generated from protobuf enum EDITION_2023 = 1000; + */ + const EDITION_2023 = 1000; + /** + * Generated from protobuf enum EDITION_2024 = 1001; + */ + const EDITION_2024 = 1001; + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + * + * Generated from protobuf enum EDITION_1_TEST_ONLY = 1; + */ + const EDITION_1_TEST_ONLY = 1; + /** + * Generated from protobuf enum EDITION_2_TEST_ONLY = 2; + */ + const EDITION_2_TEST_ONLY = 2; + /** + * Generated from protobuf enum EDITION_99997_TEST_ONLY = 99997; + */ + const EDITION_99997_TEST_ONLY = 99997; + /** + * Generated from protobuf enum EDITION_99998_TEST_ONLY = 99998; + */ + const EDITION_99998_TEST_ONLY = 99998; + /** + * Generated from protobuf enum EDITION_99999_TEST_ONLY = 99999; + */ + const EDITION_99999_TEST_ONLY = 99999; + /** + * Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + * + * Generated from protobuf enum EDITION_MAX = 2147483647; + */ + const EDITION_MAX = 2147483647; + + private static $valueToName = [ + self::EDITION_UNKNOWN => 'EDITION_UNKNOWN', + self::EDITION_LEGACY => 'EDITION_LEGACY', + self::EDITION_PROTO2 => 'EDITION_PROTO2', + self::EDITION_PROTO3 => 'EDITION_PROTO3', + self::EDITION_2023 => 'EDITION_2023', + self::EDITION_2024 => 'EDITION_2024', + self::EDITION_1_TEST_ONLY => 'EDITION_1_TEST_ONLY', + self::EDITION_2_TEST_ONLY => 'EDITION_2_TEST_ONLY', + self::EDITION_99997_TEST_ONLY => 'EDITION_99997_TEST_ONLY', + self::EDITION_99998_TEST_ONLY => 'EDITION_99998_TEST_ONLY', + self::EDITION_99999_TEST_ONLY => 'EDITION_99999_TEST_ONLY', + self::EDITION_MAX => 'EDITION_MAX', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php index cb2a42ae3..43e6e4595 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto.php @@ -1,14 +1,15 @@ repeated string reserved_name = 5; */ private $reserved_name; + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 6; + */ + protected $visibility = null; /** * Constructor. @@ -52,15 +59,17 @@ class EnumDescriptorProto extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * @type array<\Google\Protobuf\Internal\EnumValueDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $value + * @type \Google\Protobuf\Internal\EnumValueDescriptorProto[] $value * @type \Google\Protobuf\Internal\EnumOptions $options - * @type array<\Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange>|\Google\Protobuf\Internal\RepeatedField $reserved_range + * @type \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[] $reserved_range * Range of reserved numeric values. Reserved numeric values may not be used * by enum values in the same enum declaration. Reserved ranges may not * overlap. - * @type array|\Google\Protobuf\Internal\RepeatedField $reserved_name + * @type string[] $reserved_name * Reserved enum value names, which may not be reused. A given name may only * be reserved once. + * @type int $visibility + * Support for `export` and `local` keywords on enums. * } */ public function __construct($data = NULL) { @@ -102,7 +111,7 @@ public function setName($var) /** * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\EnumValueDescriptorProto> */ public function getValue() { @@ -111,7 +120,7 @@ public function getValue() /** * Generated from protobuf field repeated .google.protobuf.EnumValueDescriptorProto value = 2; - * @param array<\Google\Protobuf\Internal\EnumValueDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\EnumValueDescriptorProto[] $var * @return $this */ public function setValue($var) @@ -160,7 +169,7 @@ public function setOptions($var) * overlap. * * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange> */ public function getReservedRange() { @@ -173,7 +182,7 @@ public function getReservedRange() * overlap. * * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; - * @param array<\Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[] $var * @return $this */ public function setReservedRange($var) @@ -189,7 +198,7 @@ public function setReservedRange($var) * be reserved once. * * Generated from protobuf field repeated string reserved_name = 5; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getReservedName() { @@ -201,7 +210,7 @@ public function getReservedName() * be reserved once. * * Generated from protobuf field repeated string reserved_name = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ public function setReservedName($var) @@ -212,5 +221,41 @@ public function setReservedName($var) return $this; } + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 6; + * @return int + */ + public function getVisibility() + { + return isset($this->visibility) ? $this->visibility : 0; + } + + public function hasVisibility() + { + return isset($this->visibility); + } + + public function clearVisibility() + { + unset($this->visibility); + } + + /** + * Support for `export` and `local` keywords on enums. + * + * Generated from protobuf field optional .google.protobuf.SymbolVisibility visibility = 6; + * @param int $var + * @return $this + */ + public function setVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\SymbolVisibility::class); + $this->visibility = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php index 7282fccb0..b8234cf81 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php @@ -1,14 +1,15 @@ google.protobuf.EnumOptions @@ -43,6 +44,15 @@ class EnumOptions extends \Google\Protobuf\Internal\Message * @deprecated */ protected $deprecated_legacy_json_field_conflicts = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 7; + */ + protected $features = null; /** * The parser stores options it doesn't recognize here. See above. * @@ -71,7 +81,12 @@ class EnumOptions extends \Google\Protobuf\Internal\Message * well. * TODO Remove this legacy behavior once downstream teams have * had time to migrate. - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } */ @@ -174,13 +189,17 @@ public function setDeprecated($var) */ public function getDeprecatedLegacyJsonFieldConflicts() { - @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } return isset($this->deprecated_legacy_json_field_conflicts) ? $this->deprecated_legacy_json_field_conflicts : false; } public function hasDeprecatedLegacyJsonFieldConflicts() { - @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } return isset($this->deprecated_legacy_json_field_conflicts); } @@ -212,11 +231,53 @@ public function setDeprecatedLegacyJsonFieldConflicts($var) return $this; } + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 7; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 7; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + /** * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -227,7 +288,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php index 0feaea6f1..fce650fdb 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php @@ -1,14 +1,15 @@ google.protobuf.EnumValueOptions @@ -24,6 +25,29 @@ class EnumValueOptions extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool deprecated = 1 [default = false]; */ protected $deprecated = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 2; + */ + protected $features = null; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * Generated from protobuf field optional bool debug_redact = 3 [default = false]; + */ + protected $debug_redact = null; + /** + * Information about the support window of a feature value. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + protected $feature_support = null; /** * The parser stores options it doesn't recognize here. See above. * @@ -42,7 +66,18 @@ class EnumValueOptions extends \Google\Protobuf\Internal\Message * Depending on the target platform, this can emit Deprecated annotations * for the enum value, or it will be completely ignored; in the very least, * this is a formalization for deprecating enum values. - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type bool $debug_redact + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * @type \Google\Protobuf\Internal\FieldOptions\FeatureSupport $feature_support + * Information about the support window of a feature value. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } */ @@ -93,11 +128,129 @@ public function setDeprecated($var) return $this; } + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 2; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 2; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * Generated from protobuf field optional bool debug_redact = 3 [default = false]; + * @return bool + */ + public function getDebugRedact() + { + return isset($this->debug_redact) ? $this->debug_redact : false; + } + + public function hasDebugRedact() + { + return isset($this->debug_redact); + } + + public function clearDebugRedact() + { + unset($this->debug_redact); + } + + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * Generated from protobuf field optional bool debug_redact = 3 [default = false]; + * @param bool $var + * @return $this + */ + public function setDebugRedact($var) + { + GPBUtil::checkBool($var); + $this->debug_redact = $var; + + return $this; + } + + /** + * Information about the support window of a feature value. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + * @return \Google\Protobuf\Internal\FieldOptions\FeatureSupport|null + */ + public function getFeatureSupport() + { + return $this->feature_support; + } + + public function hasFeatureSupport() + { + return isset($this->feature_support); + } + + public function clearFeatureSupport() + { + unset($this->feature_support); + } + + /** + * Information about the support window of a feature value. + * + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + * @param \Google\Protobuf\Internal\FieldOptions\FeatureSupport $var + * @return $this + */ + public function setFeatureSupport($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class); + $this->feature_support = $var; + + return $this; + } + /** * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -108,7 +261,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php index 245173c3d..4d85c3121 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php @@ -1,14 +1,15 @@ google.protobuf.ExtensionRangeOptions @@ -21,6 +22,28 @@ class ExtensionRangeOptions extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; */ private $uninterpreted_option; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * Generated from protobuf field repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; + */ + private $declaration; + /** + * Any features defined in the specific edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + */ + protected $features = null; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE]; + */ + protected $verification = null; /** * Constructor. @@ -28,8 +51,18 @@ class ExtensionRangeOptions extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. + * @type \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration[] $declaration + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * @type int $verification + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. * } */ public function __construct($data = NULL) { @@ -41,7 +74,7 @@ public function __construct($data = NULL) { * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -52,7 +85,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) @@ -63,5 +96,111 @@ public function setUninterpretedOption($var) return $this; } + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * Generated from protobuf field repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; + * @return RepeatedField<\Google\Protobuf\Internal\ExtensionRangeOptions\Declaration> + */ + public function getDeclaration() + { + return $this->declaration; + } + + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * Generated from protobuf field repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; + * @param \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration[] $var + * @return $this + */ + public function setDeclaration($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration::class); + $this->declaration = $arr; + + return $this; + } + + /** + * Any features defined in the specific edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE]; + * @return int + */ + public function getVerification() + { + return isset($this->verification) ? $this->verification : 0; + } + + public function hasVerification() + { + return isset($this->verification); + } + + public function clearVerification() + { + unset($this->verification); + } + + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * Generated from protobuf field optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE]; + * @param int $var + * @return $this + */ + public function setVerification($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\ExtensionRangeOptions\VerificationState::class); + $this->verification = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/Declaration.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/Declaration.php new file mode 100644 index 000000000..632692118 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/Declaration.php @@ -0,0 +1,278 @@ +google.protobuf.ExtensionRangeOptions.Declaration + */ +class Declaration extends \Google\Protobuf\Internal\Message +{ + /** + * The extension number declared within the extension range. + * + * Generated from protobuf field optional int32 number = 1; + */ + protected $number = null; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * Generated from protobuf field optional string full_name = 2; + */ + protected $full_name = null; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * Generated from protobuf field optional string type = 3; + */ + protected $type = null; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * Generated from protobuf field optional bool reserved = 5; + */ + protected $reserved = null; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * Generated from protobuf field optional bool repeated = 6; + */ + protected $repeated = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $number + * The extension number declared within the extension range. + * @type string $full_name + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * @type string $type + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * @type bool $reserved + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * @type bool $repeated + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The extension number declared within the extension range. + * + * Generated from protobuf field optional int32 number = 1; + * @return int + */ + public function getNumber() + { + return isset($this->number) ? $this->number : 0; + } + + public function hasNumber() + { + return isset($this->number); + } + + public function clearNumber() + { + unset($this->number); + } + + /** + * The extension number declared within the extension range. + * + * Generated from protobuf field optional int32 number = 1; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * Generated from protobuf field optional string full_name = 2; + * @return string + */ + public function getFullName() + { + return isset($this->full_name) ? $this->full_name : ''; + } + + public function hasFullName() + { + return isset($this->full_name); + } + + public function clearFullName() + { + unset($this->full_name); + } + + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * Generated from protobuf field optional string full_name = 2; + * @param string $var + * @return $this + */ + public function setFullName($var) + { + GPBUtil::checkString($var, True); + $this->full_name = $var; + + return $this; + } + + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * Generated from protobuf field optional string type = 3; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * Generated from protobuf field optional string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * Generated from protobuf field optional bool reserved = 5; + * @return bool + */ + public function getReserved() + { + return isset($this->reserved) ? $this->reserved : false; + } + + public function hasReserved() + { + return isset($this->reserved); + } + + public function clearReserved() + { + unset($this->reserved); + } + + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * Generated from protobuf field optional bool reserved = 5; + * @param bool $var + * @return $this + */ + public function setReserved($var) + { + GPBUtil::checkBool($var); + $this->reserved = $var; + + return $this; + } + + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * Generated from protobuf field optional bool repeated = 6; + * @return bool + */ + public function getRepeated() + { + return isset($this->repeated) ? $this->repeated : false; + } + + public function hasRepeated() + { + return isset($this->repeated); + } + + public function clearRepeated() + { + unset($this->repeated); + } + + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * Generated from protobuf field optional bool repeated = 6; + * @param bool $var + * @return $this + */ + public function setRepeated($var) + { + GPBUtil::checkBool($var); + $this->repeated = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/VerificationState.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/VerificationState.php new file mode 100644 index 000000000..a995d4b19 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions/VerificationState.php @@ -0,0 +1,53 @@ +google.protobuf.ExtensionRangeOptions.VerificationState + */ +class VerificationState +{ + /** + * All the extensions of the range must be declared. + * + * Generated from protobuf enum DECLARATION = 0; + */ + const DECLARATION = 0; + /** + * Generated from protobuf enum UNVERIFIED = 1; + */ + const UNVERIFIED = 1; + + private static $valueToName = [ + self::DECLARATION => 'DECLARATION', + self::UNVERIFIED => 'UNVERIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet.php new file mode 100644 index 000000000..2bac64fa0 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet.php @@ -0,0 +1,337 @@ +google.protobuf.FeatureSet + */ +class FeatureSet extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $field_presence = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $enum_type = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $repeated_field_encoding = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $utf8_validation = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $message_encoding = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $json_format = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = { + */ + protected $enforce_naming_style = null; + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = { + */ + protected $default_symbol_visibility = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $field_presence + * @type int $enum_type + * @type int $repeated_field_encoding + * @type int $utf8_validation + * @type int $message_encoding + * @type int $json_format + * @type int $enforce_naming_style + * @type int $default_symbol_visibility + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getFieldPresence() + { + return isset($this->field_presence) ? $this->field_presence : 0; + } + + public function hasFieldPresence() + { + return isset($this->field_presence); + } + + public function clearFieldPresence() + { + unset($this->field_presence); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setFieldPresence($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\FieldPresence::class); + $this->field_presence = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getEnumType() + { + return isset($this->enum_type) ? $this->enum_type : 0; + } + + public function hasEnumType() + { + return isset($this->enum_type); + } + + public function clearEnumType() + { + unset($this->enum_type); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setEnumType($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\EnumType::class); + $this->enum_type = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getRepeatedFieldEncoding() + { + return isset($this->repeated_field_encoding) ? $this->repeated_field_encoding : 0; + } + + public function hasRepeatedFieldEncoding() + { + return isset($this->repeated_field_encoding); + } + + public function clearRepeatedFieldEncoding() + { + unset($this->repeated_field_encoding); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setRepeatedFieldEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\RepeatedFieldEncoding::class); + $this->repeated_field_encoding = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getUtf8Validation() + { + return isset($this->utf8_validation) ? $this->utf8_validation : 0; + } + + public function hasUtf8Validation() + { + return isset($this->utf8_validation); + } + + public function clearUtf8Validation() + { + unset($this->utf8_validation); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setUtf8Validation($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\Utf8Validation::class); + $this->utf8_validation = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getMessageEncoding() + { + return isset($this->message_encoding) ? $this->message_encoding : 0; + } + + public function hasMessageEncoding() + { + return isset($this->message_encoding); + } + + public function clearMessageEncoding() + { + unset($this->message_encoding); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setMessageEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\MessageEncoding::class); + $this->message_encoding = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getJsonFormat() + { + return isset($this->json_format) ? $this->json_format : 0; + } + + public function hasJsonFormat() + { + return isset($this->json_format); + } + + public function clearJsonFormat() + { + unset($this->json_format); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setJsonFormat($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\JsonFormat::class); + $this->json_format = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = { + * @return int + */ + public function getEnforceNamingStyle() + { + return isset($this->enforce_naming_style) ? $this->enforce_naming_style : 0; + } + + public function hasEnforceNamingStyle() + { + return isset($this->enforce_naming_style); + } + + public function clearEnforceNamingStyle() + { + unset($this->enforce_naming_style); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = { + * @param int $var + * @return $this + */ + public function setEnforceNamingStyle($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\EnforceNamingStyle::class); + $this->enforce_naming_style = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = { + * @return int + */ + public function getDefaultSymbolVisibility() + { + return isset($this->default_symbol_visibility) ? $this->default_symbol_visibility : 0; + } + + public function hasDefaultSymbolVisibility() + { + return isset($this->default_symbol_visibility); + } + + public function clearDefaultSymbolVisibility() + { + unset($this->default_symbol_visibility); + } + + /** + * Generated from protobuf field optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = { + * @param int $var + * @return $this + */ + public function setDefaultSymbolVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\VisibilityFeature\DefaultSymbolVisibility::class); + $this->default_symbol_visibility = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnforceNamingStyle.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnforceNamingStyle.php new file mode 100644 index 000000000..8fbb98b82 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnforceNamingStyle.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.EnforceNamingStyle + */ +class EnforceNamingStyle +{ + /** + * Generated from protobuf enum ENFORCE_NAMING_STYLE_UNKNOWN = 0; + */ + const ENFORCE_NAMING_STYLE_UNKNOWN = 0; + /** + * Generated from protobuf enum STYLE2024 = 1; + */ + const STYLE2024 = 1; + /** + * Generated from protobuf enum STYLE_LEGACY = 2; + */ + const STYLE_LEGACY = 2; + + private static $valueToName = [ + self::ENFORCE_NAMING_STYLE_UNKNOWN => 'ENFORCE_NAMING_STYLE_UNKNOWN', + self::STYLE2024 => 'STYLE2024', + self::STYLE_LEGACY => 'STYLE_LEGACY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnumType.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnumType.php new file mode 100644 index 000000000..81e7a083f --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/EnumType.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.EnumType + */ +class EnumType +{ + /** + * Generated from protobuf enum ENUM_TYPE_UNKNOWN = 0; + */ + const ENUM_TYPE_UNKNOWN = 0; + /** + * Generated from protobuf enum OPEN = 1; + */ + const OPEN = 1; + /** + * Generated from protobuf enum CLOSED = 2; + */ + const CLOSED = 2; + + private static $valueToName = [ + self::ENUM_TYPE_UNKNOWN => 'ENUM_TYPE_UNKNOWN', + self::OPEN => 'OPEN', + self::CLOSED => 'CLOSED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/FieldPresence.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/FieldPresence.php new file mode 100644 index 000000000..d992f059b --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/FieldPresence.php @@ -0,0 +1,59 @@ +google.protobuf.FeatureSet.FieldPresence + */ +class FieldPresence +{ + /** + * Generated from protobuf enum FIELD_PRESENCE_UNKNOWN = 0; + */ + const FIELD_PRESENCE_UNKNOWN = 0; + /** + * Generated from protobuf enum EXPLICIT = 1; + */ + const EXPLICIT = 1; + /** + * Generated from protobuf enum IMPLICIT = 2; + */ + const IMPLICIT = 2; + /** + * Generated from protobuf enum LEGACY_REQUIRED = 3; + */ + const LEGACY_REQUIRED = 3; + + private static $valueToName = [ + self::FIELD_PRESENCE_UNKNOWN => 'FIELD_PRESENCE_UNKNOWN', + self::EXPLICIT => 'EXPLICIT', + self::IMPLICIT => 'IMPLICIT', + self::LEGACY_REQUIRED => 'LEGACY_REQUIRED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/JsonFormat.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/JsonFormat.php new file mode 100644 index 000000000..c88e84031 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/JsonFormat.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.JsonFormat + */ +class JsonFormat +{ + /** + * Generated from protobuf enum JSON_FORMAT_UNKNOWN = 0; + */ + const JSON_FORMAT_UNKNOWN = 0; + /** + * Generated from protobuf enum ALLOW = 1; + */ + const ALLOW = 1; + /** + * Generated from protobuf enum LEGACY_BEST_EFFORT = 2; + */ + const LEGACY_BEST_EFFORT = 2; + + private static $valueToName = [ + self::JSON_FORMAT_UNKNOWN => 'JSON_FORMAT_UNKNOWN', + self::ALLOW => 'ALLOW', + self::LEGACY_BEST_EFFORT => 'LEGACY_BEST_EFFORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/MessageEncoding.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/MessageEncoding.php new file mode 100644 index 000000000..6827fe3ce --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/MessageEncoding.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.MessageEncoding + */ +class MessageEncoding +{ + /** + * Generated from protobuf enum MESSAGE_ENCODING_UNKNOWN = 0; + */ + const MESSAGE_ENCODING_UNKNOWN = 0; + /** + * Generated from protobuf enum LENGTH_PREFIXED = 1; + */ + const LENGTH_PREFIXED = 1; + /** + * Generated from protobuf enum DELIMITED = 2; + */ + const DELIMITED = 2; + + private static $valueToName = [ + self::MESSAGE_ENCODING_UNKNOWN => 'MESSAGE_ENCODING_UNKNOWN', + self::LENGTH_PREFIXED => 'LENGTH_PREFIXED', + self::DELIMITED => 'DELIMITED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/RepeatedFieldEncoding.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/RepeatedFieldEncoding.php new file mode 100644 index 000000000..f3ea0c843 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/RepeatedFieldEncoding.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +class RepeatedFieldEncoding +{ + /** + * Generated from protobuf enum REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + const REPEATED_FIELD_ENCODING_UNKNOWN = 0; + /** + * Generated from protobuf enum PACKED = 1; + */ + const PACKED = 1; + /** + * Generated from protobuf enum EXPANDED = 2; + */ + const EXPANDED = 2; + + private static $valueToName = [ + self::REPEATED_FIELD_ENCODING_UNKNOWN => 'REPEATED_FIELD_ENCODING_UNKNOWN', + self::PACKED => 'PACKED', + self::EXPANDED => 'EXPANDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/Utf8Validation.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/Utf8Validation.php new file mode 100644 index 000000000..8286c45c6 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/Utf8Validation.php @@ -0,0 +1,54 @@ +google.protobuf.FeatureSet.Utf8Validation + */ +class Utf8Validation +{ + /** + * Generated from protobuf enum UTF8_VALIDATION_UNKNOWN = 0; + */ + const UTF8_VALIDATION_UNKNOWN = 0; + /** + * Generated from protobuf enum VERIFY = 2; + */ + const VERIFY = 2; + /** + * Generated from protobuf enum NONE = 3; + */ + const NONE = 3; + + private static $valueToName = [ + self::UTF8_VALIDATION_UNKNOWN => 'UTF8_VALIDATION_UNKNOWN', + self::VERIFY => 'VERIFY', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature.php new file mode 100644 index 000000000..20cf256e1 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature.php @@ -0,0 +1,34 @@ +google.protobuf.FeatureSet.VisibilityFeature + */ +class VisibilityFeature extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature/DefaultSymbolVisibility.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature/DefaultSymbolVisibility.php new file mode 100644 index 000000000..fde693b8a --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSet/VisibilityFeature/DefaultSymbolVisibility.php @@ -0,0 +1,74 @@ +google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +class DefaultSymbolVisibility +{ + /** + * Generated from protobuf enum DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + */ + const DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + /** + * Default pre-EDITION_2024, all UNSET visibility are export. + * + * Generated from protobuf enum EXPORT_ALL = 1; + */ + const EXPORT_ALL = 1; + /** + * All top-level symbols default to export, nested default to local. + * + * Generated from protobuf enum EXPORT_TOP_LEVEL = 2; + */ + const EXPORT_TOP_LEVEL = 2; + /** + * All symbols default to local. + * + * Generated from protobuf enum LOCAL_ALL = 3; + */ + const LOCAL_ALL = 3; + /** + * All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + * + * Generated from protobuf enum STRICT = 4; + */ + const STRICT = 4; + + private static $valueToName = [ + self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => 'DEFAULT_SYMBOL_VISIBILITY_UNKNOWN', + self::EXPORT_ALL => 'EXPORT_ALL', + self::EXPORT_TOP_LEVEL => 'EXPORT_TOP_LEVEL', + self::LOCAL_ALL => 'LOCAL_ALL', + self::STRICT => 'STRICT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults.php new file mode 100644 index 000000000..5e0e6e065 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults.php @@ -0,0 +1,162 @@ +google.protobuf.FeatureSetDefaults + */ +class FeatureSetDefaults extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + private $defaults; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition minimum_edition = 4; + */ + protected $minimum_edition = null; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition maximum_edition = 5; + */ + protected $maximum_edition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault[] $defaults + * @type int $minimum_edition + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * @type int $maximum_edition + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + * @return RepeatedField<\Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault> + */ + public function getDefaults() + { + return $this->defaults; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + * @param \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault[] $var + * @return $this + */ + public function setDefaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault::class); + $this->defaults = $arr; + + return $this; + } + + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition minimum_edition = 4; + * @return int + */ + public function getMinimumEdition() + { + return isset($this->minimum_edition) ? $this->minimum_edition : 0; + } + + public function hasMinimumEdition() + { + return isset($this->minimum_edition); + } + + public function clearMinimumEdition() + { + unset($this->minimum_edition); + } + + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition minimum_edition = 4; + * @param int $var + * @return $this + */ + public function setMinimumEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->minimum_edition = $var; + + return $this; + } + + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition maximum_edition = 5; + * @return int + */ + public function getMaximumEdition() + { + return isset($this->maximum_edition) ? $this->maximum_edition : 0; + } + + public function hasMaximumEdition() + { + return isset($this->maximum_edition); + } + + public function clearMaximumEdition() + { + unset($this->maximum_edition); + } + + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * Generated from protobuf field optional .google.protobuf.Edition maximum_edition = 5; + * @param int $var + * @return $this + */ + public function setMaximumEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->maximum_edition = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults/FeatureSetEditionDefault.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults/FeatureSetEditionDefault.php new file mode 100644 index 000000000..d8b766c8b --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FeatureSetDefaults/FeatureSetEditionDefault.php @@ -0,0 +1,164 @@ +google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +class FeatureSetEditionDefault extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + */ + protected $edition = null; + /** + * Defaults of features that can be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet overridable_features = 4; + */ + protected $overridable_features = null; + /** + * Defaults of features that can't be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet fixed_features = 5; + */ + protected $fixed_features = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $edition + * @type \Google\Protobuf\Internal\FeatureSet $overridable_features + * Defaults of features that can be overridden in this edition. + * @type \Google\Protobuf\Internal\FeatureSet $fixed_features + * Defaults of features that can't be overridden in this edition. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @return int + */ + public function getEdition() + { + return isset($this->edition) ? $this->edition : 0; + } + + public function hasEdition() + { + return isset($this->edition); + } + + public function clearEdition() + { + unset($this->edition); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @param int $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition = $var; + + return $this; + } + + /** + * Defaults of features that can be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet overridable_features = 4; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getOverridableFeatures() + { + return $this->overridable_features; + } + + public function hasOverridableFeatures() + { + return isset($this->overridable_features); + } + + public function clearOverridableFeatures() + { + unset($this->overridable_features); + } + + /** + * Defaults of features that can be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet overridable_features = 4; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setOverridableFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->overridable_features = $var; + + return $this; + } + + /** + * Defaults of features that can't be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet fixed_features = 5; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFixedFeatures() + { + return $this->fixed_features; + } + + public function hasFixedFeatures() + { + return isset($this->fixed_features); + } + + public function clearFixedFeatures() + { + unset($this->fixed_features); + } + + /** + * Defaults of features that can't be overridden in this edition. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet fixed_features = 5; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFixedFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->fixed_features = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php index 63cd22dc6..6b8943a06 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptor.php @@ -104,6 +104,11 @@ public function getLabel() return $this->label; } + public function isRequired() + { + return $this->label === GPBLabel::REQUIRED; + } + public function isRepeated() { return $this->label === GPBLabel::REPEATED; diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php index 5e99bff17..f10018e7d 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto.php @@ -1,14 +1,15 @@ LABEL_OPTIONAL = 1; */ const LABEL_OPTIONAL = 1; - /** - * Generated from protobuf enum LABEL_REQUIRED = 2; - */ - const LABEL_REQUIRED = 2; /** * Generated from protobuf enum LABEL_REPEATED = 3; */ const LABEL_REPEATED = 3; + /** + * The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + * + * Generated from protobuf enum LABEL_REQUIRED = 2; + */ + const LABEL_REQUIRED = 2; private static $valueToName = [ self::LABEL_OPTIONAL => 'LABEL_OPTIONAL', - self::LABEL_REQUIRED => 'LABEL_REQUIRED', self::LABEL_REPEATED => 'LABEL_REPEATED', + self::LABEL_REQUIRED => 'LABEL_REQUIRED', ]; public static function name($value) @@ -53,6 +58,3 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Label::class, \Google\Protobuf\Internal\FieldDescriptorProto_Label::class); - diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php index 6072e9990..80c8395ba 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php @@ -1,5 +1,6 @@ TYPE_GROUP = 10; */ @@ -148,6 +150,3 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Protobuf\Internal\FieldDescriptorProto_Type::class); - diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php deleted file mode 100644 index 218a846e1..000000000 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php +++ /dev/null @@ -1,16 +0,0 @@ -google.protobuf.FieldOptions @@ -16,10 +17,13 @@ class FieldOptions extends \Google\Protobuf\Internal\Message { /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. * * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; */ @@ -28,8 +32,10 @@ class FieldOptions extends \Google\Protobuf\Internal\Message * The packed option can be enabled for repeated primitive fields to enable * a more efficient representation on the wire. Rather than repeatedly * writing the tag and type for each element, the entire array is encoded as - * a single length-prefixed blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. * * Generated from protobuf field optional bool packed = 2; */ @@ -64,18 +70,11 @@ class FieldOptions extends \Google\Protobuf\Internal\Message * interface is not affected by this option; const methods remain safe to * call from multiple threads concurrently, while non-const methods continue * to require exclusive access. - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - * As of May 2022, lazy verifies the contents of the byte stream during - * parsing. An invalid byte stream will cause the overall parsing to fail. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). * * Generated from protobuf field optional bool lazy = 5 [default = false]; */ @@ -103,6 +102,38 @@ class FieldOptions extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool weak = 10 [default = false]; */ protected $weak = null; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * Generated from protobuf field optional bool debug_redact = 16 [default = false]; + */ + protected $debug_redact = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + protected $retention = null; + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + private $targets; + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + private $edition_defaults; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 21; + */ + protected $features = null; + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + protected $feature_support = null; /** * The parser stores options it doesn't recognize here. See above. * @@ -117,16 +148,21 @@ class FieldOptions extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $ctype + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. * @type bool $packed * The packed option can be enabled for repeated primitive fields to enable * a more efficient representation on the wire. Rather than repeatedly * writing the tag and type for each element, the entire array is encoded as - * a single length-prefixed blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. * @type int $jstype * The jstype option determines the JavaScript type used for values of the * field. The option is permitted only for 64 bit integral and fixed types @@ -153,18 +189,11 @@ class FieldOptions extends \Google\Protobuf\Internal\Message * interface is not affected by this option; const methods remain safe to * call from multiple threads concurrently, while non-const methods continue * to require exclusive access. - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - * As of May 2022, lazy verifies the contents of the byte stream during - * parsing. An invalid byte stream will cause the overall parsing to fail. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). * @type bool $unverified_lazy * unverified_lazy does no correctness checks on the byte stream. This should * only be used where lazy with verification is prohibitive for performance @@ -176,7 +205,19 @@ class FieldOptions extends \Google\Protobuf\Internal\Message * is a formalization for deprecating fields. * @type bool $weak * For Google-internal migration only. Do not use. - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type bool $debug_redact + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * @type int $retention + * @type int[] $targets + * @type \Google\Protobuf\Internal\FieldOptions\EditionDefault[] $edition_defaults + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\FieldOptions\FeatureSupport $feature_support + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } */ @@ -186,10 +227,13 @@ public function __construct($data = NULL) { } /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. * * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; * @return int @@ -210,10 +254,13 @@ public function clearCtype() } /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. * * Generated from protobuf field optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; * @param int $var @@ -231,8 +278,10 @@ public function setCtype($var) * The packed option can be enabled for repeated primitive fields to enable * a more efficient representation on the wire. Rather than repeatedly * writing the tag and type for each element, the entire array is encoded as - * a single length-prefixed blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. * * Generated from protobuf field optional bool packed = 2; * @return bool @@ -257,7 +306,9 @@ public function clearPacked() * a more efficient representation on the wire. Rather than repeatedly * writing the tag and type for each element, the entire array is encoded as * a single length-delimited blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. * * Generated from protobuf field optional bool packed = 2; * @param bool $var @@ -340,18 +391,11 @@ public function setJstype($var) * interface is not affected by this option; const methods remain safe to * call from multiple threads concurrently, while non-const methods continue * to require exclusive access. - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - * As of May 2022, lazy verifies the contents of the byte stream during - * parsing. An invalid byte stream will cause the overall parsing to fail. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). * * Generated from protobuf field optional bool lazy = 5 [default = false]; * @return bool @@ -386,18 +430,11 @@ public function clearLazy() * interface is not affected by this option; const methods remain safe to * call from multiple threads concurrently, while non-const methods continue * to require exclusive access. - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - * As of May 2022, lazy verifies the contents of the byte stream during - * parsing. An invalid byte stream will cause the overall parsing to fail. + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). * * Generated from protobuf field optional bool lazy = 5 [default = false]; * @param bool $var @@ -529,11 +566,199 @@ public function setWeak($var) return $this; } + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * Generated from protobuf field optional bool debug_redact = 16 [default = false]; + * @return bool + */ + public function getDebugRedact() + { + return isset($this->debug_redact) ? $this->debug_redact : false; + } + + public function hasDebugRedact() + { + return isset($this->debug_redact); + } + + public function clearDebugRedact() + { + unset($this->debug_redact); + } + + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * Generated from protobuf field optional bool debug_redact = 16 [default = false]; + * @param bool $var + * @return $this + */ + public function setDebugRedact($var) + { + GPBUtil::checkBool($var); + $this->debug_redact = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + * @return int + */ + public function getRetention() + { + return isset($this->retention) ? $this->retention : 0; + } + + public function hasRetention() + { + return isset($this->retention); + } + + public function clearRetention() + { + unset($this->retention); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + * @param int $var + * @return $this + */ + public function setRetention($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\OptionRetention::class); + $this->retention = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19; + * @return RepeatedField + */ + public function getTargets() + { + return $this->targets; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19; + * @param int[] $var + * @return $this + */ + public function setTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Protobuf\Internal\FieldOptions\OptionTargetType::class); + $this->targets = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + * @return RepeatedField<\Google\Protobuf\Internal\FieldOptions\EditionDefault> + */ + public function getEditionDefaults() + { + return $this->edition_defaults; + } + + /** + * Generated from protobuf field repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + * @param \Google\Protobuf\Internal\FieldOptions\EditionDefault[] $var + * @return $this + */ + public function setEditionDefaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldOptions\EditionDefault::class); + $this->edition_defaults = $arr; + + return $this; + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 21; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 21; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + * @return \Google\Protobuf\Internal\FieldOptions\FeatureSupport|null + */ + public function getFeatureSupport() + { + return $this->feature_support; + } + + public function hasFeatureSupport() + { + return isset($this->feature_support); + } + + public function clearFeatureSupport() + { + unset($this->feature_support); + } + + /** + * Generated from protobuf field optional .google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + * @param \Google\Protobuf\Internal\FieldOptions\FeatureSupport $var + * @return $this + */ + public function setFeatureSupport($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class); + $this->feature_support = $var; + + return $this; + } + /** * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -544,7 +769,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php index ba9eb4adb..a24877729 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/CType.php @@ -1,5 +1,6 @@ CORD = 1; */ const CORD = 1; @@ -53,6 +61,3 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CType::class, \Google\Protobuf\Internal\FieldOptions_CType::class); - diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/EditionDefault.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/EditionDefault.php new file mode 100644 index 000000000..a5804bade --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/EditionDefault.php @@ -0,0 +1,115 @@ +google.protobuf.FieldOptions.EditionDefault + */ +class EditionDefault extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + */ + protected $edition = null; + /** + * Textproto value. + * + * Generated from protobuf field optional string value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $edition + * @type string $value + * Textproto value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @return int + */ + public function getEdition() + { + return isset($this->edition) ? $this->edition : 0; + } + + public function hasEdition() + { + return isset($this->edition); + } + + public function clearEdition() + { + unset($this->edition); + } + + /** + * Generated from protobuf field optional .google.protobuf.Edition edition = 3; + * @param int $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition = $var; + + return $this; + } + + /** + * Textproto value. + * + * Generated from protobuf field optional string value = 2; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Textproto value. + * + * Generated from protobuf field optional string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/FeatureSupport.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/FeatureSupport.php new file mode 100644 index 000000000..940c72302 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/FeatureSupport.php @@ -0,0 +1,236 @@ +google.protobuf.FieldOptions.FeatureSupport + */ +class FeatureSupport extends \Google\Protobuf\Internal\Message +{ + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_introduced = 1; + */ + protected $edition_introduced = null; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_deprecated = 2; + */ + protected $edition_deprecated = null; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * Generated from protobuf field optional string deprecation_warning = 3; + */ + protected $deprecation_warning = null; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_removed = 4; + */ + protected $edition_removed = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $edition_introduced + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * @type int $edition_deprecated + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * @type string $deprecation_warning + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * @type int $edition_removed + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); + parent::__construct($data); + } + + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_introduced = 1; + * @return int + */ + public function getEditionIntroduced() + { + return isset($this->edition_introduced) ? $this->edition_introduced : 0; + } + + public function hasEditionIntroduced() + { + return isset($this->edition_introduced); + } + + public function clearEditionIntroduced() + { + unset($this->edition_introduced); + } + + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_introduced = 1; + * @param int $var + * @return $this + */ + public function setEditionIntroduced($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition_introduced = $var; + + return $this; + } + + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_deprecated = 2; + * @return int + */ + public function getEditionDeprecated() + { + return isset($this->edition_deprecated) ? $this->edition_deprecated : 0; + } + + public function hasEditionDeprecated() + { + return isset($this->edition_deprecated); + } + + public function clearEditionDeprecated() + { + unset($this->edition_deprecated); + } + + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_deprecated = 2; + * @param int $var + * @return $this + */ + public function setEditionDeprecated($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition_deprecated = $var; + + return $this; + } + + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * Generated from protobuf field optional string deprecation_warning = 3; + * @return string + */ + public function getDeprecationWarning() + { + return isset($this->deprecation_warning) ? $this->deprecation_warning : ''; + } + + public function hasDeprecationWarning() + { + return isset($this->deprecation_warning); + } + + public function clearDeprecationWarning() + { + unset($this->deprecation_warning); + } + + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * Generated from protobuf field optional string deprecation_warning = 3; + * @param string $var + * @return $this + */ + public function setDeprecationWarning($var) + { + GPBUtil::checkString($var, True); + $this->deprecation_warning = $var; + + return $this; + } + + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_removed = 4; + * @return int + */ + public function getEditionRemoved() + { + return isset($this->edition_removed) ? $this->edition_removed : 0; + } + + public function hasEditionRemoved() + { + return isset($this->edition_removed); + } + + public function clearEditionRemoved() + { + unset($this->edition_removed); + } + + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * Generated from protobuf field optional .google.protobuf.Edition edition_removed = 4; + * @param int $var + * @return $this + */ + public function setEditionRemoved($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); + $this->edition_removed = $var; + + return $this; + } + +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php index 175a4330b..5ecc06bd9 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/JSType.php @@ -1,5 +1,6 @@ google.protobuf.FieldOptions.OptionRetention + */ +class OptionRetention +{ + /** + * Generated from protobuf enum RETENTION_UNKNOWN = 0; + */ + const RETENTION_UNKNOWN = 0; + /** + * Generated from protobuf enum RETENTION_RUNTIME = 1; + */ + const RETENTION_RUNTIME = 1; + /** + * Generated from protobuf enum RETENTION_SOURCE = 2; + */ + const RETENTION_SOURCE = 2; + + private static $valueToName = [ + self::RETENTION_UNKNOWN => 'RETENTION_UNKNOWN', + self::RETENTION_RUNTIME => 'RETENTION_RUNTIME', + self::RETENTION_SOURCE => 'RETENTION_SOURCE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionTargetType.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionTargetType.php new file mode 100644 index 000000000..f633cdd18 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions/OptionTargetType.php @@ -0,0 +1,93 @@ +google.protobuf.FieldOptions.OptionTargetType + */ +class OptionTargetType +{ + /** + * Generated from protobuf enum TARGET_TYPE_UNKNOWN = 0; + */ + const TARGET_TYPE_UNKNOWN = 0; + /** + * Generated from protobuf enum TARGET_TYPE_FILE = 1; + */ + const TARGET_TYPE_FILE = 1; + /** + * Generated from protobuf enum TARGET_TYPE_EXTENSION_RANGE = 2; + */ + const TARGET_TYPE_EXTENSION_RANGE = 2; + /** + * Generated from protobuf enum TARGET_TYPE_MESSAGE = 3; + */ + const TARGET_TYPE_MESSAGE = 3; + /** + * Generated from protobuf enum TARGET_TYPE_FIELD = 4; + */ + const TARGET_TYPE_FIELD = 4; + /** + * Generated from protobuf enum TARGET_TYPE_ONEOF = 5; + */ + const TARGET_TYPE_ONEOF = 5; + /** + * Generated from protobuf enum TARGET_TYPE_ENUM = 6; + */ + const TARGET_TYPE_ENUM = 6; + /** + * Generated from protobuf enum TARGET_TYPE_ENUM_ENTRY = 7; + */ + const TARGET_TYPE_ENUM_ENTRY = 7; + /** + * Generated from protobuf enum TARGET_TYPE_SERVICE = 8; + */ + const TARGET_TYPE_SERVICE = 8; + /** + * Generated from protobuf enum TARGET_TYPE_METHOD = 9; + */ + const TARGET_TYPE_METHOD = 9; + + private static $valueToName = [ + self::TARGET_TYPE_UNKNOWN => 'TARGET_TYPE_UNKNOWN', + self::TARGET_TYPE_FILE => 'TARGET_TYPE_FILE', + self::TARGET_TYPE_EXTENSION_RANGE => 'TARGET_TYPE_EXTENSION_RANGE', + self::TARGET_TYPE_MESSAGE => 'TARGET_TYPE_MESSAGE', + self::TARGET_TYPE_FIELD => 'TARGET_TYPE_FIELD', + self::TARGET_TYPE_ONEOF => 'TARGET_TYPE_ONEOF', + self::TARGET_TYPE_ENUM => 'TARGET_TYPE_ENUM', + self::TARGET_TYPE_ENUM_ENTRY => 'TARGET_TYPE_ENUM_ENTRY', + self::TARGET_TYPE_SERVICE => 'TARGET_TYPE_SERVICE', + self::TARGET_TYPE_METHOD => 'TARGET_TYPE_METHOD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php deleted file mode 100644 index 4d18783ee..000000000 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions_CType.php +++ /dev/null @@ -1,16 +0,0 @@ -repeated int32 weak_dependency = 11; */ private $weak_dependency; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * Generated from protobuf field repeated string option_dependency = 15; + */ + private $option_dependency; /** * All top-level definitions in this file. * @@ -83,14 +91,20 @@ class FileDescriptorProto extends \Google\Protobuf\Internal\Message * The syntax of the proto file. * The supported values are "proto2", "proto3", and "editions". * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * * Generated from protobuf field optional string syntax = 12; */ protected $syntax = null; /** - * The edition of the proto file, which is an opaque string. + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * - * Generated from protobuf field optional string edition = 13; + * Generated from protobuf field optional .google.protobuf.Edition edition = 14; */ protected $edition = null; @@ -104,18 +118,21 @@ class FileDescriptorProto extends \Google\Protobuf\Internal\Message * file name, relative to root of source tree * @type string $package * e.g. "foo", "foo.bar", etc. - * @type array|\Google\Protobuf\Internal\RepeatedField $dependency + * @type string[] $dependency * Names of files imported by this file. - * @type array|\Google\Protobuf\Internal\RepeatedField $public_dependency + * @type int[] $public_dependency * Indexes of the public imported files in the dependency list above. - * @type array|\Google\Protobuf\Internal\RepeatedField $weak_dependency + * @type int[] $weak_dependency * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. - * @type array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $message_type + * @type string[] $option_dependency + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * @type \Google\Protobuf\Internal\DescriptorProto[] $message_type * All top-level definitions in this file. - * @type array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $enum_type - * @type array<\Google\Protobuf\Internal\ServiceDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $service - * @type array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $extension + * @type \Google\Protobuf\Internal\EnumDescriptorProto[] $enum_type + * @type \Google\Protobuf\Internal\ServiceDescriptorProto[] $service + * @type \Google\Protobuf\Internal\FieldDescriptorProto[] $extension * @type \Google\Protobuf\Internal\FileOptions $options * @type \Google\Protobuf\Internal\SourceCodeInfo $source_code_info * This field contains optional information about the original source code. @@ -126,8 +143,14 @@ class FileDescriptorProto extends \Google\Protobuf\Internal\Message * The syntax of the proto file. * The supported values are "proto2", "proto3", and "editions". * If `edition` is present, this value must be "editions". - * @type string $edition - * The edition of the proto file, which is an opaque string. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type int $edition + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * } */ public function __construct($data = NULL) { @@ -211,7 +234,7 @@ public function setPackage($var) * Names of files imported by this file. * * Generated from protobuf field repeated string dependency = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getDependency() { @@ -222,7 +245,7 @@ public function getDependency() * Names of files imported by this file. * * Generated from protobuf field repeated string dependency = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ public function setDependency($var) @@ -237,7 +260,7 @@ public function setDependency($var) * Indexes of the public imported files in the dependency list above. * * Generated from protobuf field repeated int32 public_dependency = 10; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getPublicDependency() { @@ -248,7 +271,7 @@ public function getPublicDependency() * Indexes of the public imported files in the dependency list above. * * Generated from protobuf field repeated int32 public_dependency = 10; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param int[] $var * @return $this */ public function setPublicDependency($var) @@ -264,7 +287,7 @@ public function setPublicDependency($var) * For Google-internal migration only. Do not use. * * Generated from protobuf field repeated int32 weak_dependency = 11; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getWeakDependency() { @@ -276,7 +299,7 @@ public function getWeakDependency() * For Google-internal migration only. Do not use. * * Generated from protobuf field repeated int32 weak_dependency = 11; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param int[] $var * @return $this */ public function setWeakDependency($var) @@ -287,11 +310,39 @@ public function setWeakDependency($var) return $this; } + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * Generated from protobuf field repeated string option_dependency = 15; + * @return RepeatedField + */ + public function getOptionDependency() + { + return $this->option_dependency; + } + + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * Generated from protobuf field repeated string option_dependency = 15; + * @param string[] $var + * @return $this + */ + public function setOptionDependency($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->option_dependency = $arr; + + return $this; + } + /** * All top-level definitions in this file. * * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\DescriptorProto> */ public function getMessageType() { @@ -302,7 +353,7 @@ public function getMessageType() * All top-level definitions in this file. * * Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4; - * @param array<\Google\Protobuf\Internal\DescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\DescriptorProto[] $var * @return $this */ public function setMessageType($var) @@ -315,7 +366,7 @@ public function setMessageType($var) /** * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\EnumDescriptorProto> */ public function getEnumType() { @@ -324,7 +375,7 @@ public function getEnumType() /** * Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 5; - * @param array<\Google\Protobuf\Internal\EnumDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\EnumDescriptorProto[] $var * @return $this */ public function setEnumType($var) @@ -337,7 +388,7 @@ public function setEnumType($var) /** * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\ServiceDescriptorProto> */ public function getService() { @@ -346,7 +397,7 @@ public function getService() /** * Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6; - * @param array<\Google\Protobuf\Internal\ServiceDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\ServiceDescriptorProto[] $var * @return $this */ public function setService($var) @@ -359,7 +410,7 @@ public function setService($var) /** * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\FieldDescriptorProto> */ public function getExtension() { @@ -368,7 +419,7 @@ public function getExtension() /** * Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 7; - * @param array<\Google\Protobuf\Internal\FieldDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var * @return $this */ public function setExtension($var) @@ -457,6 +508,9 @@ public function setSourceCodeInfo($var) * The syntax of the proto file. * The supported values are "proto2", "proto3", and "editions". * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * * Generated from protobuf field optional string syntax = 12; * @return string @@ -480,6 +534,9 @@ public function clearSyntax() * The syntax of the proto file. * The supported values are "proto2", "proto3", and "editions". * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * * Generated from protobuf field optional string syntax = 12; * @param string $var @@ -494,14 +551,17 @@ public function setSyntax($var) } /** - * The edition of the proto file, which is an opaque string. + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * - * Generated from protobuf field optional string edition = 13; - * @return string + * Generated from protobuf field optional .google.protobuf.Edition edition = 14; + * @return int */ public function getEdition() { - return isset($this->edition) ? $this->edition : ''; + return isset($this->edition) ? $this->edition : 0; } public function hasEdition() @@ -515,15 +575,18 @@ public function clearEdition() } /** - * The edition of the proto file, which is an opaque string. + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * - * Generated from protobuf field optional string edition = 13; - * @param string $var + * Generated from protobuf field optional .google.protobuf.Edition edition = 14; + * @param int $var * @return $this */ public function setEdition($var) { - GPBUtil::checkString($var, True); + GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); $this->edition = $var; return $this; diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php index 1dae6fb3e..60d5f4bfb 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileDescriptorSet.php @@ -1,14 +1,15 @@ |\Google\Protobuf\Internal\RepeatedField $file + * @type \Google\Protobuf\Internal\FileDescriptorProto[] $file * } */ public function __construct($data = NULL) { @@ -39,7 +40,7 @@ public function __construct($data = NULL) { /** * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\FileDescriptorProto> */ public function getFile() { @@ -48,7 +49,7 @@ public function getFile() /** * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; - * @param array<\Google\Protobuf\Internal\FileDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\FileDescriptorProto[] $var * @return $this */ public function setFile($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php index 43931be80..91c94237a 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions.php @@ -1,14 +1,15 @@ google.protobuf.FileOptions @@ -53,12 +54,14 @@ class FileOptions extends \Google\Protobuf\Internal\Message */ protected $java_generate_equals_and_hash = null; /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. * * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; */ @@ -99,10 +102,6 @@ class FileOptions extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool py_generic_services = 18 [default = false]; */ protected $py_generic_services = null; - /** - * Generated from protobuf field optional bool php_generic_services = 42 [default = false]; - */ - protected $php_generic_services = null; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -172,6 +171,15 @@ class FileOptions extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string ruby_package = 45; */ protected $ruby_package = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + */ + protected $features = null; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. @@ -207,12 +215,14 @@ class FileOptions extends \Google\Protobuf\Internal\Message * @type bool $java_generate_equals_and_hash * This option does nothing. * @type bool $java_string_check_utf8 - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. * @type int $optimize_for * @type string $go_package * Sets the Go package where structs generated from this .proto will be @@ -232,7 +242,6 @@ class FileOptions extends \Google\Protobuf\Internal\Message * explicitly set them to true. * @type bool $java_generic_services * @type bool $py_generic_services - * @type bool $php_generic_services * @type bool $deprecated * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -266,7 +275,12 @@ class FileOptions extends \Google\Protobuf\Internal\Message * Use this option to change the package of ruby generated classes. Default * is empty. When this option is not set, the package name will be used for * determining the ruby package. - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. * } @@ -417,13 +431,17 @@ public function setJavaMultipleFiles($var) */ public function getJavaGenerateEqualsAndHash() { - @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + if (isset($this->java_generate_equals_and_hash)) { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + } return isset($this->java_generate_equals_and_hash) ? $this->java_generate_equals_and_hash : false; } public function hasJavaGenerateEqualsAndHash() { - @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + if (isset($this->java_generate_equals_and_hash)) { + @trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED); + } return isset($this->java_generate_equals_and_hash); } @@ -451,12 +469,14 @@ public function setJavaGenerateEqualsAndHash($var) } /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. * * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; * @return bool @@ -477,12 +497,14 @@ public function clearJavaStringCheckUtf8() } /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. * * Generated from protobuf field optional bool java_string_check_utf8 = 27 [default = false]; * @param bool $var @@ -688,38 +710,6 @@ public function setPyGenericServices($var) return $this; } - /** - * Generated from protobuf field optional bool php_generic_services = 42 [default = false]; - * @return bool - */ - public function getPhpGenericServices() - { - return isset($this->php_generic_services) ? $this->php_generic_services : false; - } - - public function hasPhpGenericServices() - { - return isset($this->php_generic_services); - } - - public function clearPhpGenericServices() - { - unset($this->php_generic_services); - } - - /** - * Generated from protobuf field optional bool php_generic_services = 42 [default = false]; - * @param bool $var - * @return $this - */ - public function setPhpGenericServices($var) - { - GPBUtil::checkBool($var); - $this->php_generic_services = $var; - - return $this; - } - /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -1074,12 +1064,54 @@ public function setRubyPackage($var) return $this; } + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 50; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -1091,7 +1123,7 @@ public function getUninterpretedOption() * See the documentation for the "Options" section above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php index 0df27b533..2ffe8b2fa 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php @@ -1,5 +1,6 @@ writeRaw("\"", 1); - $field_name = GPBJsonWire::formatFieldName($field); + $field_name = GPBJsonWire::formatFieldName($field, $output->getOptions()); $output->writeRaw($field_name, strlen($field_name)); $output->writeRaw("\":", 2); } @@ -178,6 +180,11 @@ private static function serializeSingularFieldValueToStream( $output->writeRaw("null", 4); break; } + if ($output->getOptions() & PrintOptions::ALWAYS_PRINT_ENUMS_AS_INTS) { + $str_value = strval($value); + $output->writeRaw($str_value, strlen($str_value)); + break; + } $enum_value_desc = $enum_desc->getValueByNumber($value); if (!is_null($enum_value_desc)) { $str_value = $enum_value_desc->getName(); @@ -220,8 +227,11 @@ private static function serializeSingularFieldValueToStream( return true; } - private static function formatFieldName($field) + private static function formatFieldName($field, $options) { + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + return $field->getName(); + } return $field->getJsonName(); } diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php index 4c1fadcd0..26b4a10d4 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php @@ -12,8 +12,8 @@ use Google\Protobuf\Duration; use Google\Protobuf\FieldMask; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\MapField; +use Google\Protobuf\RepeatedField; use function bccomp; function camel2underscore($input) { diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php index a1db269bf..6af52740b 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo.php @@ -1,14 +1,15 @@ |\Google\Protobuf\Internal\RepeatedField $annotation + * @type \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation[] $annotation * An Annotation connects some span of text in generated code to an element * of its generating .proto file. * } @@ -48,7 +49,7 @@ public function __construct($data = NULL) { * of its generating .proto file. * * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\GeneratedCodeInfo\Annotation> */ public function getAnnotation() { @@ -60,7 +61,7 @@ public function getAnnotation() * of its generating .proto file. * * Generated from protobuf field repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; - * @param array<\Google\Protobuf\Internal\GeneratedCodeInfo\Annotation>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation[] $var * @return $this */ public function setAnnotation($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php index b1ef4ee95..a7fdb42e9 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php @@ -1,14 +1,15 @@ google.protobuf.GeneratedCodeInfo.Annotation @@ -54,7 +55,7 @@ class Annotation extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type array|\Google\Protobuf\Internal\RepeatedField $path + * @type int[] $path * Identifies the element in the original source .proto file. This field * is formatted the same as SourceCodeInfo.Location.path. * @type string $source_file @@ -79,7 +80,7 @@ public function __construct($data = NULL) { * is formatted the same as SourceCodeInfo.Location.path. * * Generated from protobuf field repeated int32 path = 1 [packed = true]; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getPath() { @@ -91,7 +92,7 @@ public function getPath() * is formatted the same as SourceCodeInfo.Location.path. * * Generated from protobuf field repeated int32 path = 1 [packed = true]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param int[] $var * @return $this */ public function setPath($var) @@ -250,6 +251,3 @@ public function setSemantic($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Annotation::class, \Google\Protobuf\Internal\GeneratedCodeInfo_Annotation::class); - diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation/Semantic.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation/Semantic.php new file mode 100644 index 000000000..7d3907629 --- /dev/null +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation/Semantic.php @@ -0,0 +1,63 @@ +google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +class Semantic +{ + /** + * There is no effect or the effect is indescribable. + * + * Generated from protobuf enum NONE = 0; + */ + const NONE = 0; + /** + * The element is set or otherwise mutated. + * + * Generated from protobuf enum SET = 1; + */ + const SET = 1; + /** + * An alias to the element is returned. + * + * Generated from protobuf enum ALIAS = 2; + */ + const ALIAS = 2; + + private static $valueToName = [ + self::NONE => 'NONE', + self::SET => 'SET', + self::ALIAS => 'ALIAS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php deleted file mode 100644 index e36f1e573..000000000 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php +++ /dev/null @@ -1,16 +0,0 @@ -$setter($map_field); break; } - } else if ($field->getLabel() === GPBLabel::REPEATED) { + } else if ($field->isRepeated()) { switch ($field->getType()) { case GPBType::MESSAGE: case GPBType::GROUP: @@ -128,7 +128,7 @@ private function initWithGeneratedPool() $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; $oneof_name = $oneof->getName(); $this->$oneof_name = new OneofField($oneof); - } else if ($field->getLabel() === GPBLabel::OPTIONAL && + } else if (!$field->isRequired() && !$field->isRepeated() && PHP_INT_SIZE == 4) { switch ($field->getType()) { case GPBType::INT64: @@ -556,7 +556,7 @@ public function clear() $this->$setter($map_field); break; } - } else if ($field->getLabel() === GPBLabel::REPEATED) { + } else if ($field->isRepeated()) { switch ($field->getType()) { case GPBType::MESSAGE: case GPBType::GROUP: @@ -580,7 +580,7 @@ public function clear() $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; $oneof_name = $oneof->getName(); $this->$oneof_name = new OneofField($oneof); - } else if ($field->getLabel() === GPBLabel::OPTIONAL) { + } else if (!$field->isRequired() && !$field->isRepeated()) { switch ($field->getType()) { case GPBType::DOUBLE : case GPBType::FLOAT : @@ -651,13 +651,13 @@ public function discardUnknownFields() foreach ($map as $key => $value) { $value->discardUnknownFields(); } - } else if ($field->getLabel() === GPBLabel::REPEATED) { + } else if ($field->isRepeated()) { $getter = $field->getGetter(); $arr = $this->$getter(); foreach ($arr as $sub) { $sub->discardUnknownFields(); } - } else if ($field->getLabel() === GPBLabel::OPTIONAL) { + } else if (!$field->isRequired() && !$field->isRepeated()) { $getter = $field->getGetter(); $sub = $this->$getter(); if (!is_null($sub)) { @@ -705,7 +705,7 @@ public function mergeFrom($msg) } } } - } else if ($field->getLabel() === GPBLabel::REPEATED) { + } else if ($field->isRepeated()) { if (count($msg->$getter()) != 0) { foreach ($msg->$getter() as $tmp) { if ($field->getType() == GPBType::MESSAGE) { @@ -718,7 +718,7 @@ public function mergeFrom($msg) } } } - } else if ($field->getLabel() === GPBLabel::OPTIONAL) { + } else if (!$field->isRequired() && !$field->isRepeated()) { if($msg->$getter() !== $this->defaultValue($field)) { $tmp = $msg->$getter(); if ($field->getType() == GPBType::MESSAGE) { @@ -1255,6 +1255,18 @@ private function mergeFromArrayJsonImpl($array, $ignore_unknown) $tmp_value, $value_field, $ignore_unknown); + + // Mapped unknown enum string values should be silently + // ignored if ignore_unknown is set. + if ($value_field->getType() == GPBType::ENUM && + is_string($tmp_value) && + is_null( + $value_field->getEnumType()->getValueByName($tmp_value) + ) && + $ignore_unknown) { + continue; + } + self::kvUpdateHelper($field, $proto_key, $proto_value); } } else if ($field->isRepeated()) { @@ -1270,6 +1282,16 @@ private function mergeFromArrayJsonImpl($array, $ignore_unknown) $tmp, $field, $ignore_unknown); + + // Repeated unknown enum string values should be silently + // ignored if ignore_unknown is set. + if ($field->getType() == GPBType::ENUM && + is_string($tmp) && + is_null($field->getEnumType()->getValueByName($tmp)) && + $ignore_unknown) { + continue; + } + self::appendHelper($field, $proto_value); } } else { @@ -1548,9 +1570,9 @@ public function serializeToString() * Serialize the message to json string. * @return string Serialized json protobuf data. */ - public function serializeToJsonString() + public function serializeToJsonString($options = 0) { - $output = new CodedOutputStream($this->jsonByteSize()); + $output = new CodedOutputStream($this->jsonByteSize($options), $options); $this->serializeToJsonStream($output); return $output->getData(); } @@ -1663,7 +1685,7 @@ private function fieldDataOnlyByteSize($field, $value) /** * @ignore */ - private function fieldDataOnlyJsonByteSize($field, $value) + private function fieldDataOnlyJsonByteSize($field, $value, $options = 0) { $size = 0; @@ -1720,13 +1742,17 @@ private function fieldDataOnlyJsonByteSize($field, $value) $size += 4; break; } - $enum_value_desc = $enum_desc->getValueByNumber($value); - if (!is_null($enum_value_desc)) { - $size += 2; // size for "" - $size += strlen($enum_value_desc->getName()); + if ($options & PrintOptions::ALWAYS_PRINT_ENUMS_AS_INTS) { + $size += strlen(strval($value)); // size for integer length } else { - $str_value = strval($value); - $size += strlen($str_value); + $enum_value_desc = $enum_desc->getValueByNumber($value); + if (!is_null($enum_value_desc)) { + $size += 2; // size for "" + $size += strlen($enum_value_desc->getName()); + } else { + $str_value = strval($value); + $size += strlen($str_value); + } } break; case GPBType::BOOL: @@ -1751,7 +1777,7 @@ private function fieldDataOnlyJsonByteSize($field, $value) $size += 2; // size for \"\" break; case GPBType::MESSAGE: - $size += $value->jsonByteSize(); + $size += $value->jsonByteSize($options); break; # case GPBType::GROUP: # // TODO: Add support. @@ -1829,7 +1855,7 @@ private function fieldByteSize($field) /** * @ignore */ - private function fieldJsonByteSize($field) + private function fieldJsonByteSize($field, $options = 0) { $size = 0; @@ -1840,7 +1866,11 @@ private function fieldJsonByteSize($field) if ($count !== 0) { if (!GPBUtil::hasSpecialJsonMapping($this)) { $size += 3; // size for "\"\":". - $size += strlen($field->getJsonName()); // size for field name + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + $size += strlen($field->getName()); + } else { + $size += strlen($field->getJsonName()); + } // size for field name } $size += 2; // size for "{}". $size += $count - 1; // size for commas @@ -1864,8 +1894,8 @@ private function fieldJsonByteSize($field) if ($additional_quote) { $size += 2; // size for "" } - $size += $this->fieldDataOnlyJsonByteSize($key_field, $key); - $size += $this->fieldDataOnlyJsonByteSize($value_field, $value); + $size += $this->fieldDataOnlyJsonByteSize($key_field, $key, $options); + $size += $this->fieldDataOnlyJsonByteSize($value_field, $value, $options); $size += 1; // size for : } } @@ -1876,23 +1906,31 @@ private function fieldJsonByteSize($field) if ($count !== 0) { if (!GPBUtil::hasSpecialJsonMapping($this)) { $size += 3; // size for "\"\":". - $size += strlen($field->getJsonName()); // size for field name + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + $size += strlen($field->getName()); + } else { + $size += strlen($field->getJsonName()); + } // size for field name } $size += 2; // size for "[]". $size += $count - 1; // size for commas $getter = $field->getGetter(); foreach ($values as $value) { - $size += $this->fieldDataOnlyJsonByteSize($field, $value); + $size += $this->fieldDataOnlyJsonByteSize($field, $value, $options); } } } elseif ($this->existField($field) || GPBUtil::hasJsonValue($this)) { if (!GPBUtil::hasSpecialJsonMapping($this)) { $size += 3; // size for "\"\":". - $size += strlen($field->getJsonName()); // size for field name + if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) { + $size += strlen($field->getName()); + } else { + $size += strlen($field->getJsonName()); + } // size for field name } $getter = $field->getGetter(); $value = $this->$getter(); - $size += $this->fieldDataOnlyJsonByteSize($field, $value); + $size += $this->fieldDataOnlyJsonByteSize($field, $value, $options); } return $size; } @@ -1941,7 +1979,7 @@ private function kvUpdateHelper($field, $update_key, $update_value) /** * @ignore */ - public function jsonByteSize() + public function jsonByteSize($options = 0) { $size = 0; if (is_a($this, 'Google\Protobuf\Any')) { @@ -1958,9 +1996,9 @@ public function jsonByteSize() if (GPBUtil::hasSpecialJsonMapping($value_msg)) { // Size for "\",value\":". $size += 9; - $size += $value_msg->jsonByteSize(); + $size += $value_msg->jsonByteSize($options); } else { - $value_size = $value_msg->jsonByteSize(); + $value_size = $value_msg->jsonByteSize($options); // size === 2 it's empty message {} which is not serialized inside any if ($value_size !== 2) { // Size for value. +1 for comma, -2 for "{}". @@ -1980,7 +2018,7 @@ public function jsonByteSize() } elseif (get_class($this) === 'Google\Protobuf\ListValue') { $field = $this->desc->getField()[1]; if ($this->existField($field)) { - $field_size = $this->fieldJsonByteSize($field); + $field_size = $this->fieldJsonByteSize($field, $options); $size += $field_size; } else { // Size for "[]". @@ -1989,7 +2027,7 @@ public function jsonByteSize() } elseif (get_class($this) === 'Google\Protobuf\Struct') { $field = $this->desc->getField()[1]; if ($this->existField($field)) { - $field_size = $this->fieldJsonByteSize($field); + $field_size = $this->fieldJsonByteSize($field, $options); $size += $field_size; } else { // Size for "{}". @@ -2004,7 +2042,7 @@ public function jsonByteSize() $fields = $this->desc->getField(); $count = 0; foreach ($fields as $field) { - $field_size = $this->fieldJsonByteSize($field); + $field_size = $this->fieldJsonByteSize($field, $options); $size += $field_size; if ($field_size != 0) { $count++; diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php index bb01aa4ba..d09e6fab5 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php @@ -1,14 +1,15 @@ google.protobuf.MessageOptions @@ -53,9 +54,6 @@ class MessageOptions extends \Google\Protobuf\Internal\Message */ protected $deprecated = null; /** - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -71,6 +69,9 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * * Generated from protobuf field optional bool map_entry = 7; */ @@ -89,6 +90,15 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * @deprecated */ protected $deprecated_legacy_json_field_conflicts = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 12; + */ + protected $features = null; /** * The parser stores options it doesn't recognize here. See above. * @@ -128,9 +138,6 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * for the message, or it will be completely ignored; in the very least, * this is a formalization for deprecating messages. * @type bool $map_entry - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -146,6 +153,9 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * @type bool $deprecated_legacy_json_field_conflicts * Enable the legacy handling of JSON field name conflicts. This lowercases * and strips underscored from the fields before comparison in proto3 only. @@ -155,7 +165,12 @@ class MessageOptions extends \Google\Protobuf\Internal\Message * to the change in behavior for JSON field name conflicts. * TODO This is legacy behavior we plan to remove once downstream * teams have had time to migrate. - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } */ @@ -311,9 +326,6 @@ public function setDeprecated($var) } /** - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -329,6 +341,9 @@ public function setDeprecated($var) * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * * Generated from protobuf field optional bool map_entry = 7; * @return bool @@ -349,9 +364,6 @@ public function clearMapEntry() } /** - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. * Whether the message is an automatically generated map entry type for the * maps field. * For maps fields: @@ -367,6 +379,9 @@ public function clearMapEntry() * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. * * Generated from protobuf field optional bool map_entry = 7; * @param bool $var @@ -396,13 +411,17 @@ public function setMapEntry($var) */ public function getDeprecatedLegacyJsonFieldConflicts() { - @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } return isset($this->deprecated_legacy_json_field_conflicts) ? $this->deprecated_legacy_json_field_conflicts : false; } public function hasDeprecatedLegacyJsonFieldConflicts() { - @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + if (isset($this->deprecated_legacy_json_field_conflicts)) { + @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED); + } return isset($this->deprecated_legacy_json_field_conflicts); } @@ -436,11 +455,53 @@ public function setDeprecatedLegacyJsonFieldConflicts($var) return $this; } + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 12; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 12; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + /** * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -451,7 +512,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php index 96efb02d2..59ab86781 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodDescriptorProto.php @@ -1,14 +1,15 @@ google.protobuf.MethodOptions @@ -28,6 +29,15 @@ class MethodOptions extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; */ protected $idempotency_level = null; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 35; + */ + protected $features = null; /** * The parser stores options it doesn't recognize here. See above. * @@ -47,7 +57,12 @@ class MethodOptions extends \Google\Protobuf\Internal\Message * for the method, or it will be completely ignored; in the very least, * this is a formalization for deprecating methods. * @type int $idempotency_level - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } */ @@ -130,11 +145,53 @@ public function setIdempotencyLevel($var) return $this; } + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 35; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 35; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + /** * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -145,7 +202,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php index ce3c062c6..ce99b8c70 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php @@ -1,5 +1,6 @@ google.protobuf.OneofOptions */ class OneofOptions extends \Google\Protobuf\Internal\Message { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 1; + */ + protected $features = null; /** * The parser stores options it doesn't recognize here. See above. * @@ -28,7 +38,12 @@ class OneofOptions extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } */ @@ -37,11 +52,53 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 1; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 1; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + /** * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -52,7 +109,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php index 3d9e66d48..cd6ef02cb 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php @@ -1,254 +1,13 @@ container = []; - $this->type = $type; - if ($this->type == GPBType::MESSAGE) { - $pool = DescriptorPool::getGeneratedPool(); - $desc = $pool->getDescriptorByClassName($klass); - if ($desc == NULL) { - new $klass; // No msg class instance has been created before. - $desc = $pool->getDescriptorByClassName($klass); - } - $this->klass = $desc->getClass(); - $this->legacy_klass = $desc->getLegacyClass(); - } - } - - /** - * @ignore - */ - public function getType() - { - return $this->type; - } - - /** - * @ignore - */ - public function getClass() - { - return $this->klass; - } - - /** - * @ignore - */ - public function getLegacyClass() - { - return $this->legacy_klass; - } - - /** - * Return the element at the given index. - * - * This will also be called for: $ele = $arr[0] - * - * @param integer $offset The index of the element to be fetched. - * @return mixed The stored element at given index. - * @throws \ErrorException Invalid type for index. - * @throws \ErrorException Non-existing index. - * @todo need to add return type mixed (require update php version to 8.0) - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset]; - } - - /** - * Assign the element at the given index. - * - * This will also be called for: $arr []= $ele and $arr[0] = ele - * - * @param int|null $offset The index of the element to be assigned. - * @param mixed $value The element to be assigned. - * @return void - * @throws \ErrorException Invalid type for index. - * @throws \ErrorException Non-existing index. - * @throws \ErrorException Incorrect type of the element. - * @todo need to add return type void (require update php version to 7.1) - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - switch ($this->type) { - case GPBType::SFIXED32: - case GPBType::SINT32: - case GPBType::INT32: - case GPBType::ENUM: - GPBUtil::checkInt32($value); - break; - case GPBType::FIXED32: - case GPBType::UINT32: - GPBUtil::checkUint32($value); - break; - case GPBType::SFIXED64: - case GPBType::SINT64: - case GPBType::INT64: - GPBUtil::checkInt64($value); - break; - case GPBType::FIXED64: - case GPBType::UINT64: - GPBUtil::checkUint64($value); - break; - case GPBType::FLOAT: - GPBUtil::checkFloat($value); - break; - case GPBType::DOUBLE: - GPBUtil::checkDouble($value); - break; - case GPBType::BOOL: - GPBUtil::checkBool($value); - break; - case GPBType::BYTES: - GPBUtil::checkString($value, false); - break; - case GPBType::STRING: - GPBUtil::checkString($value, true); - break; - case GPBType::MESSAGE: - if (is_null($value)) { - throw new \TypeError("RepeatedField element cannot be null."); - } - GPBUtil::checkMessage($value, $this->klass); - break; - default: - break; - } - if (is_null($offset)) { - $this->container[] = $value; - } else { - $count = count($this->container); - if (!is_numeric($offset) || $offset < 0 || $offset >= $count) { - trigger_error( - "Cannot modify element at the given index", - E_USER_ERROR); - return; - } - $this->container[$offset] = $value; - } - } - - /** - * Remove the element at the given index. - * - * This will also be called for: unset($arr) - * - * @param integer $offset The index of the element to be removed. - * @return void - * @throws \ErrorException Invalid type for index. - * @throws \ErrorException The element to be removed is not at the end of the - * RepeatedField. - * @todo need to add return type void (require update php version to 7.1) - */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - $count = count($this->container); - if (!is_numeric($offset) || $count === 0 || $offset < 0 || $offset >= $count) { - trigger_error( - "Cannot remove element at the given index", - E_USER_ERROR); - return; - } - array_splice($this->container, $offset, 1); - } - - /** - * Check the existence of the element at the given index. - * - * This will also be called for: isset($arr) - * - * @param integer $offset The index of the element to be removed. - * @return bool True if the element at the given offset exists. - * @throws \ErrorException Invalid type for index. - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * @ignore - */ - public function getIterator(): Traversable - { - return new RepeatedFieldIter($this->container); - } - - /** - * Return the number of stored elements. - * - * This will also be called for: count($arr) - * - * @return integer The number of stored elements. - */ - public function count(): int - { - return count($this->container); - } - - public function __debugInfo() - { - return array_map( - function ($item) { - if ($item instanceof Message || $item instanceof RepeatedField) { - return $item->__debugInfo(); - } - return $item; - }, - iterator_to_array($this) - ); - } + class RepeatedField {} } +class_exists(\Google\Protobuf\RepeatedField::class); +@trigger_error('Google\Protobuf\Internal\RepeatedField is deprecated and will be removed in the next major release. Use Google\Protobuf\RepeatedField instead', E_USER_DEPRECATED); diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php index e322e2abf..27b274b22 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceDescriptorProto.php @@ -1,14 +1,15 @@ |\Google\Protobuf\Internal\RepeatedField $method + * @type \Google\Protobuf\Internal\MethodDescriptorProto[] $method * @type \Google\Protobuf\Internal\ServiceOptions $options * } */ @@ -80,7 +81,7 @@ public function setName($var) /** * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\MethodDescriptorProto> */ public function getMethod() { @@ -89,7 +90,7 @@ public function getMethod() /** * Generated from protobuf field repeated .google.protobuf.MethodDescriptorProto method = 2; - * @param array<\Google\Protobuf\Internal\MethodDescriptorProto>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\MethodDescriptorProto[] $var * @return $this */ public function setMethod($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php index 8ac27ee80..d478bb2c3 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/ServiceOptions.php @@ -1,20 +1,30 @@ google.protobuf.ServiceOptions */ class ServiceOptions extends \Google\Protobuf\Internal\Message { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 34; + */ + protected $features = null; /** * Is this service deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -37,12 +47,17 @@ class ServiceOptions extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type \Google\Protobuf\Internal\FeatureSet $features + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. * @type bool $deprecated * Is this service deprecated? * Depending on the target platform, this can emit Deprecated annotations * for the service, or it will be completely ignored; in the very least, * this is a formalization for deprecating services. - * @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * @type \Google\Protobuf\Internal\UninterpretedOption[] $uninterpreted_option * The parser stores options it doesn't recognize here. See above. * } */ @@ -51,6 +66,48 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 34; + * @return \Google\Protobuf\Internal\FeatureSet|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * Generated from protobuf field optional .google.protobuf.FeatureSet features = 34; + * @param \Google\Protobuf\Internal\FeatureSet $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); + $this->features = $var; + + return $this; + } + /** * Is this service deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -97,7 +154,7 @@ public function setDeprecated($var) * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption> */ public function getUninterpretedOption() { @@ -108,7 +165,7 @@ public function getUninterpretedOption() * The parser stores options it doesn't recognize here. See above. * * Generated from protobuf field repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption[] $var * @return $this */ public function setUninterpretedOption($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php index 0005bc669..b194a0416 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo.php @@ -1,14 +1,15 @@ |\Google\Protobuf\Internal\RepeatedField $location + * @type \Google\Protobuf\Internal\SourceCodeInfo\Location[] $location * A Location identifies a piece of source code in a .proto file which * corresponds to a particular definition. This information is intended * to be useful to IDEs, code indexers, documentation generators, and similar @@ -164,7 +165,7 @@ public function __construct($data = NULL) { * be recorded in the future. * * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\SourceCodeInfo\Location> */ public function getLocation() { @@ -215,7 +216,7 @@ public function getLocation() * be recorded in the future. * * Generated from protobuf field repeated .google.protobuf.SourceCodeInfo.Location location = 1; - * @param array<\Google\Protobuf\Internal\SourceCodeInfo\Location>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\SourceCodeInfo\Location[] $var * @return $this */ public function setLocation($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php index 032be3921..87d3452a1 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php @@ -1,14 +1,15 @@ google.protobuf.SourceCodeInfo.Location @@ -19,7 +20,7 @@ class Location extends \Google\Protobuf\Internal\Message * Identifies which part of the FileDescriptorProto was defined at this * location. * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition occurs. + * the root FileDescriptorProto to the place where the definition appears. * For example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: @@ -81,11 +82,11 @@ class Location extends \Google\Protobuf\Internal\Message * // both. * // Detached comment for corge paragraph 2. * optional string corge = 5; - * /* Block comment attached + * /* Block comment attached * * to corge. Leading asterisks - * * will be removed. */ - * /* Block comment attached to - * * grault. */ + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} * optional int32 grault = 6; * // ignored detached comments. * @@ -107,11 +108,11 @@ class Location extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type array|\Google\Protobuf\Internal\RepeatedField $path + * @type int[] $path * Identifies which part of the FileDescriptorProto was defined at this * location. * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition occurs. + * the root FileDescriptorProto to the place where the definition appears. * For example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: @@ -129,7 +130,7 @@ class Location extends \Google\Protobuf\Internal\Message * [ 4, 3, 2, 7 ] * this path refers to the whole field declaration (from the beginning * of the label to the terminating semicolon). - * @type array|\Google\Protobuf\Internal\RepeatedField $span + * @type int[] $span * Always has exactly three or four elements: start line, start column, * end line (optional, otherwise assumed same as start line), end column. * These are packed into a single field for efficiency. Note that line @@ -165,15 +166,15 @@ class Location extends \Google\Protobuf\Internal\Message * // both. * // Detached comment for corge paragraph 2. * optional string corge = 5; - * /* Block comment attached + * /* Block comment attached * * to corge. Leading asterisks - * * will be removed. */ - * /* Block comment attached to - * * grault. */ + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} * optional int32 grault = 6; * // ignored detached comments. * @type string $trailing_comments - * @type array|\Google\Protobuf\Internal\RepeatedField $leading_detached_comments + * @type string[] $leading_detached_comments * } */ public function __construct($data = NULL) { @@ -185,7 +186,7 @@ public function __construct($data = NULL) { * Identifies which part of the FileDescriptorProto was defined at this * location. * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition occurs. + * the root FileDescriptorProto to the place where the definition appears. * For example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: @@ -205,7 +206,7 @@ public function __construct($data = NULL) { * of the label to the terminating semicolon). * * Generated from protobuf field repeated int32 path = 1 [packed = true]; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getPath() { @@ -216,7 +217,7 @@ public function getPath() * Identifies which part of the FileDescriptorProto was defined at this * location. * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition occurs. + * the root FileDescriptorProto to the place where the definition appears. * For example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: @@ -236,7 +237,7 @@ public function getPath() * of the label to the terminating semicolon). * * Generated from protobuf field repeated int32 path = 1 [packed = true]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param int[] $var * @return $this */ public function setPath($var) @@ -255,7 +256,7 @@ public function setPath($var) * 1 to each before displaying to a user. * * Generated from protobuf field repeated int32 span = 2 [packed = true]; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getSpan() { @@ -270,7 +271,7 @@ public function getSpan() * 1 to each before displaying to a user. * * Generated from protobuf field repeated int32 span = 2 [packed = true]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param int[] $var * @return $this */ public function setSpan($var) @@ -311,11 +312,11 @@ public function setSpan($var) * // both. * // Detached comment for corge paragraph 2. * optional string corge = 5; - * /* Block comment attached + * /* Block comment attached * * to corge. Leading asterisks - * * will be removed. */ - * /* Block comment attached to - * * grault. */ + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} * optional int32 grault = 6; * // ignored detached comments. * @@ -367,11 +368,11 @@ public function clearLeadingComments() * // both. * // Detached comment for corge paragraph 2. * optional string corge = 5; - * /* Block comment attached + * /* Block comment attached * * to corge. Leading asterisks - * * will be removed. */ - * /* Block comment attached to - * * grault. */ + * * will be removed. {@*} + * /* Block comment attached to + * * grault. {@*} * optional int32 grault = 6; * // ignored detached comments. * @@ -421,7 +422,7 @@ public function setTrailingComments($var) /** * Generated from protobuf field repeated string leading_detached_comments = 6; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getLeadingDetachedComments() { @@ -430,7 +431,7 @@ public function getLeadingDetachedComments() /** * Generated from protobuf field repeated string leading_detached_comments = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ public function setLeadingDetachedComments($var) @@ -443,6 +444,3 @@ public function setLeadingDetachedComments($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Location::class, \Google\Protobuf\Internal\SourceCodeInfo_Location::class); - diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php deleted file mode 100644 index 1346492d2..000000000 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php +++ /dev/null @@ -1,16 +0,0 @@ -google.protobuf.SymbolVisibility + */ +class SymbolVisibility +{ + /** + * Generated from protobuf enum VISIBILITY_UNSET = 0; + */ + const VISIBILITY_UNSET = 0; + /** + * Generated from protobuf enum VISIBILITY_LOCAL = 1; + */ + const VISIBILITY_LOCAL = 1; + /** + * Generated from protobuf enum VISIBILITY_EXPORT = 2; + */ + const VISIBILITY_EXPORT = 2; + + private static $valueToName = [ + self::VISIBILITY_UNSET => 'VISIBILITY_UNSET', + self::VISIBILITY_LOCAL => 'VISIBILITY_LOCAL', + self::VISIBILITY_EXPORT => 'VISIBILITY_EXPORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php index a1cdca573..b365b6c0c 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption.php @@ -1,14 +1,15 @@ |\Google\Protobuf\Internal\RepeatedField $name + * @type \Google\Protobuf\Internal\UninterpretedOption\NamePart[] $name * @type string $identifier_value * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. @@ -78,7 +79,7 @@ public function __construct($data = NULL) { /** * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Internal\UninterpretedOption\NamePart> */ public function getName() { @@ -87,7 +88,7 @@ public function getName() /** * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; - * @param array<\Google\Protobuf\Internal\UninterpretedOption\NamePart>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Internal\UninterpretedOption\NamePart[] $var * @return $this */ public function setName($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php index 2debf83a6..547e3f4c3 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php @@ -1,14 +1,15 @@ |\Google\Protobuf\Internal\RepeatedField $values + * @type \Google\Protobuf\Value[] $values * Repeated field of dynamically typed values. * } */ @@ -42,7 +43,7 @@ public function __construct($data = NULL) { * Repeated field of dynamically typed values. * * Generated from protobuf field repeated .google.protobuf.Value values = 1; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Value> */ public function getValues() { @@ -53,7 +54,7 @@ public function getValues() * Repeated field of dynamically typed values. * * Generated from protobuf field repeated .google.protobuf.Value values = 1; - * @param array<\Google\Protobuf\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Value[] $var * @return $this */ public function setValues($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Method.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Method.php index eda00bf61..5e55a764c 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Method.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Method.php @@ -1,12 +1,13 @@ |\Google\Protobuf\Internal\RepeatedField $options + * @type \Google\Protobuf\Option[] $options * Any metadata attached to the method. * @type int $syntax * The source syntax of this method. @@ -219,7 +220,7 @@ public function setResponseStreaming($var) * Any metadata attached to the method. * * Generated from protobuf field repeated .google.protobuf.Option options = 6; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Option> */ public function getOptions() { @@ -230,7 +231,7 @@ public function getOptions() * Any metadata attached to the method. * * Generated from protobuf field repeated .google.protobuf.Option options = 6; - * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Option[] $var * @return $this */ public function setOptions($var) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Mixin.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Mixin.php index 4f7bf844c..0250b8e82 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Mixin.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Mixin.php @@ -1,12 +1,13 @@ google.protobuf.NullValue */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Option.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Option.php index 31249e513..7674fda83 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Option.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Option.php @@ -1,12 +1,13 @@ + * @implements \IteratorAggregate + */ +class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable +{ + + /** + * @ignore + */ + private $container; + /** + * @ignore + */ + private $type; + /** + * @ignore + * @var string|class-string + */ + private $klass; + + /** + * Constructs an instance of RepeatedField. + * + * @param integer $type Type of the stored element. + * @param string|class-string $klass Message/Enum class name (message/enum fields only). + * @ignore + */ + public function __construct($type, $klass = null) + { + $this->container = []; + $this->type = $type; + if ($this->type == GPBType::MESSAGE) { + $pool = DescriptorPool::getGeneratedPool(); + $desc = $pool->getDescriptorByClassName($klass); + if ($desc == NULL) { + new $klass; // No msg class instance has been created before. + $desc = $pool->getDescriptorByClassName($klass); + } + $this->klass = $desc->getClass(); + } + } + + /** + * @ignore + */ + public function getType() + { + return $this->type; + } + + /** + * @ignore + * @return string|class-string + */ + public function getClass() + { + return $this->klass; + } + + /** + * Return the element at the given index. + * + * This will also be called for: $ele = $arr[0] + * + * @param integer $offset The index of the element to be fetched. + * @return T The stored element at given index. + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @todo need to add return type mixed (require update php version to 8.0) + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset]; + } + + /** + * Assign the element at the given index. + * + * This will also be called for: $arr []= $ele and $arr[0] = ele + * + * @param int|null $offset The index of the element to be assigned. + * @param T $value The element to be assigned. + * @return void + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException Non-existing index. + * @throws \ErrorException Incorrect type of the element. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + switch ($this->type) { + case GPBType::SFIXED32: + case GPBType::SINT32: + case GPBType::INT32: + case GPBType::ENUM: + GPBUtil::checkInt32($value); + break; + case GPBType::FIXED32: + case GPBType::UINT32: + GPBUtil::checkUint32($value); + break; + case GPBType::SFIXED64: + case GPBType::SINT64: + case GPBType::INT64: + GPBUtil::checkInt64($value); + break; + case GPBType::FIXED64: + case GPBType::UINT64: + GPBUtil::checkUint64($value); + break; + case GPBType::FLOAT: + GPBUtil::checkFloat($value); + break; + case GPBType::DOUBLE: + GPBUtil::checkDouble($value); + break; + case GPBType::BOOL: + GPBUtil::checkBool($value); + break; + case GPBType::BYTES: + GPBUtil::checkString($value, false); + break; + case GPBType::STRING: + GPBUtil::checkString($value, true); + break; + case GPBType::MESSAGE: + if (is_null($value)) { + throw new \TypeError("RepeatedField element cannot be null."); + } + GPBUtil::checkMessage($value, $this->klass); + break; + default: + break; + } + if (is_null($offset)) { + $this->container[] = $value; + } else { + $count = count($this->container); + if (!is_numeric($offset) || $offset < 0 || $offset >= $count) { + trigger_error( + "Cannot modify element at the given index", + E_USER_ERROR); + return; + } + $this->container[$offset] = $value; + } + } + + /** + * Remove the element at the given index. + * + * This will also be called for: unset($arr) + * + * @param integer $offset The index of the element to be removed. + * @return void + * @throws \ErrorException Invalid type for index. + * @throws \ErrorException The element to be removed is not at the end of the + * RepeatedField. + * @todo need to add return type void (require update php version to 7.1) + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $count = count($this->container); + if (!is_numeric($offset) || $count === 0 || $offset < 0 || $offset >= $count) { + trigger_error( + "Cannot remove element at the given index", + E_USER_ERROR); + return; + } + array_splice($this->container, $offset, 1); + } + + /** + * Check the existence of the element at the given index. + * + * This will also be called for: isset($arr) + * + * @param integer $offset The index of the element to be removed. + * @return bool True if the element at the given offset exists. + * @throws \ErrorException Invalid type for index. + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * @ignore + */ + public function getIterator(): Traversable + { + return new RepeatedFieldIter($this->container); + } + + /** + * Return the number of stored elements. + * + * This will also be called for: count($arr) + * + * @return integer The number of stored elements. + */ + public function count(): int + { + return count($this->container); + } + + public function __debugInfo() + { + return array_map( + function ($item) { + if ($item instanceof Message || $item instanceof RepeatedField) { + return $item->__debugInfo(); + } + return $item; + }, + iterator_to_array($this) + ); + } +} + +class_alias(RepeatedField::class, Internal\RepeatedField::class); diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php index 8b3ea1122..3cebbdecd 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/SourceContext.php @@ -1,12 +1,13 @@ google.protobuf.StringValue */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Struct.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Struct.php index 0456541cb..0c433a914 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Struct.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Struct.php @@ -1,12 +1,13 @@ SYNTAX_PROTO3 = 1; */ const SYNTAX_PROTO3 = 1; + /** + * Syntax `editions`. + * + * Generated from protobuf enum SYNTAX_EDITIONS = 2; + */ + const SYNTAX_EDITIONS = 2; private static $valueToName = [ self::SYNTAX_PROTO2 => 'SYNTAX_PROTO2', self::SYNTAX_PROTO3 => 'SYNTAX_PROTO3', + self::SYNTAX_EDITIONS => 'SYNTAX_EDITIONS', ]; public static function name($value) diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php index a12f48520..54d675cb2 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Timestamp.php @@ -1,12 +1,13 @@ google.protobuf.Timestamp diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Type.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Type.php index d4af7dfec..c274909ab 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Type.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Type.php @@ -1,12 +1,13 @@ .google.protobuf.Syntax syntax = 6; */ protected $syntax = 0; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 7; + */ + protected $edition = ''; /** * Constructor. @@ -60,16 +67,18 @@ class Type extends \Google\Protobuf\Internal\Message * * @type string $name * The fully qualified message name. - * @type array<\Google\Protobuf\Field>|\Google\Protobuf\Internal\RepeatedField $fields + * @type \Google\Protobuf\Field[] $fields * The list of fields. - * @type array|\Google\Protobuf\Internal\RepeatedField $oneofs + * @type string[] $oneofs * The list of types appearing in `oneof` definitions in this type. - * @type array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $options + * @type \Google\Protobuf\Option[] $options * The protocol buffer options. * @type \Google\Protobuf\SourceContext $source_context * The source context. * @type int $syntax * The source syntax. + * @type string $edition + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. * } */ public function __construct($data = NULL) { @@ -107,7 +116,7 @@ public function setName($var) * The list of fields. * * Generated from protobuf field repeated .google.protobuf.Field fields = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Field> */ public function getFields() { @@ -118,7 +127,7 @@ public function getFields() * The list of fields. * * Generated from protobuf field repeated .google.protobuf.Field fields = 2; - * @param array<\Google\Protobuf\Field>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Field[] $var * @return $this */ public function setFields($var) @@ -133,7 +142,7 @@ public function setFields($var) * The list of types appearing in `oneof` definitions in this type. * * Generated from protobuf field repeated string oneofs = 3; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getOneofs() { @@ -144,7 +153,7 @@ public function getOneofs() * The list of types appearing in `oneof` definitions in this type. * * Generated from protobuf field repeated string oneofs = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ public function setOneofs($var) @@ -159,7 +168,7 @@ public function setOneofs($var) * The protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 4; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Protobuf\Option> */ public function getOptions() { @@ -170,7 +179,7 @@ public function getOptions() * The protocol buffer options. * * Generated from protobuf field repeated .google.protobuf.Option options = 4; - * @param array<\Google\Protobuf\Option>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Protobuf\Option[] $var * @return $this */ public function setOptions($var) @@ -243,5 +252,31 @@ public function setSyntax($var) return $this; } + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 7; + * @return string + */ + public function getEdition() + { + return $this->edition; + } + + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * Generated from protobuf field string edition = 7; + * @param string $var + * @return $this + */ + public function setEdition($var) + { + GPBUtil::checkString($var, True); + $this->edition = $var; + + return $this; + } + } diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php index ae5fc5b42..028689f92 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt32Value.php @@ -1,16 +1,19 @@ google.protobuf.UInt32Value */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php index aa9686726..db52ec1ac 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/UInt64Value.php @@ -1,16 +1,19 @@ google.protobuf.UInt64Value */ diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Value.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Value.php index dcc0bdf7c..85e4c1e52 100644 --- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Value.php +++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Value.php @@ -1,12 +1,13 @@ withoutHeader('Expect'); // Append a content-length header if body size is zero to match - // cURL's behavior. - if (0 === $request->getBody()->getSize()) { + // the behavior of `CurlHandler` + if ( + ( + 0 === \strcasecmp('PUT', $request->getMethod()) + || 0 === \strcasecmp('POST', $request->getMethod()) + ) + && 0 === $request->getBody()->getSize() + ) { $request = $request->withHeader('Content-Length', '0'); } diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Pool.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Pool.php index 6277c61fb..ddc304bb1 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/Pool.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Pool.php @@ -86,7 +86,7 @@ public function promise(): PromiseInterface * @param ClientInterface $client Client used to send the requests * @param array|\Iterator $requests Requests to send concurrently. * @param array $options Passes through the options available in - * {@see \GuzzleHttp\Pool::__construct} + * {@see Pool::__construct} * * @return array Returns an array containing the response or an exception * in the same order that the requests were sent. diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php index df529270e..c6a5893dd 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php @@ -79,7 +79,7 @@ public static function debugResource($value = null) * * The returned handler is not wrapped by any default middlewares. * - * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system. + * @return callable(\Psr\Http\Message\RequestInterface, array): Promise\PromiseInterface Returns the best handler for the given system. * * @throws \RuntimeException if no viable Handler is available. */ diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/functions.php b/lib/Google/vendor/guzzlehttp/guzzle/src/functions.php index 5edc66ab1..9ab4b9649 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/functions.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/functions.php @@ -50,7 +50,7 @@ function debug_resource($value = null) * * The returned handler is not wrapped by any default middlewares. * - * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system. + * @return callable(\Psr\Http\Message\RequestInterface, array): Promise\PromiseInterface Returns the best handler for the given system. * * @throws \RuntimeException if no viable Handler is available. * diff --git a/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md index c7c49a144..1d8045032 100644 --- a/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,6 +1,20 @@ # CHANGELOG +## 2.2.0 - 2025-03-27 + +### Fixed + +- Revert "Allow an empty EachPromise to be resolved by running the queue" + + +## 2.1.0 - 2025-03-27 + +### Added + +- Allow an empty EachPromise to be resolved by running the queue + + ## 2.0.4 - 2024-10-17 ### Fixed diff --git a/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md index 75aabfb93..a85929521 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.7.1 - 2025-03-27 + +### Fixed + +- Fixed uppercase IPv6 addresses in URI + +### Changed + +- Improve uploaded file error message + ## 2.7.0 - 2024-07-18 ### Added diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php b/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php index 9c9ea49fb..d9b779f13 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -11,15 +11,15 @@ class UploadedFile implements UploadedFileInterface { - private const ERRORS = [ - UPLOAD_ERR_OK, - UPLOAD_ERR_INI_SIZE, - UPLOAD_ERR_FORM_SIZE, - UPLOAD_ERR_PARTIAL, - UPLOAD_ERR_NO_FILE, - UPLOAD_ERR_NO_TMP_DIR, - UPLOAD_ERR_CANT_WRITE, - UPLOAD_ERR_EXTENSION, + private const ERROR_MAP = [ + UPLOAD_ERR_OK => 'UPLOAD_ERR_OK', + UPLOAD_ERR_INI_SIZE => 'UPLOAD_ERR_INI_SIZE', + UPLOAD_ERR_FORM_SIZE => 'UPLOAD_ERR_FORM_SIZE', + UPLOAD_ERR_PARTIAL => 'UPLOAD_ERR_PARTIAL', + UPLOAD_ERR_NO_FILE => 'UPLOAD_ERR_NO_FILE', + UPLOAD_ERR_NO_TMP_DIR => 'UPLOAD_ERR_NO_TMP_DIR', + UPLOAD_ERR_CANT_WRITE => 'UPLOAD_ERR_CANT_WRITE', + UPLOAD_ERR_EXTENSION => 'UPLOAD_ERR_EXTENSION', ]; /** @@ -104,7 +104,7 @@ private function setStreamOrFile($streamOrFile): void */ private function setError(int $error): void { - if (false === in_array($error, UploadedFile::ERRORS, true)) { + if (!isset(UploadedFile::ERROR_MAP[$error])) { throw new InvalidArgumentException( 'Invalid error status for UploadedFile' ); @@ -137,7 +137,7 @@ public function isMoved(): bool private function validateActive(): void { if (false === $this->isOk()) { - throw new RuntimeException('Cannot retrieve stream due to upload error'); + throw new RuntimeException(\sprintf('Cannot retrieve stream due to upload error (%s)', self::ERROR_MAP[$this->error])); } if ($this->isMoved()) { diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php b/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php index 481dfca94..a7cdfb003 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php @@ -107,7 +107,7 @@ private static function parse(string $url) { // If IPv6 $prefix = ''; - if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + if (preg_match('%^(.*://\[[0-9:a-fA-F]+\])(.*?)$%', $url, $matches)) { /** @var array{0:string, 1:string, 2:string} $matches */ $prefix = $matches[1]; $url = $matches[2]; diff --git a/lib/Google/vendor/psr/log/Psr/Log/AbstractLogger.php b/lib/Google/vendor/psr/log/Psr/Log/AbstractLogger.php new file mode 100644 index 000000000..e02f9daf3 --- /dev/null +++ b/lib/Google/vendor/psr/log/Psr/Log/AbstractLogger.php @@ -0,0 +1,128 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param mixed[] $context + * + * @return void + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param mixed[] $context + * + * @return void + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param mixed[] $context + * + * @return void + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param mixed[] $context + * + * @return void + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param mixed[] $context + * + * @return void + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param mixed[] $context + * + * @return void + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param mixed[] $context + * + * @return void + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } +} diff --git a/lib/Google/vendor/psr/log/src/InvalidArgumentException.php b/lib/Google/vendor/psr/log/Psr/Log/InvalidArgumentException.php similarity index 100% rename from lib/Google/vendor/psr/log/src/InvalidArgumentException.php rename to lib/Google/vendor/psr/log/Psr/Log/InvalidArgumentException.php diff --git a/lib/Google/vendor/psr/log/src/LogLevel.php b/lib/Google/vendor/psr/log/Psr/Log/LogLevel.php similarity index 100% rename from lib/Google/vendor/psr/log/src/LogLevel.php rename to lib/Google/vendor/psr/log/Psr/Log/LogLevel.php diff --git a/lib/Google/vendor/psr/log/src/LoggerAwareInterface.php b/lib/Google/vendor/psr/log/Psr/Log/LoggerAwareInterface.php similarity index 56% rename from lib/Google/vendor/psr/log/src/LoggerAwareInterface.php rename to lib/Google/vendor/psr/log/Psr/Log/LoggerAwareInterface.php index 062187057..4d64f4786 100644 --- a/lib/Google/vendor/psr/log/src/LoggerAwareInterface.php +++ b/lib/Google/vendor/psr/log/Psr/Log/LoggerAwareInterface.php @@ -9,6 +9,10 @@ interface LoggerAwareInterface { /** * Sets a logger instance on the object. + * + * @param LoggerInterface $logger + * + * @return void */ - public function setLogger(LoggerInterface $logger): void; + public function setLogger(LoggerInterface $logger); } diff --git a/lib/Google/vendor/psr/log/src/LoggerAwareTrait.php b/lib/Google/vendor/psr/log/Psr/Log/LoggerAwareTrait.php similarity index 59% rename from lib/Google/vendor/psr/log/src/LoggerAwareTrait.php rename to lib/Google/vendor/psr/log/Psr/Log/LoggerAwareTrait.php index 85104dbc1..82bf45c89 100644 --- a/lib/Google/vendor/psr/log/src/LoggerAwareTrait.php +++ b/lib/Google/vendor/psr/log/Psr/Log/LoggerAwareTrait.php @@ -9,13 +9,17 @@ trait LoggerAwareTrait { /** * The logger instance. + * + * @var LoggerInterface|null */ - protected ?LoggerInterface $logger = null; + protected $logger; /** * Sets a logger. + * + * @param LoggerInterface $logger */ - public function setLogger(LoggerInterface $logger): void + public function setLogger(LoggerInterface $logger) { $this->logger = $logger; } diff --git a/lib/Google/vendor/psr/log/src/LoggerInterface.php b/lib/Google/vendor/psr/log/Psr/Log/LoggerInterface.php similarity index 63% rename from lib/Google/vendor/psr/log/src/LoggerInterface.php rename to lib/Google/vendor/psr/log/Psr/Log/LoggerInterface.php index cb4cf648b..2206cfde4 100644 --- a/lib/Google/vendor/psr/log/src/LoggerInterface.php +++ b/lib/Google/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -22,9 +22,12 @@ interface LoggerInterface /** * System is unusable. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function emergency(string|\Stringable $message, array $context = []): void; + public function emergency($message, array $context = array()); /** * Action must be taken immediately. @@ -32,26 +35,35 @@ public function emergency(string|\Stringable $message, array $context = []): voi * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function alert(string|\Stringable $message, array $context = []): void; + public function alert($message, array $context = array()); /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function critical(string|\Stringable $message, array $context = []): void; + public function critical($message, array $context = array()); /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function error(string|\Stringable $message, array $context = []): void; + public function error($message, array $context = array()); /** * Exceptional occurrences that are not errors. @@ -59,40 +71,55 @@ public function error(string|\Stringable $message, array $context = []): void; * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function warning(string|\Stringable $message, array $context = []): void; + public function warning($message, array $context = array()); /** * Normal but significant events. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function notice(string|\Stringable $message, array $context = []): void; + public function notice($message, array $context = array()); /** * Interesting events. * * Example: User logs in, SQL logs. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function info(string|\Stringable $message, array $context = []): void; + public function info($message, array $context = array()); /** * Detailed debug information. * + * @param string $message * @param mixed[] $context + * + * @return void */ - public function debug(string|\Stringable $message, array $context = []): void; + public function debug($message, array $context = array()); /** * Logs with an arbitrary level. * - * @param mixed $level + * @param mixed $level + * @param string $message * @param mixed[] $context * + * @return void + * * @throws \Psr\Log\InvalidArgumentException */ - public function log($level, string|\Stringable $message, array $context = []): void; + public function log($level, $message, array $context = array()); } diff --git a/lib/Google/vendor/psr/log/src/LoggerTrait.php b/lib/Google/vendor/psr/log/Psr/Log/LoggerTrait.php similarity index 57% rename from lib/Google/vendor/psr/log/src/LoggerTrait.php rename to lib/Google/vendor/psr/log/Psr/Log/LoggerTrait.php index a5d9980b6..e392fef0a 100644 --- a/lib/Google/vendor/psr/log/src/LoggerTrait.php +++ b/lib/Google/vendor/psr/log/Psr/Log/LoggerTrait.php @@ -14,8 +14,13 @@ trait LoggerTrait { /** * System is unusable. + * + * @param string $message + * @param array $context + * + * @return void */ - public function emergency(string|\Stringable $message, array $context = []): void + public function emergency($message, array $context = array()) { $this->log(LogLevel::EMERGENCY, $message, $context); } @@ -25,8 +30,13 @@ public function emergency(string|\Stringable $message, array $context = []): voi * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void */ - public function alert(string|\Stringable $message, array $context = []): void + public function alert($message, array $context = array()) { $this->log(LogLevel::ALERT, $message, $context); } @@ -35,8 +45,13 @@ public function alert(string|\Stringable $message, array $context = []): void * Critical conditions. * * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void */ - public function critical(string|\Stringable $message, array $context = []): void + public function critical($message, array $context = array()) { $this->log(LogLevel::CRITICAL, $message, $context); } @@ -44,8 +59,13 @@ public function critical(string|\Stringable $message, array $context = []): void /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void */ - public function error(string|\Stringable $message, array $context = []): void + public function error($message, array $context = array()) { $this->log(LogLevel::ERROR, $message, $context); } @@ -55,16 +75,26 @@ public function error(string|\Stringable $message, array $context = []): void * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * + * @return void */ - public function warning(string|\Stringable $message, array $context = []): void + public function warning($message, array $context = array()) { $this->log(LogLevel::WARNING, $message, $context); } /** * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void */ - public function notice(string|\Stringable $message, array $context = []): void + public function notice($message, array $context = array()) { $this->log(LogLevel::NOTICE, $message, $context); } @@ -73,16 +103,26 @@ public function notice(string|\Stringable $message, array $context = []): void * Interesting events. * * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void */ - public function info(string|\Stringable $message, array $context = []): void + public function info($message, array $context = array()) { $this->log(LogLevel::INFO, $message, $context); } /** * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void */ - public function debug(string|\Stringable $message, array $context = []): void + public function debug($message, array $context = array()) { $this->log(LogLevel::DEBUG, $message, $context); } @@ -90,9 +130,13 @@ public function debug(string|\Stringable $message, array $context = []): void /** * Logs with an arbitrary level. * - * @param mixed $level + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void * * @throws \Psr\Log\InvalidArgumentException */ - abstract public function log($level, string|\Stringable $message, array $context = []): void; + abstract public function log($level, $message, array $context = array()); } diff --git a/lib/Google/vendor/psr/log/src/NullLogger.php b/lib/Google/vendor/psr/log/Psr/Log/NullLogger.php similarity index 74% rename from lib/Google/vendor/psr/log/src/NullLogger.php rename to lib/Google/vendor/psr/log/Psr/Log/NullLogger.php index de0561e2a..c8f7293b1 100644 --- a/lib/Google/vendor/psr/log/src/NullLogger.php +++ b/lib/Google/vendor/psr/log/Psr/Log/NullLogger.php @@ -15,11 +15,15 @@ class NullLogger extends AbstractLogger /** * Logs with an arbitrary level. * - * @param mixed[] $context + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void * * @throws \Psr\Log\InvalidArgumentException */ - public function log($level, string|\Stringable $message, array $context = []): void + public function log($level, $message, array $context = array()) { // noop } diff --git a/lib/Google/vendor/psr/log/Psr/Log/Test/DummyTest.php b/lib/Google/vendor/psr/log/Psr/Log/Test/DummyTest.php new file mode 100644 index 000000000..9638c1101 --- /dev/null +++ b/lib/Google/vendor/psr/log/Psr/Log/Test/DummyTest.php @@ -0,0 +1,18 @@ + ". + * + * Example ->error('Foo') would yield "error Foo". + * + * @return string[] + */ + abstract public function getLogs(); + + public function testImplements() + { + $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); + } + + /** + * @dataProvider provideLevelsAndMessages + */ + public function testLogsAtAllLevels($level, $message) + { + $logger = $this->getLogger(); + $logger->{$level}($message, array('user' => 'Bob')); + $logger->log($level, $message, array('user' => 'Bob')); + + $expected = array( + $level.' message of level '.$level.' with context: Bob', + $level.' message of level '.$level.' with context: Bob', + ); + $this->assertEquals($expected, $this->getLogs()); + } + + public function provideLevelsAndMessages() + { + return array( + LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), + LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), + LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), + LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), + LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), + LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), + LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), + LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), + ); + } + + /** + * @expectedException \Psr\Log\InvalidArgumentException + */ + public function testThrowsOnInvalidLevel() + { + $logger = $this->getLogger(); + $logger->log('invalid level', 'Foo'); + } + + public function testContextReplacement() + { + $logger = $this->getLogger(); + $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); + + $expected = array('info {Message {nothing} Bob Bar a}'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testObjectCastToString() + { + if (method_exists($this, 'createPartialMock')) { + $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); + } else { + $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); + } + $dummy->expects($this->once()) + ->method('__toString') + ->will($this->returnValue('DUMMY')); + + $this->getLogger()->warning($dummy); + + $expected = array('warning DUMMY'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testContextCanContainAnything() + { + $closed = fopen('php://memory', 'r'); + fclose($closed); + + $context = array( + 'bool' => true, + 'null' => null, + 'string' => 'Foo', + 'int' => 0, + 'float' => 0.5, + 'nested' => array('with object' => new DummyTest), + 'object' => new \DateTime, + 'resource' => fopen('php://memory', 'r'), + 'closed' => $closed, + ); + + $this->getLogger()->warning('Crazy context data', $context); + + $expected = array('warning Crazy context data'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testContextExceptionKeyCanBeExceptionOrOtherValues() + { + $logger = $this->getLogger(); + $logger->warning('Random message', array('exception' => 'oops')); + $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); + + $expected = array( + 'warning Random message', + 'critical Uncaught Exception!' + ); + $this->assertEquals($expected, $this->getLogs()); + } +} diff --git a/lib/Google/vendor/psr/log/Psr/Log/Test/TestLogger.php b/lib/Google/vendor/psr/log/Psr/Log/Test/TestLogger.php new file mode 100644 index 000000000..1be323049 --- /dev/null +++ b/lib/Google/vendor/psr/log/Psr/Log/Test/TestLogger.php @@ -0,0 +1,147 @@ + $level, + 'message' => $message, + 'context' => $context, + ]; + + $this->recordsByLevel[$record['level']][] = $record; + $this->records[] = $record; + } + + public function hasRecords($level) + { + return isset($this->recordsByLevel[$level]); + } + + public function hasRecord($record, $level) + { + if (is_string($record)) { + $record = ['message' => $record]; + } + return $this->hasRecordThatPasses(function ($rec) use ($record) { + if ($rec['message'] !== $record['message']) { + return false; + } + if (isset($record['context']) && $rec['context'] !== $record['context']) { + return false; + } + return true; + }, $level); + } + + public function hasRecordThatContains($message, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($message) { + return strpos($rec['message'], $message) !== false; + }, $level); + } + + public function hasRecordThatMatches($regex, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($regex) { + return preg_match($regex, $rec['message']) > 0; + }, $level); + } + + public function hasRecordThatPasses(callable $predicate, $level) + { + if (!isset($this->recordsByLevel[$level])) { + return false; + } + foreach ($this->recordsByLevel[$level] as $i => $rec) { + if (call_user_func($predicate, $rec, $i)) { + return true; + } + } + return false; + } + + public function __call($method, $args) + { + if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { + $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; + $level = strtolower($matches[2]); + if (method_exists($this, $genericMethod)) { + $args[] = $level; + return call_user_func_array([$this, $genericMethod], $args); + } + } + throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); + } + + public function reset() + { + $this->records = []; + $this->recordsByLevel = []; + } +} diff --git a/lib/Google/vendor/psr/log/composer.json b/lib/Google/vendor/psr/log/composer.json index 879fc6f53..ca0569537 100644 --- a/lib/Google/vendor/psr/log/composer.json +++ b/lib/Google/vendor/psr/log/composer.json @@ -11,16 +11,16 @@ } ], "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Log\\": "Psr/Log/" } }, "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.1.x-dev" } } } diff --git a/lib/Google/vendor/psr/log/src/AbstractLogger.php b/lib/Google/vendor/psr/log/src/AbstractLogger.php deleted file mode 100644 index d60a091af..000000000 --- a/lib/Google/vendor/psr/log/src/AbstractLogger.php +++ /dev/null @@ -1,15 +0,0 @@ - +Copyright (c) 2012-2025 Ben Ramsey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/Google/vendor/ramsey/uuid/README.md b/lib/Google/vendor/ramsey/uuid/README.md index 0db814959..eab624da1 100644 --- a/lib/Google/vendor/ramsey/uuid/README.md +++ b/lib/Google/vendor/ramsey/uuid/README.md @@ -11,7 +11,6 @@ Read License Build Status Codecov Code Coverage - Psalm Type Coverage

ramsey/uuid is a PHP library for generating and working with universally unique diff --git a/lib/Google/vendor/ramsey/uuid/composer.json b/lib/Google/vendor/ramsey/uuid/composer.json index 8139b54e3..db4429217 100644 --- a/lib/Google/vendor/ramsey/uuid/composer.json +++ b/lib/Google/vendor/ramsey/uuid/composer.json @@ -10,31 +10,27 @@ ], "require": { "php": "^8.0", - "ext-json": "*", - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13", "ramsey/collection": "^1.2 || ^2.0" }, "require-dev": { - "captainhook/captainhook": "^5.10", + "captainhook/captainhook": "^5.25", "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" }, "replace": { "rhumsaa/uuid": "self.version" @@ -66,10 +62,9 @@ "config": { "allow-plugins": { "captainhook/plugin-composer": true, - "ergebnis/composer-normalize": true, - "phpstan/extension-installer": true, "dealerdirect/phpcodesniffer-composer-installer": true, - "ramsey/composer-repl": true + "ergebnis/composer-normalize": true, + "phpstan/extension-installer": true }, "sort-packages": true }, @@ -79,30 +74,41 @@ } }, "scripts": { - "analyze": [ - "@phpstan", - "@psalm" + "dev:analyze": "@dev:analyze:phpstan", + "dev:analyze:phpstan": "phpstan analyse --ansi --memory-limit 1G", + "dev:bench": "@php -d 'error_reporting=24575' vendor/bin/phpbench run", + "dev:build:clean": "git clean -fX build/", + "dev:lint": [ + "@dev:lint:syntax", + "@dev:lint:style" ], - "build:clean": "git clean -fX build/", - "lint": "parallel-lint src tests", - "lint:paths": "parallel-lint", - "phpbench": "phpbench run", - "phpcbf": "phpcbf -vpw --cache=build/cache/phpcs.cache", - "phpcs": "phpcs --cache=build/cache/phpcs.cache", - "phpstan": [ - "phpstan analyse --no-progress --memory-limit=1G", - "phpstan analyse -c phpstan-tests.neon --no-progress --memory-limit=1G" + "dev:lint:fix": "phpcbf --cache=build/cache/phpcs.cache", + "dev:lint:style": "phpcs --cache=build/cache/phpcs.cache --colors", + "dev:lint:syntax": "parallel-lint --colors src/ tests/", + "dev:test": [ + "@dev:lint", + "@dev:bench", + "@dev:analyze", + "@dev:test:unit" ], - "phpunit": "phpunit --verbose --colors=always", - "phpunit-coverage": "phpunit --verbose --colors=always --coverage-html build/coverage", - "psalm": "psalm --show-info=false --config=psalm.xml", - "test": [ - "@lint", - "@phpbench", - "@phpcs", - "@phpstan", - "@psalm", - "@phpunit" - ] + "dev:test:coverage:ci": "@php -d 'xdebug.mode=coverage' vendor/bin/phpunit --colors=always --coverage-text --coverage-clover build/coverage/clover.xml --coverage-cobertura build/coverage/cobertura.xml --coverage-crap4j build/coverage/crap4j.xml --coverage-xml build/coverage/coverage-xml --log-junit build/junit.xml", + "dev:test:coverage:html": "@php -d 'xdebug.mode=coverage' vendor/bin/phpunit --colors=always --coverage-html build/coverage/coverage-html/", + "dev:test:unit": "phpunit --colors=always", + "test": "@dev:test" + }, + "scripts-descriptions": { + "dev:analyze": "Runs all static analysis checks.", + "dev:analyze:phpstan": "Runs the PHPStan static analyzer.", + "dev:bench": "Runs PHPBench benchmark tests.", + "dev:build:clean": "Cleans the build/ directory.", + "dev:lint": "Runs all linting checks.", + "dev:lint:fix": "Auto-fixes coding standards issues, if possible.", + "dev:lint:style": "Checks for coding standards issues.", + "dev:lint:syntax": "Checks for syntax errors.", + "dev:test": "Runs linting, static analysis, and unit tests.", + "dev:test:coverage:ci": "Runs unit tests and generates CI coverage reports.", + "dev:test:coverage:html": "Runs unit tests and generates HTML coverage report.", + "dev:test:unit": "Runs unit tests.", + "test": "Runs linting, static analysis, and unit tests." } } diff --git a/lib/Google/vendor/ramsey/uuid/src/BinaryUtils.php b/lib/Google/vendor/ramsey/uuid/src/BinaryUtils.php index fb8ba9adc..d8aac2e91 100644 --- a/lib/Google/vendor/ramsey/uuid/src/BinaryUtils.php +++ b/lib/Google/vendor/ramsey/uuid/src/BinaryUtils.php @@ -20,44 +20,35 @@ class BinaryUtils { /** - * Applies the RFC 4122 variant field to the 16-bit clock sequence + * Applies the variant field to the 16-bit clock sequence * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field * - * @param int $clockSeq The 16-bit clock sequence value before the RFC 4122 - * variant is applied + * @param int $clockSeq The 16-bit clock sequence value before the variant is applied * * @return int The 16-bit clock sequence multiplexed with the UUID variant * - * @psalm-pure + * @pure */ public static function applyVariant(int $clockSeq): int { - $clockSeq = $clockSeq & 0x3fff; - $clockSeq |= 0x8000; - - return $clockSeq; + return ($clockSeq & 0x3fff) | 0x8000; } /** - * Applies the RFC 4122 version number to the 16-bit `time_hi_and_version` field + * Applies the version field to the 16-bit `time_hi_and_version` field * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field * - * @param int $timeHi The value of the 16-bit `time_hi_and_version` field - * before the RFC 4122 version is applied - * @param int $version The RFC 4122 version to apply to the `time_hi` field + * @param int $timeHi The value of the 16-bit `time_hi_and_version` field before the version is applied + * @param int $version The version to apply to the `time_hi` field * - * @return int The 16-bit time_hi field of the timestamp multiplexed with - * the UUID version number + * @return int The 16-bit time_hi field of the timestamp multiplexed with the UUID version number * - * @psalm-pure + * @pure */ public static function applyVersion(int $timeHi, int $version): int { - $timeHi = $timeHi & 0x0fff; - $timeHi |= $version << 12; - - return $timeHi; + return ($timeHi & 0x0fff) | ($version << 12); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Builder/BuilderCollection.php b/lib/Google/vendor/ramsey/uuid/src/Builder/BuilderCollection.php index 9df3110fd..2b2e0a2d3 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Builder/BuilderCollection.php +++ b/lib/Google/vendor/ramsey/uuid/src/Builder/BuilderCollection.php @@ -27,10 +27,10 @@ /** * A collection of UuidBuilderInterface objects * - * @deprecated this class has been deprecated, and will be removed in 5.0.0. The use-case for this class comes from - * a pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced - * at runtime: that is no longer necessary, now that you can safely verify your code to be correct, and use - * more generic types like `iterable` instead. + * @deprecated this class has been deprecated and will be removed in 5.0.0. The use-case for this class comes from a + * pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced at runtime: + * that is no longer necessary, now that you can safely verify your code to be correct, and use more generic types + * like `iterable` instead. * * @extends AbstractCollection */ @@ -41,11 +41,6 @@ public function getType(): string return UuidBuilderInterface::class; } - /** - * @psalm-mutation-free - * @psalm-suppress ImpureMethodCall - * @psalm-suppress InvalidTemplateParam - */ public function getIterator(): Traversable { return parent::getIterator(); @@ -54,11 +49,7 @@ public function getIterator(): Traversable /** * Re-constructs the object from its serialized form * - * @param string $serialized The serialized PHP string to unserialize into - * a UuidInterface instance - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress RedundantConditionGivenDocblockType + * @param string $serialized The serialized PHP string to unserialize into a UuidInterface instance */ public function unserialize($serialized): void { @@ -78,8 +69,9 @@ public function unserialize($serialized): void $this->data = array_filter( $data, function ($unserialized): bool { + /** @phpstan-ignore instanceof.alwaysTrue */ return $unserialized instanceof UuidBuilderInterface; - } + }, ); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php b/lib/Google/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php index 7c4a6f837..3d62159be 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php +++ b/lib/Google/vendor/ramsey/uuid/src/Builder/DefaultUuidBuilder.php @@ -17,9 +17,9 @@ use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; /** - * @deprecated Transition to {@see Rfc4122UuidBuilder}. + * @deprecated Please transition to {@see Rfc4122UuidBuilder}. * - * @psalm-immutable + * @immutable */ class DefaultUuidBuilder extends Rfc4122UuidBuilder { diff --git a/lib/Google/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php b/lib/Google/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php index 20b384212..1554a9761 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php +++ b/lib/Google/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php @@ -23,20 +23,18 @@ use Ramsey\Uuid\UuidInterface; /** - * @deprecated DegradedUuid instances are no longer necessary to support 32-bit - * systems. Transition to {@see DefaultUuidBuilder}. + * @deprecated DegradedUuid instances are no longer necessary to support 32-bit systems. Please transition to {@see DefaultUuidBuilder}. * - * @psalm-immutable + * @immutable */ class DegradedUuidBuilder implements UuidBuilderInterface { private TimeConverterInterface $timeConverter; /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the DegradedUuid - * @param TimeConverterInterface|null $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the DegradedUuid + * @param TimeConverterInterface|null $timeConverter The time converter to use for converting timestamps extracted + * from a UUID to Unix timestamps */ public function __construct( private NumberConverterInterface $numberConverter, @@ -53,15 +51,10 @@ public function __construct( * * @return DegradedUuid The DegradedUuidBuild returns an instance of Ramsey\Uuid\DegradedUuid * - * @psalm-pure + * @phpstan-impure */ public function build(CodecInterface $codec, string $bytes): UuidInterface { - return new DegradedUuid( - new Rfc4122Fields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); + return new DegradedUuid(new Rfc4122Fields($bytes), $this->numberConverter, $codec, $this->timeConverter); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php b/lib/Google/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php index ba5f31fbe..e40f778b0 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php +++ b/lib/Google/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php @@ -20,10 +20,9 @@ use Ramsey\Uuid\UuidInterface; /** - * FallbackBuilder builds a UUID by stepping through a list of UUID builders - * until a UUID can be constructed without exceptions + * FallbackBuilder builds a UUID by stepping through a list of UUID builders until a UUID can be constructed without exceptions * - * @psalm-immutable + * @immutable */ class FallbackBuilder implements UuidBuilderInterface { @@ -35,15 +34,14 @@ public function __construct(private iterable $builders) } /** - * Builds and returns a UuidInterface instance using the first builder that - * succeeds + * Builds and returns a UuidInterface instance using the first builder that succeeds * * @param CodecInterface $codec The codec to use for building this instance * @param string $bytes The byte string from which to construct a UUID * * @return UuidInterface an instance of a UUID object * - * @psalm-pure + * @pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface { @@ -62,7 +60,7 @@ public function build(CodecInterface $codec, string $bytes): UuidInterface throw new BuilderNotFoundException( 'Could not find a suitable builder for the provided codec and fields', 0, - $lastBuilderException + $lastBuilderException, ); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php b/lib/Google/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php index 8e58b2b43..c409878a0 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php @@ -20,7 +20,7 @@ /** * A UUID builder builds instances of UuidInterface * - * @psalm-immutable + * @immutable */ interface UuidBuilderInterface { @@ -30,10 +30,9 @@ interface UuidBuilderInterface * @param CodecInterface $codec The codec to use for building this UuidInterface instance * @param string $bytes The byte string from which to construct a UUID * - * @return UuidInterface Implementations may choose to return more specific - * instances of UUIDs that implement UuidInterface + * @return UuidInterface Implementations may choose to return more specific instances of UUIDs that implement UuidInterface * - * @psalm-pure + * @pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Codec/CodecInterface.php b/lib/Google/vendor/ramsey/uuid/src/Codec/CodecInterface.php index 85f8a7e99..b1e554eac 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Codec/CodecInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Codec/CodecInterface.php @@ -19,53 +19,51 @@ /** * A codec encodes and decodes a UUID according to defined rules * - * @psalm-immutable + * @immutable */ interface CodecInterface { /** * Returns a hexadecimal string representation of a UuidInterface * - * @param UuidInterface $uuid The UUID for which to create a hexadecimal - * string representation + * @param UuidInterface $uuid The UUID for which to create a hexadecimal string representation * - * @return string Hexadecimal string representation of a UUID + * @return non-empty-string Hexadecimal string representation of a UUID * - * @psalm-return non-empty-string + * @pure */ public function encode(UuidInterface $uuid): string; /** * Returns a binary string representation of a UuidInterface * - * @param UuidInterface $uuid The UUID for which to create a binary string - * representation + * @param UuidInterface $uuid The UUID for which to create a binary string representation * - * @return string Binary string representation of a UUID + * @return non-empty-string Binary string representation of a UUID * - * @psalm-return non-empty-string + * @pure */ public function encodeBinary(UuidInterface $uuid): string; /** * Returns a UuidInterface derived from a hexadecimal string representation * - * @param string $encodedUuid The hexadecimal string representation to - * convert into a UuidInterface instance + * @param string $encodedUuid The hexadecimal string representation to convert into a UuidInterface instance * - * @return UuidInterface An instance of a UUID decoded from a hexadecimal - * string representation + * @return UuidInterface An instance of a UUID decoded from a hexadecimal string representation + * + * @pure */ public function decode(string $encodedUuid): UuidInterface; /** * Returns a UuidInterface derived from a binary string representation * - * @param string $bytes The binary string representation to convert into a - * UuidInterface instance + * @param string $bytes The binary string representation to convert into a UuidInterface instance + * + * @return UuidInterface An instance of a UUID decoded from a binary string representation * - * @return UuidInterface An instance of a UUID decoded from a binary string - * representation + * @pure */ public function decodeBytes(string $bytes): UuidInterface; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php b/lib/Google/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php index 04872e0bc..a1bd58a29 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php +++ b/lib/Google/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php @@ -26,12 +26,13 @@ * * @see Guid * - * @psalm-immutable + * @immutable */ class GuidStringCodec extends StringCodec { public function encode(UuidInterface $uuid): string { + /** @phpstan-ignore possiblyImpure.methodCall */ $hex = bin2hex($uuid->getFields()->getBytes()); /** @var non-empty-string */ @@ -52,14 +53,16 @@ public function encode(UuidInterface $uuid): string public function decode(string $encodedUuid): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ $bytes = $this->getBytes($encodedUuid); + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ return $this->getBuilder()->build($this, $this->swapBytes($bytes)); } public function decodeBytes(string $bytes): UuidInterface { - // Specifically call parent::decode to preserve correct byte order + // Call parent::decode() to preserve the correct byte order. return parent::decode(bin2hex($bytes)); } @@ -69,8 +72,7 @@ public function decodeBytes(string $bytes): UuidInterface private function swapBytes(string $bytes): string { return $bytes[3] . $bytes[2] . $bytes[1] . $bytes[0] - . $bytes[5] . $bytes[4] - . $bytes[7] . $bytes[6] + . $bytes[5] . $bytes[4] . $bytes[7] . $bytes[6] . substr($bytes, 8); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php b/lib/Google/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php index 0798ebc4d..ea533d997 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php +++ b/lib/Google/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php @@ -24,59 +24,51 @@ use function substr; /** - * OrderedTimeCodec encodes and decodes a UUID, optimizing the byte order for - * more efficient storage + * OrderedTimeCodec encodes and decodes a UUID, optimizing the byte order for more efficient storage * - * For binary representations of version 1 UUID, this codec may be used to - * reorganize the time fields, making the UUID closer to sequential when storing - * the bytes. According to Percona, this optimization can improve database - * INSERTs and SELECTs using the UUID column as a key. + * For binary representations of version 1 UUID, this codec may be used to reorganize the time fields, making the UUID + * closer to sequential when storing the bytes. According to Percona, this optimization can improve database INSERT and + * SELECT statements using the UUID column as a key. * - * The string representation of the UUID will remain unchanged. Only the binary - * representation is reordered. + * The string representation of the UUID will remain unchanged. Only the binary representation is reordered. * - * **PLEASE NOTE:** Binary representations of UUIDs encoded with this codec must - * be decoded with this codec. Decoding using another codec can result in - * malformed UUIDs. + * PLEASE NOTE: Binary representations of UUIDs encoded with this codec must be decoded with this codec. Decoding using + * another codec can result in malformed UUIDs. + * + * @deprecated Please migrate to {@link https://uuid.ramsey.dev/en/stable/rfc4122/version6.html Version 6, reordered time-based UUIDs}. * * @link https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ Storing UUID Values in MySQL * - * @psalm-immutable + * @immutable */ class OrderedTimeCodec extends StringCodec { /** - * Returns a binary string representation of a UUID, with the timestamp - * fields rearranged for optimized storage + * Returns a binary string representation of a UUID, with the timestamp fields rearranged for optimized storage * - * @inheritDoc - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @return non-empty-string */ public function encodeBinary(UuidInterface $uuid): string { if ( + /** @phpstan-ignore possiblyImpure.methodCall */ !($uuid->getFields() instanceof Rfc4122FieldsInterface) + /** @phpstan-ignore possiblyImpure.methodCall */ || $uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME ) { - throw new InvalidArgumentException( - 'Expected RFC 4122 version 1 (time-based) UUID' - ); + throw new InvalidArgumentException('Expected version 1 (time-based) UUID'); } + /** @phpstan-ignore possiblyImpure.methodCall */ $bytes = $uuid->getFields()->getBytes(); - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ - return $bytes[6] . $bytes[7] - . $bytes[4] . $bytes[5] + return $bytes[6] . $bytes[7] . $bytes[4] . $bytes[5] . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3] . substr($bytes, 8); } /** - * Returns a UuidInterface derived from an ordered-time binary string - * representation + * Returns a UuidInterface derived from an ordered-time binary string representation * * @throws InvalidArgumentException if $bytes is an invalid length * @@ -85,26 +77,22 @@ public function encodeBinary(UuidInterface $uuid): string public function decodeBytes(string $bytes): UuidInterface { if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - '$bytes string should contain 16 characters.' - ); + throw new InvalidArgumentException('$bytes string should contain 16 characters.'); } // Rearrange the bytes to their original order. $rearrangedBytes = $bytes[4] . $bytes[5] . $bytes[6] . $bytes[7] - . $bytes[2] . $bytes[3] - . $bytes[0] . $bytes[1] + . $bytes[2] . $bytes[3] . $bytes[0] . $bytes[1] . substr($bytes, 8); $uuid = parent::decodeBytes($rearrangedBytes); - if ( - !($uuid->getFields() instanceof Rfc4122FieldsInterface) - || $uuid->getFields()->getVersion() !== Uuid::UUID_TYPE_TIME - ) { + /** @phpstan-ignore possiblyImpure.methodCall */ + $fields = $uuid->getFields(); + + if (!$fields instanceof Rfc4122FieldsInterface || $fields->getVersion() !== Uuid::UUID_TYPE_TIME) { throw new UnsupportedOperationException( - 'Attempting to decode a non-time-based UUID using ' - . 'OrderedTimeCodec' + 'Attempting to decode a non-time-based UUID using OrderedTimeCodec', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Codec/StringCodec.php b/lib/Google/vendor/ramsey/uuid/src/Codec/StringCodec.php index 95f38d2e8..55f4f8b27 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Codec/StringCodec.php +++ b/lib/Google/vendor/ramsey/uuid/src/Codec/StringCodec.php @@ -29,11 +29,9 @@ use function substr; /** - * StringCodec encodes and decodes RFC 4122 UUIDs + * StringCodec encodes and decodes RFC 9562 (formerly RFC 4122) UUIDs * - * @link http://tools.ietf.org/html/rfc4122 - * - * @psalm-immutable + * @immutable */ class StringCodec implements CodecInterface { @@ -48,6 +46,7 @@ public function __construct(private UuidBuilderInterface $builder) public function encode(UuidInterface $uuid): string { + /** @phpstan-ignore possiblyImpure.methodCall */ $hex = bin2hex($uuid->getFields()->getBytes()); /** @var non-empty-string */ @@ -62,9 +61,7 @@ public function encode(UuidInterface $uuid): string } /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @return non-empty-string */ public function encodeBinary(UuidInterface $uuid): string { @@ -79,15 +76,14 @@ public function encodeBinary(UuidInterface $uuid): string */ public function decode(string $encodedUuid): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ return $this->builder->build($this, $this->getBytes($encodedUuid)); } public function decodeBytes(string $bytes): UuidInterface { if (strlen($bytes) !== 16) { - throw new InvalidArgumentException( - '$bytes string should contain 16 characters.' - ); + throw new InvalidArgumentException('$bytes string should contain 16 characters.'); } return $this->builder->build($this, $bytes); @@ -106,11 +102,7 @@ protected function getBuilder(): UuidBuilderInterface */ protected function getBytes(string $encodedUuid): string { - $parsedUuid = str_replace( - ['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}', '-'], - '', - $encodedUuid - ); + $parsedUuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}', '-'], '', $encodedUuid); $components = [ substr($parsedUuid, 0, 8), @@ -121,9 +113,7 @@ protected function getBytes(string $encodedUuid): string ]; if (!Uuid::isValid(implode('-', $components))) { - throw new InvalidUuidStringException( - 'Invalid UUID string: ' . $encodedUuid - ); + throw new InvalidUuidStringException('Invalid UUID string: ' . $encodedUuid); } return (string) hex2bin($parsedUuid); diff --git a/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php b/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php index 0e0042d0a..e7c8efd4c 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php +++ b/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php @@ -23,40 +23,39 @@ use function substr_replace; /** - * TimestampFirstCombCodec encodes and decodes COMBs, with the timestamp as the - * first 48 bits + * TimestampFirstCombCodec encodes and decodes COMBs, with the timestamp as the first 48 bits * - * In contrast with the TimestampLastCombCodec, the TimestampFirstCombCodec - * adds the timestamp to the first 48 bits of the COMB. To generate a - * timestamp-first COMB, set the TimestampFirstCombCodec as the codec, along - * with the CombGenerator as the random generator. + * In contrast with the TimestampLastCombCodec, the TimestampFirstCombCodec adds the timestamp to the first 48 bits of + * the COMB. To generate a timestamp-first COMB, set the TimestampFirstCombCodec as the codec, along with the + * CombGenerator as the random generator. * - * ``` php + * ``` * $factory = new UuidFactory(); * * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); * * $factory->setRandomGenerator(new CombGenerator( * $factory->getRandomGenerator(), - * $factory->getNumberConverter() + * $factory->getNumberConverter(), * )); * * $timestampFirstComb = $factory->uuid4(); * ``` * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys + * @deprecated Please migrate to {@link https://uuid.ramsey.dev/en/stable/rfc4122/version7.html Version 7, Unix Epoch Time UUIDs}. + * + * @link https://web.archive.org/web/20240118030355/https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys * - * @psalm-immutable + * @immutable */ class TimestampFirstCombCodec extends StringCodec { /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @return non-empty-string */ public function encode(UuidInterface $uuid): string { + /** @phpstan-ignore possiblyImpure.methodCall */ $bytes = $this->swapBytes($uuid->getFields()->getBytes()); return sprintf( @@ -70,9 +69,7 @@ public function encode(UuidInterface $uuid): string } /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @return non-empty-string */ public function encodeBinary(UuidInterface $uuid): string { @@ -87,27 +84,29 @@ public function encodeBinary(UuidInterface $uuid): string */ public function decode(string $encodedUuid): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ $bytes = $this->getBytes($encodedUuid); + /** @phpstan-ignore possiblyImpure.methodCall */ return $this->getBuilder()->build($this, $this->swapBytes($bytes)); } public function decodeBytes(string $bytes): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ return $this->getBuilder()->build($this, $this->swapBytes($bytes)); } /** * Swaps bytes according to the timestamp-first COMB rules + * + * @pure */ private function swapBytes(string $bytes): string { $first48Bits = substr($bytes, 0, 6); $last48Bits = substr($bytes, -6); - $bytes = substr_replace($bytes, $last48Bits, 0, 6); - $bytes = substr_replace($bytes, $first48Bits, -6); - - return $bytes; + return substr_replace(substr_replace($bytes, $last48Bits, 0, 6), $first48Bits, -6); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php b/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php index 4856deaed..14d10b661 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php +++ b/lib/Google/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php @@ -15,36 +15,33 @@ namespace Ramsey\Uuid\Codec; /** - * TimestampLastCombCodec encodes and decodes COMBs, with the timestamp as the - * last 48 bits - * - * The CombGenerator when used with the StringCodec (and, by proxy, the - * TimestampLastCombCodec) adds the timestamp to the last 48 bits of the COMB. - * The TimestampLastCombCodec is provided for the sake of consistency. In - * practice, it is identical to the standard StringCodec but, it may be used - * with the CombGenerator for additional context when reading code. - * - * Consider the following code. By default, the codec used by UuidFactory is the - * StringCodec, but here, we explicitly set the TimestampLastCombCodec. It is - * redundant, but it is clear that we intend this COMB to be generated with the + * TimestampLastCombCodec encodes and decodes COMBs, with the timestamp as the last 48 bits + * + * The CombGenerator when used with the StringCodec (and, by proxy, the TimestampLastCombCodec) adds the timestamp to + * the last 48 bits of the COMB. The TimestampLastCombCodec is provided for the sake of consistency. In practice, it is + * identical to the standard StringCodec, but it may be used with the CombGenerator for additional context when reading + * code. + * + * Consider the following code. By default, the codec used by UuidFactory is the StringCodec, but here, we explicitly + * set the TimestampLastCombCodec. It is redundant, but it is clear that we intend this COMB to be generated with the * timestamp appearing at the end. * - * ``` php + * ``` * $factory = new UuidFactory(); * * $factory->setCodec(new TimestampLastCombCodec($factory->getUuidBuilder())); * * $factory->setRandomGenerator(new CombGenerator( * $factory->getRandomGenerator(), - * $factory->getNumberConverter() + * $factory->getNumberConverter(), * )); * * $timestampLastComb = $factory->uuid4(); * ``` * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys + * @deprecated Please use {@see StringCodec} instead. * - * @psalm-immutable + * @immutable */ class TimestampLastCombCodec extends StringCodec { diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php index 99b88b3bf..ff4e1cca9 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php @@ -18,12 +18,12 @@ use Ramsey\Uuid\Math\BrickMathCalculator; /** - * Previously used to integrate moontoast/math as a bignum arithmetic library, - * BigNumberConverter is deprecated in favor of GenericNumberConverter + * Previously used to integrate moontoast/math as a bignum arithmetic library, BigNumberConverter is deprecated in favor + * of GenericNumberConverter * - * @deprecated Transition to {@see GenericNumberConverter}. + * @deprecated Please transition to {@see GenericNumberConverter}. * - * @psalm-immutable + * @immutable */ class BigNumberConverter implements NumberConverterInterface { @@ -35,8 +35,7 @@ public function __construct() } /** - * @inheritDoc - * @psalm-pure + * @pure */ public function fromHex(string $hex): string { @@ -44,8 +43,7 @@ public function fromHex(string $hex): string } /** - * @inheritDoc - * @psalm-pure + * @pure */ public function toHex(string $number): string { diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php index c9cfa6864..54e4e8c0e 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php @@ -15,10 +15,10 @@ namespace Ramsey\Uuid\Converter\Number; /** - * @deprecated DegradedNumberConverter is no longer necessary for converting - * numbers on 32-bit systems. Transition to {@see GenericNumberConverter}. + * @deprecated DegradedNumberConverter is no longer necessary for converting numbers on 32-bit systems. Please + * transition to {@see GenericNumberConverter}. * - * @psalm-immutable + * @immutable */ class DegradedNumberConverter extends BigNumberConverter { diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php index 043c3c43d..86968abd2 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php @@ -19,10 +19,9 @@ use Ramsey\Uuid\Type\Integer as IntegerObject; /** - * GenericNumberConverter uses the provided calculator to convert decimal - * numbers to and from hexadecimal values + * GenericNumberConverter uses the provided calculator to convert decimal numbers to and from hexadecimal values * - * @psalm-immutable + * @immutable */ class GenericNumberConverter implements NumberConverterInterface { @@ -31,11 +30,7 @@ public function __construct(private CalculatorInterface $calculator) } /** - * @inheritDoc - * @psalm-pure - * @psalm-return numeric-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @pure */ public function fromHex(string $hex): string { @@ -43,15 +38,11 @@ public function fromHex(string $hex): string } /** - * @inheritDoc - * @psalm-pure - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @pure */ public function toHex(string $number): string { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ + /** @phpstan-ignore return.type, possiblyImpure.new */ return $this->calculator->toBase(new IntegerObject($number), 16); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php b/lib/Google/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php index b33ec31f9..63eca6c46 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php @@ -15,43 +15,35 @@ namespace Ramsey\Uuid\Converter; /** - * A number converter converts UUIDs from hexadecimal characters into - * representations of integers and vice versa + * A number converter converts UUIDs from hexadecimal characters into representations of integers and vice versa * - * @psalm-immutable + * @immutable */ interface NumberConverterInterface { /** - * Converts a hexadecimal number into an string integer representation of - * the number + * Converts a hexadecimal number into a string integer representation of the number * - * The integer representation returned is a string representation of the - * integer, to accommodate unsigned integers greater than PHP_INT_MAX. + * The integer representation returned is a string representation of the integer to accommodate unsigned integers + * that are greater than `PHP_INT_MAX`. * * @param string $hex The hexadecimal string representation to convert * - * @return string String representation of an integer + * @return numeric-string String representation of an integer * - * @psalm-return numeric-string - * - * @psalm-pure + * @pure */ public function fromHex(string $hex): string; /** - * Converts a string integer representation into a hexadecimal string - * representation of the number - * - * @param string $number A string integer representation to convert; this - * must be a numeric string to accommodate unsigned integers greater - * than PHP_INT_MAX. + * Converts a string integer representation into a hexadecimal string representation of the number * - * @return string Hexadecimal string + * @param string $number A string integer representation to convert; this must be a numeric string to accommodate + * unsigned integers that are greater than `PHP_INT_MAX`. * - * @psalm-return non-empty-string + * @return non-empty-string Hexadecimal string * - * @psalm-pure + * @pure */ public function toHex(string $number): string; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php index b6bca9ee2..7112495c4 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/BigNumberTimeConverter.php @@ -20,12 +20,12 @@ use Ramsey\Uuid\Type\Time; /** - * Previously used to integrate moontoast/math as a bignum arithmetic library, - * BigNumberTimeConverter is deprecated in favor of GenericTimeConverter + * Previously used to integrate moontoast/math as a bignum arithmetic library, BigNumberTimeConverter is deprecated in + * favor of GenericTimeConverter * - * @deprecated Transition to {@see GenericTimeConverter}. + * @deprecated Please transition to {@see GenericTimeConverter}. * - * @psalm-immutable + * @immutable */ class BigNumberTimeConverter implements TimeConverterInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php index cdc28752d..47204509d 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php @@ -15,10 +15,10 @@ namespace Ramsey\Uuid\Converter\Time; /** - * @deprecated DegradedTimeConverter is no longer necessary for converting - * time on 32-bit systems. Transition to {@see GenericTimeConverter}. + * @deprecated DegradedTimeConverter is no longer necessary for converting time on 32-bit systems. Please transition to + * {@see GenericTimeConverter}. * - * @psalm-immutable + * @immutable */ class DegradedTimeConverter extends BigNumberTimeConverter { diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php index f6b60abbe..1079e885d 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php @@ -27,16 +27,14 @@ use const STR_PAD_LEFT; /** - * GenericTimeConverter uses the provided calculator to calculate and convert - * time values + * GenericTimeConverter uses the provided calculator to calculate and convert time values * - * @psalm-immutable + * @immutable */ class GenericTimeConverter implements TimeConverterInterface { /** - * The number of 100-nanosecond intervals from the Gregorian calendar epoch - * to the Unix epoch. + * The number of 100-nanosecond intervals from the Gregorian calendar epoch to the Unix epoch. */ private const GREGORIAN_TO_UNIX_INTERVALS = '122192928000000000'; @@ -56,51 +54,46 @@ public function __construct(private CalculatorInterface $calculator) public function calculateTime(string $seconds, string $microseconds): Hexadecimal { + /** @phpstan-ignore possiblyImpure.new */ $timestamp = new Time($seconds, $microseconds); // Convert the seconds into a count of 100-nanosecond intervals. $sec = $this->calculator->multiply( $timestamp->getSeconds(), - new IntegerObject(self::SECOND_INTERVALS) + new IntegerObject(self::SECOND_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ ); // Convert the microseconds into a count of 100-nanosecond intervals. $usec = $this->calculator->multiply( $timestamp->getMicroseconds(), - new IntegerObject(self::MICROSECOND_INTERVALS) + new IntegerObject(self::MICROSECOND_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ ); - // Combine the seconds and microseconds intervals and add the count of - // 100-nanosecond intervals from the Gregorian calendar epoch to the - // Unix epoch. This gives us the correct count of 100-nanosecond - // intervals since the Gregorian calendar epoch for the given seconds - // and microseconds. - /** @var IntegerObject $uuidTime */ - $uuidTime = $this->calculator->add( - $sec, - $usec, - new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS) - ); - - $uuidTimeHex = str_pad( - $this->calculator->toHexadecimal($uuidTime)->toString(), - 16, - '0', - STR_PAD_LEFT - ); - - return new Hexadecimal($uuidTimeHex); + /** + * Combine the intervals of seconds and microseconds and add the count of 100-nanosecond intervals from the + * Gregorian calendar epoch to the Unix epoch. This gives us the correct count of 100-nanosecond intervals since + * the Gregorian calendar epoch for the given seconds and microseconds. + * + * @var IntegerObject $uuidTime + * @phpstan-ignore possiblyImpure.new + */ + $uuidTime = $this->calculator->add($sec, $usec, new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS)); + + /** + * PHPStan considers CalculatorInterface::toHexadecimal, Hexadecimal:toString impure. + * + * @phpstan-ignore possiblyImpure.new + */ + return new Hexadecimal(str_pad($this->calculator->toHexadecimal($uuidTime)->toString(), 16, '0', STR_PAD_LEFT)); } public function convertTime(Hexadecimal $uuidTimestamp): Time { - // From the total, subtract the number of 100-nanosecond intervals from - // the Gregorian calendar epoch to the Unix epoch. This gives us the - // number of 100-nanosecond intervals from the Unix epoch, which also - // includes the microtime. + // From the total, subtract the number of 100-nanosecond intervals from the Gregorian calendar epoch to the Unix + // epoch. This gives us the number of 100-nanosecond intervals from the Unix epoch, which also includes the microtime. $epochNanoseconds = $this->calculator->subtract( $this->calculator->toInteger($uuidTimestamp), - new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS) + new IntegerObject(self::GREGORIAN_TO_UNIX_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ ); // Convert the 100-nanosecond intervals into seconds and microseconds. @@ -108,11 +101,12 @@ public function convertTime(Hexadecimal $uuidTimestamp): Time RoundingMode::HALF_UP, 6, $epochNanoseconds, - new IntegerObject(self::SECOND_INTERVALS) + new IntegerObject(self::SECOND_INTERVALS), /** @phpstan-ignore possiblyImpure.new */ ); $split = explode('.', (string) $unixTimestamp, 2); + /** @phpstan-ignore possiblyImpure.new */ return new Time($split[0], $split[1] ?? 0); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php index 66009f14d..67dbf8871 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php @@ -34,24 +34,22 @@ use const STR_PAD_RIGHT; /** - * PhpTimeConverter uses built-in PHP functions and standard math operations - * available to the PHP programming language to provide facilities for - * converting parts of time into representations that may be used in UUIDs + * PhpTimeConverter uses built-in PHP functions and standard math operations available to the PHP programming language + * to provide facilities for converting parts of time into representations that may be used in UUIDs * - * @psalm-immutable + * @immutable */ class PhpTimeConverter implements TimeConverterInterface { /** - * The number of 100-nanosecond intervals from the Gregorian calendar epoch - * to the Unix epoch. + * The number of 100-nanosecond intervals from the Gregorian calendar epoch to the Unix epoch. */ private const GREGORIAN_TO_UNIX_INTERVALS = 0x01b21dd213814000; /** * The number of 100-nanosecond intervals in one second. */ - private const SECOND_INTERVALS = 10000000; + private const SECOND_INTERVALS = 10_000_000; /** * The number of 100-nanosecond intervals in one microsecond. @@ -64,7 +62,7 @@ class PhpTimeConverter implements TimeConverterInterface public function __construct( ?CalculatorInterface $calculator = null, - ?TimeConverterInterface $fallbackConverter = null + ?TimeConverterInterface $fallbackConverter = null, ) { if ($calculator === null) { $calculator = new BrickMathCalculator(); @@ -81,26 +79,29 @@ public function __construct( public function calculateTime(string $seconds, string $microseconds): Hexadecimal { - $seconds = new IntegerObject($seconds); - $microseconds = new IntegerObject($microseconds); + $seconds = new IntegerObject($seconds); /** @phpstan-ignore possiblyImpure.new */ + $microseconds = new IntegerObject($microseconds); /** @phpstan-ignore possiblyImpure.new */ - // Calculate the count of 100-nanosecond intervals since the Gregorian - // calendar epoch for the given seconds and microseconds. + // Calculate the count of 100-nanosecond intervals since the Gregorian calendar epoch + // for the given seconds and microseconds. $uuidTime = ((int) $seconds->toString() * self::SECOND_INTERVALS) + ((int) $microseconds->toString() * self::MICROSECOND_INTERVALS) + self::GREGORIAN_TO_UNIX_INTERVALS; // Check to see whether we've overflowed the max/min integer size. // If so, we will default to a different time converter. - /** @psalm-suppress RedundantCondition */ + // @phpstan-ignore function.alreadyNarrowedType (the integer value might have overflowed) if (!is_int($uuidTime)) { return $this->fallbackConverter->calculateTime( $seconds->toString(), - $microseconds->toString() + $microseconds->toString(), ); } - return new Hexadecimal(str_pad(dechex($uuidTime), 16, '0', STR_PAD_LEFT)); + /** @phpstan-ignore possiblyImpure.new */ + return new Hexadecimal( + str_pad(dechex($uuidTime), 16, '0', STR_PAD_LEFT) + ); } public function convertTime(Hexadecimal $uuidTimestamp): Time @@ -109,44 +110,41 @@ public function convertTime(Hexadecimal $uuidTimestamp): Time // Convert the 100-nanosecond intervals into seconds and microseconds. $splitTime = $this->splitTime( - ((int) $timestamp->toString() - self::GREGORIAN_TO_UNIX_INTERVALS) - / self::SECOND_INTERVALS + ((int) $timestamp->toString() - self::GREGORIAN_TO_UNIX_INTERVALS) / self::SECOND_INTERVALS, ); if (count($splitTime) === 0) { return $this->fallbackConverter->convertTime($uuidTimestamp); } + /** @phpstan-ignore possiblyImpure.new */ return new Time($splitTime['sec'], $splitTime['usec']); } /** - * @param float|int $time The time to split into seconds and microseconds + * @param float | int $time The time to split into seconds and microseconds * * @return string[] + * + * @pure */ private function splitTime(float | int $time): array { $split = explode('.', (string) $time, 2); - // If the $time value is a float but $split only has 1 element, then the - // float math was rounded up to the next second, so we want to return - // an empty array to allow use of the fallback converter. + // If the $time value is a float but $split only has 1 element, then the float math was rounded up to the next + // second, so we want to return an empty array to allow use of the fallback converter. if (is_float($time) && count($split) === 1) { return []; } if (count($split) === 1) { - return [ - 'sec' => $split[0], - 'usec' => '0', - ]; + return ['sec' => $split[0], 'usec' => '0']; } - // If the microseconds are less than six characters AND the length of - // the number is greater than or equal to the PHP precision, then it's - // possible that we lost some precision for the microseconds. Return an - // empty array, so that we can choose to use the fallback converter. + // If the microseconds are less than six characters AND the length of the number is greater than or equal to the + // PHP precision, then it's possible that we lost some precision for the microseconds. Return an empty array so + // that we can choose to use the fallback converter. if (strlen($split[1]) < 6 && strlen((string) $time) >= $this->phpPrecision) { return []; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php index 4d6d0a8a7..4bd412552 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php @@ -27,10 +27,10 @@ use const STR_PAD_LEFT; /** - * UnixTimeConverter converts Unix Epoch timestamps to/from hexadecimal values - * consisting of milliseconds elapsed since the Unix Epoch + * UnixTimeConverter converts Unix Epoch timestamps to/from hexadecimal values consisting of milliseconds elapsed since + * the Unix Epoch * - * @psalm-immutable + * @immutable */ class UnixTimeConverter implements TimeConverterInterface { @@ -42,34 +42,35 @@ public function __construct(private CalculatorInterface $calculator) public function calculateTime(string $seconds, string $microseconds): Hexadecimal { + /** @phpstan-ignore possiblyImpure.new */ $timestamp = new Time($seconds, $microseconds); // Convert the seconds into milliseconds. $sec = $this->calculator->multiply( $timestamp->getSeconds(), - new IntegerObject(self::MILLISECONDS), + new IntegerObject(self::MILLISECONDS) /** @phpstan-ignore possiblyImpure.new */ ); - // Convert the microseconds into milliseconds; the scale is zero because - // we need to discard the fractional part. + // Convert the microseconds into milliseconds; the scale is zero because we need to discard the fractional part. $usec = $this->calculator->divide( RoundingMode::DOWN, // Always round down to stay in the previous millisecond. 0, $timestamp->getMicroseconds(), - new IntegerObject(self::MILLISECONDS), + new IntegerObject(self::MILLISECONDS), /** @phpstan-ignore possiblyImpure.new */ ); /** @var IntegerObject $unixTime */ $unixTime = $this->calculator->add($sec, $usec); - $unixTimeHex = str_pad( - $this->calculator->toHexadecimal($unixTime)->toString(), - 12, - '0', - STR_PAD_LEFT + /** @phpstan-ignore possiblyImpure.new */ + return new Hexadecimal( + str_pad( + $this->calculator->toHexadecimal($unixTime)->toString(), + 12, + '0', + STR_PAD_LEFT + ), ); - - return new Hexadecimal($unixTimeHex); } public function convertTime(Hexadecimal $uuidTimestamp): Time @@ -80,11 +81,12 @@ public function convertTime(Hexadecimal $uuidTimestamp): Time RoundingMode::HALF_UP, 6, $milliseconds, - new IntegerObject(self::MILLISECONDS) + new IntegerObject(self::MILLISECONDS), /** @phpstan-ignore possiblyImpure.new */ ); $split = explode('.', (string) $unixTimestamp, 2); + /** @phpstan-ignore possiblyImpure.new */ return new Time($split[0], $split[1] ?? '0'); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php b/lib/Google/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php index 1e8480701..065e3b7d1 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php @@ -18,41 +18,36 @@ use Ramsey\Uuid\Type\Time; /** - * A time converter converts timestamps into representations that may be used - * in UUIDs + * A time converter converts timestamps into representations that may be used in UUIDs * - * @psalm-immutable + * @immutable */ interface TimeConverterInterface { /** - * Uses the provided seconds and micro-seconds to calculate the count of - * 100-nanosecond intervals since UTC 00:00:00.00, 15 October 1582, for - * RFC 4122 variant UUIDs + * Uses the provided seconds and micro-seconds to calculate the count of 100-nanosecond intervals since + * UTC 00:00:00.00, 15 October 1582, for RFC 9562 (formerly RFC 4122) variant UUIDs * - * @link http://tools.ietf.org/html/rfc4122#section-4.2.2 RFC 4122, § 4.2.2: Generation Details + * @link https://www.rfc-editor.org/rfc/rfc9562#appendix-A RFC 9562, Appendix A. Test Vectors * - * @param string $seconds A string representation of the number of seconds - * since the Unix epoch for the time to calculate - * @param string $microseconds A string representation of the micro-seconds - * associated with the time to calculate + * @param string $seconds A string representation of seconds since the Unix epoch for the time to calculate + * @param string $microseconds A string representation of the micro-seconds associated with the time to calculate * * @return Hexadecimal The full UUID timestamp as a Hexadecimal value * - * @psalm-pure + * @pure */ public function calculateTime(string $seconds, string $microseconds): Hexadecimal; /** * Converts a timestamp extracted from a UUID to a Unix timestamp * - * @param Hexadecimal $uuidTimestamp A hexadecimal representation of a UUID - * timestamp; a UUID timestamp is a count of 100-nanosecond intervals - * since UTC 00:00:00.00, 15 October 1582. + * @param Hexadecimal $uuidTimestamp A hexadecimal representation of a UUID timestamp; a UUID timestamp is a count + * of 100-nanosecond intervals since UTC 00:00:00.00, 15 October 1582. * * @return Time An instance of {@see Time} * - * @psalm-pure + * @pure */ public function convertTime(Hexadecimal $uuidTimestamp): Time; } diff --git a/lib/Google/vendor/ramsey/uuid/src/DegradedUuid.php b/lib/Google/vendor/ramsey/uuid/src/DegradedUuid.php index 9166042cc..169976e74 100644 --- a/lib/Google/vendor/ramsey/uuid/src/DegradedUuid.php +++ b/lib/Google/vendor/ramsey/uuid/src/DegradedUuid.php @@ -15,10 +15,10 @@ namespace Ramsey\Uuid; /** - * @deprecated DegradedUuid is no longer necessary to represent UUIDs on 32-bit - * systems. Transition typehints to {@see UuidInterface}. + * @deprecated DegradedUuid is no longer necessary to represent UUIDs on 32-bit systems. + * Transition any type declarations using this class to {@see UuidInterface}. * - * @psalm-immutable + * @immutable */ class DegradedUuid extends Uuid { diff --git a/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php b/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php index ac01a79cf..91dbbc60b 100644 --- a/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidInterface.php @@ -20,119 +20,105 @@ /** * This interface encapsulates deprecated methods for ramsey/uuid * - * @psalm-immutable + * @immutable */ interface DeprecatedUuidInterface { /** - * @deprecated This method will be removed in 5.0.0. There is no alternative - * recommendation, so plan accordingly. + * @deprecated This method will be removed in 5.0.0. There is no alternative recommendation, so plan accordingly. */ public function getNumberConverter(): NumberConverterInterface; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. * * @return string[] */ public function getFieldsHex(): array; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. */ public function getClockSeqHiAndReservedHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. */ public function getClockSeqLowHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. */ public function getClockSequenceHex(): string; /** - * @deprecated In ramsey/uuid version 5.0.0, this will be removed from the - * interface. It is available at {@see UuidV1::getDateTime()}. + * @deprecated In ramsey/uuid version 5.0.0, this will be removed from the interface. It is available at + * {@see UuidV1::getDateTime()}. */ public function getDateTime(): DateTimeInterface; /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getLeastSignificantBitsHex(): string; /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getMostSignificantBitsHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. */ public function getNodeHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. */ public function getTimeHiAndVersionHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. */ public function getTimeLowHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. */ public function getTimeMidHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. */ public function getTimestampHex(): string; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. */ public function getVariant(): ?int; /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. */ diff --git a/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php b/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php index d3fbb0ccb..fb8857873 100644 --- a/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php +++ b/lib/Google/vendor/ramsey/uuid/src/DeprecatedUuidMethodsTrait.php @@ -27,22 +27,19 @@ use const STR_PAD_LEFT; /** - * This trait encapsulates deprecated methods for ramsey/uuid; this trait and - * its methods will be removed in ramsey/uuid 5.0.0. + * This trait encapsulates deprecated methods for ramsey/uuid; this trait and its methods will be removed in ramsey/uuid 5.0.0. * * @deprecated This trait and its methods will be removed in ramsey/uuid 5.0.0. * - * @psalm-immutable + * @immutable */ trait DeprecatedUuidMethodsTrait { /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()} and use the arbitrary-precision math + * library of your choice to convert it to a string integer. */ public function getClockSeqHiAndReserved(): string { @@ -50,9 +47,8 @@ public function getClockSeqHiAndReserved(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqHiAndReserved()}. */ public function getClockSeqHiAndReservedHex(): string @@ -61,12 +57,10 @@ public function getClockSeqHiAndReservedHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. */ public function getClockSeqLow(): string { @@ -74,9 +68,8 @@ public function getClockSeqLow(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeqLow()}. */ public function getClockSeqLowHex(): string @@ -85,12 +78,10 @@ public function getClockSeqLowHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. */ public function getClockSequence(): string { @@ -98,9 +89,8 @@ public function getClockSequence(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getClockSeq()}. */ public function getClockSequenceHex(): string @@ -109,8 +99,7 @@ public function getClockSequenceHex(): string } /** - * @deprecated This method will be removed in 5.0.0. There is no alternative - * recommendation, so plan accordingly. + * @deprecated This method will be removed in 5.0.0. There is no alternative recommendation, so plan accordingly. */ public function getNumberConverter(): NumberConverterInterface { @@ -118,8 +107,7 @@ public function getNumberConverter(): NumberConverterInterface } /** - * @deprecated In ramsey/uuid version 5.0.0, this will be removed. - * It is available at {@see UuidV1::getDateTime()}. + * @deprecated In ramsey/uuid version 5.0.0, this will be removed. It is available at {@see UuidV1::getDateTime()}. * * @return DateTimeImmutable An immutable instance of DateTimeInterface * @@ -147,8 +135,7 @@ public function getDateTime(): DateTimeInterface } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. * * @return string[] */ @@ -165,9 +152,8 @@ public function getFieldsHex(): array } /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getLeastSignificantBits(): string { @@ -177,9 +163,8 @@ public function getLeastSignificantBits(): string } /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getLeastSignificantBitsHex(): string { @@ -187,9 +172,8 @@ public function getLeastSignificantBitsHex(): string } /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getMostSignificantBits(): string { @@ -199,9 +183,8 @@ public function getMostSignificantBits(): string } /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getMostSignificantBitsHex(): string { @@ -209,12 +192,10 @@ public function getMostSignificantBitsHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()} and use the - * arbitrary-precision math library of your choice to convert it to a - * string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()} and use the arbitrary-precision math library of your + * choice to convert it to a string integer. */ public function getNode(): string { @@ -222,9 +203,8 @@ public function getNode(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getNode()}. */ public function getNodeHex(): string @@ -233,12 +213,10 @@ public function getNodeHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()} and use the arbitrary-precision math + * library of your choice to convert it to a string integer. */ public function getTimeHiAndVersion(): string { @@ -246,9 +224,8 @@ public function getTimeHiAndVersion(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeHiAndVersion()}. */ public function getTimeHiAndVersionHex(): string @@ -257,12 +234,10 @@ public function getTimeHiAndVersionHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()} and use the - * arbitrary-precision math library of your choice to convert it to a - * string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. */ public function getTimeLow(): string { @@ -270,9 +245,8 @@ public function getTimeLow(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeLow()}. */ public function getTimeLowHex(): string @@ -281,12 +255,10 @@ public function getTimeLowHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()} and use the - * arbitrary-precision math library of your choice to convert it to a - * string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. */ public function getTimeMid(): string { @@ -294,9 +266,8 @@ public function getTimeMid(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimeMid()}. */ public function getTimeMidHex(): string @@ -305,12 +276,10 @@ public function getTimeMidHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()} and use - * the arbitrary-precision math library of your choice to convert it to - * a string integer. + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()} and use the arbitrary-precision math library of + * your choice to convert it to a string integer. */ public function getTimestamp(): string { @@ -322,9 +291,8 @@ public function getTimestamp(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getTimestamp()}. */ public function getTimestampHex(): string @@ -337,9 +305,8 @@ public function getTimestampHex(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVariant()}. */ public function getVariant(): ?int @@ -348,9 +315,8 @@ public function getVariant(): ?int } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. If it is a - * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see \Ramsey\Uuid\Fields\FieldsInterface} instance. + * If it is a {@see \Ramsey\Uuid\Rfc4122\FieldsInterface} instance, you may call * {@see \Ramsey\Uuid\Rfc4122\FieldsInterface::getVersion()}. */ public function getVersion(): ?int diff --git a/lib/Google/vendor/ramsey/uuid/src/Exception/DceSecurityException.php b/lib/Google/vendor/ramsey/uuid/src/Exception/DceSecurityException.php index e6d800136..bd8ca4c65 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Exception/DceSecurityException.php +++ b/lib/Google/vendor/ramsey/uuid/src/Exception/DceSecurityException.php @@ -17,8 +17,7 @@ use RuntimeException as PhpRuntimeException; /** - * Thrown to indicate an exception occurred while dealing with DCE Security - * (version 2) UUIDs + * Thrown to indicate an exception occurred while dealing with DCE Security (version 2) UUIDs */ class DceSecurityException extends PhpRuntimeException implements UuidExceptionInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php b/lib/Google/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php index 6d9758166..cfc7eee47 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php +++ b/lib/Google/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php @@ -17,8 +17,8 @@ /** * Thrown to indicate that the string received is not a valid UUID * - * The InvalidArgumentException that this extends is the ramsey/uuid version - * of this exception. It exists in the same namespace as this class. + * The InvalidArgumentException that this extends is the ramsey/uuid version of this exception. It exists in the same + * namespace as this class. */ class InvalidUuidStringException extends InvalidArgumentException implements UuidExceptionInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Exception/NameException.php b/lib/Google/vendor/ramsey/uuid/src/Exception/NameException.php index fd96a1faf..ee72e165a 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Exception/NameException.php +++ b/lib/Google/vendor/ramsey/uuid/src/Exception/NameException.php @@ -17,8 +17,7 @@ use RuntimeException as PhpRuntimeException; /** - * Thrown to indicate that an error occurred while attempting to hash a - * namespace and name + * Thrown to indicate that an error occurred while attempting to hash a namespace and name */ class NameException extends PhpRuntimeException implements UuidExceptionInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Exception/RandomSourceException.php b/lib/Google/vendor/ramsey/uuid/src/Exception/RandomSourceException.php index a44dd34a2..7b2460411 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Exception/RandomSourceException.php +++ b/lib/Google/vendor/ramsey/uuid/src/Exception/RandomSourceException.php @@ -19,8 +19,8 @@ /** * Thrown to indicate that the source of random data encountered an error * - * This exception is used mostly to indicate that random_bytes() or random_int() - * threw an exception. However, it may be used for other sources of random data. + * This exception is used mostly to indicate that random_bytes() or random_int() threw an exception. However, it may be + * used for other sources of random data. */ class RandomSourceException extends PhpRuntimeException implements UuidExceptionInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/FeatureSet.php b/lib/Google/vendor/ramsey/uuid/src/FeatureSet.php index b9af869f9..88ce7c421 100644 --- a/lib/Google/vendor/ramsey/uuid/src/FeatureSet.php +++ b/lib/Google/vendor/ramsey/uuid/src/FeatureSet.php @@ -57,8 +57,7 @@ /** * FeatureSet detects and exposes available features in the current environment * - * A feature set is used by UuidFactory to determine the available features and - * capabilities of the environment. + * A feature set is used by UuidFactory to determine the available features and capabilities of the environment. */ class FeatureSet { @@ -78,20 +77,19 @@ class FeatureSet /** * @param bool $useGuids True build UUIDs using the GuidStringCodec - * @param bool $force32Bit True to force the use of 32-bit functionality - * (primarily for testing purposes) + * @param bool $force32Bit True to force the use of 32-bit functionality (primarily for testing purposes) * @param bool $forceNoBigNumber (obsolete) - * @param bool $ignoreSystemNode True to disable attempts to check for the - * system node ID (primarily for testing purposes) - * @param bool $enablePecl True to enable the use of the PeclUuidTimeGenerator - * to generate version 1 UUIDs + * @param bool $ignoreSystemNode True to disable attempts to check for the system node ID (primarily for testing purposes) + * @param bool $enablePecl True to enable the use of the PeclUuidTimeGenerator to generate version 1 UUIDs + * + * @phpstan-ignore constructor.unusedParameter ($forceNoBigNumber is deprecated) */ public function __construct( bool $useGuids = false, private bool $force32Bit = false, bool $forceNoBigNumber = false, private bool $ignoreSystemNode = false, - private bool $enablePecl = false + private bool $enablePecl = false, ) { $this->randomGenerator = $this->buildRandomGenerator(); $this->setCalculator(new BrickMathCalculator()); @@ -212,7 +210,6 @@ public function setCalculator(CalculatorInterface $calculator): void $this->numberConverter = $this->buildNumberConverter($calculator); $this->timeConverter = $this->buildTimeConverter($calculator); - /** @psalm-suppress RedundantPropertyInitializationCheck */ if (isset($this->timeProvider)) { $this->timeGenerator = $this->buildTimeGenerator($this->timeProvider); } @@ -273,13 +270,9 @@ private function buildCodec(bool $useGuids = false): CodecInterface * Returns a DCE Security generator configured for this environment */ private function buildDceSecurityGenerator( - DceSecurityProviderInterface $dceSecurityProvider + DceSecurityProviderInterface $dceSecurityProvider, ): DceSecurityGeneratorInterface { - return new DceSecurityGenerator( - $this->numberConverter, - $this->timeGenerator, - $dceSecurityProvider - ); + return new DceSecurityGenerator($this->numberConverter, $this->timeGenerator, $dceSecurityProvider); } /** @@ -291,10 +284,7 @@ private function buildNodeProvider(): NodeProviderInterface return new RandomNodeProvider(); } - return new FallbackNodeProvider([ - new SystemNodeProvider(), - new RandomNodeProvider(), - ]); + return new FallbackNodeProvider([new SystemNodeProvider(), new RandomNodeProvider()]); } /** @@ -329,11 +319,7 @@ private function buildTimeGenerator(TimeProviderInterface $timeProvider): TimeGe return new PeclUuidTimeGenerator(); } - return (new TimeGeneratorFactory( - $this->nodeProvider, - $this->timeConverter, - $timeProvider - ))->getGenerator(); + return (new TimeGeneratorFactory($this->nodeProvider, $this->timeConverter, $timeProvider))->getGenerator(); } /** diff --git a/lib/Google/vendor/ramsey/uuid/src/Fields/FieldsInterface.php b/lib/Google/vendor/ramsey/uuid/src/Fields/FieldsInterface.php index f1b7a290d..f17ea880b 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Fields/FieldsInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Fields/FieldsInterface.php @@ -17,16 +17,17 @@ use Serializable; /** - * UUIDs are comprised of unsigned integers, the bytes of which are separated - * into fields and arranged in a particular layout defined by the specification - * for the variant + * UUIDs consist of unsigned integers, the bytes of which are separated into fields and arranged in a particular layout + * defined by the specification for the variant * - * @psalm-immutable + * @immutable */ interface FieldsInterface extends Serializable { /** * Returns the bytes that comprise the fields + * + * @pure */ public function getBytes(): string; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php b/lib/Google/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php index 3d36b6f12..9ea47c637 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php +++ b/lib/Google/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php @@ -23,7 +23,7 @@ /** * Provides common serialization functionality to fields * - * @psalm-immutable + * @immutable */ trait SerializableFieldsTrait { @@ -38,7 +38,7 @@ abstract public function __construct(string $bytes); abstract public function getBytes(): string; /** - * Returns a string representation of object + * Returns a string representation of the object */ public function serialize(): string { @@ -57,8 +57,6 @@ public function __serialize(): array * Constructs the object from a serialized string representation * * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall */ public function unserialize(string $data): void { @@ -71,8 +69,6 @@ public function unserialize(string $data): void /** * @param array{bytes?: string} $data - * - * @psalm-suppress UnusedMethodCall */ public function __unserialize(array $data): void { diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/CombGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/CombGenerator.php index 0e8870608..5f6fa1d98 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/CombGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/CombGenerator.php @@ -29,33 +29,32 @@ /** * CombGenerator generates COMBs (combined UUID/timestamp) * - * The CombGenerator, when used with the StringCodec (and, by proxy, the - * TimestampLastCombCodec) or the TimestampFirstCombCodec, combines the current - * timestamp with a UUID (hence the name "COMB"). The timestamp either appears - * as the first or last 48 bits of the COMB, depending on the codec used. + * The CombGenerator, when used with the StringCodec (and, by proxy, the TimestampLastCombCodec) or the + * TimestampFirstCombCodec, combines the current timestamp with a UUID (hence the name "COMB"). The timestamp either + * appears as the first or last 48 bits of the COMB, depending on the codec used. * - * By default, COMBs will have the timestamp set as the last 48 bits of the - * identifier. + * By default, COMBs will have the timestamp set as the last 48 bits of the identifier. * - * ``` php + * ``` * $factory = new UuidFactory(); * * $factory->setRandomGenerator(new CombGenerator( * $factory->getRandomGenerator(), - * $factory->getNumberConverter() + * $factory->getNumberConverter(), * )); * * $comb = $factory->uuid4(); * ``` * - * To generate a COMB with the timestamp as the first 48 bits, set the - * TimestampFirstCombCodec as the codec. + * To generate a COMB with the timestamp as the first 48 bits, set the TimestampFirstCombCodec as the codec. * - * ``` php + * ``` * $factory->setCodec(new TimestampFirstCombCodec($factory->getUuidBuilder())); * ``` * - * @link https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys + * @deprecated Please migrate to {@link https://uuid.ramsey.dev/en/stable/rfc4122/version7.html Version 7, Unix Epoch Time UUIDs}. + * + * @link https://web.archive.org/web/20240118030355/https://www.informit.com/articles/printerfriendly/25862 The Cost of GUIDs as Primary Keys */ class CombGenerator implements RandomGeneratorInterface { @@ -68,8 +67,7 @@ public function __construct( } /** - * @throws InvalidArgumentException if $length is not a positive integer - * greater than or equal to CombGenerator::TIMESTAMP_BYTES + * @throws InvalidArgumentException if $length is not a positive integer greater than or equal to CombGenerator::TIMESTAMP_BYTES * * @inheritDoc */ @@ -81,7 +79,13 @@ public function generate(int $length): string ); } + if ($length % 2 !== 0) { + throw new InvalidArgumentException('Length must be an even number'); + } + $hash = ''; + + /** @phpstan-ignore greater.alwaysTrue (TIMESTAMP_BYTES constant could change in child classes) */ if (self::TIMESTAMP_BYTES > 0 && $length > self::TIMESTAMP_BYTES) { $hash = $this->generator->generate($length - self::TIMESTAMP_BYTES); } @@ -90,21 +94,14 @@ public function generate(int $length): string $this->numberConverter->toHex($this->timestamp()), self::TIMESTAMP_BYTES * 2, '0', - STR_PAD_LEFT + STR_PAD_LEFT, ); - return (string) hex2bin( - str_pad( - bin2hex($hash), - $length - self::TIMESTAMP_BYTES, - '0' - ) - . $lsbTime - ); + return (string) hex2bin(str_pad(bin2hex($hash), $length - self::TIMESTAMP_BYTES, '0') . $lsbTime); } /** - * Returns current timestamp a string integer, precise to 0.00001 seconds + * Returns the current timestamp as a string integer, precise to 0.00001 seconds */ private function timestamp(): string { diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php index 37ba78131..71192c09f 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php @@ -31,8 +31,8 @@ use const STR_PAD_LEFT; /** - * DceSecurityGenerator generates strings of binary data based on a local - * domain, local identifier, node ID, clock sequence, and the current time + * DceSecurityGenerator generates strings of binary data based on a local domain, local identifier, node ID, clock + * sequence, and the current time */ class DceSecurityGenerator implements DceSecurityGeneratorInterface { @@ -55,7 +55,7 @@ class DceSecurityGenerator implements DceSecurityGeneratorInterface public function __construct( private NumberConverterInterface $numberConverter, private TimeGeneratorInterface $timeGenerator, - private DceSecurityProviderInterface $dceSecurityProvider + private DceSecurityProviderInterface $dceSecurityProvider, ) { } @@ -63,32 +63,26 @@ public function generate( int $localDomain, ?IntegerObject $localIdentifier = null, ?Hexadecimal $node = null, - ?int $clockSeq = null + ?int $clockSeq = null, ): string { if (!in_array($localDomain, self::DOMAINS)) { - throw new DceSecurityException( - 'Local domain must be a valid DCE Security domain' - ); + throw new DceSecurityException('Local domain must be a valid DCE Security domain'); } if ($localIdentifier && $localIdentifier->isNegative()) { throw new DceSecurityException( - 'Local identifier out of bounds; it must be a value between 0 and 4294967295' + 'Local identifier out of bounds; it must be a value between 0 and 4294967295', ); } if ($clockSeq > self::CLOCK_SEQ_HIGH || $clockSeq < self::CLOCK_SEQ_LOW) { - throw new DceSecurityException( - 'Clock sequence out of bounds; it must be a value between 0 and 63' - ); + throw new DceSecurityException('Clock sequence out of bounds; it must be a value between 0 and 63'); } switch ($localDomain) { case Uuid::DCE_DOMAIN_ORG: if ($localIdentifier === null) { - throw new DceSecurityException( - 'A local identifier must be provided for the org domain' - ); + throw new DceSecurityException('A local identifier must be provided for the org domain'); } break; @@ -109,13 +103,11 @@ public function generate( $identifierHex = $this->numberConverter->toHex($localIdentifier->toString()); - // The maximum value for the local identifier is 0xffffffff, or - // 4294967295. This is 8 hexadecimal digits, so if the length of - // hexadecimal digits is greater than 8, we know the value is greater - // than 0xffffffff. + // The maximum value for the local identifier is 0xffffffff, or 4,294,967,295. This is 8 hexadecimal digits, so + // if the length of hexadecimal digits is greater than 8, we know the value is greater than 0xffffffff. if (strlen($identifierHex) > 8) { throw new DceSecurityException( - 'Local identifier out of bounds; it must be a value between 0 and 4294967295' + 'Local identifier out of bounds; it must be a value between 0 and 4294967295', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php b/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php index faa29a53d..f52eb557e 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php @@ -19,28 +19,23 @@ use Ramsey\Uuid\Type\Integer as IntegerObject; /** - * A DCE Security generator generates strings of binary data based on a local - * domain, local identifier, node ID, clock sequence, and the current time + * A DCE Security generator generates strings of binary data based on a local domain, local identifier, node ID, clock + * sequence, and the current time * * @see UuidV2 */ interface DceSecurityGeneratorInterface { /** - * Generate a binary string from a local domain, local identifier, node ID, - * clock sequence, and current time + * Generate a binary string from a local domain, local identifier, node ID, clock sequence, and current time * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID + * on POSIX systems if the local domain is "person" or "group," or it may be a site-defined identifier if the + * local domain is "org" + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * * @return string A binary string */ @@ -48,6 +43,6 @@ public function generate( int $localDomain, ?IntegerObject $localIdentifier = null, ?Hexadecimal $node = null, - ?int $clockSeq = null + ?int $clockSeq = null, ): string; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php index 7303e9fa2..cf37b4539 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php @@ -21,28 +21,22 @@ use function hash; /** - * DefaultNameGenerator generates strings of binary data based on a namespace, - * name, and hashing algorithm + * DefaultNameGenerator generates strings of binary data based on a namespace, name, and hashing algorithm */ class DefaultNameGenerator implements NameGeneratorInterface { - /** @psalm-pure */ + /** + * @pure + */ public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string { try { - /** @var string|bool $bytes */ - $bytes = @hash($hashAlgorithm, $ns->getBytes() . $name, true); + return hash($hashAlgorithm, $ns->getBytes() . $name, true); } catch (ValueError $e) { - $bytes = false; // keep same behavior than PHP 7 + throw new NameException( + message: sprintf('Unable to hash namespace and name with algorithm \'%s\'', $hashAlgorithm), + previous: $e, + ); } - - if ($bytes === false) { - throw new NameException(sprintf( - 'Unable to hash namespace and name with algorithm \'%s\'', - $hashAlgorithm - )); - } - - return (string) $bytes; } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php index ea1e2a6ff..6ded59d38 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php @@ -35,15 +35,14 @@ use const STR_PAD_LEFT; /** - * DefaultTimeGenerator generates strings of binary data based on a node ID, - * clock sequence, and the current time + * DefaultTimeGenerator generates strings of binary data based on a node ID, clock sequence, and the current time */ class DefaultTimeGenerator implements TimeGeneratorInterface { public function __construct( private NodeProviderInterface $nodeProvider, private TimeConverterInterface $timeConverter, - private TimeProviderInterface $timeProvider + private TimeProviderInterface $timeProvider, ) { } @@ -63,14 +62,10 @@ public function generate($node = null, ?int $clockSeq = null): string if ($clockSeq === null) { try { - // This does not use "stable storage"; see RFC 4122, Section 4.2.1.1. + // This does not use "stable storage"; see RFC 9562, section 6.3. $clockSeq = random_int(0, 0x3fff); } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); + throw new RandomSourceException($exception->getMessage(), (int) $exception->getCode(), $exception); } } @@ -84,26 +79,20 @@ public function generate($node = null, ?int $clockSeq = null): string $timeHex = str_pad($uuidTime->toString(), 16, '0', STR_PAD_LEFT); if (strlen($timeHex) !== 16) { - throw new TimeSourceException(sprintf( - 'The generated time of \'%s\' is larger than expected', - $timeHex - )); + throw new TimeSourceException(sprintf('The generated time of \'%s\' is larger than expected', $timeHex)); } $timeBytes = (string) hex2bin($timeHex); return $timeBytes[4] . $timeBytes[5] . $timeBytes[6] . $timeBytes[7] - . $timeBytes[2] . $timeBytes[3] - . $timeBytes[0] . $timeBytes[1] - . pack('n*', $clockSeq) - . $node; + . $timeBytes[2] . $timeBytes[3] . $timeBytes[0] . $timeBytes[1] + . pack('n*', $clockSeq) . $node; } /** - * Uses the node provider given when constructing this instance to get - * the node ID (usually a MAC address) + * Uses the node provider given when constructing this instance to get the node ID (usually a MAC address) * - * @param int|string|null $node A node value that may be used to override the node provider + * @param int | string | null $node A node value that may be used to override the node provider * * @return string 6-byte binary string representation of the node * @@ -115,7 +104,7 @@ private function getValidNode(int | string | null $node): string $node = $this->nodeProvider->getNode(); } - // Convert the node to hex, if it is still an integer. + // Convert the node to hex if it is still an integer. if (is_int($node)) { $node = dechex($node); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php b/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php index 6f08e2910..d68e94b76 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php @@ -15,8 +15,7 @@ namespace Ramsey\Uuid\Generator; /** - * NameGeneratorFactory retrieves a default name generator, based on the - * environment + * NameGeneratorFactory retrieves a default name generator, based on the environment */ class NameGeneratorFactory { diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php b/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php index cc43dd029..f0fb8daa9 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php @@ -17,14 +17,13 @@ use Ramsey\Uuid\UuidInterface; /** - * A name generator generates strings of binary data created by hashing together - * a namespace with a name, according to a hashing algorithm + * A name generator generates strings of binary data created by hashing together a namespace with a name, according to a + * hashing algorithm */ interface NameGeneratorInterface { /** - * Generate a binary string from a namespace and name hashed together with - * the specified hashing algorithm + * Generate a binary string from a namespace and name hashed together with the specified hashing algorithm * * @param UuidInterface $ns The namespace * @param string $name The name to use for creating a UUID @@ -32,7 +31,7 @@ interface NameGeneratorInterface * * @return string A binary string * - * @psalm-pure + * @pure */ public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php index 6a6d1aec3..d13bafc95 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php @@ -23,27 +23,26 @@ use function uuid_parse; /** - * PeclUuidNameGenerator generates strings of binary data from a namespace and a - * name, using ext-uuid + * PeclUuidNameGenerator generates strings of binary data from a namespace and a name, using ext-uuid * * @link https://pecl.php.net/package/uuid ext-uuid */ class PeclUuidNameGenerator implements NameGeneratorInterface { - /** @psalm-pure */ + /** + * @pure + */ public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string { $uuid = match ($hashAlgorithm) { - 'md5' => uuid_generate_md5($ns->toString(), $name), - 'sha1' => uuid_generate_sha1($ns->toString(), $name), + 'md5' => uuid_generate_md5($ns->toString(), $name), /** @phpstan-ignore possiblyImpure.functionCall */ + 'sha1' => uuid_generate_sha1($ns->toString(), $name), /** @phpstan-ignore possiblyImpure.functionCall */ default => throw new NameException( - sprintf( - 'Unable to hash namespace and name with algorithm \'%s\'', - $hashAlgorithm - ) + sprintf('Unable to hash namespace and name with algorithm \'%s\'', $hashAlgorithm), ), }; - return uuid_parse($uuid); + /** @phpstan-ignore possiblyImpure.functionCall */ + return (string) uuid_parse($uuid); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php index 07c47d265..6ad45acae 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php @@ -30,6 +30,6 @@ public function generate(int $length): string { $uuid = uuid_create(UUID_TYPE_RANDOM); - return uuid_parse($uuid); + return (string) uuid_parse($uuid); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php index e01f44e52..558abf7e7 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php @@ -20,8 +20,7 @@ use const UUID_TYPE_TIME; /** - * PeclUuidTimeGenerator generates strings of binary data for time-base UUIDs, - * using ext-uuid + * PeclUuidTimeGenerator generates strings of binary data for time-base UUIDs, using ext-uuid * * @link https://pecl.php.net/package/uuid ext-uuid */ @@ -34,6 +33,6 @@ public function generate($node = null, ?int $clockSeq = null): string { $uuid = uuid_create(UUID_TYPE_TIME); - return uuid_parse($uuid); + return (string) uuid_parse($uuid); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php index 12edb96ae..c169e63ca 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php @@ -18,8 +18,7 @@ use Throwable; /** - * RandomBytesGenerator generates strings of random binary data using the - * built-in `random_bytes()` PHP function + * RandomBytesGenerator generates strings of random binary data using the built-in `random_bytes()` PHP function * * @link http://php.net/random_bytes random_bytes() */ @@ -35,11 +34,7 @@ public function generate(int $length): string try { return random_bytes($length); } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); + throw new RandomSourceException($exception->getMessage(), (int) $exception->getCode(), $exception); } } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php index b723ac29e..f4c3a6ffb 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php @@ -15,8 +15,7 @@ namespace Ramsey\Uuid\Generator; /** - * RandomGeneratorFactory retrieves a default random generator, based on the - * environment + * RandomGeneratorFactory retrieves a default random generator, based on the environment */ class RandomGeneratorFactory { diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php index 1180b9764..ddd87327a 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php @@ -22,7 +22,7 @@ interface RandomGeneratorInterface /** * Generates a string of randomized binary data * - * @param int<1, max> $length The number of bytes of random binary data to generate + * @param int<1, max> $length The number of bytes to generate of random binary data * * @return string A binary string */ diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php index fd0ccc8aa..b6d401d1a 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php @@ -18,12 +18,10 @@ use RandomLib\Generator; /** - * RandomLibAdapter generates strings of random binary data using the - * paragonie/random-lib library + * RandomLibAdapter generates strings of random binary data using the paragonie/random-lib library * - * @deprecated This class will be removed in 5.0.0. Use the default - * RandomBytesGenerator or implement your own generator that implements - * RandomGeneratorInterface. + * @deprecated This class will be removed in 5.0.0. Use the default RandomBytesGenerator or implement your own generator + * that implements RandomGeneratorInterface. * * @link https://packagist.org/packages/paragonie/random-lib paragonie/random-lib */ @@ -34,10 +32,10 @@ class RandomLibAdapter implements RandomGeneratorInterface /** * Constructs a RandomLibAdapter * - * By default, if no Generator is passed in, this creates a high-strength - * generator to use when generating random binary data. + * By default, if no Generator is passed in, this creates a high-strength generator to use when generating random + * binary data. * - * @param Generator|null $generator The generator to use when generating binary data + * @param Generator | null $generator The generator to use when generating binary data */ public function __construct(?Generator $generator = null) { diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php b/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php index 8d06fc3ae..433e74c81 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php @@ -19,15 +19,14 @@ use Ramsey\Uuid\Provider\TimeProviderInterface; /** - * TimeGeneratorFactory retrieves a default time generator, based on the - * environment + * TimeGeneratorFactory retrieves a default time generator, based on the environment */ class TimeGeneratorFactory { public function __construct( private NodeProviderInterface $nodeProvider, private TimeConverterInterface $timeConverter, - private TimeProviderInterface $timeProvider + private TimeProviderInterface $timeProvider, ) { } @@ -36,10 +35,6 @@ public function __construct( */ public function getGenerator(): TimeGeneratorInterface { - return new DefaultTimeGenerator( - $this->nodeProvider, - $this->timeConverter, - $this->timeProvider - ); + return new DefaultTimeGenerator($this->nodeProvider, $this->timeConverter, $this->timeProvider); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php b/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php index 18f21c4b6..c15d82073 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php @@ -17,20 +17,17 @@ use Ramsey\Uuid\Type\Hexadecimal; /** - * A time generator generates strings of binary data based on a node ID, - * clock sequence, and the current time + * A time generator generates strings of binary data based on a node ID, clock sequence, and the current time */ interface TimeGeneratorInterface { /** * Generate a binary string from a node ID, clock sequence, and current time * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may + * be represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * * @return string A binary string */ diff --git a/lib/Google/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php b/lib/Google/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php index d7c8ed4ee..024ed51e1 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php @@ -19,6 +19,7 @@ use DateTimeInterface; use Ramsey\Uuid\Type\Hexadecimal; +use function assert; use function hash; use function pack; use function str_pad; @@ -31,11 +32,10 @@ use const STR_PAD_LEFT; /** - * UnixTimeGenerator generates bytes that combine a 48-bit timestamp in - * milliseconds since the Unix Epoch with 80 random bits + * UnixTimeGenerator generates bytes, combining a 48-bit timestamp in milliseconds since the Unix Epoch with 80 random bits * - * Code and concepts within this class are borrowed from the symfony/uid package - * and are used under the terms of the MIT license distributed with symfony/uid. + * Code and concepts within this class are borrowed from the symfony/uid package and are used under the terms of the MIT + * license distributed with symfony/uid. * * symfony/uid is copyright (c) Fabien Potencier. * @@ -57,17 +57,14 @@ class UnixTimeGenerator implements TimeGeneratorInterface public function __construct( private RandomGeneratorInterface $randomGenerator, - private int $intSize = PHP_INT_SIZE + private int $intSize = PHP_INT_SIZE, ) { } /** - * @param Hexadecimal|int|string|null $node Unused in this generator - * @param int|null $clockSeq Unused in this generator - * @param DateTimeInterface $dateTime A date-time instance to use when - * generating bytes - * - * @inheritDoc + * @param Hexadecimal | int | string | null $node Unused in this generator + * @param int | null $clockSeq Unused in this generator + * @param DateTimeInterface | null $dateTime A date-time instance to use when generating bytes */ public function generate($node = null, ?int $clockSeq = null, ?DateTimeInterface $dateTime = null): string { @@ -85,7 +82,8 @@ public function generate($node = null, ?int $clockSeq = null, ?DateTimeInterface $time = str_pad(BigInteger::of($time)->toBytes(false), 6, "\x00", STR_PAD_LEFT); } - /** @var non-empty-string */ + assert(strlen($time) === 6); + return $time . pack('n*', self::$rand[1], self::$rand[2], self::$rand[3], self::$rand[4], self::$rand[5]); } @@ -107,23 +105,17 @@ private function randomize(string $time): void } /** - * Special thanks to Nicolas Grekas for sharing the following information: + * Special thanks to Nicolas Grekas () for sharing the following information: * * Within the same ms, we increment the rand part by a random 24-bit number. * - * Instead of getting this number from random_bytes(), which is slow, we get - * it by sha512-hashing self::$seed. This produces 64 bytes of entropy, - * which we need to split in a list of 24-bit numbers. unpack() first splits - * them into 16 x 32-bit numbers; we take the first byte of each of these - * numbers to get 5 extra 24-bit numbers. Then, we consume those numbers - * one-by-one and run this logic every 21 iterations. - * - * self::$rand holds the random part of the UUID, split into 5 x 16-bit - * numbers for x86 portability. We increment this random part by the next - * 24-bit number in the self::$seedParts list and decrement - * self::$seedIndex. + * Instead of getting this number from random_bytes(), which is slow, we get it by sha512-hashing self::$seed. This + * produces 64 bytes of entropy, which we need to split in a list of 24-bit numbers. `unpack()` first splits them + * into 16 x 32-bit numbers; we take the first byte of each number to get 5 extra 24-bit numbers. Then, we consume + * each number one-by-one and run this logic every 21 iterations. * - * @link https://twitter.com/nicolasgrekas/status/1583356938825261061 Tweet from Nicolas Grekas + * `self::$rand` holds the random part of the UUID, split into 5 x 16-bit numbers for x86 portability. We increment + * this random part by the next 24-bit number in the `self::$seedParts` list and decrement `self::$seedIndex`. */ private function increment(): string { diff --git a/lib/Google/vendor/ramsey/uuid/src/Guid/Fields.php b/lib/Google/vendor/ramsey/uuid/src/Guid/Fields.php index 0fc5d1c9b..58aa5e1cd 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Guid/Fields.php +++ b/lib/Google/vendor/ramsey/uuid/src/Guid/Fields.php @@ -37,11 +37,11 @@ use const STR_PAD_LEFT; /** - * GUIDs are comprised of a set of named fields, according to RFC 4122 + * GUIDs consist of a set of named fields, according to RFC 9562 (formerly RFC 4122) * * @see Guid * - * @psalm-immutable + * @immutable */ final class Fields implements FieldsInterface { @@ -62,22 +62,19 @@ public function __construct(private string $bytes) { if (strlen($this->bytes) !== 16) { throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($this->bytes) . ' bytes' + 'The byte string must be 16 bytes long; received ' . strlen($this->bytes) . ' bytes', ); } if (!$this->isCorrectVariant()) { throw new InvalidArgumentException( - 'The byte string received does not conform to the RFC ' - . '4122 or Microsoft Corporation variants' + 'The byte string received does not conform to the RFC 9562 (formerly RFC 4122) ' + . 'or Microsoft Corporation variants', ); } if (!$this->isCorrectVersion()) { - throw new InvalidArgumentException( - 'The byte string received does not contain a valid version' - ); + throw new InvalidArgumentException('The byte string received does not contain a valid version'); } } @@ -89,47 +86,35 @@ public function getBytes(): string public function getTimeLow(): Hexadecimal { // Swap the bytes from little endian to network byte order. - /** @var array $hex */ + /** @var string[] $hex */ $hex = unpack( 'H*', pack( 'v*', hexdec(bin2hex(substr($this->bytes, 2, 2))), - hexdec(bin2hex(substr($this->bytes, 0, 2))) - ) + hexdec(bin2hex(substr($this->bytes, 0, 2))), + ), ); - return new Hexadecimal((string) ($hex[1] ?? '')); + return new Hexadecimal($hex[1] ?? ''); } public function getTimeMid(): Hexadecimal { // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v', - hexdec(bin2hex(substr($this->bytes, 4, 2))) - ) - ); + /** @var string[] $hex */ + $hex = unpack('H*', pack('v', hexdec(bin2hex(substr($this->bytes, 4, 2))))); - return new Hexadecimal((string) ($hex[1] ?? '')); + return new Hexadecimal($hex[1] ?? ''); } public function getTimeHiAndVersion(): Hexadecimal { // Swap the bytes from little endian to network byte order. - /** @var array $hex */ - $hex = unpack( - 'H*', - pack( - 'v', - hexdec(bin2hex(substr($this->bytes, 6, 2))) - ) - ); + /** @var string[] $hex */ + $hex = unpack('H*', pack('v', hexdec(bin2hex(substr($this->bytes, 6, 2))))); - return new Hexadecimal((string) ($hex[1] ?? '')); + return new Hexadecimal($hex[1] ?? ''); } public function getTimestamp(): Hexadecimal @@ -176,10 +161,10 @@ public function getVersion(): ?int return null; } - /** @var array $parts */ + /** @var int[] $parts */ $parts = unpack('n*', $this->bytes); - return ((int) $parts[4] >> 4) & 0x00f; + return ($parts[4] >> 4) & 0x00f; } private function isCorrectVariant(): bool diff --git a/lib/Google/vendor/ramsey/uuid/src/Guid/Guid.php b/lib/Google/vendor/ramsey/uuid/src/Guid/Guid.php index b3ed096ab..af551cfc1 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Guid/Guid.php +++ b/lib/Google/vendor/ramsey/uuid/src/Guid/Guid.php @@ -24,29 +24,25 @@ * * From Wikipedia: * - * > The first three fields are unsigned 32- and 16-bit integers and are subject - * > to swapping, while the last two fields consist of uninterpreted bytes, not - * > subject to swapping. This byte swapping applies even for versions 3, 4, and - * > 5, where the canonical fields do not correspond to the content of the UUID. + * > The first three fields are unsigned 32- and 16-bit integers and are subject to swapping, while the last two fields + * > consist of uninterpreted bytes, not subject to swapping. This byte swapping applies even for versions 3, 4, and 5, + * > where the canonical fields do not correspond to the content of the UUID. * - * The first three fields of a GUID are encoded in little-endian byte order, - * while the last three fields are in network (big-endian) byte order. This is - * according to the history of the Microsoft definition of a GUID. + * The first three fields of a GUID are encoded in little-endian byte order, while the last three fields are in network + * (big-endian) byte order. This is according to the history of the Microsoft GUID definition. * * According to the .NET Guid.ToByteArray method documentation: * - * > Note that the order of bytes in the returned byte array is different from - * > the string representation of a Guid value. The order of the beginning - * > four-byte group and the next two two-byte groups is reversed, whereas the - * > order of the last two-byte group and the closing six-byte group is the - * > same. + * > Note that the order of bytes in the returned byte array is different from the string representation of a Guid value. + * > The order of the beginning four-byte group and the next two two-byte groups is reversed, whereas the order of the + * > last two-byte group and the closing six-byte group is the same. * * @link https://en.wikipedia.org/wiki/Universally_unique_identifier#Variants UUID Variants on Wikipedia * @link https://docs.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid Windows GUID structure * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid .NET Guid Struct * @link https://docs.microsoft.com/en-us/dotnet/api/system.guid.tobytearray .NET Guid.ToByteArray Method * - * @psalm-immutable + * @immutable */ final class Guid extends Uuid { @@ -54,7 +50,7 @@ public function __construct( Fields $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { parent::__construct($fields, $numberConverter, $codec, $timeConverter); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Guid/GuidBuilder.php b/lib/Google/vendor/ramsey/uuid/src/Guid/GuidBuilder.php index c036bb20b..db743d9e6 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Guid/GuidBuilder.php +++ b/lib/Google/vendor/ramsey/uuid/src/Guid/GuidBuilder.php @@ -27,19 +27,18 @@ * * @see Guid * - * @psalm-immutable + * @immutable */ class GuidBuilder implements UuidBuilderInterface { /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Guid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the Guid + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to Unix timestamps */ public function __construct( private NumberConverterInterface $numberConverter, - private TimeConverterInterface $timeConverter + private TimeConverterInterface $timeConverter, ) { } @@ -51,27 +50,27 @@ public function __construct( * * @return Guid The GuidBuilder returns an instance of Ramsey\Uuid\Guid\Guid * - * @psalm-pure + * @pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface { try { - return new Guid( - $this->buildFields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); + /** @phpstan-ignore possiblyImpure.new */ + return new Guid($this->buildFields($bytes), $this->numberConverter, $codec, $this->timeConverter); } catch (Throwable $e) { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); } } /** - * Proxy method to allow injecting a mock, for testing + * Proxy method to allow injecting a mock for testing + * + * @pure */ protected function buildFields(string $bytes): Fields { + /** @phpstan-ignore possiblyImpure.new */ return new Fields($bytes); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php b/lib/Google/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php index c0b47bbf2..8d3129c07 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php +++ b/lib/Google/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php @@ -35,22 +35,18 @@ /** * Lazy version of a UUID: its format has not been determined yet, so it is mostly only usable for string/bytes - * conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of - * increased overhead for more advanced UUID operations. + * conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of increased + * overhead for more advanced UUID operations. * - * @internal this type is used internally for performance reasons, and is not supposed to be directly referenced - * in consumer libraries. + * > [!NOTE] + * > The {@see FieldsInterface} does not declare methods that deprecated API relies upon: the API has been ported from + * > the {@see \Ramsey\Uuid\Uuid} definition, and is deprecated anyway. * - * @psalm-immutable + * > [!NOTE] + * > The deprecated API from {@see \Ramsey\Uuid\Uuid} is in use here (on purpose): it will be removed once the + * > deprecated API is gone from this class too. * - * Note: the {@see FieldsInterface} does not declare methods that deprecated API - * relies upon: the API has been ported from the {@see \Ramsey\Uuid\Uuid} definition, - * and is deprecated anyway. - * Note: the deprecated API from {@see \Ramsey\Uuid\Uuid} is in use here (on purpose): it will be removed - * once the deprecated API is gone from this class too. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod + * @internal this type is used internally for performance reasons and is not supposed to be directly referenced in consumer libraries. */ final class LazyUuidFromString implements UuidInterface { @@ -59,13 +55,12 @@ final class LazyUuidFromString implements UuidInterface private ?UuidInterface $unwrapped = null; /** - * @psalm-param non-empty-string $uuid + * @param non-empty-string $uuid */ public function __construct(private string $uuid) { } - /** @psalm-pure */ public static function fromBytes(string $bytes): self { $base16Uuid = bin2hex($bytes); @@ -89,9 +84,7 @@ public function serialize(): string } /** - * @return array{string: string} - * - * @psalm-return array{string: non-empty-string} + * @return array{string: non-empty-string} */ public function __serialize(): array { @@ -101,9 +94,7 @@ public function __serialize(): array /** * {@inheritDoc} * - * @param string $data - * - * @psalm-param non-empty-string $data + * @param non-empty-string $data */ public function unserialize(string $data): void { @@ -111,10 +102,7 @@ public function unserialize(string $data): void } /** - * @param array{string?: string} $data - * - * @psalm-param array{string?: non-empty-string} $data - * @psalm-suppress UnusedMethodCall + * @param array{string?: non-empty-string} $data */ public function __unserialize(array $data): void { @@ -127,166 +115,125 @@ public function __unserialize(array $data): void $this->unserialize($data['string']); } - /** @psalm-suppress DeprecatedMethod */ public function getNumberConverter(): NumberConverterInterface { - return ($this->unwrapped ?? $this->unwrap()) - ->getNumberConverter(); + return ($this->unwrapped ?? $this->unwrap())->getNumberConverter(); } /** - * {@inheritDoc} - * - * @psalm-suppress DeprecatedMethod + * @inheritDoc */ public function getFieldsHex(): array { - return ($this->unwrapped ?? $this->unwrap()) - ->getFieldsHex(); + return ($this->unwrapped ?? $this->unwrap())->getFieldsHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getClockSeqHiAndReservedHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSeqHiAndReservedHex(); + return ($this->unwrapped ?? $this->unwrap())->getClockSeqHiAndReservedHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getClockSeqLowHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSeqLowHex(); + return ($this->unwrapped ?? $this->unwrap())->getClockSeqLowHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getClockSequenceHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getClockSequenceHex(); + return ($this->unwrapped ?? $this->unwrap())->getClockSequenceHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getDateTime(): DateTimeInterface { - return ($this->unwrapped ?? $this->unwrap()) - ->getDateTime(); + return ($this->unwrapped ?? $this->unwrap())->getDateTime(); } - /** @psalm-suppress DeprecatedMethod */ public function getLeastSignificantBitsHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getLeastSignificantBitsHex(); + return ($this->unwrapped ?? $this->unwrap())->getLeastSignificantBitsHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getMostSignificantBitsHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getMostSignificantBitsHex(); + return ($this->unwrapped ?? $this->unwrap())->getMostSignificantBitsHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getNodeHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getNodeHex(); + return ($this->unwrapped ?? $this->unwrap())->getNodeHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getTimeHiAndVersionHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeHiAndVersionHex(); + return ($this->unwrapped ?? $this->unwrap())->getTimeHiAndVersionHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getTimeLowHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeLowHex(); + return ($this->unwrapped ?? $this->unwrap())->getTimeLowHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getTimeMidHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimeMidHex(); + return ($this->unwrapped ?? $this->unwrap())->getTimeMidHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getTimestampHex(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getTimestampHex(); + return ($this->unwrapped ?? $this->unwrap())->getTimestampHex(); } - /** @psalm-suppress DeprecatedMethod */ public function getUrn(): string { - return ($this->unwrapped ?? $this->unwrap()) - ->getUrn(); + return ($this->unwrapped ?? $this->unwrap())->getUrn(); } - /** @psalm-suppress DeprecatedMethod */ public function getVariant(): ?int { - return ($this->unwrapped ?? $this->unwrap()) - ->getVariant(); + return ($this->unwrapped ?? $this->unwrap())->getVariant(); } - /** @psalm-suppress DeprecatedMethod */ public function getVersion(): ?int { - return ($this->unwrapped ?? $this->unwrap()) - ->getVersion(); + return ($this->unwrapped ?? $this->unwrap())->getVersion(); } public function compareTo(UuidInterface $other): int { - return ($this->unwrapped ?? $this->unwrap()) - ->compareTo($other); + return ($this->unwrapped ?? $this->unwrap())->compareTo($other); } public function equals(?object $other): bool { - if (! $other instanceof UuidInterface) { + if (!$other instanceof UuidInterface) { return false; } return $this->uuid === $other->toString(); } - /** - * {@inheritDoc} - * - * @psalm-suppress MoreSpecificReturnType - * @psalm-suppress LessSpecificReturnStatement we know that {@see self::$uuid} is a non-empty string, so - * we know that {@see hex2bin} will retrieve a non-empty string too. - */ public function getBytes(): string { - /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */ + /** + * @var non-empty-string + * @phpstan-ignore possiblyImpure.functionCall, possiblyImpure.functionCall + */ return (string) hex2bin(str_replace('-', '', $this->uuid)); } public function getFields(): FieldsInterface { - return ($this->unwrapped ?? $this->unwrap()) - ->getFields(); + return ($this->unwrapped ?? $this->unwrap())->getFields(); } public function getHex(): Hexadecimal { - return ($this->unwrapped ?? $this->unwrap()) - ->getHex(); + return ($this->unwrapped ?? $this->unwrap())->getHex(); } public function getInteger(): IntegerObject { - return ($this->unwrapped ?? $this->unwrap()) - ->getInteger(); + return ($this->unwrapped ?? $this->unwrap())->getInteger(); } public function toString(): string @@ -305,232 +252,149 @@ public function jsonSerialize(): string } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getClockSeqHiAndReserved()} + * and use the arbitrary-precision math library of your choice to convert it to a string integer. */ public function getClockSeqHiAndReserved(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeqHiAndReserved() - ->toString() - ); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getClockSeqHiAndReserved()->toString()); } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getClockSeqLow()} and use + * the arbitrary-precision math library of your choice to convert it to a string integer. */ public function getClockSeqLow(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeqLow() - ->toString() - ); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getClockSeqLow()->toString()); } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getClockSeq()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. */ public function getClockSequence(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getClockSeq() - ->toString() - ); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getClockSeq()->toString()); } /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getLeastSignificantBits(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex(substr($instance->getHex()->toString(), 16)); + return $instance->getNumberConverter()->fromHex(substr($instance->getHex()->toString(), 16)); } /** - * @deprecated This method will be removed in 5.0.0. There is no direct - * alternative, but the same information may be obtained by splitting - * in half the value returned by {@see UuidInterface::getHex()}. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated This method will be removed in 5.0.0. There is no direct alternative, but the same information may be + * obtained by splitting in half the value returned by {@see UuidInterface::getHex()}. */ public function getMostSignificantBits(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex(substr($instance->getHex()->toString(), 0, 16)); + return $instance->getNumberConverter()->fromHex(substr($instance->getHex()->toString(), 0, 16)); } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getNode()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getNode()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. */ public function getNode(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getNode() - ->toString() - ); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getNode()->toString()); } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimeHiAndVersion()} and + * use the arbitrary-precision math library of your choice to convert it to a string integer. */ public function getTimeHiAndVersion(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeHiAndVersion() - ->toString() - ); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getTimeHiAndVersion()->toString()); } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimeLow()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. */ public function getTimeLow(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeLow() - ->toString() - ); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getTimeLow()->toString()); } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimeMid()} and use the + * arbitrary-precision math library of your choice to convert it to a string integer. */ public function getTimeMid(): string { $instance = ($this->unwrapped ?? $this->unwrap()); - return $instance->getNumberConverter() - ->fromHex( - $instance->getFields() - ->getTimeMid() - ->toString() - ); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); + + return $instance->getNumberConverter()->fromHex($fields->getTimeMid()->toString()); } /** - * @deprecated Use {@see UuidInterface::getFields()} to get a - * {@see FieldsInterface} instance. If it is a {@see Rfc4122FieldsInterface} - * instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()} - * and use the arbitrary-precision math library of your choice to - * convert it to a string integer. - * - * @psalm-suppress UndefinedInterfaceMethod - * @psalm-suppress DeprecatedMethod - * @psalm-suppress MixedArgument - * @psalm-suppress MixedMethodCall + * @deprecated Use {@see UuidInterface::getFields()} to get a {@see FieldsInterface} instance. If it is a + * {@see Rfc4122FieldsInterface} instance, you may call {@see Rfc4122FieldsInterface::getTimestamp()} and use + * the arbitrary-precision math library of your choice to convert it to a string integer. */ public function getTimestamp(): string { $instance = ($this->unwrapped ?? $this->unwrap()); + $fields = $instance->getFields(); + assert($fields instanceof \Ramsey\Uuid\Rfc4122\FieldsInterface); if ($fields->getVersion() !== 1) { throw new UnsupportedOperationException('Not a time-based UUID'); } - return $instance->getNumberConverter() - ->fromHex($fields->getTimestamp()->toString()); + return $instance->getNumberConverter()->fromHex($fields->getTimestamp()->toString()); } public function toUuidV1(): UuidV1 @@ -555,18 +419,8 @@ public function toUuidV6(): UuidV6 return $instance; } - /** - * @psalm-suppress ImpureMethodCall the retrieval of the factory is a clear violation of purity here: this is a - * known pitfall of the design of this library, where a value object contains - * a mutable reference to a factory. We use a fixed factory here, so the violation - * will not have real-world effects, as this object is only instantiated with the - * default factory settings/features. - * @psalm-suppress InaccessibleProperty property {@see $unwrapped} is used as a cache: we don't expose it to the - * outside world, so we should be fine here. - */ private function unwrap(): UuidInterface { - return $this->unwrapped = (new UuidFactory()) - ->fromString($this->uuid); + return $this->unwrapped = (new UuidFactory())->fromString($this->uuid); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php b/lib/Google/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php index f065acd46..869835e9c 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php @@ -27,7 +27,7 @@ /** * A calculator using the brick/math library for arbitrary-precision arithmetic * - * @psalm-immutable + * @immutable */ final class BrickMathCalculator implements CalculatorInterface { @@ -49,9 +49,10 @@ public function add(NumberInterface $augend, NumberInterface ...$addends): Numbe $sum = BigInteger::of($augend->toString()); foreach ($addends as $addend) { - $sum = $sum->plus($addend->toString()); + $sum = $sum->plus($addend->toString()); /** @phpstan-ignore possiblyImpure.methodCall */ } + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ return new IntegerObject((string) $sum); } @@ -60,9 +61,10 @@ public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahen $difference = BigInteger::of($minuend->toString()); foreach ($subtrahends as $subtrahend) { - $difference = $difference->minus($subtrahend->toString()); + $difference = $difference->minus($subtrahend->toString()); /** @phpstan-ignore possiblyImpure.methodCall */ } + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ return new IntegerObject((string) $difference); } @@ -71,9 +73,11 @@ public function multiply(NumberInterface $multiplicand, NumberInterface ...$mult $product = BigInteger::of($multiplicand->toString()); foreach ($multipliers as $multiplier) { + /** @phpstan-ignore possiblyImpure.methodCall */ $product = $product->multipliedBy($multiplier->toString()); } + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ return new IntegerObject((string) $product); } @@ -81,26 +85,31 @@ public function divide( int $roundingMode, int $scale, NumberInterface $dividend, - NumberInterface ...$divisors + NumberInterface ...$divisors, ): NumberInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ $brickRounding = $this->getBrickRoundingMode($roundingMode); $quotient = BigDecimal::of($dividend->toString()); foreach ($divisors as $divisor) { + /** @phpstan-ignore possiblyImpure.methodCall */ $quotient = $quotient->dividedBy($divisor->toString(), $scale, $brickRounding); } if ($scale === 0) { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall, possiblyImpure.new */ return new IntegerObject((string) $quotient->toBigInteger()); } + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ return new Decimal((string) $quotient); } public function fromBase(string $value, int $base): IntegerObject { try { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ return new IntegerObject((string) BigInteger::fromBase($value, $base)); } catch (MathException | \InvalidArgumentException $exception) { throw new InvalidArgumentException( @@ -114,6 +123,7 @@ public function fromBase(string $value, int $base): IntegerObject public function toBase(IntegerObject $value, int $base): string { try { + /** @phpstan-ignore possiblyImpure.methodCall */ return BigInteger::of($value->toString())->toBase($base); } catch (MathException | \InvalidArgumentException $exception) { throw new InvalidArgumentException( @@ -126,6 +136,7 @@ public function toBase(IntegerObject $value, int $base): string public function toHexadecimal(IntegerObject $value): Hexadecimal { + /** @phpstan-ignore possiblyImpure.new */ return new Hexadecimal($this->toBase($value, 16)); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Math/CalculatorInterface.php b/lib/Google/vendor/ramsey/uuid/src/Math/CalculatorInterface.php index f03645d0f..e6789a6ea 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Math/CalculatorInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Math/CalculatorInterface.php @@ -21,7 +21,7 @@ /** * A calculator performs arithmetic operations on numbers * - * @psalm-immutable + * @immutable */ interface CalculatorInterface { @@ -32,6 +32,8 @@ interface CalculatorInterface * @param NumberInterface ...$addends The additional integers to a add to the augend * * @return NumberInterface The sum of all the parameters + * + * @pure */ public function add(NumberInterface $augend, NumberInterface ...$addends): NumberInterface; @@ -42,6 +44,8 @@ public function add(NumberInterface $augend, NumberInterface ...$addends): Numbe * @param NumberInterface ...$subtrahends The integers to subtract from the minuend * * @return NumberInterface The difference after subtracting all parameters + * + * @pure */ public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahends): NumberInterface; @@ -52,6 +56,8 @@ public function subtract(NumberInterface $minuend, NumberInterface ...$subtrahen * @param NumberInterface ...$multipliers The factors by which to multiply the multiplicand * * @return NumberInterface The product of multiplying all the provided parameters + * + * @pure */ public function multiply(NumberInterface $multiplicand, NumberInterface ...$multipliers): NumberInterface; @@ -61,17 +67,18 @@ public function multiply(NumberInterface $multiplicand, NumberInterface ...$mult * @param int $roundingMode The RoundingMode constant to use for this operation * @param int $scale The scale to use for this operation * @param NumberInterface $dividend The integer to be divided - * @param NumberInterface ...$divisors The integers to divide $dividend by, in - * the order in which the division operations should take place - * (left-to-right) + * @param NumberInterface ...$divisors The integers to divide $dividend by, in the order in which the division + * operations should take place (left-to-right) * * @return NumberInterface The quotient of dividing the provided parameters left-to-right + * + * @pure */ public function divide( int $roundingMode, int $scale, NumberInterface $dividend, - NumberInterface ...$divisors + NumberInterface ...$divisors, ): NumberInterface; /** @@ -81,6 +88,8 @@ public function divide( * @param int $base The base to convert from (i.e., 2, 16, 32, etc.) * * @return IntegerObject The base-10 integer value of the converted value + * + * @pure */ public function fromBase(string $value, int $base): IntegerObject; @@ -91,16 +100,22 @@ public function fromBase(string $value, int $base): IntegerObject; * @param int $base The base to convert to (i.e., 2, 16, 32, etc.) * * @return string The value represented in the specified base + * + * @pure */ public function toBase(IntegerObject $value, int $base): string; /** * Converts an Integer instance to a Hexadecimal instance + * + * @pure */ public function toHexadecimal(IntegerObject $value): Hexadecimal; /** * Converts a Hexadecimal instance to an Integer instance + * + * @pure */ public function toInteger(Hexadecimal $value): IntegerObject; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Math/RoundingMode.php b/lib/Google/vendor/ramsey/uuid/src/Math/RoundingMode.php index e710270d0..1497aa6a6 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Math/RoundingMode.php +++ b/lib/Google/vendor/ramsey/uuid/src/Math/RoundingMode.php @@ -31,116 +31,97 @@ namespace Ramsey\Uuid\Math; /** - * Specifies a rounding behavior for numerical operations capable of discarding - * precision. + * Specifies a rounding behavior for numerical operations capable of discarding precision. * - * Each rounding mode indicates how the least significant returned digit of a - * rounded result is to be calculated. If fewer digits are returned than the - * digits needed to represent the exact numerical result, the discarded digits - * will be referred to as the discarded fraction regardless the digits' - * contribution to the value of the number. In other words, considered as a - * numerical value, the discarded fraction could have an absolute value greater - * than one. + * Each rounding mode indicates how the least significant returned digit of a rounded result is to be calculated. If + * fewer digits are returned than the digits needed to represent the exact numerical result, the discarded digits will + * be referred to as the discarded fraction regardless of the digits' contribution to the value of the number. In other + * words, considered as a numerical value, the discarded fraction could have an absolute value greater than one. */ final class RoundingMode { /** - * Private constructor. This class is not instantiable. - * - * @codeCoverageIgnore - */ - private function __construct() - { - } - - /** - * Asserts that the requested operation has an exact result, hence no - * rounding is necessary. + * Asserts that the requested operation has an exact result; hence no rounding is necessary. */ public const UNNECESSARY = 0; /** * Rounds away from zero. * - * Always increments the digit prior to a nonzero discarded fraction. - * Note that this rounding mode never decreases the magnitude of the - * calculated value. + * Always increments the digit prior to a nonzero discarded fraction. Note that this rounding mode never decreases + * the magnitude of the calculated value. */ public const UP = 1; /** * Rounds towards zero. * - * Never increments the digit prior to a discarded fraction (i.e., - * truncates). Note that this rounding mode never increases the magnitude of - * the calculated value. + * Never increments the digit prior to a discarded fraction (i.e., truncates). Note that this rounding mode never + * increases the magnitude of the calculated value. */ public const DOWN = 2; /** * Rounds towards positive infinity. * - * If the result is positive, behaves as for UP; if negative, behaves as for - * DOWN. Note that this rounding mode never decreases the calculated value. + * If the result is positive, behaves as for UP; if negative, behaves as for DOWN. Note that this rounding mode + * never decreases the calculated value. */ public const CEILING = 3; /** * Rounds towards negative infinity. * - * If the result is positive, behave as for DOWN; if negative, behave as for - * UP. Note that this rounding mode never increases the calculated value. + * If the result is positive, behave as for DOWN; if negative, behave as for UP. Note that this rounding mode never + * increases the calculated value. */ public const FLOOR = 4; /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round up. + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. * - * Behaves as for UP if the discarded fraction is >= 0.5; otherwise, behaves - * as for DOWN. Note that this is the rounding mode commonly taught at - * school. + * Behaves as for UP if the discarded fraction is >= 0.5; otherwise, behaves as for DOWN. Note that this is the + * rounding mode commonly taught at school. */ public const HALF_UP = 5; /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round down. + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. * - * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves - * as for DOWN. + * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves as for DOWN. */ public const HALF_DOWN = 6; /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round towards positive infinity. + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards positive infinity. * - * If the result is positive, behaves as for HALF_UP; if negative, behaves - * as for HALF_DOWN. + * If the result is positive, behaves as for HALF_UP; if negative, behaves as for HALF_DOWN. */ public const HALF_CEILING = 7; /** - * Rounds towards "nearest neighbor" unless both neighbors are equidistant, - * in which case round towards negative infinity. + * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards negative infinity. * - * If the result is positive, behaves as for HALF_DOWN; if negative, behaves - * as for HALF_UP. + * If the result is positive, behaves as for HALF_DOWN; if negative, behaves as for HALF_UP. */ public const HALF_FLOOR = 8; /** - * Rounds towards the "nearest neighbor" unless both neighbors are - * equidistant, in which case rounds towards the even neighbor. + * Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the even neighbor. * - * Behaves as for HALF_UP if the digit to the left of the discarded fraction - * is odd; behaves as for HALF_DOWN if it's even. + * Behaves as for HALF_UP if the digit to the left of the discarded fraction is odd; behaves as for HALF_DOWN if it's even. * - * Note that this is the rounding mode that statistically minimizes - * cumulative error when applied repeatedly over a sequence of calculations. - * It is sometimes known as "Banker's rounding", and is chiefly used in the - * USA. + * Note that this is the rounding mode that statistically minimizes cumulative error when applied repeatedly over a + * sequence of calculations. It is sometimes known as "Banker's rounding", and is chiefly used in the USA. */ public const HALF_EVEN = 9; + + /** + * Private constructor. This class is not instantiable. + * + * @codeCoverageIgnore + */ + private function __construct() + { + } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Fields.php b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Fields.php index 5dfe61076..d309c9a6b 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Fields.php +++ b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Fields.php @@ -31,16 +31,14 @@ use const STR_PAD_LEFT; /** - * Nonstandard UUID fields do not conform to the RFC 4122 standard + * Nonstandard UUID fields do not conform to the RFC 9562 (formerly RFC 4122) standard * - * Since some systems may create nonstandard UUIDs, this implements the - * Rfc4122\FieldsInterface, so that functionality of a nonstandard UUID is not - * degraded, in the event these UUIDs are expected to contain RFC 4122 fields. + * Since some systems may create nonstandard UUIDs, this implements the {@see FieldsInterface}, so that functionality of + * a nonstandard UUID is not degraded, in the event these UUIDs are expected to contain RFC 9562 (formerly RFC 4122) fields. * - * Internally, this class represents the fields together as a 16-byte binary - * string. + * Internally, this class represents the fields together as a 16-byte binary string. * - * @psalm-immutable + * @immutable */ final class Fields implements FieldsInterface { @@ -56,8 +54,7 @@ public function __construct(private string $bytes) { if (strlen($this->bytes) !== 16) { throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($this->bytes) . ' bytes' + 'The byte string must be 16 bytes long; received ' . strlen($this->bytes) . ' bytes', ); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Uuid.php b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Uuid.php index 715f82554..7f15e6e17 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Uuid.php +++ b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/Uuid.php @@ -20,9 +20,10 @@ use Ramsey\Uuid\Uuid as BaseUuid; /** - * Nonstandard\Uuid is a UUID that doesn't conform to RFC 4122 + * Nonstandard\Uuid is a UUID that doesn't conform to RFC 9562 (formerly RFC 4122) * - * @psalm-immutable + * @immutable + * @pure */ final class Uuid extends BaseUuid { @@ -30,7 +31,7 @@ public function __construct( Fields $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { parent::__construct($fields, $numberConverter, $codec, $timeConverter); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php index 82efd402f..74da99264 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php +++ b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php @@ -25,19 +25,18 @@ /** * Nonstandard\UuidBuilder builds instances of Nonstandard\Uuid * - * @psalm-immutable + * @immutable */ class UuidBuilder implements UuidBuilderInterface { /** - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Nonstandard\Uuid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to Unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the Nonstandard\Uuid + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to Unix timestamps */ public function __construct( private NumberConverterInterface $numberConverter, - private TimeConverterInterface $timeConverter + private TimeConverterInterface $timeConverter, ) { } @@ -47,30 +46,29 @@ public function __construct( * @param CodecInterface $codec The codec to use for building this instance * @param string $bytes The byte string from which to construct a UUID * - * @return Uuid The Nonstandard\UuidBuilder returns an instance of - * Nonstandard\Uuid + * @return Uuid The Nonstandard\UuidBuilder returns an instance of Nonstandard\Uuid * - * @psalm-pure + * @pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface { try { - return new Uuid( - $this->buildFields($bytes), - $this->numberConverter, - $codec, - $this->timeConverter - ); + /** @phpstan-ignore possiblyImpure.new */ + return new Uuid($this->buildFields($bytes), $this->numberConverter, $codec, $this->timeConverter); } catch (Throwable $e) { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); } } /** - * Proxy method to allow injecting a mock, for testing + * Proxy method to allow injecting a mock for testing + * + * @pure */ protected function buildFields(string $bytes): Fields { + /** @phpstan-ignore possiblyImpure.new */ return new Fields($bytes); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php index 7497dd101..e277afcc6 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php +++ b/lib/Google/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php @@ -26,41 +26,39 @@ use Ramsey\Uuid\Uuid as BaseUuid; /** - * Reordered time, or version 6, UUIDs include timestamp, clock sequence, and - * node values that are combined into a 128-bit unsigned integer + * Reordered time, or version 6, UUIDs include timestamp, clock sequence, and node values that are combined into a + * 128-bit unsigned integer * * @deprecated Use {@see \Ramsey\Uuid\Rfc4122\UuidV6} instead. * * @link https://github.com/uuid6/uuid6-ietf-draft UUID version 6 IETF draft * @link http://gh.peabody.io/uuidv6/ "Version 6" UUIDs + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.6 RFC 9562, 5.6. UUID Version 6 * - * @psalm-immutable + * @immutable */ class UuidV6 extends BaseUuid implements UuidInterface { use TimeTrait; /** - * Creates a version 6 (reordered time) UUID + * Creates a version 6 (reordered Gregorian time) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { - if ($fields->getVersion() !== Uuid::UUID_TYPE_REORDERED_TIME) { + if ($fields->getVersion() !== BaseUuid::UUID_TYPE_REORDERED_TIME) { throw new InvalidArgumentException( - 'Fields used to create a UuidV6 must represent a ' - . 'version 6 (reordered time) UUID' + 'Fields used to create a UuidV6 must represent a version 6 (reordered time) UUID', ); } @@ -80,7 +78,7 @@ public function toUuidV1(): UuidV1 . substr($hex, 16); /** @var LazyUuidFromString $uuid */ - $uuid = Uuid::fromBytes((string) hex2bin($hex)); + $uuid = BaseUuid::fromBytes((string) hex2bin($hex)); return $uuid->toUuidV1(); } @@ -98,7 +96,7 @@ public static function fromUuidV1(UuidV1 $uuidV1): \Ramsey\Uuid\Rfc4122\UuidV6 . substr($hex, 16); /** @var LazyUuidFromString $uuid */ - $uuid = Uuid::fromBytes((string) hex2bin($hex)); + $uuid = BaseUuid::fromBytes((string) hex2bin($hex)); return $uuid->toUuidV6(); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php b/lib/Google/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php index d5b6cf0c0..830ffdd96 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php @@ -41,7 +41,7 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface */ public function getUid(): IntegerObject { - /** @var int|float|string|IntegerObject|null $uid */ + /** @var IntegerObject | int | float | string | null $uid */ static $uid = null; if ($uid instanceof IntegerObject) { @@ -54,9 +54,8 @@ public function getUid(): IntegerObject if ($uid === '') { throw new DceSecurityException( - 'Unable to get a user identifier using the system DCE ' - . 'Security provider; please provide a custom identifier or ' - . 'use a different provider' + 'Unable to get a user identifier using the system DCE Security provider; please provide a custom ' + . 'identifier or use a different provider', ); } @@ -72,7 +71,7 @@ public function getUid(): IntegerObject */ public function getGid(): IntegerObject { - /** @var int|float|string|IntegerObject|null $gid */ + /** @var IntegerObject | int | float | string | null $gid */ static $gid = null; if ($gid instanceof IntegerObject) { @@ -85,9 +84,8 @@ public function getGid(): IntegerObject if ($gid === '') { throw new DceSecurityException( - 'Unable to get a group identifier using the system DCE ' - . 'Security provider; please provide a custom identifier or ' - . 'use a different provider' + 'Unable to get a group identifier using the system DCE Security provider; please provide a custom ' + . 'identifier or use a different provider', ); } @@ -131,9 +129,7 @@ private function getSystemGid(): string */ private function hasShellExec(): bool { - $disabledFunctions = strtolower((string) ini_get('disable_functions')); - - return !str_contains($disabledFunctions, 'shell_exec'); + return !str_contains(strtolower((string) ini_get('disable_functions')), 'shell_exec'); } /** @@ -141,10 +137,7 @@ private function hasShellExec(): bool */ private function getOs(): string { - /** - * @psalm-suppress UnnecessaryVarAnnotation - * @var string $phpOs - */ + /** @var string $phpOs */ $phpOs = constant('PHP_OS'); return strtoupper(substr($phpOs, 0, 3)); @@ -153,17 +146,14 @@ private function getOs(): string /** * Returns the user identifier for a user on a Windows system * - * Windows does not have the same concept as an effective POSIX UID for the - * running script. Instead, each user is uniquely identified by an SID - * (security identifier). The SID includes three 32-bit unsigned integers - * that make up a unique domain identifier, followed by an RID (relative - * identifier) that we will use as the UID. The primary caveat is that this - * UID may not be unique to the system, since it is, instead, unique to the - * domain. + * Windows does not have the same concept as an effective POSIX UID for the running script. Instead, each user is + * uniquely identified by an SID (security identifier). The SID includes three 32-bit unsigned integers that make up + * a unique domain identifier, followed by an RID (relative identifier) that we will use as the UID. The primary + * caveat is that this UID may not be unique to the system, since it is, instead, unique to the domain. * * @link https://www.lifewire.com/what-is-an-sid-number-2626005 What Is an SID Number? - * @link https://bit.ly/30vE7NM Well-known SID Structures - * @link https://bit.ly/2FWcYKJ Well-known security identifiers in Windows operating systems + * @link https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/81d92bba-d22b-4a8c-908a-554ab29148ab Well-known SID Structures + * @link https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers#well-known-sids Well-known SIDs * @link https://www.windows-commandline.com/get-sid-of-user/ Get SID of user */ private function getWindowsUid(): string @@ -174,7 +164,7 @@ private function getWindowsUid(): string return ''; } - $sid = str_getcsv(trim((string) $response))[1] ?? ''; + $sid = str_getcsv(trim((string) $response), escape: '\\')[1] ?? ''; if (($lastHyphen = strrpos($sid, '-')) === false) { return ''; @@ -186,11 +176,10 @@ private function getWindowsUid(): string /** * Returns a group identifier for a user on a Windows system * - * Since Windows does not have the same concept as an effective POSIX GID - * for the running script, we will get the local group memberships for the - * user running the script. Then, we will get the SID (security identifier) - * for the first group that appears in that list. Finally, we will return - * the RID (relative identifier) for the group and use that as the GID. + * Since Windows does not have the same concept as an effective POSIX GID for the running script, we will get the + * local group memberships for the user running the script. Then, we will get the SID (security identifier) for the + * first group that appears in that list. Finally, we will return the RID (relative identifier) for the group and + * use that as the GID. * * @link https://www.windows-commandline.com/list-of-user-groups-command-line/ List of user groups command line */ @@ -202,9 +191,7 @@ private function getWindowsGid(): string return ''; } - /** @var string[] $userGroups */ $userGroups = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); - $firstGroup = trim($userGroups[1] ?? '', "* \t\n\r\0\x0B"); if ($firstGroup === '') { @@ -217,9 +204,7 @@ private function getWindowsGid(): string return ''; } - /** @var string[] $userGroup */ $userGroup = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY); - $sid = $userGroup[1] ?? ''; if (($lastHyphen = strrpos($sid, '-')) === false) { diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php b/lib/Google/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php index 8325da696..f1c3e97c6 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php @@ -18,8 +18,7 @@ use Ramsey\Uuid\Type\Integer as IntegerObject; /** - * A DCE provider provides access to local domain identifiers for version 2, - * DCE Security, UUIDs + * A DCE provider provides access to local domain identifiers for version 2, DCE Security, UUIDs * * @see UuidV2 */ diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php index d2eb20b70..267ea9bf0 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php @@ -19,8 +19,7 @@ use Ramsey\Uuid\Type\Hexadecimal; /** - * FallbackNodeProvider retrieves the system node ID by stepping through a list - * of providers until a node ID can be obtained + * FallbackNodeProvider retrieves the system node ID by stepping through a list of providers until a node ID can be obtained */ class FallbackNodeProvider implements NodeProviderInterface { @@ -45,10 +44,6 @@ public function getNode(): Hexadecimal } } - throw new NodeException( - 'Unable to find a suitable node provider', - 0, - $lastProviderException - ); + throw new NodeException(message: 'Unable to find a suitable node provider', previous: $lastProviderException); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php index 1b979faee..1d4908a1d 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php @@ -21,10 +21,10 @@ /** * A collection of NodeProviderInterface objects * - * @deprecated this class has been deprecated, and will be removed in 5.0.0. The use-case for this class comes from - * a pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced - * at runtime: that is no longer necessary, now that you can safely verify your code to be correct, and use - * more generic types like `iterable` instead. + * @deprecated this class has been deprecated and will be removed in 5.0.0. The use-case for this class comes from a + * pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced at runtime: + * that is no longer necessary, now that you can safely verify your code to be correct and use more generic types + * like `iterable` instead. * * @extends AbstractCollection */ @@ -38,11 +38,7 @@ public function getType(): string /** * Re-constructs the object from its serialized form * - * @param string $serialized The serialized PHP string to unserialize into - * a UuidInterface instance - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - * @psalm-suppress RedundantConditionGivenDocblockType + * @param string $serialized The serialized PHP string to unserialize into a UuidInterface instance */ public function unserialize($serialized): void { @@ -56,11 +52,7 @@ public function unserialize($serialized): void ], ]); - $this->data = array_filter( - $data, - function ($unserialized): bool { - return $unserialized instanceof NodeProviderInterface; - } - ); + /** @phpstan-ignore-next-line */ + $this->data = array_filter($data, fn ($unserialized): bool => $unserialized instanceof NodeProviderInterface); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php index 76141361b..9334ce0e5 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php @@ -31,7 +31,7 @@ /** * RandomNodeProvider generates a random node ID * - * @link http://tools.ietf.org/html/rfc4122#section-4.5 RFC 4122, § 4.5: Node IDs that Do Not Identify the Host + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.10 RFC 9562, 6.10. UUIDs That Do Not Identify the Host */ class RandomNodeProvider implements NodeProviderInterface { @@ -40,30 +40,16 @@ public function getNode(): Hexadecimal try { $nodeBytes = random_bytes(6); } catch (Throwable $exception) { - throw new RandomSourceException( - $exception->getMessage(), - (int) $exception->getCode(), - $exception - ); + throw new RandomSourceException($exception->getMessage(), (int) $exception->getCode(), $exception); } // Split the node bytes for math on 32-bit systems. $nodeMsb = substr($nodeBytes, 0, 3); $nodeLsb = substr($nodeBytes, 3); - // Set the multicast bit; see RFC 4122, section 4.5. - $nodeMsb = hex2bin( - str_pad( - dechex(hexdec(bin2hex($nodeMsb)) | 0x010000), - 6, - '0', - STR_PAD_LEFT - ) - ); + // Set the multicast bit; see RFC 9562, section 6.10. + $nodeMsb = hex2bin(str_pad(dechex(hexdec(bin2hex($nodeMsb)) | 0x010000), 6, '0', STR_PAD_LEFT)); - // Recombine the node bytes. - $node = $nodeMsb . $nodeLsb; - - return new Hexadecimal(str_pad(bin2hex($node), 12, '0', STR_PAD_LEFT)); + return new Hexadecimal(str_pad(bin2hex($nodeMsb . $nodeLsb), 12, '0', STR_PAD_LEFT)); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php index 0f7536a82..612ccd9a6 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php @@ -28,7 +28,7 @@ /** * StaticNodeProvider provides a static node value with the multicast bit set * - * @link http://tools.ietf.org/html/rfc4122#section-4.5 RFC 4122, § 4.5: Node IDs that Do Not Identify the Host + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.10 RFC 9562, 6.10. UUIDs That Do Not Identify the Host */ class StaticNodeProvider implements NodeProviderInterface { @@ -40,9 +40,7 @@ class StaticNodeProvider implements NodeProviderInterface public function __construct(Hexadecimal $node) { if (strlen($node->toString()) > 12) { - throw new InvalidArgumentException( - 'Static node value cannot be greater than 12 hexadecimal characters' - ); + throw new InvalidArgumentException('Static node value cannot be greater than 12 hexadecimal characters'); } $this->node = $this->setMulticastBit($node); @@ -60,13 +58,7 @@ private function setMulticastBit(Hexadecimal $node): Hexadecimal { $nodeHex = str_pad($node->toString(), 12, '0', STR_PAD_LEFT); $firstOctet = substr($nodeHex, 0, 2); - - $firstOctet = str_pad( - dechex(hexdec($firstOctet) | 0x01), - 2, - '0', - STR_PAD_LEFT - ); + $firstOctet = str_pad(dechex(hexdec($firstOctet) | 0x01), 2, '0', STR_PAD_LEFT); return new Hexadecimal($firstOctet . substr($nodeHex, 2)); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php index a03c93b4d..05e2ea820 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php @@ -39,13 +39,12 @@ /** * SystemNodeProvider retrieves the system node ID, if possible * - * The system node ID, or host ID, is often the same as the MAC address for a - * network interface on the host. + * The system node ID, or host ID, is often the same as the MAC address for a network interface on the host. */ class SystemNodeProvider implements NodeProviderInterface { /** - * Pattern to match nodes in ifconfig and ipconfig output. + * Pattern to match nodes in `ifconfig` and `ipconfig` output. */ private const IFCONFIG_PATTERN = '/[^:]([0-9a-f]{2}([:-])[0-9a-f]{2}(\2[0-9a-f]{2}){4})[^:]/i'; @@ -59,23 +58,22 @@ public function getNode(): Hexadecimal $node = $this->getNodeFromSystem(); if ($node === '') { - throw new NodeException( - 'Unable to fetch a node for this system' - ); + throw new NodeException('Unable to fetch a node for this system'); } return new Hexadecimal($node); } /** - * Returns the system node, if it can find it + * Returns the system node if found */ protected function getNodeFromSystem(): string { + /** @var string | null $node */ static $node = null; if ($node !== null) { - return (string) $node; + return $node; } // First, try a Linux-specific approach. @@ -98,16 +96,11 @@ protected function getNodeFromSystem(): string */ protected function getIfconfig(): string { - $disabledFunctions = strtolower((string) ini_get('disable_functions')); - - if (str_contains($disabledFunctions, 'passthru')) { + if (str_contains(strtolower((string) ini_get('disable_functions')), 'passthru')) { return ''; } - /** - * @psalm-suppress UnnecessaryVarAnnotation - * @var string $phpOs - */ + /** @var string $phpOs */ $phpOs = constant('PHP_OS'); ob_start(); @@ -149,44 +142,42 @@ protected function getIfconfig(): string */ protected function getSysfs(): string { - $mac = ''; - - /** - * @psalm-suppress UnnecessaryVarAnnotation - * @var string $phpOs - */ + /** @var string $phpOs */ $phpOs = constant('PHP_OS'); - if (strtoupper($phpOs) === 'LINUX') { - $addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT); + if (strtoupper($phpOs) !== 'LINUX') { + return ''; + } + + $addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT); - if ($addressPaths === false || count($addressPaths) === 0) { - return ''; - } + if ($addressPaths === false || count($addressPaths) === 0) { + return ''; + } - /** @var array $macs */ - $macs = []; + /** @var array $macs */ + $macs = []; - array_walk($addressPaths, function (string $addressPath) use (&$macs): void { - if (is_readable($addressPath)) { - $macs[] = file_get_contents($addressPath); - } - }); + array_walk($addressPaths, function (string $addressPath) use (&$macs): void { + if (is_readable($addressPath)) { + $macs[] = file_get_contents($addressPath); + } + }); - /** @var callable $trim */ - $trim = 'trim'; + /** @var callable $trim */ + $trim = 'trim'; - $macs = array_map($trim, $macs); + $macs = array_map($trim, $macs); - // Remove invalid entries. - $macs = array_filter($macs, function (string $address) { - return $address !== '00:00:00:00:00:00' - && preg_match(self::SYSFS_PATTERN, $address); - }); + // Remove invalid entries. + $macs = array_filter($macs, function (mixed $address): bool { + assert(is_string($address)); - /** @var string|bool $mac */ - $mac = reset($macs); - } + return $address !== '00:00:00:00:00:00' && preg_match(self::SYSFS_PATTERN, $address); + }); + + /** @var bool | string $mac */ + $mac = reset($macs); return (string) $mac; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php b/lib/Google/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php index 526c8ff46..68d9f10ad 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php +++ b/lib/Google/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php @@ -21,8 +21,7 @@ /** * FixedTimeProvider uses a known time to provide the time * - * This provider allows the use of a previously-generated, or known, time - * when generating time-based UUIDs. + * This provider allows the use of a previously generated, or known, time when generating time-based UUIDs. */ class FixedTimeProvider implements TimeProviderInterface { @@ -33,7 +32,7 @@ public function __construct(private Time $time) /** * Sets the `usec` component of the time * - * @param int|string|IntegerObject $value The `usec` value to set + * @param IntegerObject | int | string $value The `usec` value to set */ public function setUsec($value): void { @@ -43,7 +42,7 @@ public function setUsec($value): void /** * Sets the `sec` component of the time * - * @param int|string|IntegerObject $value The `sec` value to set + * @param IntegerObject | int | string $value The `sec` value to set */ public function setSec($value): void { diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Fields.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Fields.php index 9acf810c2..4f607d54b 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Fields.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Fields.php @@ -31,12 +31,11 @@ use const STR_PAD_LEFT; /** - * RFC 4122 variant UUIDs are comprised of a set of named fields + * RFC 9562 (formerly RFC 4122) variant UUIDs consist of a set of named fields * - * Internally, this class represents the fields together as a 16-byte binary - * string. + * Internally, this class represents the fields together as a 16-byte binary string. * - * @psalm-immutable + * @immutable */ final class Fields implements FieldsInterface { @@ -50,31 +49,33 @@ final class Fields implements FieldsInterface * @param string $bytes A 16-byte binary string representation of a UUID * * @throws InvalidArgumentException if the byte string is not exactly 16 bytes - * @throws InvalidArgumentException if the byte string does not represent an RFC 4122 UUID + * @throws InvalidArgumentException if the byte string does not represent an RFC 9562 (formerly RFC 4122) UUID * @throws InvalidArgumentException if the byte string does not contain a valid version */ public function __construct(private string $bytes) { if (strlen($this->bytes) !== 16) { throw new InvalidArgumentException( - 'The byte string must be 16 bytes long; ' - . 'received ' . strlen($this->bytes) . ' bytes' + 'The byte string must be 16 bytes long; ' . 'received ' . strlen($this->bytes) . ' bytes', ); } if (!$this->isCorrectVariant()) { throw new InvalidArgumentException( - 'The byte string received does not conform to the RFC 4122 variant' + 'The byte string received does not conform to the RFC 9562 (formerly RFC 4122) variant', ); } if (!$this->isCorrectVersion()) { throw new InvalidArgumentException( - 'The byte string received does not contain a valid RFC 4122 version' + 'The byte string received does not contain a valid RFC 9562 (formerly RFC 4122) version', ); } } + /** + * @pure + */ public function getBytes(): string { return $this->bytes; @@ -126,21 +127,18 @@ public function getTimeMid(): Hexadecimal /** * Returns the full 60-bit timestamp, without the version * - * For version 2 UUIDs, the time_low field is the local identifier and - * should not be returned as part of the time. For this reason, we set the - * bottom 32 bits of the timestamp to 0's. As a result, there is some loss - * of fidelity of the timestamp, for version 2 UUIDs. The timestamp can be - * off by a range of 0 to 429.4967295 seconds (or 7 minutes, 9 seconds, and - * 496730 microseconds). + * For version 2 UUIDs, the time_low field is the local identifier and should not be returned as part of the time. + * For this reason, we set the bottom 32 bits of the timestamp to 0's. As a result, there is some loss of timestamp + * fidelity, for version 2 UUIDs. The timestamp can be off by a range of 0 to 429.4967295 seconds (or 7 minutes, 9 + * seconds, and 496,730 microseconds). * - * For version 6 UUIDs, the timestamp order is reversed from the typical RFC - * 4122 order (the time bits are in the correct bit order, so that it is - * monotonically increasing). In returning the timestamp value, we put the - * bits in the order: time_low + time_mid + time_hi. + * For version 6 UUIDs, the timestamp order is reversed from the typical RFC 9562 (formerly RFC 4122) order (the + * time bits are in the correct bit order, so that it is monotonically increasing). In returning the timestamp + * value, we put the bits in the order: time_low + time_mid + time_hi. */ public function getTimestamp(): Hexadecimal { - $timestamp = match ($this->getVersion()) { + return new Hexadecimal(match ($this->getVersion()) { Uuid::UUID_TYPE_DCE_SECURITY => sprintf( '%03x%04s%08s', hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff, @@ -153,9 +151,8 @@ public function getTimestamp(): Hexadecimal $this->getTimeMid()->toString(), hexdec($this->getTimeHiAndVersion()->toString()) & 0x0fff ), - // The Unix timestamp in version 7 UUIDs is a 48-bit number, - // but for consistency, we will return a 60-bit number, padded - // to the left with zeros. + // The Unix timestamp in version 7 UUIDs is a 48-bit number, but for consistency, we will return a 60-bit + // number, padded to the left with zeros. Uuid::UUID_TYPE_UNIX_TIME => sprintf( '%011s%04s', $this->getTimeLow()->toString(), @@ -167,9 +164,7 @@ public function getTimestamp(): Hexadecimal $this->getTimeMid()->toString(), $this->getTimeLow()->toString() ), - }; - - return new Hexadecimal($timestamp); + }); } public function getVersion(): ?int diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php index 2241cf574..13d86d9df 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php @@ -18,30 +18,30 @@ use Ramsey\Uuid\Type\Hexadecimal; /** - * RFC 4122 defines fields for a specific variant of UUID + * UUID fields, as defined by RFC 4122 + * + * This interface defines the fields of an RFC 4122 variant UUID. Since RFC 9562 removed the concept of fields and + * instead defined layouts that are specific to a given version, this interface is a legacy artifact of the earlier, and + * now obsolete, RFC 4122. * * The fields of an RFC 4122 variant UUID are: * * * **time_low**: The low field of the timestamp, an unsigned 32-bit integer * * **time_mid**: The middle field of the timestamp, an unsigned 16-bit integer - * * **time_hi_and_version**: The high field of the timestamp multiplexed with - * the version number, an unsigned 16-bit integer - * * **clock_seq_hi_and_reserved**: The high field of the clock sequence - * multiplexed with the variant, an unsigned 8-bit integer - * * **clock_seq_low**: The low field of the clock sequence, an unsigned - * 8-bit integer - * * **node**: The spatially unique node identifier, an unsigned 48-bit - * integer + * * **time_hi_and_version**: The high field of the timestamp multiplexed with the version number, an unsigned 16-bit integer + * * **clock_seq_hi_and_reserved**: The high field of the clock sequence multiplexed with the variant, an unsigned 8-bit integer + * * **clock_seq_low**: The low field of the clock sequence, an unsigned 8-bit integer + * * **node**: The spatially unique node identifier, an unsigned 48-bit integer * - * @link http://tools.ietf.org/html/rfc4122#section-4.1 RFC 4122, § 4.1: Format + * @link https://www.rfc-editor.org/rfc/rfc4122#section-4.1 RFC 4122, 4.1. Format + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4 RFC 9562, 4. UUID Format * - * @psalm-immutable + * @immutable */ interface FieldsInterface extends BaseFieldsInterface { /** - * Returns the full 16-bit clock sequence, with the variant bits (two most - * significant bits) masked out + * Returns the full 16-bit clock sequence, with the variant bits (two most significant bits) masked out */ public function getClockSeq(): Hexadecimal; @@ -83,46 +83,48 @@ public function getTimestamp(): Hexadecimal; /** * Returns the variant * - * The variant number describes the layout of the UUID. The variant - * number has the following meaning: + * The variant number describes the layout of the UUID. The variant number has the following meaning: * * - 0 - Reserved for NCS backward compatibility - * - 2 - The RFC 4122 variant + * - 2 - The RFC 9562 (formerly RFC 4122) variant * - 6 - Reserved, Microsoft Corporation backward compatibility * - 7 - Reserved for future definition * - * For RFC 4122 variant UUIDs, this value should always be the integer `2`. + * For RFC 9562 (formerly RFC 4122) variant UUIDs, this value should always be the integer `2`. * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field */ public function getVariant(): int; /** - * Returns the version + * Returns the UUID version * - * The version number describes how the UUID was generated and has the - * following meaning: + * The version number describes how the UUID was generated and has the following meaning: * * 1. Gregorian time UUID * 2. DCE security UUID * 3. Name-based UUID hashed with MD5 * 4. Randomly generated UUID * 5. Name-based UUID hashed with SHA-1 - * 6. Reordered time UUID + * 6. Reordered Gregorian time UUID * 7. Unix Epoch time UUID + * 8. Custom format UUID + * + * This returns `null` if the UUID is not an RFC 9562 (formerly RFC 4122) variant, since the version is only + * meaningful for this variant. * - * This returns `null` if the UUID is not an RFC 4122 variant, since version - * is only meaningful for this variant. + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version + * @pure */ public function getVersion(): ?int; /** * Returns true if these fields represent a nil UUID * - * The nil UUID is special form of UUID that is specified to have all 128 - * bits set to zero. + * The nil UUID is a special form of UUID that is specified to have all 128 bits set to zero. + * + * @pure */ public function isNil(): bool; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php index dedb72798..8646e6ad0 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php @@ -17,22 +17,21 @@ /** * Provides common functionality for max UUIDs * - * The max UUID is special form of UUID that is specified to have all 128 bits - * set to one. It is the inverse of the nil UUID. - * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.10 Max UUID - * - * @psalm-immutable + * @immutable */ trait MaxTrait { /** * Returns the bytes that comprise the fields + * + * @pure */ abstract public function getBytes(): string; /** * Returns true if the byte string represents a max UUID + * + * @pure */ public function isMax(): bool { diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php index e5ffa72c6..ac50bcea0 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php @@ -17,10 +17,11 @@ use Ramsey\Uuid\Uuid; /** - * The max UUID is special form of UUID that is specified to have all 128 bits - * set to one + * The max UUID is a special form of UUID that has all 128 bits set to one (`1`) * - * @psalm-immutable + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.10 RFC 9562, 5.10. Max UUID + * + * @immutable */ final class MaxUuid extends Uuid implements UuidInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php index 9a9774d89..19d137783 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php @@ -17,17 +17,14 @@ /** * Provides common functionality for nil UUIDs * - * The nil UUID is special form of UUID that is specified to have all 128 bits - * set to zero. - * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.7 RFC 4122, § 4.1.7: Nil UUID - * - * @psalm-immutable + * @immutable */ trait NilTrait { /** * Returns the bytes that comprise the fields + * + * @pure */ abstract public function getBytes(): string; diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php index c49b9945d..a139de7f4 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php @@ -17,10 +17,11 @@ use Ramsey\Uuid\Uuid; /** - * The nil UUID is special form of UUID that is specified to have all 128 bits - * set to zero + * The nil UUID is a special form of UUID that has all 128 bits set to zero (`0`) * - * @psalm-immutable + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.9 RFC 9562, 5.9. Nil UUID + * + * @immutable */ final class NilUuid extends Uuid implements UuidInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php index 5d939fac6..c468c9bf1 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php @@ -26,16 +26,14 @@ /** * Provides common functionality for getting the time from a time-based UUID * - * @psalm-immutable + * @immutable */ trait TimeTrait { /** - * Returns a DateTimeInterface object representing the timestamp associated - * with the UUID + * Returns a DateTimeInterface object representing the timestamp associated with the UUID * - * @return DateTimeImmutable A PHP DateTimeImmutable instance representing - * the timestamp of a time-based UUID + * @return DateTimeImmutable A PHP DateTimeImmutable instance representing the timestamp of a time-based UUID */ public function getDateTime(): DateTimeInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php index 2c2677db7..787a0b717 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php @@ -28,9 +28,9 @@ use Throwable; /** - * UuidBuilder builds instances of RFC 4122 UUIDs + * UuidBuilder builds instances of RFC 9562 (formerly 4122) UUIDs * - * @psalm-immutable + * @immutable */ class UuidBuilder implements UuidBuilderInterface { @@ -39,19 +39,16 @@ class UuidBuilder implements UuidBuilderInterface /** * Constructs the DefaultUuidBuilder * - * @param NumberConverterInterface $numberConverter The number converter to - * use when constructing the Uuid - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting Gregorian time extracted from version 1, 2, and 6 - * UUIDs to Unix timestamps - * @param TimeConverterInterface|null $unixTimeConverter The time converter - * to use for converter Unix Epoch time extracted from version 7 UUIDs - * to Unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use when constructing the Uuid + * @param TimeConverterInterface $timeConverter The time converter to use for converting Gregorian time extracted + * from version 1, 2, and 6 UUIDs to Unix timestamps + * @param TimeConverterInterface | null $unixTimeConverter The time converter to use for converter Unix Epoch time + * extracted from version 7 UUIDs to Unix timestamps */ public function __construct( private NumberConverterInterface $numberConverter, private TimeConverterInterface $timeConverter, - ?TimeConverterInterface $unixTimeConverter = null + ?TimeConverterInterface $unixTimeConverter = null, ) { $this->unixTimeConverter = $unixTimeConverter ?? new UnixTimeConverter(new BrickMathCalculator()); } @@ -64,7 +61,7 @@ public function __construct( * * @return Rfc4122UuidInterface UuidBuilder returns instances of Rfc4122UuidInterface * - * @psalm-pure + * @pure */ public function build(CodecInterface $codec, string $bytes): UuidInterface { @@ -73,46 +70,53 @@ public function build(CodecInterface $codec, string $bytes): UuidInterface $fields = $this->buildFields($bytes); if ($fields->isNil()) { + /** @phpstan-ignore possiblyImpure.new */ return new NilUuid($fields, $this->numberConverter, $codec, $this->timeConverter); } if ($fields->isMax()) { + /** @phpstan-ignore possiblyImpure.new */ return new MaxUuid($fields, $this->numberConverter, $codec, $this->timeConverter); } - switch ($fields->getVersion()) { - case Uuid::UUID_TYPE_TIME: - return new UuidV1($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_DCE_SECURITY: - return new UuidV2($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_HASH_MD5: - return new UuidV3($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_RANDOM: - return new UuidV4($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_HASH_SHA1: - return new UuidV5($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_REORDERED_TIME: - return new UuidV6($fields, $this->numberConverter, $codec, $this->timeConverter); - case Uuid::UUID_TYPE_UNIX_TIME: - return new UuidV7($fields, $this->numberConverter, $codec, $this->unixTimeConverter); - case Uuid::UUID_TYPE_CUSTOM: - return new UuidV8($fields, $this->numberConverter, $codec, $this->timeConverter); - } - - throw new UnsupportedOperationException( - 'The UUID version in the given fields is not supported ' - . 'by this UUID builder' - ); + return match ($fields->getVersion()) { + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_TIME => new UuidV1($fields, $this->numberConverter, $codec, $this->timeConverter), + Uuid::UUID_TYPE_DCE_SECURITY + /** @phpstan-ignore possiblyImpure.new */ + => new UuidV2($fields, $this->numberConverter, $codec, $this->timeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_HASH_MD5 => new UuidV3($fields, $this->numberConverter, $codec, $this->timeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_RANDOM => new UuidV4($fields, $this->numberConverter, $codec, $this->timeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_HASH_SHA1 => new UuidV5($fields, $this->numberConverter, $codec, $this->timeConverter), + Uuid::UUID_TYPE_REORDERED_TIME + /** @phpstan-ignore possiblyImpure.new */ + => new UuidV6($fields, $this->numberConverter, $codec, $this->timeConverter), + Uuid::UUID_TYPE_UNIX_TIME + /** @phpstan-ignore possiblyImpure.new */ + => new UuidV7($fields, $this->numberConverter, $codec, $this->unixTimeConverter), + /** @phpstan-ignore possiblyImpure.new */ + Uuid::UUID_TYPE_CUSTOM => new UuidV8($fields, $this->numberConverter, $codec, $this->timeConverter), + default => throw new UnsupportedOperationException( + 'The UUID version in the given fields is not supported by this UUID builder', + ), + }; } catch (Throwable $e) { + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e); } } /** - * Proxy method to allow injecting a mock, for testing + * Proxy method to allow injecting a mock for testing + * + * @pure */ protected function buildFields(string $bytes): FieldsInterface { + /** @phpstan-ignore possiblyImpure.new */ return new Fields($bytes); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php index e80f33bef..5918306ad 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php @@ -17,12 +17,11 @@ use Ramsey\Uuid\UuidInterface as BaseUuidInterface; /** - * Also known as a Leach-Salz variant UUID, an RFC 4122 variant UUID is a - * universally unique identifier defined by RFC 4122 + * A universally unique identifier (UUID), as defined in RFC 9562 (formerly RFC 4122) * - * @link https://tools.ietf.org/html/rfc4122 RFC 4122 + * @link https://www.rfc-editor.org/rfc/rfc9562 RFC 9562 * - * @psalm-immutable + * @immutable */ interface UuidInterface extends BaseUuidInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php index 515c038d9..df2af6fc3 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php @@ -22,10 +22,11 @@ use Ramsey\Uuid\Uuid; /** - * Gregorian time, or version 1, UUIDs include timestamp, clock sequence, and node - * values that are combined into a 128-bit unsigned integer + * Gregorian time, or version 1, UUIDs include timestamp, clock sequence, and node values, combined into a 128-bit unsigned integer * - * @psalm-immutable + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.1 RFC 9562, 5.1. UUID Version 1 + * + * @immutable */ final class UuidV1 extends Uuid implements UuidInterface { @@ -35,23 +36,20 @@ final class UuidV1 extends Uuid implements UuidInterface * Creates a version 1 (Gregorian time) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { if ($fields->getVersion() !== Uuid::UUID_TYPE_TIME) { throw new InvalidArgumentException( - 'Fields used to create a UuidV1 must represent a ' - . 'version 1 (time-based) UUID' + 'Fields used to create a UuidV1 must represent a version 1 (time-based) UUID', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php index c8ccbe422..c3417d7bb 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php @@ -25,22 +25,19 @@ use function hexdec; /** - * DCE Security version, or version 2, UUIDs include local domain identifier, - * local ID for the specified domain, and node values that are combined into a - * 128-bit unsigned integer + * DCE Security version, or version 2, UUIDs include local domain identifier, local ID for the specified domain, and + * node values that are combined into a 128-bit unsigned integer * - * It is important to note that a version 2 UUID suffers from some loss of - * fidelity of the timestamp, due to replacing the time_low field with the - * local identifier. When constructing the timestamp value for date - * purposes, we replace the local identifier bits with zeros. As a result, - * the timestamp can be off by a range of 0 to 429.4967295 seconds (or 7 - * minutes, 9 seconds, and 496730 microseconds). + * It is important to note that a version 2 UUID suffers from some loss of timestamp fidelity, due to replacing the + * time_low field with the local identifier. When constructing the timestamp value for date purposes, we replace the + * local identifier bits with zeros. As a result, the timestamp can be off by a range of 0 to 429.4967295 seconds (or 7 + * minutes, 9 seconds, and 496,730 microseconds). * - * Astute observers might note this value directly corresponds to 2^32 - 1, - * or 0xffffffff. The local identifier is 32-bits, and we have set each of - * these bits to 0, so the maximum range of timestamp drift is 0x00000000 - * to 0xffffffff (counted in 100-nanosecond intervals). + * Astute observers might note this value directly corresponds to `2^32-1`, or `0xffffffff`. The local identifier is + * 32-bits, and we have set each of these bits to `0`, so the maximum range of timestamp drift is `0x00000000` to + * `0xffffffff` (counted in 100-nanosecond intervals). * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.2 RFC 9562, 5.2. UUID Version 2 * @link https://publications.opengroup.org/c311 DCE 1.1: Authentication and Security Services * @link https://publications.opengroup.org/c706 DCE 1.1: Remote Procedure Call * @link https://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 DCE 1.1: Auth & Sec, §5.2.1.1 @@ -48,7 +45,7 @@ * @link https://pubs.opengroup.org/onlinepubs/9629399/apdxa.htm DCE 1.1: RPC, Appendix A * @link https://github.com/google/uuid Go package for UUIDs (includes DCE implementation) * - * @psalm-immutable + * @immutable */ final class UuidV2 extends Uuid implements UuidInterface { @@ -58,23 +55,20 @@ final class UuidV2 extends Uuid implements UuidInterface * Creates a version 2 (DCE Security) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { if ($fields->getVersion() !== Uuid::UUID_TYPE_DCE_SECURITY) { throw new InvalidArgumentException( - 'Fields used to create a UuidV2 must represent a ' - . 'version 2 (DCE Security) UUID' + 'Fields used to create a UuidV2 must represent a version 2 (DCE Security) UUID' ); } @@ -108,8 +102,6 @@ public function getLocalIdentifier(): IntegerObject /** @var Rfc4122FieldsInterface $fields */ $fields = $this->getFields(); - return new IntegerObject( - $this->numberConverter->fromHex($fields->getTimeLow()->toString()) - ); + return new IntegerObject($this->numberConverter->fromHex($fields->getTimeLow()->toString())); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php index deaa54eb0..1b065e28c 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php @@ -22,10 +22,12 @@ use Ramsey\Uuid\Uuid; /** - * Version 3 UUIDs are named-based, using combination of a namespace and name - * that are hashed into a 128-bit unsigned integer using MD5 + * Version 3 UUIDs are named-based, using a combination of a namespace and name that are hashed into a 128-bit unsigned + * integer using the MD5 hashing algorithm * - * @psalm-immutable + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.3 RFC 9562, 5.3. UUID Version 3 + * + * @immutable */ final class UuidV3 extends Uuid implements UuidInterface { @@ -33,23 +35,20 @@ final class UuidV3 extends Uuid implements UuidInterface * Creates a version 3 (name-based, MD5-hashed) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_MD5) { throw new InvalidArgumentException( - 'Fields used to create a UuidV3 must represent a ' - . 'version 3 (name-based, MD5-hashed) UUID' + 'Fields used to create a UuidV3 must represent a version 3 (name-based, MD5-hashed) UUID', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php index 2e5724620..e28ddc358 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php @@ -22,10 +22,11 @@ use Ramsey\Uuid\Uuid; /** - * Random, or version 4, UUIDs are randomly or pseudo-randomly generated 128-bit - * integers + * Random, or version 4, UUIDs are randomly or pseudo-randomly generated 128-bit integers * - * @psalm-immutable + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.4 RFC 9562, 5.4. UUID Version 4 + * + * @immutable */ final class UuidV4 extends Uuid implements UuidInterface { @@ -33,23 +34,20 @@ final class UuidV4 extends Uuid implements UuidInterface * Creates a version 4 (random) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { if ($fields->getVersion() !== Uuid::UUID_TYPE_RANDOM) { throw new InvalidArgumentException( - 'Fields used to create a UuidV4 must represent a ' - . 'version 4 (random) UUID' + 'Fields used to create a UuidV4 must represent a version 4 (random) UUID', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php index 2ef6ab3f1..be4390833 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php @@ -22,10 +22,12 @@ use Ramsey\Uuid\Uuid; /** - * Version 5 UUIDs are named-based, using combination of a namespace and name - * that are hashed into a 128-bit unsigned integer using SHA1 + * Version 5 UUIDs are named-based, using a combination of a namespace and name that are hashed into a 128-bit unsigned + * integer using the SHA1 hashing algorithm * - * @psalm-immutable + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.5 RFC 9562, 5.5. UUID Version 5 + * + * @immutable */ final class UuidV5 extends Uuid implements UuidInterface { @@ -33,23 +35,20 @@ final class UuidV5 extends Uuid implements UuidInterface * Creates a version 5 (name-based, SHA1-hashed) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { if ($fields->getVersion() !== Uuid::UUID_TYPE_HASH_SHA1) { throw new InvalidArgumentException( - 'Fields used to create a UuidV5 must represent a ' - . 'version 5 (named-based, SHA1-hashed) UUID' + 'Fields used to create a UuidV5 must represent a version 5 (named-based, SHA1-hashed) UUID', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php index 7e3743391..3ae4ffc94 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php @@ -17,12 +17,12 @@ use Ramsey\Uuid\Nonstandard\UuidV6 as NonstandardUuidV6; /** - * Reordered time, or version 6, UUIDs include timestamp, clock sequence, and - * node values that are combined into a 128-bit unsigned integer + * Reordered Gregorian time, or version 6, UUIDs include timestamp, clock sequence, and node values that are combined + * into a 128-bit unsigned integer * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.6 UUID Version 6 + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.6 RFC 9562, 5.6. UUID Version 6 * - * @psalm-immutable + * @immutable */ final class UuidV6 extends NonstandardUuidV6 implements UuidInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php index 5b524c486..1f2f4b57f 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php @@ -22,12 +22,11 @@ use Ramsey\Uuid\Uuid; /** - * Unix Epoch time, or version 7, UUIDs include a timestamp in milliseconds - * since the Unix Epoch, along with random bytes + * Unix Epoch time, or version 7, UUIDs include a timestamp in milliseconds since the Unix Epoch, along with random bytes * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.7 UUID Version 7 + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.7 RFC 9562, 5.7. UUID Version 7 * - * @psalm-immutable + * @immutable */ final class UuidV7 extends Uuid implements UuidInterface { @@ -37,23 +36,20 @@ final class UuidV7 extends Uuid implements UuidInterface * Creates a version 7 (Unix Epoch time) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { if ($fields->getVersion() !== Uuid::UUID_TYPE_UNIX_TIME) { throw new InvalidArgumentException( - 'Fields used to create a UuidV7 must represent a ' - . 'version 7 (Unix Epoch time) UUID' + 'Fields used to create a UuidV7 must represent a version 7 (Unix Epoch time) UUID', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php index 78b0290c7..ea57ec291 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php @@ -22,41 +22,36 @@ use Ramsey\Uuid\Uuid; /** - * Version 8, Custom UUIDs provide an RFC 4122 compatible format for - * experimental or vendor-specific uses + * Custom format, or version 8, UUIDs provide an RFC-compatible format for experimental or vendor-specific uses * - * The only requirement for version 8 UUIDs is that the version and variant bits - * must be set. Otherwise, implementations are free to set the other bits - * according to their needs. As a result, the uniqueness of version 8 UUIDs is + * The only requirement for version 8 UUIDs is that the version and variant bits must be set. Otherwise, implementations + * are free to set the other bits according to their needs. As a result, the uniqueness of version 8 UUIDs is * implementation-specific and should not be assumed. * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.8 UUID Version 8 + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.8 RFC 9562, 5.8. UUID Version 8 * - * @psalm-immutable + * @immutable */ final class UuidV8 extends Uuid implements UuidInterface { /** - * Creates a version 8 (custom) UUID + * Creates a version 8 (custom format) UUID * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { if ($fields->getVersion() !== Uuid::UUID_TYPE_CUSTOM) { throw new InvalidArgumentException( - 'Fields used to create a UuidV8 must represent a ' - . 'version 8 (custom) UUID' + 'Fields used to create a UuidV8 must represent a version 8 (custom format) UUID', ); } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Validator.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Validator.php index e82a11e6e..173628609 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Validator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/Validator.php @@ -21,9 +21,9 @@ use function str_replace; /** - * Rfc4122\Validator validates strings as UUIDs of the RFC 4122 variant + * Rfc4122\Validator validates strings as UUIDs of the RFC 9562 (formerly RFC 4122) variant * - * @psalm-immutable + * @immutable */ final class Validator implements ValidatorInterface { @@ -31,9 +31,7 @@ final class Validator implements ValidatorInterface . '[1-8][0-9A-Fa-f]{3}-[ABab89][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}\z'; /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @return non-empty-string */ public function getPattern(): string { @@ -42,9 +40,10 @@ public function getPattern(): string public function validate(string $uuid): bool { - $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); - $uuid = strtolower($uuid); + /** @phpstan-ignore possiblyImpure.functionCall */ + $uuid = strtolower(str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid)); + /** @phpstan-ignore possiblyImpure.functionCall */ return $uuid === Uuid::NIL || $uuid === Uuid::MAX || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php index 1041de51e..3d3936950 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php @@ -27,9 +27,9 @@ use const STR_PAD_LEFT; /** - * Provides common functionality for handling the variant, as defined by RFC 4122 + * Provides common functionality for handling the variant, as defined by RFC 9562 (formerly RFC 4122) * - * @psalm-immutable + * @immutable */ trait VariantTrait { @@ -39,18 +39,18 @@ trait VariantTrait abstract public function getBytes(): string; /** - * Returns the variant identifier, according to RFC 4122, for the given bytes + * Returns the variant * - * The following values may be returned: + * The variant number describes the layout of the UUID. The variant number has the following meaning: * - * - `0` -- Reserved, NCS backward compatibility. - * - `2` -- The variant specified in RFC 4122. - * - `6` -- Reserved, Microsoft Corporation backward compatibility. - * - `7` -- Reserved for future definition. + * - 0 - Reserved for NCS backward compatibility + * - 2 - The RFC 9562 (formerly RFC 4122) variant + * - 6 - Reserved, Microsoft Corporation backward compatibility + * - 7 - Reserved for future definition * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant + * For RFC 9562 (formerly RFC 4122) variant UUIDs, this value should always be the integer `2`. * - * @return int The variant identifier, according to RFC 4122 + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field */ public function getVariant(): int { @@ -58,28 +58,27 @@ public function getVariant(): int throw new InvalidBytesException('Invalid number of bytes'); } - if ($this->isMax() || $this->isNil()) { - // RFC 4122 defines these special types of UUID, so we will consider - // them as belonging to the RFC 4122 variant. - return Uuid::RFC_4122; + // According to RFC 9562, sections {@link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 4.1} and + // {@link https://www.rfc-editor.org/rfc/rfc9562#section-5.10 5.10}, the Max UUID falls within the range + // of the future variant. + if ($this->isMax()) { + return Uuid::RESERVED_FUTURE; + } + + // According to RFC 9562, sections {@link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 4.1} and + // {@link https://www.rfc-editor.org/rfc/rfc9562#section-5.9 5.9}, the Nil UUID falls within the range + // of the Apollo NCS variant. + if ($this->isNil()) { + return Uuid::RESERVED_NCS; } /** @var int[] $parts */ $parts = unpack('n*', $this->getBytes()); - // $parts[5] is a 16-bit, unsigned integer containing the variant bits - // of the UUID. We convert this integer into a string containing a - // binary representation, padded to 16 characters. We analyze the first - // three characters (three most-significant bits) to determine the - // variant. - $binary = str_pad( - decbin($parts[5]), - 16, - '0', - STR_PAD_LEFT - ); - - $msb = substr($binary, 0, 3); + // $parts[5] is a 16-bit, unsigned integer containing the variant bits of the UUID. We convert this integer into + // a string containing a binary representation, padded to 16 characters. We analyze the first three characters + // (three most-significant bits) to determine the variant. + $msb = substr(str_pad(decbin($parts[5]), 16, '0', STR_PAD_LEFT), 0, 3); if ($msb === '111') { return Uuid::RESERVED_FUTURE; diff --git a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php index 0195e46c7..5f4e17bde 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php +++ b/lib/Google/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php @@ -17,14 +17,32 @@ use Ramsey\Uuid\Uuid; /** - * Provides common functionality for handling the version, as defined by RFC 4122 + * Provides common functionality for handling the version, as defined by RFC 9562 (formerly RFC 4122) * - * @psalm-immutable + * @immutable */ trait VersionTrait { /** - * Returns the version + * Returns the UUID version + * + * The version number describes how the UUID was generated and has the following meaning: + * + * 1. Gregorian time UUID + * 2. DCE security UUID + * 3. Name-based UUID hashed with MD5 + * 4. Randomly generated UUID + * 5. Name-based UUID hashed with SHA-1 + * 6. Reordered Gregorian time UUID + * 7. Unix Epoch time UUID + * 8. Custom format UUID + * + * This returns `null` if the UUID is not an RFC 9562 (formerly RFC 4122) variant, since the version is only + * meaningful for this variant. + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field + * + * @pure */ abstract public function getVersion(): ?int; @@ -39,7 +57,7 @@ abstract public function isMax(): bool; abstract public function isNil(): bool; /** - * Returns true if the version matches one of those defined by RFC 4122 + * Returns true if the version matches one of those defined by RFC 9562 (formerly RFC 4122) * * @return bool True if the UUID version is valid, false otherwise */ @@ -51,9 +69,9 @@ private function isCorrectVersion(): bool return match ($this->getVersion()) { Uuid::UUID_TYPE_TIME, Uuid::UUID_TYPE_DCE_SECURITY, - Uuid::UUID_TYPE_HASH_MD5, Uuid::UUID_TYPE_RANDOM, - Uuid::UUID_TYPE_HASH_SHA1, Uuid::UUID_TYPE_REORDERED_TIME, - Uuid::UUID_TYPE_UNIX_TIME, Uuid::UUID_TYPE_CUSTOM => true, + Uuid::UUID_TYPE_HASH_MD5, Uuid::UUID_TYPE_RANDOM, + Uuid::UUID_TYPE_HASH_SHA1, Uuid::UUID_TYPE_REORDERED_TIME, + Uuid::UUID_TYPE_UNIX_TIME, Uuid::UUID_TYPE_CUSTOM => true, default => false, }; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Type/Decimal.php b/lib/Google/vendor/ramsey/uuid/src/Type/Decimal.php index acc5e754b..b5b4f9738 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Type/Decimal.php +++ b/lib/Google/vendor/ramsey/uuid/src/Type/Decimal.php @@ -24,19 +24,17 @@ /** * A value object representing a decimal * - * This class exists for type-safety purposes, to ensure that decimals - * returned from ramsey/uuid methods as strings are truly decimals and not some - * other kind of string. + * This class exists for type-safety purposes, to ensure that decimals returned from ramsey/uuid methods as strings are + * truly decimals and not some other kind of string. * - * To support values as true decimals and not as floats or doubles, we store the - * decimals as strings. + * To support values as true decimals and not as floats or doubles, we store the decimals as strings. * - * @psalm-immutable + * @immutable */ final class Decimal implements NumberInterface { private string $value; - private bool $isNegative = false; + private bool $isNegative; public function __construct(float | int | string | self $value) { @@ -61,6 +59,8 @@ public function __construct(float | int | string | self $value) if (str_starts_with($value, '-')) { $this->isNegative = true; + } else { + $this->isNegative = false; } $this->value = $value; @@ -103,8 +103,6 @@ public function __serialize(): array * Constructs the object from a serialized string representation * * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall */ public function unserialize(string $data): void { @@ -113,8 +111,6 @@ public function unserialize(string $data): void /** * @param array{string?: string} $data - * - * @psalm-suppress UnusedMethodCall */ public function __unserialize(array $data): void { diff --git a/lib/Google/vendor/ramsey/uuid/src/Type/Hexadecimal.php b/lib/Google/vendor/ramsey/uuid/src/Type/Hexadecimal.php index bf71ec4b1..c41176457 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Type/Hexadecimal.php +++ b/lib/Google/vendor/ramsey/uuid/src/Type/Hexadecimal.php @@ -24,39 +24,55 @@ /** * A value object representing a hexadecimal number * - * This class exists for type-safety purposes, to ensure that hexadecimal numbers - * returned from ramsey/uuid methods as strings are truly hexadecimal and not some - * other kind of string. + * This class exists for type-safety purposes, to ensure that hexadecimal numbers returned from ramsey/uuid methods as + * strings are truly hexadecimal and not some other kind of string. * - * @psalm-immutable + * @immutable */ final class Hexadecimal implements TypeInterface { + /** + * @var non-empty-string + */ private string $value; /** - * @param self|string $value The hexadecimal value to store + * @param self | string $value The hexadecimal value to store */ public function __construct(self | string $value) { $this->value = $value instanceof self ? (string) $value : $this->prepareValue($value); } + /** + * @return non-empty-string + * + * @pure + */ public function toString(): string { return $this->value; } + /** + * @return non-empty-string + */ public function __toString(): string { return $this->toString(); } + /** + * @return non-empty-string + */ public function jsonSerialize(): string { return $this->toString(); } + /** + * @return non-empty-string + */ public function serialize(): string { return $this->toString(); @@ -74,8 +90,6 @@ public function __serialize(): array * Constructs the object from a serialized string representation * * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall */ public function unserialize(string $data): void { @@ -96,6 +110,9 @@ public function __unserialize(array $data): void $this->unserialize($data['string']); } + /** + * @return non-empty-string + */ private function prepareValue(string $value): string { $value = strtolower($value); @@ -105,11 +122,10 @@ private function prepareValue(string $value): string } if (!preg_match('/^[A-Fa-f0-9]+$/', $value)) { - throw new InvalidArgumentException( - 'Value must be a hexadecimal number' - ); + throw new InvalidArgumentException('Value must be a hexadecimal number'); } + /** @var non-empty-string */ return $value; } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Type/Integer.php b/lib/Google/vendor/ramsey/uuid/src/Type/Integer.php index 50dac9934..ed6c82d2a 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Type/Integer.php +++ b/lib/Google/vendor/ramsey/uuid/src/Type/Integer.php @@ -26,25 +26,27 @@ /** * A value object representing an integer * - * This class exists for type-safety purposes, to ensure that integers - * returned from ramsey/uuid methods as strings are truly integers and not some - * other kind of string. + * This class exists for type-safety purposes, to ensure that integers returned from ramsey/uuid methods as strings are + * truly integers and not some other kind of string. * - * To support large integers beyond PHP_INT_MAX and PHP_INT_MIN on both 64-bit - * and 32-bit systems, we store the integers as strings. + * To support large integers beyond PHP_INT_MAX and PHP_INT_MIN on both 64-bit and 32-bit systems, we store the integers + * as strings. * - * @psalm-immutable + * @immutable */ final class Integer implements NumberInterface { /** - * @psalm-var numeric-string + * @var numeric-string */ private string $value; + /** + * @phpstan-ignore property.readOnlyByPhpDocDefaultValue + */ private bool $isNegative = false; - public function __construct(float | int | string | self $value) + public function __construct(self | float | int | string $value) { $this->value = $value instanceof self ? (string) $value : $this->prepareValue($value); } @@ -55,7 +57,9 @@ public function isNegative(): bool } /** - * @psalm-return numeric-string + * @return numeric-string + * + * @pure */ public function toString(): string { @@ -63,7 +67,7 @@ public function toString(): string } /** - * @psalm-return numeric-string + * @return numeric-string */ public function __toString(): string { @@ -92,8 +96,6 @@ public function __serialize(): array * Constructs the object from a serialized string representation * * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall */ public function unserialize(string $data): void { @@ -122,7 +124,7 @@ private function prepareValue(float | int | string $value): string $value = (string) $value; $sign = '+'; - // If the value contains a sign, remove it for digit pattern check. + // If the value contains a sign, remove it for the digit pattern check. if (str_starts_with($value, '-') || str_starts_with($value, '+')) { $sign = substr($value, 0, 1); $value = substr($value, 1); @@ -147,7 +149,7 @@ private function prepareValue(float | int | string $value): string if ($sign === '-' && $value !== '0') { $value = $sign . $value; - /** @psalm-suppress InaccessibleProperty */ + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ $this->isNegative = true; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Type/NumberInterface.php b/lib/Google/vendor/ramsey/uuid/src/Type/NumberInterface.php index bf4ae9db8..d85e103d1 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Type/NumberInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Type/NumberInterface.php @@ -17,7 +17,7 @@ /** * NumberInterface ensures consistency in numeric values returned by ramsey/uuid * - * @psalm-immutable + * @immutable */ interface NumberInterface extends TypeInterface { diff --git a/lib/Google/vendor/ramsey/uuid/src/Type/Time.php b/lib/Google/vendor/ramsey/uuid/src/Type/Time.php index 0cedb4476..2556c5b84 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Type/Time.php +++ b/lib/Google/vendor/ramsey/uuid/src/Type/Time.php @@ -25,11 +25,10 @@ /** * A value object representing a timestamp * - * This class exists for type-safety purposes, to ensure that timestamps used - * by ramsey/uuid are truly timestamp integers and not some other kind of string - * or integer. + * This class exists for type-safety purposes, to ensure that timestamps used by ramsey/uuid are truly timestamp + * integers and not some other kind of string or integer. * - * @psalm-immutable + * @immutable */ final class Time implements TypeInterface { @@ -37,18 +36,24 @@ final class Time implements TypeInterface private IntegerObject $microseconds; public function __construct( - float | int | string | IntegerObject $seconds, - float | int | string | IntegerObject $microseconds = 0, + IntegerObject | float | int | string $seconds, + IntegerObject | float | int | string $microseconds = 0, ) { $this->seconds = new IntegerObject($seconds); $this->microseconds = new IntegerObject($microseconds); } + /** + * @pure + */ public function getSeconds(): IntegerObject { return $this->seconds; } + /** + * @pure + */ public function getMicroseconds(): IntegerObject { return $this->microseconds; @@ -95,18 +100,14 @@ public function __serialize(): array * Constructs the object from a serialized string representation * * @param string $data The serialized string representation of the object - * - * @psalm-suppress UnusedMethodCall */ public function unserialize(string $data): void { - /** @var array{seconds?: int|float|string, microseconds?: int|float|string} $time */ + /** @var array{seconds?: float | int | string, microseconds?: float | int | string} $time */ $time = json_decode($data, true); if (!isset($time['seconds']) || !isset($time['microseconds'])) { - throw new UnsupportedOperationException( - 'Attempted to unserialize an invalid value' - ); + throw new UnsupportedOperationException('Attempted to unserialize an invalid value'); } $this->__construct($time['seconds'], $time['microseconds']); diff --git a/lib/Google/vendor/ramsey/uuid/src/Type/TypeInterface.php b/lib/Google/vendor/ramsey/uuid/src/Type/TypeInterface.php index da2d8b203..0c88a2826 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Type/TypeInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Type/TypeInterface.php @@ -20,11 +20,17 @@ /** * TypeInterface ensures consistency in typed values returned by ramsey/uuid * - * @psalm-immutable + * @immutable */ interface TypeInterface extends JsonSerializable, Serializable { + /** + * @pure + */ public function toString(): string; + /** + * @pure + */ public function __toString(): string; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Uuid.php b/lib/Google/vendor/ramsey/uuid/src/Uuid.php index e0384a50c..0f05bbfb8 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Uuid.php +++ b/lib/Google/vendor/ramsey/uuid/src/Uuid.php @@ -19,6 +19,7 @@ use Ramsey\Uuid\Codec\CodecInterface; use Ramsey\Uuid\Converter\NumberConverterInterface; use Ramsey\Uuid\Converter\TimeConverterInterface; +use Ramsey\Uuid\Exception\InvalidArgumentException; use Ramsey\Uuid\Exception\UnsupportedOperationException; use Ramsey\Uuid\Fields\FieldsInterface; use Ramsey\Uuid\Lazy\LazyUuidFromString; @@ -41,83 +42,87 @@ /** * Uuid provides constants and static methods for working with and generating UUIDs * - * @psalm-immutable + * @immutable */ class Uuid implements UuidInterface { use DeprecatedUuidMethodsTrait; /** - * When this namespace is specified, the name string is a fully-qualified - * domain name + * When this namespace is specified, the name string is a fully qualified domain name * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation */ public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; /** * When this namespace is specified, the name string is a URL * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation */ public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; /** * When this namespace is specified, the name string is an ISO OID * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation */ public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8'; /** - * When this namespace is specified, the name string is an X.500 DN in DER - * or a text output format + * When this namespace is specified, the name string is an X.500 DN (in DER or a text output format) * - * @link http://tools.ietf.org/html/rfc4122#appendix-C RFC 4122, Appendix C: Some Name Space IDs + * @link https://www.rfc-editor.org/rfc/rfc9562#section-6.6 RFC 9562, 6.6. Namespace ID Usage and Allocation */ public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8'; /** - * The nil UUID is a special form of UUID that is specified to have all 128 - * bits set to zero + * The Nil UUID is a special form of UUID that is specified to have all 128 bits set to zero * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.7 RFC 4122, § 4.1.7: Nil UUID + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.9 RFC 9562, 5.9. Nil UUID */ public const NIL = '00000000-0000-0000-0000-000000000000'; /** - * The max UUID is a special form of UUID that is specified to have all 128 - * bits set to one + * The Max UUID is a special form of UUID that is specified to have all 128 bits set to one * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.10 Max UUID + * @link https://www.rfc-editor.org/rfc/rfc9562#section-5.10 RFC 9562, 5.10. Max UUID */ public const MAX = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; /** * Variant: reserved, NCS backward compatibility * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field */ public const RESERVED_NCS = 0; /** - * Variant: the UUID layout specified in RFC 4122 + * Variant: the UUID layout specified in RFC 9562 (formerly RFC 4122) * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + * @see Uuid::RFC_9562 */ public const RFC_4122 = 2; + /** + * Variant: the UUID layout specified in RFC 9562 (formerly RFC 4122) + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field + */ + public const RFC_9562 = 2; + /** * Variant: reserved, Microsoft Corporation backward compatibility * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field */ public const RESERVED_MICROSOFT = 6; /** * Variant: reserved for future definition * - * @link http://tools.ietf.org/html/rfc4122#section-4.1.1 RFC 4122, § 4.1.1: Variant + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.1 RFC 9562, 4.1. Variant Field */ public const RESERVED_FUTURE = 7; @@ -129,14 +134,14 @@ class Uuid implements UuidInterface /** * Version 1 (Gregorian time) UUID * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_TIME = 1; /** * Version 2 (DCE Security) UUID * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_DCE_SECURITY = 2; @@ -148,21 +153,21 @@ class Uuid implements UuidInterface /** * Version 3 (name-based and hashed with MD5) UUID * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_HASH_MD5 = 3; /** * Version 4 (random) UUID * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_RANDOM = 4; /** * Version 5 (name-based and hashed with SHA1) UUID * - * @link https://tools.ietf.org/html/rfc4122#section-4.1.3 RFC 4122, § 4.1.3: Version + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_HASH_SHA1 = 5; @@ -172,21 +177,23 @@ class Uuid implements UuidInterface public const UUID_TYPE_PEABODY = 6; /** - * Version 6 (reordered time) UUID + * Version 6 (reordered Gregorian time) UUID * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.6 UUID Version 6 + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_REORDERED_TIME = 6; /** * Version 7 (Unix Epoch time) UUID * - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.7 UUID Version 7 + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_UNIX_TIME = 7; /** - * @link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#section-5.8 UUID Version 8 + * Version 8 (custom format) UUID + * + * @link https://www.rfc-editor.org/rfc/rfc9562#section-4.2 RFC 9562, 4.2. Version Field */ public const UUID_TYPE_CUSTOM = 8; @@ -222,12 +229,15 @@ class Uuid implements UuidInterface self::DCE_DOMAIN_ORG => 'org', ]; + /** + * @phpstan-ignore property.readOnlyByPhpDocDefaultValue + */ private static ?UuidFactoryInterface $factory = null; /** - * @var bool flag to detect if the UUID factory was replaced internally, - * which disables all optimizations for the default/happy path internal - * scenarios + * @var bool flag to detect if the UUID factory was replaced internally, which disables all optimizations for the + * default/happy path internal scenarios + * @phpstan-ignore property.readOnlyByPhpDocDefaultValue */ private static bool $factoryReplaced = false; @@ -239,9 +249,8 @@ class Uuid implements UuidInterface /** * Creates a universally unique identifier (UUID) from an array of fields * - * Unless you're making advanced use of this library to generate identifiers - * that deviate from RFC 4122, you probably do not want to instantiate a - * UUID directly. Use the static methods, instead: + * Unless you're making advanced use of this library to generate identifiers that deviate from RFC 9562 (formerly + * RFC 4122), you probably do not want to instantiate a UUID directly. Use the static methods, instead: * * ``` * use Ramsey\Uuid\Uuid; @@ -253,18 +262,16 @@ class Uuid implements UuidInterface * ``` * * @param Rfc4122FieldsInterface $fields The fields from which to construct a UUID - * @param NumberConverterInterface $numberConverter The number converter to use - * for converting hex values to/from integers - * @param CodecInterface $codec The codec to use when encoding or decoding - * UUID strings - * @param TimeConverterInterface $timeConverter The time converter to use - * for converting timestamps extracted from a UUID to unix timestamps + * @param NumberConverterInterface $numberConverter The number converter to use for converting hex values to/from integers + * @param CodecInterface $codec The codec to use when encoding or decoding UUID strings + * @param TimeConverterInterface $timeConverter The time converter to use for converting timestamps extracted from a + * UUID to unix timestamps */ public function __construct( Rfc4122FieldsInterface $fields, NumberConverterInterface $numberConverter, CodecInterface $codec, - TimeConverterInterface $timeConverter + TimeConverterInterface $timeConverter, ) { $this->fields = $fields; $this->codec = $codec; @@ -273,7 +280,7 @@ public function __construct( } /** - * @psalm-return non-empty-string + * @return non-empty-string */ public function __toString(): string { @@ -307,8 +314,7 @@ public function __serialize(): array /** * Re-constructs the object from its serialized form * - * @param string $data The serialized PHP string to unserialize into - * a UuidInterface instance + * @param string $data The serialized PHP string to unserialize into a UuidInterface instance */ public function unserialize(string $data): void { @@ -320,9 +326,16 @@ public function unserialize(string $data): void $uuid = self::getFactory()->fromString($data); } + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ $this->codec = $uuid->codec; + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ $this->numberConverter = $uuid->numberConverter; + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ $this->fields = $uuid->fields; + + /** @phpstan-ignore property.readOnlyByPhpDocAssignNotInConstructor */ $this->timeConverter = $uuid->timeConverter; } @@ -365,7 +378,7 @@ public function equals(?object $other): bool } /** - * @psalm-return non-empty-string + * @return non-empty-string */ public function getBytes(): string { @@ -393,7 +406,7 @@ public function getUrn(): string } /** - * @psalm-return non-empty-string + * @return non-empty-string */ public function toString(): string { @@ -415,8 +428,7 @@ public static function getFactory(): UuidFactoryInterface /** * Sets the factory used to create UUIDs * - * @param UuidFactoryInterface $factory A factory that will be used by this - * class to create UUIDs + * @param UuidFactoryInterface $factory A factory that will be used by this class to create UUIDs */ public static function setFactory(UuidFactoryInterface $factory): void { @@ -433,19 +445,15 @@ public static function setFactory(UuidFactoryInterface $factory): void * * @param string $bytes A binary string * - * @return UuidInterface A UuidInterface instance created from a binary - * string representation + * @return UuidInterface A UuidInterface instance created from a binary string representation * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners + * @throws InvalidArgumentException * - * @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. + * @pure */ public static function fromBytes(string $bytes): UuidInterface { + /** @phpstan-ignore impure.staticPropertyAccess */ if (!self::$factoryReplaced && strlen($bytes) === 16) { $base16Uuid = bin2hex($bytes); @@ -459,10 +467,11 @@ public static function fromBytes(string $bytes): UuidInterface . '-' . substr($base16Uuid, 16, 4) . '-' - . substr($base16Uuid, 20, 12) + . substr($base16Uuid, 20, 12), ); } + /** @phpstan-ignore possiblyImpure.methodCall */ return self::getFactory()->fromBytes($bytes); } @@ -471,26 +480,25 @@ public static function fromBytes(string $bytes): UuidInterface * * @param string $uuid A hexadecimal string * - * @return UuidInterface A UuidInterface instance created from a hexadecimal - * string representation + * @return UuidInterface A UuidInterface instance created from a hexadecimal string representation * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners + * @throws InvalidArgumentException * - * @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. + * @pure */ public static function fromString(string $uuid): UuidInterface { $uuid = strtolower($uuid); + /** @phpstan-ignore impure.staticPropertyAccess, possiblyImpure.functionCall */ if (!self::$factoryReplaced && preg_match(LazyUuidFromString::VALID_REGEX, $uuid) === 1) { + /** @phpstan-ignore possiblyImpure.functionCall */ assert($uuid !== ''); + /** @phpstan-ignore possiblyImpure.new */ return new LazyUuidFromString($uuid); } + /** @phpstan-ignore possiblyImpure.methodCall */ return self::getFactory()->fromString($uuid); } @@ -498,14 +506,11 @@ public static function fromString(string $uuid): UuidInterface * Creates a UUID from a DateTimeInterface instance * * @param DateTimeInterface $dateTime The date and time - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID created from a DateTimeInterface instance + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID created from a DateTimeInterface instance */ public static function fromDateTime( DateTimeInterface $dateTime, @@ -520,23 +525,24 @@ public static function fromDateTime( * * @param Hexadecimal $hex Hexadecimal object representing a hexadecimal number * - * @return UuidInterface A UuidInterface instance created from the Hexadecimal - * object representing a hexadecimal number + * @return UuidInterface A UuidInterface instance created from the Hexadecimal object representing a hexadecimal number + * + * @throws InvalidArgumentException * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * @psalm-suppress MixedInferredReturnType,MixedReturnStatement + * @pure */ public static function fromHexadecimal(Hexadecimal $hex): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ $factory = self::getFactory(); if (method_exists($factory, 'fromHexadecimal')) { - /** - * @phpstan-ignore-next-line - * @psalm-suppress UndefinedInterfaceMethod - */ - return self::getFactory()->fromHexadecimal($hex); + /** @phpstan-ignore possiblyImpure.methodCall */ + $uuid = $factory->fromHexadecimal($hex); + /** @phpstan-ignore possiblyImpure.functionCall */ + assert($uuid instanceof UuidInterface); + + return $uuid; } throw new BadMethodCallException('The method fromHexadecimal() does not exist on the provided factory'); @@ -547,15 +553,15 @@ public static function fromHexadecimal(Hexadecimal $hex): UuidInterface * * @param string $integer String representation of 128-bit integer * - * @return UuidInterface A UuidInterface instance created from the string - * representation of a 128-bit integer + * @return UuidInterface A UuidInterface instance created from the string representation of a 128-bit integer * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners + * @throws InvalidArgumentException + * + * @pure */ public static function fromInteger(string $integer): UuidInterface { - /** @psalm-suppress ImpureMethodCall */ + /** @phpstan-ignore possiblyImpure.methodCall */ return self::getFactory()->fromInteger($integer); } @@ -566,30 +572,25 @@ public static function fromInteger(string $integer): UuidInterface * * @return bool True if the string is a valid UUID, false otherwise * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners + * @phpstan-assert-if-true =non-empty-string $uuid * - * @psalm-assert-if-true =non-empty-string $uuid + * @pure */ public static function isValid(string $uuid): bool { - /** @psalm-suppress ImpureMethodCall */ + /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall */ return self::getFactory()->getValidator()->validate($uuid); } /** - * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, - * and the current time + * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, and the current time * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may + * be represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID */ public static function uuid1($node = null, ?int $clockSeq = null): UuidInterface { @@ -597,24 +598,18 @@ public static function uuid1($node = null, ?int $clockSeq = null): UuidInterface } /** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time + * Returns a version 2 (DCE Security) UUID from a local domain, local identifier, host ID, clock sequence, and the current time * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes (in a version 2 UUID, the lower 8 bits of this number - * are replaced with the domain). + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID + * on POSIX systems, if the local domain is "person" or "group," or it may be a site-defined identifier if the + * local domain is "org" + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes (in a version 2 UUID, the lower 8 bits of this number are + * replaced with the domain). * - * @return UuidInterface A UuidInterface instance that represents a - * version 2 UUID + * @return UuidInterface A UuidInterface instance that represents a version 2 UUID */ public static function uuid2( int $localDomain, @@ -626,33 +621,25 @@ public static function uuid2( } /** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name + * Returns a version 3 (name-based) UUID based on the MD5 hash of a namespace ID and a name * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) + * @param UuidInterface | string $ns The namespace (must be a valid UUID) * @param string $name The name to use for creating a UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 3 UUID - * - * @psalm-suppress ImpureMethodCall we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. + * @return UuidInterface A UuidInterface instance that represents a version 3 UUID * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners + * @pure */ public static function uuid3($ns, string $name): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ return self::getFactory()->uuid3($ns, $name); } /** * Returns a version 4 (random) UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 4 UUID + * @return UuidInterface A UuidInterface instance that represents a version 4 UUID */ public static function uuid4(): UuidInterface { @@ -660,40 +647,29 @@ public static function uuid4(): UuidInterface } /** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name + * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a namespace ID and a name * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) + * @param UuidInterface | string $ns The namespace (must be a valid UUID) * @param string $name The name to use for creating a UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 5 UUID + * @return UuidInterface A UuidInterface instance that represents a version 5 UUID * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners - * - * @psalm-suppress ImpureMethodCall we know that the factory being replaced can lead to massive - * havoc across all consumers: that should never happen, and - * is generally to be discouraged. Until the factory is kept - * un-replaced, this method is effectively pure. + * @pure */ public static function uuid5($ns, string $name): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ return self::getFactory()->uuid5($ns, $name); } /** - * Returns a version 6 (reordered time) UUID from a host ID, sequence number, - * and the current time + * Returns a version 6 (reordered Gregorian time) UUID from a host ID, sequence number, and the current time * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * - * @return UuidInterface A UuidInterface instance that represents a - * version 6 UUID + * @return UuidInterface A UuidInterface instance that represents a version 6 UUID */ public static function uuid6( ?Hexadecimal $node = null, @@ -705,12 +681,10 @@ public static function uuid6( /** * Returns a version 7 (Unix Epoch time) UUID * - * @param DateTimeInterface|null $dateTime An optional date/time from which - * to create the version 7 UUID. If not provided, the UUID is generated - * using the current date/time. + * @param DateTimeInterface | null $dateTime An optional date/time from which to create the version 7 UUID. If not + * provided, the UUID is generated using the current date/time. * - * @return UuidInterface A UuidInterface instance that represents a - * version 7 UUID + * @return UuidInterface A UuidInterface instance that represents a version 7 UUID */ public static function uuid7(?DateTimeInterface $dateTime = null): UuidInterface { @@ -721,38 +695,36 @@ public static function uuid7(?DateTimeInterface $dateTime = null): UuidInterface return $factory->uuid7($dateTime); } - throw new UnsupportedOperationException( - 'The provided factory does not support the uuid7() method', - ); + throw new UnsupportedOperationException('The provided factory does not support the uuid7() method'); } /** - * Returns a version 8 (custom) UUID + * Returns a version 8 (custom format) UUID + * + * The bytes provided may contain any value according to your application's needs. Be aware, however, that other + * applications may not understand the semantics of the value. * - * The bytes provided may contain any value according to your application's - * needs. Be aware, however, that other applications may not understand the - * semantics of the value. + * @param string $bytes A 16-byte octet string. This is an open blob of data that you may fill with 128 bits of + * information. Be aware, however, bits 48 through 51 will be replaced with the UUID version field, and bits 64 + * and 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application needs. * - * @param string $bytes A 16-byte octet string. This is an open blob - * of data that you may fill with 128 bits of information. Be aware, - * however, bits 48 through 51 will be replaced with the UUID version - * field, and bits 64 and 65 will be replaced with the UUID variant. You - * MUST NOT rely on these bits for your application needs. + * @return UuidInterface A UuidInterface instance that represents a version 8 UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 8 UUID + * @pure */ public static function uuid8(string $bytes): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ $factory = self::getFactory(); if (method_exists($factory, 'uuid8')) { - /** @var UuidInterface */ + /** + * @var UuidInterface + * @phpstan-ignore possiblyImpure.methodCall + */ return $factory->uuid8($bytes); } - throw new UnsupportedOperationException( - 'The provided factory does not support the uuid8() method', - ); + throw new UnsupportedOperationException('The provided factory does not support the uuid8() method'); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/UuidFactory.php b/lib/Google/vendor/ramsey/uuid/src/UuidFactory.php index 1b06ea6ed..c7607a1b1 100644 --- a/lib/Google/vendor/ramsey/uuid/src/UuidFactory.php +++ b/lib/Google/vendor/ramsey/uuid/src/UuidFactory.php @@ -59,13 +59,12 @@ class UuidFactory implements UuidFactoryInterface private ValidatorInterface $validator; /** - * @var bool whether the feature set was provided from outside, or we can - * operate under "default" assumptions + * @var bool whether the feature set was provided from outside, or we can operate under "default" assumptions */ private bool $isDefaultFeatureSet; /** - * @param FeatureSet|null $features A set of available features in the current environment + * @param FeatureSet | null $features A set of available features in the current environment */ public function __construct(?FeatureSet $features = null) { @@ -117,8 +116,7 @@ public function getNameGenerator(): NameGeneratorInterface /** * Sets the name generator to use for this factory * - * @param NameGeneratorInterface $nameGenerator A generator to generate - * binary data, based on a namespace and name + * @param NameGeneratorInterface $nameGenerator A generator to generate binary data, based on a namespace and name */ public function setNameGenerator(NameGeneratorInterface $nameGenerator): void { @@ -154,8 +152,7 @@ public function getTimeGenerator(): TimeGeneratorInterface /** * Sets the time generator to use for this factory * - * @param TimeGeneratorInterface $generator A generator to generate binary - * data, based on the time + * @param TimeGeneratorInterface $generator A generator to generate binary data, based on the time */ public function setTimeGenerator(TimeGeneratorInterface $generator): void { @@ -175,8 +172,8 @@ public function getDceSecurityGenerator(): DceSecurityGeneratorInterface /** * Sets the DCE Security generator to use for this factory * - * @param DceSecurityGeneratorInterface $generator A generator to generate - * binary data, based on a local domain and local identifier + * @param DceSecurityGeneratorInterface $generator A generator to generate binary data, based on a local domain and + * local identifier */ public function setDceSecurityGenerator(DceSecurityGeneratorInterface $generator): void { @@ -196,8 +193,7 @@ public function getNumberConverter(): NumberConverterInterface /** * Sets the random generator to use for this factory * - * @param RandomGeneratorInterface $generator A generator to generate binary - * data, based on some random input + * @param RandomGeneratorInterface $generator A generator to generate binary data, based on some random input */ public function setRandomGenerator(RandomGeneratorInterface $generator): void { @@ -209,8 +205,8 @@ public function setRandomGenerator(RandomGeneratorInterface $generator): void /** * Sets the number converter to use for this factory * - * @param NumberConverterInterface $converter A converter to use for working - * with large integers (i.e. integers greater than PHP_INT_MAX) + * @param NumberConverterInterface $converter A converter to use for working with large integers (i.e., integers + * greater than PHP_INT_MAX) */ public function setNumberConverter(NumberConverterInterface $converter): void { @@ -230,8 +226,7 @@ public function getUuidBuilder(): UuidBuilderInterface /** * Sets the UUID builder to use for this factory * - * @param UuidBuilderInterface $builder A builder for constructing instances - * of UuidInterface + * @param UuidBuilderInterface $builder A builder for constructing instances of UuidInterface */ public function setUuidBuilder(UuidBuilderInterface $builder): void { @@ -240,9 +235,6 @@ public function setUuidBuilder(UuidBuilderInterface $builder): void $this->uuidBuilder = $builder; } - /** - * @psalm-mutation-free - */ public function getValidator(): ValidatorInterface { return $this->validator; @@ -251,8 +243,7 @@ public function getValidator(): ValidatorInterface /** * Sets the validator to use for this factory * - * @param ValidatorInterface $validator A validator to use for validating - * whether a string is a valid UUID + * @param ValidatorInterface $validator A validator to use for validating whether a string is a valid UUID */ public function setValidator(ValidatorInterface $validator): void { @@ -262,7 +253,7 @@ public function setValidator(ValidatorInterface $validator): void } /** - * @psalm-pure + * @pure */ public function fromBytes(string $bytes): UuidInterface { @@ -270,7 +261,7 @@ public function fromBytes(string $bytes): UuidInterface } /** - * @psalm-pure + * @pure */ public function fromString(string $uuid): UuidInterface { @@ -280,7 +271,7 @@ public function fromString(string $uuid): UuidInterface } /** - * @psalm-pure + * @pure */ public function fromInteger(string $integer): UuidInterface { @@ -293,27 +284,17 @@ public function fromInteger(string $integer): UuidInterface public function fromDateTime( DateTimeInterface $dateTime, ?Hexadecimal $node = null, - ?int $clockSeq = null + ?int $clockSeq = null, ): UuidInterface { - $timeProvider = new FixedTimeProvider( - new Time($dateTime->format('U'), $dateTime->format('u')) - ); - - $timeGenerator = new DefaultTimeGenerator( - $this->nodeProvider, - $this->timeConverter, - $timeProvider - ); - - $nodeHex = $node ? $node->toString() : null; - - $bytes = $timeGenerator->generate($nodeHex, $clockSeq); + $timeProvider = new FixedTimeProvider(new Time($dateTime->format('U'), $dateTime->format('u'))); + $timeGenerator = new DefaultTimeGenerator($this->nodeProvider, $this->timeConverter, $timeProvider); + $bytes = $timeGenerator->generate($node?->toString(), $clockSeq); return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_TIME); } /** - * @psalm-pure + * @pure */ public function fromHexadecimal(Hexadecimal $hex): UuidInterface { @@ -334,21 +315,16 @@ public function uuid2( int $localDomain, ?IntegerObject $localIdentifier = null, ?Hexadecimal $node = null, - ?int $clockSeq = null + ?int $clockSeq = null, ): UuidInterface { - $bytes = $this->dceSecurityGenerator->generate( - $localDomain, - $localIdentifier, - $node, - $clockSeq - ); + $bytes = $this->dceSecurityGenerator->generate($localDomain, $localIdentifier, $node, $clockSeq); return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_DCE_SECURITY); } /** * @inheritDoc - * @psalm-pure + * @pure */ public function uuid3($ns, string $name): UuidInterface { @@ -364,7 +340,7 @@ public function uuid4(): UuidInterface /** * @inheritDoc - * @psalm-pure + * @pure */ public function uuid5($ns, string $name): UuidInterface { @@ -373,17 +349,15 @@ public function uuid5($ns, string $name): UuidInterface public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface { - $nodeHex = $node ? $node->toString() : null; - $bytes = $this->timeGenerator->generate($nodeHex, $clockSeq); + $bytes = $this->timeGenerator->generate($node?->toString(), $clockSeq); // Rearrange the bytes, according to the UUID version 6 specification. $v6 = $bytes[6] . $bytes[7] . $bytes[4] . $bytes[5] . $bytes[0] . $bytes[1] . $bytes[2] . $bytes[3]; $v6 = bin2hex($v6); - // Drop the first four bits, while adding an empty four bits for the - // version field. This allows us to reconstruct the correct time from - // the bytes of this UUID. + // Drop the first four bits, while adding an empty four bits for the version field. This allows us to + // reconstruct the correct time from the bytes of this UUID. $v6Bytes = hex2bin(substr($v6, 1, 12) . '0' . substr($v6, -3)); $v6Bytes .= substr($bytes, 8); @@ -393,12 +367,10 @@ public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInt /** * Returns a version 7 (Unix Epoch time) UUID * - * @param DateTimeInterface|null $dateTime An optional date/time from which - * to create the version 7 UUID. If not provided, the UUID is generated - * using the current date/time. + * @param DateTimeInterface | null $dateTime An optional date/time from which to create the version 7 UUID. If not + * provided, the UUID is generated using the current date/time. * - * @return UuidInterface A UuidInterface instance that represents a - * version 7 UUID + * @return UuidInterface A UuidInterface instance that represents a version 7 UUID */ public function uuid7(?DateTimeInterface $dateTime = null): UuidInterface { @@ -409,64 +381,58 @@ public function uuid7(?DateTimeInterface $dateTime = null): UuidInterface } /** - * Returns a version 8 (Custom) UUID + * Returns a version 8 (custom format) UUID + * + * The bytes provided may contain any value according to your application's needs. Be aware, however, that other + * applications may not understand the semantics of the value. * - * The bytes provided may contain any value according to your application's - * needs. Be aware, however, that other applications may not understand the - * semantics of the value. + * @param string $bytes A 16-byte octet string. This is an open blob of data that you may fill with 128 bits of + * information. Be aware, however, bits 48 through 51 will be replaced with the UUID version field, and bits 64 + * and 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application needs. * - * @param string $bytes A 16-byte octet string. This is an open blob - * of data that you may fill with 128 bits of information. Be aware, - * however, bits 48 through 51 will be replaced with the UUID version - * field, and bits 64 and 65 will be replaced with the UUID variant. You - * MUST NOT rely on these bits for your application needs. + * @return UuidInterface A UuidInterface instance that represents a version 8 UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 8 UUID + * @pure */ public function uuid8(string $bytes): UuidInterface { + /** @phpstan-ignore possiblyImpure.methodCall */ return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_CUSTOM); } /** * Returns a Uuid created from the provided byte string * - * Uses the configured builder and codec and the provided byte string to - * construct a Uuid object. + * Uses the configured builder and codec and the provided byte string to construct a Uuid object. * * @param string $bytes The byte string from which to construct a UUID * - * @return UuidInterface An instance of UuidInterface, created from the - * provided bytes + * @return UuidInterface An instance of UuidInterface, created from the provided bytes * - * @psalm-pure + * @pure */ public function uuid(string $bytes): UuidInterface { - /** @psalm-suppress ImpurePropertyFetch */ return $this->uuidBuilder->build($this->codec, $bytes); } /** * Returns a version 3 or 5 namespaced Uuid * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) + * @param UuidInterface | string $ns The namespace (must be a valid UUID) * @param string $name The name to hash together with the namespace * @param int $version The version of UUID to create (3 or 5) - * @param string $hashAlgorithm The hashing algorithm to use when hashing - * together the namespace and name + * @param string $hashAlgorithm The hashing algorithm to use when hashing together the namespace and name * - * @return UuidInterface An instance of UuidInterface, created by hashing - * together the provided namespace and name + * @return UuidInterface An instance of UuidInterface, created by hashing together the provided namespace and name * - * @psalm-pure + * @pure */ private function uuidFromNsAndName( UuidInterface | string $ns, string $name, int $version, - string $hashAlgorithm + string $hashAlgorithm, ): UuidInterface { if (!($ns instanceof UuidInterface)) { $ns = $this->fromString($ns); @@ -474,30 +440,28 @@ private function uuidFromNsAndName( $bytes = $this->nameGenerator->generate($ns, $name, $hashAlgorithm); + /** @phpstan-ignore possiblyImpure.methodCall */ return $this->uuidFromBytesAndVersion(substr($bytes, 0, 16), $version); } /** - * Returns an RFC 4122 variant Uuid, created from the provided bytes and version + * Returns a Uuid created from the provided bytes and version * * @param string $bytes The byte string to convert to a UUID - * @param int $version The RFC 4122 version to apply to the UUID - * - * @return UuidInterface An instance of UuidInterface, created from the - * byte string and version + * @param int $version The version to apply to the UUID * - * @psalm-pure + * @return UuidInterface An instance of UuidInterface, created from the byte string and version */ private function uuidFromBytesAndVersion(string $bytes, int $version): UuidInterface { - /** @var array $unpackedTime */ + /** @var int[] $unpackedTime */ $unpackedTime = unpack('n*', substr($bytes, 6, 2)); - $timeHi = (int) $unpackedTime[1]; + $timeHi = $unpackedTime[1]; $timeHiAndVersion = pack('n*', BinaryUtils::applyVersion($timeHi, $version)); - /** @var array $unpackedClockSeq */ + /** @var int[] $unpackedClockSeq */ $unpackedClockSeq = unpack('n*', substr($bytes, 8, 2)); - $clockSeqHi = (int) $unpackedClockSeq[1]; + $clockSeqHi = $unpackedClockSeq[1]; $clockSeqHiAndReserved = pack('n*', BinaryUtils::applyVariant($clockSeqHi)); $bytes = substr_replace($bytes, $timeHiAndVersion, 6, 2); @@ -507,7 +471,6 @@ private function uuidFromBytesAndVersion(string $bytes, int $version): UuidInter return LazyUuidFromString::fromBytes($bytes); } - /** @psalm-suppress ImpureVariable */ return $this->uuid($bytes); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/UuidFactoryInterface.php b/lib/Google/vendor/ramsey/uuid/src/UuidFactoryInterface.php index d99fc9d58..5a83a7971 100644 --- a/lib/Google/vendor/ramsey/uuid/src/UuidFactoryInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/UuidFactoryInterface.php @@ -20,8 +20,7 @@ use Ramsey\Uuid\Validator\ValidatorInterface; /** - * UuidFactoryInterface defines common functionality all `UuidFactory` instances - * must implement + * UuidFactoryInterface defines the common functionality all `UuidFactory` instances must implement */ interface UuidFactoryInterface { @@ -30,10 +29,9 @@ interface UuidFactoryInterface * * @param string $bytes A binary string * - * @return UuidInterface A UuidInterface instance created from a binary - * string representation + * @return UuidInterface A UuidInterface instance created from a binary string representation * - * @psalm-pure + * @pure */ public function fromBytes(string $bytes): UuidInterface; @@ -41,19 +39,16 @@ public function fromBytes(string $bytes): UuidInterface; * Creates a UUID from a DateTimeInterface instance * * @param DateTimeInterface $dateTime The date and time - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID created from a DateTimeInterface instance + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID created from a DateTimeInterface instance */ public function fromDateTime( DateTimeInterface $dateTime, ?Hexadecimal $node = null, - ?int $clockSeq = null + ?int $clockSeq = null, ): UuidInterface; /** @@ -61,10 +56,9 @@ public function fromDateTime( * * @param string $integer String representation of 128-bit integer * - * @return UuidInterface A UuidInterface instance created from the string - * representation of a 128-bit integer + * @return UuidInterface A UuidInterface instance created from the string representation of a 128-bit integer * - * @psalm-pure + * @pure */ public function fromInteger(string $integer): UuidInterface; @@ -73,110 +67,89 @@ public function fromInteger(string $integer): UuidInterface; * * @param string $uuid A hexadecimal string * - * @return UuidInterface A UuidInterface instance created from a hexadecimal - * string representation + * @return UuidInterface A UuidInterface instance created from a hexadecimal string representation * - * @psalm-pure + * @pure */ public function fromString(string $uuid): UuidInterface; /** - * Returns the validator to use for the factory - * - * @psalm-mutation-free + * Returns the validator used by the factory */ public function getValidator(): ValidatorInterface; /** - * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, - * and the current time - * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 1 UUID + * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, and the current time + * + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may + * be represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 1 UUID */ public function uuid1($node = null, ?int $clockSeq = null): UuidInterface; /** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes - * - * @return UuidInterface A UuidInterface instance that represents a - * version 2 UUID + * Returns a version 2 (DCE Security) UUID from a local domain, local identifier, host ID, clock sequence, and the + * current time + * + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID + * on POSIX systems, if the local domain is a person or group, or it may be a site-defined identifier if the + * local domain is org + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes + * + * @return UuidInterface A UuidInterface instance that represents a version 2 UUID */ public function uuid2( int $localDomain, ?IntegerObject $localIdentifier = null, ?Hexadecimal $node = null, - ?int $clockSeq = null + ?int $clockSeq = null, ): UuidInterface; /** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name + * Returns a version 3 (name-based) UUID based on the MD5 hash of a namespace ID and a name * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) + * @param UuidInterface | string $ns The namespace (must be a valid UUID) * @param string $name The name to use for creating a UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 3 UUID + * @return UuidInterface A UuidInterface instance that represents a version 3 UUID * - * @psalm-pure + * @pure */ public function uuid3($ns, string $name): UuidInterface; /** * Returns a version 4 (random) UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 4 UUID + * @return UuidInterface A UuidInterface instance that represents a version 4 UUID */ public function uuid4(): UuidInterface; /** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name + * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a namespace ID and a name * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) + * @param UuidInterface | string $ns The namespace (must be a valid UUID) * @param string $name The name to use for creating a UUID * - * @return UuidInterface A UuidInterface instance that represents a - * version 5 UUID + * @return UuidInterface A UuidInterface instance that represents a version 5 UUID * - * @psalm-pure + * @pure */ public function uuid5($ns, string $name): UuidInterface; /** - * Returns a version 6 (reordered time) UUID from a host ID, sequence number, - * and the current time + * Returns a version 6 (reordered Gregorian time) UUID from a host ID, sequence number, and the current time * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * - * @return UuidInterface A UuidInterface instance that represents a - * version 6 UUID + * @return UuidInterface A UuidInterface instance that represents a version 6 UUID */ public function uuid6(?Hexadecimal $node = null, ?int $clockSeq = null): UuidInterface; } diff --git a/lib/Google/vendor/ramsey/uuid/src/UuidInterface.php b/lib/Google/vendor/ramsey/uuid/src/UuidInterface.php index cac9457de..38525cb51 100644 --- a/lib/Google/vendor/ramsey/uuid/src/UuidInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/UuidInterface.php @@ -22,10 +22,9 @@ use Stringable; /** - * A UUID is a universally unique identifier adhering to an agreed-upon - * representation format and standard for generation + * A UUID is a universally unique identifier adhering to an agreed-upon representation format and standard for generation * - * @psalm-immutable + * @immutable */ interface UuidInterface extends DeprecatedUuidInterface, @@ -34,15 +33,10 @@ interface UuidInterface extends Stringable { /** - * Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than - * the other UUID + * Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than the other UUID * - * The first of two UUIDs is greater than the second if the most - * significant field in which the UUIDs differ is greater for the first - * UUID. - * - * * Q. What's the value of being able to sort UUIDs? - * * A. Use them as keys in a B-Tree or similar mapping. + * The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is + * greater for the first UUID. * * @param UuidInterface $other The UUID to compare * @@ -53,11 +47,10 @@ public function compareTo(UuidInterface $other): int; /** * Returns true if the UUID is equal to the provided object * - * The result is true if and only if the argument is not null, is a UUID - * object, has the same variant, and contains the same value, bit for bit, - * as the UUID. + * The result is true if and only if the argument is not null, is a UUID object, has the same variant, and contains + * the same value, bit-for-bit, as the UUID. * - * @param object|null $other An object to test for equality with this UUID + * @param object | null $other An object to test for equality with this UUID * * @return bool True if the other object is equal to this UUID */ @@ -66,7 +59,9 @@ public function equals(?object $other): bool; /** * Returns the binary string representation of the UUID * - * @psalm-return non-empty-string + * @return non-empty-string + * + * @pure */ public function getBytes(): string; @@ -89,21 +84,27 @@ public function getInteger(): IntegerObject; * Returns the string standard representation of the UUID as a URN * * @link http://en.wikipedia.org/wiki/Uniform_Resource_Name Uniform Resource Name - * @link https://tools.ietf.org/html/rfc4122#section-3 RFC 4122, § 3: Namespace Registration Template + * @link https://www.rfc-editor.org/rfc/rfc9562.html#section-4 RFC 9562, 4. UUID Format + * @link https://www.rfc-editor.org/rfc/rfc9562.html#section-7 RFC 9562, 7. IANA Considerations + * @link https://www.rfc-editor.org/rfc/rfc4122.html#section-3 RFC 4122, 3. Namespace Registration Template */ public function getUrn(): string; /** * Returns the string standard representation of the UUID * - * @psalm-return non-empty-string + * @return non-empty-string + * + * @pure */ public function toString(): string; /** * Casts the UUID to the string standard representation * - * @psalm-return non-empty-string + * @return non-empty-string + * + * @pure */ public function __toString(): string; } diff --git a/lib/Google/vendor/ramsey/uuid/src/Validator/GenericValidator.php b/lib/Google/vendor/ramsey/uuid/src/Validator/GenericValidator.php index fd6095511..6d60647be 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Validator/GenericValidator.php +++ b/lib/Google/vendor/ramsey/uuid/src/Validator/GenericValidator.php @@ -22,7 +22,7 @@ /** * GenericValidator validates strings as UUIDs of any variant * - * @psalm-immutable + * @immutable */ final class GenericValidator implements ValidatorInterface { @@ -32,9 +32,7 @@ final class GenericValidator implements ValidatorInterface private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\z'; /** - * @psalm-return non-empty-string - * @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty - * @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty + * @return non-empty-string */ public function getPattern(): string { @@ -43,8 +41,10 @@ public function getPattern(): string public function validate(string $uuid): bool { + /** @phpstan-ignore possiblyImpure.functionCall */ $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); + /** @phpstan-ignore possiblyImpure.functionCall */ return $uuid === Uuid::NIL || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php b/lib/Google/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php index 3d4bd6f28..95dc8ebdc 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php +++ b/lib/Google/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php @@ -17,16 +17,14 @@ /** * A validator validates a string as a proper UUID * - * @psalm-immutable + * @immutable */ interface ValidatorInterface { /** * Returns the regular expression pattern used by this validator * - * @return string The regular expression pattern this validator uses - * - * @psalm-return non-empty-string + * @return non-empty-string The regular expression pattern this validator uses */ public function getPattern(): string; @@ -36,6 +34,8 @@ public function getPattern(): string; * @param string $uuid The string to validate as a UUID * * @return bool True if the string is a valid UUID, false otherwise + * + * @pure */ public function validate(string $uuid): bool; } diff --git a/lib/Google/vendor/ramsey/uuid/src/functions.php b/lib/Google/vendor/ramsey/uuid/src/functions.php index 1b3ce00f7..854c5c55b 100644 --- a/lib/Google/vendor/ramsey/uuid/src/functions.php +++ b/lib/Google/vendor/ramsey/uuid/src/functions.php @@ -20,15 +20,12 @@ use Ramsey\Uuid\Type\Integer as IntegerObject; /** - * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, - * and the current time + * Returns a version 1 (Gregorian time) UUID from a host ID, sequence number, and the current time * - * @param Hexadecimal|int|string|null $node A 48-bit number representing the - * hardware address; this number may be represented as an integer or a - * hexadecimal string - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes + * @param Hexadecimal | int | string | null $node A 48-bit number representing the hardware address; this number may be + * represented as an integer or a hexadecimal string + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * * @return non-empty-string Version 1 UUID as a string */ @@ -38,20 +35,15 @@ function v1($node = null, ?int $clockSeq = null): string } /** - * Returns a version 2 (DCE Security) UUID from a local domain, local - * identifier, host ID, clock sequence, and the current time - * - * @param int $localDomain The local domain to use when generating bytes, - * according to DCE Security - * @param IntegerObject|null $localIdentifier The local identifier for the - * given domain; this may be a UID or GID on POSIX systems, if the local - * domain is person or group, or it may be a site-defined identifier - * if the local domain is org - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates - * that could arise when the clock is set backwards in time or if the - * node ID changes + * Returns a version 2 (DCE Security) UUID from a local domain, local identifier, host ID, clock sequence, and the current time + * + * @param int $localDomain The local domain to use when generating bytes, according to DCE Security + * @param IntegerObject | null $localIdentifier The local identifier for the given domain; this may be a UID or GID on + * POSIX systems, if the local domain is a person or group, or it may be a site-defined identifier if the local + * domain is org + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * * @return non-empty-string Version 2 UUID as a string */ @@ -59,21 +51,19 @@ function v2( int $localDomain, ?IntegerObject $localIdentifier = null, ?Hexadecimal $node = null, - ?int $clockSeq = null + ?int $clockSeq = null, ): string { return Uuid::uuid2($localDomain, $localIdentifier, $node, $clockSeq)->toString(); } /** - * Returns a version 3 (name-based) UUID based on the MD5 hash of a - * namespace ID and a name + * Returns a version 3 (name-based) UUID based on the MD5 hash of a namespace ID and a name * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) + * @param UuidInterface | string $ns The namespace (must be a valid UUID) * * @return non-empty-string Version 3 UUID as a string * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners + * @pure */ function v3($ns, string $name): string { @@ -91,15 +81,13 @@ function v4(): string } /** - * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a - * namespace ID and a name + * Returns a version 5 (name-based) UUID based on the SHA-1 hash of a namespace ID and a name * - * @param string|UuidInterface $ns The namespace (must be a valid UUID) + * @param UuidInterface | string $ns The namespace (must be a valid UUID) * * @return non-empty-string Version 5 UUID as a string * - * @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, - * but under constant factory setups, this method operates in functionally pure manners + * @pure */ function v5($ns, string $name): string { @@ -107,14 +95,11 @@ function v5($ns, string $name): string } /** - * Returns a version 6 (reordered time) UUID from a host ID, sequence number, - * and the current time + * Returns a version 6 (reordered Gregorian time) UUID from a host ID, sequence number, and the current time * - * @param Hexadecimal|null $node A 48-bit number representing the hardware - * address - * @param int|null $clockSeq A 14-bit number used to help avoid duplicates that - * could arise when the clock is set backwards in time or if the node ID - * changes + * @param Hexadecimal | null $node A 48-bit number representing the hardware address + * @param int | null $clockSeq A 14-bit number used to help avoid duplicates that could arise when the clock is set + * backwards in time or if the node ID changes * * @return non-empty-string Version 6 UUID as a string */ @@ -126,9 +111,8 @@ function v6(?Hexadecimal $node = null, ?int $clockSeq = null): string /** * Returns a version 7 (Unix Epoch time) UUID * - * @param DateTimeInterface|null $dateTime An optional date/time from which - * to create the version 7 UUID. If not provided, the UUID is generated - * using the current date/time. + * @param DateTimeInterface|null $dateTime An optional date/time from which to create the version 7 UUID. If not + * provided, the UUID is generated using the current date/time. * * @return non-empty-string Version 7 UUID as a string */ @@ -138,19 +122,18 @@ function v7(?DateTimeInterface $dateTime = null): string } /** - * Returns a version 8 (custom) UUID + * Returns a version 8 (custom format) UUID * - * The bytes provided may contain any value according to your application's - * needs. Be aware, however, that other applications may not understand the - * semantics of the value. + * The bytes provided may contain any value according to your application's needs. Be aware, however, that other + * applications may not understand the semantics of the value. * - * @param string $bytes A 16-byte octet string. This is an open blob - * of data that you may fill with 128 bits of information. Be aware, - * however, bits 48 through 51 will be replaced with the UUID version - * field, and bits 64 and 65 will be replaced with the UUID variant. You - * MUST NOT rely on these bits for your application needs. + * @param string $bytes A 16-byte octet string. This is an open blob of data that you may fill with 128 bits of + * information. Be aware, however, bits 48 through 51 will be replaced with the UUID version field, and bits 64 and + * 65 will be replaced with the UUID variant. You MUST NOT rely on these bits for your application needs. * * @return non-empty-string Version 8 UUID as a string + * + * @pure */ function v8(string $bytes): string { diff --git a/lib/classes/class-bootstrap.php b/lib/classes/class-bootstrap.php index 12d33208b..6d266bb2a 100644 --- a/lib/classes/class-bootstrap.php +++ b/lib/classes/class-bootstrap.php @@ -1250,7 +1250,8 @@ public function admin_init() { ]); /* Setup wizard styles. */ - wp_register_style('wp-stateless-setup-wizard', $this->path('static/styles/wp-stateless-setup-wizard.css', 'url'), array(), self::$version); + // #152 + // wp_register_style('wp-stateless-setup-wizard', $this->path('static/styles/wp-stateless-setup-wizard.css', 'url'), array(), self::$version); wp_register_script('wp-stateless-select2', ud_get_stateless_media()->path('static/scripts/select2.min.js', 'url'), array('jquery'), self::$version, true); @@ -1335,10 +1336,12 @@ public function admin_enqueue_scripts($hook) { break; - case 'media_page_stateless-setup': + // #152 + // case 'media_page_stateless-setup': case 'settings_page_stateless-setup': wp_enqueue_style('wp-stateless'); - wp_enqueue_style('wp-stateless-setup-wizard'); + // #152 + // wp_enqueue_style('wp-stateless-setup-wizard'); break; case 'media_page_stateless-settings': case 'settings_page_stateless-settings': @@ -1756,11 +1759,15 @@ public function redirect_to_splash($plugin = '') { } if ($plugin == plugin_basename($this->boot_file)) { - $url = $this->get_settings_page_url('?page=stateless-setup&step=splash-screen'); + // #152 + // $url = $this->get_settings_page_url('?page=stateless-setup&step=splash-screen'); + $url = $this->get_settings_page_url('?page=stateless-settings'); + if (json_decode($this->settings->get('sm.key_json'))) { $url = $this->get_settings_page_url('?page=stateless-settings'); } - exit(wp_redirect($url)); + + exit( wp_redirect($url) ); } } diff --git a/lib/classes/class-settings.php b/lib/classes/class-settings.php index 44dcf0786..f241def0f 100644 --- a/lib/classes/class-settings.php +++ b/lib/classes/class-settings.php @@ -11,6 +11,7 @@ final class Settings extends \UDX\Settings { const DEFAULT_CACHE_CONTROL = 'public, max-age=36000, must-revalidate'; + const SETUP_MESSAGE_KEY = 'finish-setup'; /** * @var false|null|string @@ -93,6 +94,9 @@ public function __construct($bootstrap = null) { ) )); + add_action('activated_plugin', array( $this, 'check_setup' )); + add_action('admin_notices', array( $this, 'documentation_message' ), 1); + // Setting sm variable $this->refresh(); @@ -444,7 +448,8 @@ public function parse_root_dir_wildcards( $path ) { public function admin_menu() { $key_json = $this->get('sm.key_json'); if($this->get('sm.hide_setup_assistant') != 'true' && empty($key_json) ){ - $this->setup_wizard_ui = add_media_page( __( 'Stateless Setup', $this->bootstrap->domain ), __( 'Stateless Setup', $this->bootstrap->domain ), 'manage_options', 'stateless-setup', array($this, 'setup_wizard_interface') ); + // #152 + // $this->setup_wizard_ui = add_media_page( __( 'Stateless Setup', $this->bootstrap->domain ), __( 'Stateless Setup', $this->bootstrap->domain ), 'manage_options', 'stateless-setup', array($this, 'setup_wizard_interface') ); } if($this->get('sm.hide_settings_panel') != 'true'){ @@ -457,7 +462,8 @@ public function admin_menu() { * @param $slug */ public function network_admin_menu($slug) { - $this->setup_wizard_ui = add_submenu_page( 'settings.php', __( 'Stateless Setup', $this->bootstrap->domain ), __( 'Stateless Setup', $this->bootstrap->domain ), 'manage_options', 'stateless-setup', array($this, 'setup_wizard_interface') ); + // #152 + // $this->setup_wizard_ui = add_submenu_page( 'settings.php', __( 'Stateless Setup', $this->bootstrap->domain ), __( 'Stateless Setup', $this->bootstrap->domain ), 'manage_options', 'stateless-setup', array($this, 'setup_wizard_interface') ); $this->stateless_settings = add_submenu_page( 'settings.php', __( 'Stateless Settings', $this->bootstrap->domain ), __( 'Stateless Settings', $this->bootstrap->domain ), 'manage_options', 'stateless-settings', array($this, 'settings_interface') ); } @@ -725,6 +731,43 @@ public function plugin_row_meta($meta, $file) { return $meta; } + /** + * Upon plugin activation check if configuration is complete and show setup message if needed + */ + public function check_setup() { + if ( json_decode($this->get('sm.key_json')) ) { + return; + } + + delete_option('dismissed_notice_' . self::SETUP_MESSAGE_KEY); + } + + /** + * Check if configuration is complete and show setup message if needed + */ + public function documentation_message() { + if ( json_decode($this->get('sm.key_json')) ) { + return; + } + + $documentation_url = sprintf( + '%s', + $this->bootstrap->get_docs_page_url('/setup/'), + __('Refer to the setup manual', ud_get_stateless_media()->domain), + ); + + $this->bootstrap->errors->add([ + 'title' => __('WP-Stateless: Finish Setup', ud_get_stateless_media()->domain), + 'message' => sprintf( + __( + 'WP-Stateless has been successfully activated. %s for guidance on completing the setup.', + ud_get_stateless_media()->domain, + ), + $documentation_url, + ), + 'key' => self::SETUP_MESSAGE_KEY, + ], 'message'); + } } } diff --git a/lib/classes/status/class-info-google_cloud.php b/lib/classes/status/class-info-google_cloud.php index b51983d10..78e8e744f 100644 --- a/lib/classes/status/class-info-google_cloud.php +++ b/lib/classes/status/class-info-google_cloud.php @@ -79,6 +79,7 @@ public function get_soft_delete($value) { * Get the values related to GCS bucket configuration */ public function get_bucket_info($values) { + $rows = []; $client = ud_get_stateless_media()->get_client(); $bucket_name = ud_get_stateless_media()->get('sm.bucket'); @@ -92,32 +93,41 @@ public function get_bucket_info($values) { return $values + $rows; } - + // Get bucket info - $info = $client->service->buckets->get($bucket_name); - - $rows = [ - 'storage_class' => [ - 'label' => __('Storage Class', ud_get_stateless_media()->domain), - 'value' => $info->storageClass, - ], - 'public_access' => [ - 'label' => __('Public Access Prevention', ud_get_stateless_media()->domain), - 'value' => $info->iamConfiguration->publicAccessPrevention, - ], - 'access_control' => [ - 'label' => __('Access Control', ud_get_stateless_media()->domain), - 'value' => $info->iamConfiguration->uniformBucketLevelAccess->enabled, - ], - 'versioning' => [ - 'label' => __('Versioning', ud_get_stateless_media()->domain), - 'value' => isset($info->versioning) && isset($info->versioning->enabled) ? $info->versioning->enabled : false, - ], - 'soft_delete' => [ - 'label' => __('Soft Delete', ud_get_stateless_media()->domain), - 'value' => isset($info->softDeletePolicy) && isset($info->softDeletePolicy->retentionDurationSeconds) ? $info->softDeletePolicy->retentionDurationSeconds : 0, - ], - ]; + try { + $info = $client->service->buckets->get($bucket_name); + + $rows = [ + 'storage_class' => [ + 'label' => __('Storage Class', ud_get_stateless_media()->domain), + 'value' => $info->storageClass, + ], + 'public_access' => [ + 'label' => __('Public Access Prevention', ud_get_stateless_media()->domain), + 'value' => $info->iamConfiguration->publicAccessPrevention, + ], + 'access_control' => [ + 'label' => __('Access Control', ud_get_stateless_media()->domain), + 'value' => $info->iamConfiguration->uniformBucketLevelAccess->enabled, + ], + 'versioning' => [ + 'label' => __('Versioning', ud_get_stateless_media()->domain), + 'value' => isset($info->versioning) && isset($info->versioning->enabled) ? $info->versioning->enabled : false, + ], + 'soft_delete' => [ + 'label' => __('Soft Delete', ud_get_stateless_media()->domain), + 'value' => isset($info->softDeletePolicy) && isset($info->softDeletePolicy->retentionDurationSeconds) ? $info->softDeletePolicy->retentionDurationSeconds : 0, + ], + ]; + } catch ( \Throwable $e ) { + $rows = [ + 'gcs_error' => [ + 'label' => __('Error', ud_get_stateless_media()->domain), + 'value' => __('Google Cloud Storage Bucket info not available', ud_get_stateless_media()->domain), + ], + ]; + } return $values + $rows; } diff --git a/lib/classes/status/class-info.php b/lib/classes/status/class-info.php index e3f74f7ec..b545139ca 100644 --- a/lib/classes/status/class-info.php +++ b/lib/classes/status/class-info.php @@ -43,7 +43,7 @@ private function _init_hooks() { public function check_ajax() { if ( !check_ajax_referer('stateless_check_ajax') ) { wp_send_json_error([ - 'status' => 'Error', + 'status' => __('Error', ud_get_stateless_media()->domain), 'message' => __('Invalid nonce', ud_get_stateless_media()->domain), ]); } diff --git a/readme.md b/readme.md index aae31f842..62921f9b2 100644 --- a/readme.md +++ b/readme.md @@ -62,7 +62,7 @@ Looking for a unique feature for your next project? [Hire us!](https://udx.io/) 4. Set a Google Cloud Project, Google Cloud Storage Bucket, and Google Cloud Billing Account and click "Continue." 5. Installation and setup are now complete. Visit *Media > Stateless Settings* for more options. -For a more detailed installation and setup walkthrough, please see the [manual setup instructions on Github](https://stateless.udx.io/docs/manual-setup/). +For a more detailed installation and setup walkthrough, please see the [manual setup instructions on Github](https://stateless.udx.io/setup/). ## Frequently Asked Questions diff --git a/readme.txt b/readme.txt index f3c427a23..bea6d3a4d 100644 --- a/readme.txt +++ b/readme.txt @@ -5,8 +5,8 @@ Tags: google cloud, google cloud storage, cdn, uploads, backup License: GPLv2 or later Requires PHP: 8.0 Requires at least: 5.0 -Tested up to: 6.7.2 -Stable tag: 4.1.3 +Tested up to: 6.8 +Stable tag: 4.2.0 Upload and serve your WordPress media files from Google Cloud Storage. @@ -71,7 +71,7 @@ Looking for a unique feature for your next project? [Hire us!](https://udx.io/) 3. Click "Google Login" and sign-in with your Google account. 4. Set a Google Cloud Project, Google Cloud Storage Bucket, and Google Cloud Billing Account and click "Continue." 5. Installation and setup is now complete. Visit *Media > Stateless Settings* for more options. -For a more detailed installation and setup walkthrough, please see the [manual setup instructions on Github](https://stateless.udx.io/docs/manual-setup/). +For a more detailed installation and setup walkthrough, please see the [manual setup instructions on Github](https://stateless.udx.io/setup/). == Screenshots == @@ -135,6 +135,12 @@ Before upgrading to WP-Stateless 3.2.0, please, make sure you use PHP 7.2 or abo Before upgrading to WP-Stateless 3.0, please, make sure you tested it on your development environment. == Changelog == += 4.2 = +* ENHANCEMENT - Updated Client library for Google APIs from 2.18.2 to 2.18.3. +* ENHANCEMENT - updated `firebase/php-jwt` library from 6.10.2 to 6.11.1. +* ENHANCEMENT - updated `wpmetabox/meta-box` library from 5.10.1 to 5.10.11. +* DEPRECATED - Setup Assistant removed. + = 4.1.3 = * COMPATIBILITY - PolyLang Compatibility replaced with [WP-Stateless – Polylang Pro Addon](https://wordpress.org/plugins/wp-stateless-polylang-pro-addon/). * ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.7. diff --git a/static/views/settings-sections/network.php b/static/views/settings-sections/network.php index 02e4b40bb..d37c3b158 100644 --- a/static/views/settings-sections/network.php +++ b/static/views/settings-sections/network.php @@ -17,6 +17,7 @@ + domain); ?> @@ -35,3 +36,4 @@ +*/ ?> diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f41213b95..55efadc61 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -197,17 +197,17 @@ }, { "name": "firebase/php-jwt", - "version": "v6.10.2", - "version_normalized": "6.10.2.0", + "version": "v6.11.1", + "version_normalized": "6.11.1.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b" + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b", - "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", + "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66", "shasum": "" }, "require": { @@ -225,7 +225,7 @@ "ext-sodium": "Support EdDSA (Ed25519) signatures", "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" }, - "time": "2024-11-24T11:22:49+00:00", + "time": "2025-04-09T20:32:01+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -257,7 +257,7 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.2" + "source": "https://github.com/firebase/php-jwt/tree/v6.11.1" }, "install-path": "../firebase/php-jwt" }, @@ -345,16 +345,16 @@ }, { "name": "wpackagist-plugin/meta-box", - "version": "5.10.7", - "version_normalized": "5.10.7.0", + "version": "5.10.11", + "version_normalized": "5.10.11.0", "source": { "type": "svn", "url": "https://plugins.svn.wordpress.org/meta-box/", - "reference": "tags/5.10.7" + "reference": "tags/5.10.11" }, "dist": { "type": "zip", - "url": "https://downloads.wordpress.org/plugin/meta-box.5.10.7.zip" + "url": "https://downloads.wordpress.org/plugin/meta-box.5.10.11.zip" }, "require": { "composer/installers": "^1.0 || ^2.0" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 0ef00ca28..d632920b6 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'wpcloud/wp-stateless', 'pretty_version' => 'dev-latest', 'version' => 'dev-latest', - 'reference' => '9f0502c153794c5cdc49be5c50577f45add9364a', + 'reference' => 'e9bccc39abc840b90f13f5054b669f3d2d2fe0df', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -29,9 +29,9 @@ 'dev_requirement' => false, ), 'firebase/php-jwt' => array( - 'pretty_version' => 'v6.10.2', - 'version' => '6.10.2.0', - 'reference' => '30c19ed0f3264cb660ea496895cfb6ef7ee3653b', + 'pretty_version' => 'v6.11.1', + 'version' => '6.11.1.0', + 'reference' => 'd1e91ecf8c598d073d0995afa8cd5c75c6e19e66', 'type' => 'library', 'install_path' => __DIR__ . '/../firebase/php-jwt', 'aliases' => array(), @@ -56,9 +56,9 @@ 'dev_requirement' => false, ), 'wpackagist-plugin/meta-box' => array( - 'pretty_version' => '5.10.7', - 'version' => '5.10.7.0', - 'reference' => 'tags/5.10.7', + 'pretty_version' => '5.10.11', + 'version' => '5.10.11.0', + 'reference' => 'tags/5.10.11', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../wpmetabox/meta-box', 'aliases' => array(), @@ -67,7 +67,7 @@ 'wpcloud/wp-stateless' => array( 'pretty_version' => 'dev-latest', 'version' => 'dev-latest', - 'reference' => '9f0502c153794c5cdc49be5c50577f45add9364a', + 'reference' => 'e9bccc39abc840b90f13f5054b669f3d2d2fe0df', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/vendor/firebase/php-jwt/CHANGELOG.md b/vendor/firebase/php-jwt/CHANGELOG.md index 5feeb5a67..7b5f6ce40 100644 --- a/vendor/firebase/php-jwt/CHANGELOG.md +++ b/vendor/firebase/php-jwt/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [6.11.1](https://github.com/firebase/php-jwt/compare/v6.11.0...v6.11.1) (2025-04-09) + + +### Bug Fixes + +* update error text for consistency ([#528](https://github.com/firebase/php-jwt/issues/528)) ([c11113a](https://github.com/firebase/php-jwt/commit/c11113afa13265e016a669e75494b9203b8a7775)) + +## [6.11.0](https://github.com/firebase/php-jwt/compare/v6.10.2...v6.11.0) (2025-01-23) + + +### Features + +* support octet typed JWK ([#587](https://github.com/firebase/php-jwt/issues/587)) ([7cb8a26](https://github.com/firebase/php-jwt/commit/7cb8a265fa81edf2fa6ef8098f5bc5ae573c33ad)) + + +### Bug Fixes + +* refactor constructor Key to use PHP 8.0 syntax ([#577](https://github.com/firebase/php-jwt/issues/577)) ([29fa2ce](https://github.com/firebase/php-jwt/commit/29fa2ce9e0582cd397711eec1e80c05ce20fabca)) + ## [6.10.2](https://github.com/firebase/php-jwt/compare/v6.10.1...v6.10.2) (2024-11-24) diff --git a/vendor/firebase/php-jwt/README.md b/vendor/firebase/php-jwt/README.md index 4fd140745..e45ccb808 100644 --- a/vendor/firebase/php-jwt/README.md +++ b/vendor/firebase/php-jwt/README.md @@ -48,7 +48,8 @@ $decoded = JWT::decode($jwt, new Key($key, 'HS256')); print_r($decoded); // Pass a stdClass in as the third parameter to get the decoded header values -$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers = new stdClass()); +$headers = new stdClass(); +$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers); print_r($headers); /* @@ -290,7 +291,7 @@ $jwks = ['keys' => []]; // JWK::parseKeySet($jwks) returns an associative array of **kid** to Firebase\JWT\Key // objects. Pass this as the second parameter to JWT::decode. -JWT::decode($payload, JWK::parseKeySet($jwks)); +JWT::decode($jwt, JWK::parseKeySet($jwks)); ``` Using Cached Key Sets @@ -349,7 +350,7 @@ use InvalidArgumentException; use UnexpectedValueException; try { - $decoded = JWT::decode($payload, $keys); + $decoded = JWT::decode($jwt, $keys); } catch (InvalidArgumentException $e) { // provided key/key-array is empty or malformed. } catch (DomainException $e) { @@ -379,7 +380,7 @@ like this: use Firebase\JWT\JWT; use UnexpectedValueException; try { - $decoded = JWT::decode($payload, $keys); + $decoded = JWT::decode($jwt, $keys); } catch (LogicException $e) { // errors having to do with environmental setup or malformed JWT Keys } catch (UnexpectedValueException $e) { @@ -394,7 +395,7 @@ instead, you can do the following: ```php // return type is stdClass -$decoded = JWT::decode($payload, $keys); +$decoded = JWT::decode($jwt, $keys); // cast to array $decoded = json_decode(json_encode($decoded), true); diff --git a/vendor/firebase/php-jwt/src/JWK.php b/vendor/firebase/php-jwt/src/JWK.php index 6efc2fe38..405dcc49b 100644 --- a/vendor/firebase/php-jwt/src/JWK.php +++ b/vendor/firebase/php-jwt/src/JWK.php @@ -172,6 +172,12 @@ public static function parseKey(array $jwk, ?string $defaultAlg = null): ?Key // This library works internally with EdDSA keys (Ed25519) encoded in standard base64. $publicKey = JWT::convertBase64urlToBase64($jwk['x']); return new Key($publicKey, $jwk['alg']); + case 'oct': + if (!isset($jwk['k'])) { + throw new UnexpectedValueException('k not set'); + } + + return new Key(JWT::urlsafeB64Decode($jwk['k']), $jwk['alg']); default: break; } diff --git a/vendor/firebase/php-jwt/src/JWT.php b/vendor/firebase/php-jwt/src/JWT.php index dd9292a43..833a415e6 100644 --- a/vendor/firebase/php-jwt/src/JWT.php +++ b/vendor/firebase/php-jwt/src/JWT.php @@ -154,7 +154,7 @@ public static function decode( // token can actually be used. If it's not yet that time, abort. if (isset($payload->nbf) && floor($payload->nbf) > ($timestamp + static::$leeway)) { $ex = new BeforeValidException( - 'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) $payload->nbf) + 'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) floor($payload->nbf)) ); $ex->setPayload($payload); throw $ex; @@ -165,7 +165,7 @@ public static function decode( // correctly used the nbf claim). if (!isset($payload->nbf) && isset($payload->iat) && floor($payload->iat) > ($timestamp + static::$leeway)) { $ex = new BeforeValidException( - 'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) $payload->iat) + 'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) floor($payload->iat)) ); $ex->setPayload($payload); throw $ex; diff --git a/vendor/firebase/php-jwt/src/Key.php b/vendor/firebase/php-jwt/src/Key.php index 00cf7f2ed..b34eae258 100644 --- a/vendor/firebase/php-jwt/src/Key.php +++ b/vendor/firebase/php-jwt/src/Key.php @@ -9,18 +9,13 @@ class Key { - /** @var string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate */ - private $keyMaterial; - /** @var string */ - private $algorithm; - /** * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial * @param string $algorithm */ public function __construct( - $keyMaterial, - string $algorithm + private $keyMaterial, + private string $algorithm ) { if ( !\is_string($keyMaterial) @@ -38,10 +33,6 @@ public function __construct( if (empty($algorithm)) { throw new InvalidArgumentException('Algorithm must not be empty'); } - - // TODO: Remove in PHP 8.0 in favor of class constructor property promotion - $this->keyMaterial = $keyMaterial; - $this->algorithm = $algorithm; } /** diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php index 22c124dcf..378fcc9e4 100644 --- a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php @@ -33,7 +33,7 @@ protected function __construct( $args ) { //** Maybe define license client */ $this->define_license_client(); //** Load text domain */ - add_action( 'plugins_loaded', array( $this, 'load_textdomain' ), 1 ); + add_action( 'init', array( $this, 'load_textdomain' ), 1 ); //** May be initialize Licenses Manager. */ add_action( 'plugins_loaded', array( $this, 'define_license_manager' ), 1 ); //** Initialize plugin here. All plugin actions must be added on this step */ diff --git a/vendor/wpmetabox/meta-box/css/password.css b/vendor/wpmetabox/meta-box/css/password.css new file mode 100644 index 000000000..9473fcfd1 --- /dev/null +++ b/vendor/wpmetabox/meta-box/css/password.css @@ -0,0 +1,24 @@ +.rwmb-password-wrapper .rwmb-input { + position: relative; +} + +.rwmb-password-toggle { + background: none; + border: none; + padding: 0; + cursor: pointer; + position: absolute; + width: 36px; + height: 36px; + top: 0; + right: 0; + display: flex; + align-items: center; + justify-content: center; +} + +.rwmb-password-toggle svg { + width: 20px; + height: 20px; + fill: #2C3338; +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/switch.css b/vendor/wpmetabox/meta-box/css/switch.css index 5ea409bd6..58dd7156d 100644 --- a/vendor/wpmetabox/meta-box/css/switch.css +++ b/vendor/wpmetabox/meta-box/css/switch.css @@ -1,16 +1,18 @@ .rwmb-switch-label { + --size: 13px; + --padding: 2px; + --color: var(--wp-admin-theme-color, #2271b1); + + cursor: pointer; position: relative; display: inline-block; background-color: #ccc; - padding: 2px; + padding: var(--padding); border-radius: 3px; - min-width: 40px; - height: 22px; + min-width: calc(var(--size) * 2 + var(--padding) * 2); + height: calc(var(--size) + var(--padding) * 2); box-sizing: border-box; - - --color: var(--wp-admin-theme-color, #2271b1); } - .rwmb-switch.rwmb-switch { display: none; } @@ -21,7 +23,7 @@ } .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider:before { - left: calc(100% - 20px); + left: calc(100% - var(--size) - var(--padding)); } .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-off { @@ -48,10 +50,10 @@ .rwmb-switch-slider:before { position: absolute; content: attr(title-before) ""; - height: 18px; - width: 18px; - left: 2px; - bottom: 2px; + height: var(--size); + width: var(--size); + left: var(--padding); + bottom: var(--padding); z-index: 99; background-color: white; transition: .4s; @@ -64,7 +66,7 @@ .rwmb-switch-label--rounded, .rwmb-switch-label--rounded .rwmb-switch-slider { - border-radius: 34px; + border-radius: 99px; } .rwmb-switch-label--rounded .rwmb-switch-slider:before { @@ -81,15 +83,15 @@ font-size: 11px; position: relative; z-index: 20; - line-height: 18px; + line-height: var(--size); } .rwmb-switch-on { - padding-right: 20px; + padding-right: calc(var(--size) + var(--padding)); } .rwmb-switch-off { - padding-left: 20px; + padding-left: calc(var(--size) + var(--padding)); } /* Admin color schemes */ diff --git a/vendor/wpmetabox/meta-box/inc/about/about.php b/vendor/wpmetabox/meta-box/inc/about/about.php deleted file mode 100644 index e2ee46f0b..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/about.php +++ /dev/null @@ -1,146 +0,0 @@ -is_pro = $update_checker && $update_checker->has_extensions(); - } - - public function init(): void { - // Add links to about page in the plugin action links. - add_filter( 'plugin_action_links_meta-box/meta-box.php', [ $this, 'plugin_links' ], 20 ); - - // Add a shared top-level admin menu and Dashboard page. Use priority 5 to show Dashboard at the top. - add_action( 'admin_menu', [ $this, 'add_menu' ], 5 ); - add_action( 'admin_menu', [ $this, 'add_submenu' ], 5 ); - - // If no admin menu, then hide the About page. - add_action( 'admin_head', [ $this, 'hide_page' ] ); - - // Redirect to about page after activation. - add_action( 'activated_plugin', [ $this, 'redirect' ], 10, 2 ); - } - - public function plugin_links( array $links ): array { - $links[] = '' . esc_html__( 'About', 'meta-box' ) . ''; - if ( ! $this->is_pro ) { - $links[] = '' . esc_html__( 'Go Pro', 'meta-box' ) . ''; - } - return $links; - } - - public function add_menu(): void { - if ( ! $this->has_menu() ) { - return; - } - add_menu_page( - __( 'Meta Box', 'meta-box' ), - __( 'Meta Box', 'meta-box' ), - 'activate_plugins', - 'meta-box', - '__return_null', - 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIxNjQuMzI4IDE0OS40NDEgNTMuNDcgNDIuNjYiIHdpZHRoPSI1My40NyIgaGVpZ2h0PSI0Mi42NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNIDIwNC42NjggMTc5LjM5MSBMIDIwNS40ODggMTYwLjU1MSBMIDIwNS4zMTggMTYwLjUyMSBMIDE5My44ODggMTkyLjEwMSBMIDE4OC4xNDggMTkyLjEwMSBMIDE3Ni43NzggMTYwLjY0MSBMIDE3Ni42MDggMTYwLjY2MSBMIDE3Ny40MjggMTc5LjM5MSBMIDE3Ny40MjggMTg2LjA5MSBMIDE4MS45OTggMTg2Ljk3MSBMIDE4MS45OTggMTkyLjEwMSBMIDE2NC4zMjggMTkyLjEwMSBMIDE2NC4zMjggMTg2Ljk3MSBMIDE2OC44NjggMTg2LjA5MSBMIDE2OC44NjggMTU1LjQ4MSBMIDE2NC4zMjggMTU0LjYwMSBMIDE2NC4zMjggMTQ5LjQ0MSBMIDE2OC44NjggMTQ5LjQ0MSBMIDE4MC4wMjggMTQ5LjQ0MSBMIDE5MC44OTggMTgwLjg4MSBMIDE5MS4wNzggMTgwLjg4MSBMIDIwMi4wMzggMTQ5LjQ0MSBMIDIxNy43OTggMTQ5LjQ0MSBMIDIxNy43OTggMTU0LjYwMSBMIDIxMy4yMjggMTU1LjQ4MSBMIDIxMy4yMjggMTg2LjA5MSBMIDIxNy43OTggMTg2Ljk3MSBMIDIxNy43OTggMTkyLjEwMSBMIDIwMC4xMjggMTkyLjEwMSBMIDIwMC4xMjggMTg2Ljk3MSBMIDIwNC42NjggMTg2LjA5MSBMIDIwNC42NjggMTc5LjM5MSBaIiBzdHlsZT0iZmlsbDogcmdiKDE1OCwgMTYzLCAxNjgpOyB3aGl0ZS1zcGFjZTogcHJlOyIvPgo8L3N2Zz4=' - ); - } - - public function add_submenu(): void { - $parent_menu = $this->has_menu() ? 'meta-box' : $this->get_parent_menu(); - $about = add_submenu_page( - $parent_menu, - __( 'Welcome to Meta Box', 'meta-box' ), - __( 'Dashboard', 'meta-box' ), - 'activate_plugins', - 'meta-box', - [ $this, 'render' ] - ); - add_action( "load-$about", [ $this, 'enqueue' ] ); - } - - public function hide_page(): void { - remove_submenu_page( $this->get_parent_menu(), 'meta-box' ); - } - - public function render(): void { - ?> -
-
-
-
-
- is_pro ) { - include __DIR__ . '/sections/getting-started-pro.php'; - } else { - include __DIR__ . '/sections/getting-started.php'; - } - include __DIR__ . '/sections/extensions.php'; - include __DIR__ . '/sections/support.php'; - do_action( 'rwmb_about_tabs_content' ); - ?> -
-
-
- is_pro ) { - include __DIR__ . '/sections/upgrade.php'; - } - ?> -
-
-
-
- post( 'action' ) && count( rwmb_request()->post( 'checked' ) ) > 1; - $is_doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; - - if ( ! $is_plugin || $network_wide || $is_cli || $is_bulk_activate || $this->is_bundled() || $is_doing_ajax ) { - return; - } - wp_safe_redirect( $this->get_menu_link() ); - die; - } - - private function get_menu_link(): string { - $menu = $this->has_menu() ? 'admin.php?page=meta-box' : $this->get_parent_menu() . '?page=meta-box'; - return admin_url( $menu ); - } - - private function get_parent_menu(): string { - return 'plugins.php'; - } - - private function has_menu(): bool { - return apply_filters( 'rwmb_admin_menu', false ); - } - - private function is_bundled(): bool { - // @codingStandardsIgnoreLine - foreach ( $_REQUEST as $key => $value ) { - if ( str_contains( $key, 'tgmpa' ) || ( is_string( $value ) && str_contains( $value, 'tgmpa' ) ) ) { - return true; - } - } - return false; - } -} diff --git a/vendor/wpmetabox/meta-box/inc/about/css/about.css b/vendor/wpmetabox/meta-box/inc/about/css/about.css deleted file mode 100644 index dd0e34e30..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/css/about.css +++ /dev/null @@ -1,234 +0,0 @@ -.about-wrap { - padding-right: 20px; -} -.about-wrap.about-wrap .wp-badge { - background-image: url(../images/meta-box.svg); - background-color: #fff; - color: #222; - text-transform: uppercase; - font-weight: bold; - text-decoration: none; -} - -.wp-badge:hover { - text-decoration: none; -} - -.about-buttons .dashicons { - position: relative; - top: 5px; - width: 16px; - height: 16px; - font-size: 16px; -} - -#poststuff .nav-tab-wrapper { - padding: 0; - margin-top: 60px; -} - -.nav-tab-active:focus { - box-shadow: none; -} - -.gt-tab-pane { - display: none; - padding-top: 24px; -} -.gt-tab-pane .about-description.about-description { - margin-top: 0; -} - -.gt-is-active { - display: block; -} - -.two { - display: flex; -} -.two .col + .col { - margin-left: 40px; -} -.two h3 { - margin-top: 2em; -} -.two h3:first-child { - margin-top: 0; -} -.two img { - display: block; - box-shadow: 0 0 20px rgba(0, 0, 0, .1); - border-radius: 4px; -} -.screenshot { - display: block; - margin: 3em auto; -} -.col { - flex: 1; - max-width: 50%; -} -.col ul { - font-size: 14px; - margin: 2em 0; -} -.col li a { - text-decoration: none; -} - -/* Extensions tab */ -.extensions { - margin-top: 40px; - display: flex; - justify-content: space-between; - flex-wrap: wrap; -} -.extension { - width: 100%; - margin-bottom: 20px; -} -.extension-inner { - display: flex; - background: #fff; - padding: 25px 20px; -} -.extension-inner svg { - width: 36px; - height: 36px; - margin: 8px 15px 0 0; - fill: #b4b9be; -} -.extension-info { - flex: 1; -} -.extension-info.extension-info h3 { - margin: 0 0 5px; - font-size: 1.2em; -} -.extension-info p { - margin: 0; -} -.extension-action { - border-top: 1px solid #ddd; - text-align: center; - padding: 20px; - background: #f7f7f7; -} - -/* Extensions tab: 2 columns */ -@media (min-width: 768px) { - .extension { - width: 49%; - } -} -/* For large screen: 3 columns */ -@media (min-width: 1600px) { - .extension { - width: 32%; - } -} - -/* Right column */ -#post-body.columns-2 #postbox-container-1 { - position: fixed; - right: 320px; - top: 80px; -} - -@media (max-width: 1279px) { - #postbox-container-1 { - display: none; - } - #poststuff #post-body.columns-2 { - margin-right: 0; - } -} - -/* Upgrade */ -.upgrade { - border: 3px dashed #82878c; - background: #fff; - padding: 15px; -} -.upgrade .dashicons { - color: #ef4836; - width: 26px; - height: 26px; - font-size: 30px; - position: relative; - top: -4px; - left: -5px; -} -.upgrade h3 { - margin: 0; -} -.upgrade li { - padding-left: 20px; - position: relative; -} -.upgrade svg { - width: 1em; - height: 1em; - fill: #0073aa; - position: absolute; - top: 4px; - left: 0; -} - -.youtube-video-container { - position: relative; - overflow: hidden; - width: 100%; -} - -.youtube-video-container::after { - display: block; - content: ""; - padding-top: 56.25%; -} - -.youtube-video-container iframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} -#getting-started .tutorial a { - font-size: 32px; - font-weight: 600; - color:#32373c; - text-decoration: unset; -} -#getting-started .tutorial a:hover { - color: #2271b1; -} -.tutorial-items{ - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 15px 30px; - margin-top: 30px; -} -@media (max-width: 767px) { - .tutorial-items{ - grid-template-columns: repeat(1, 1fr); - gap: 15px 0px; - } -} -.tutorial-items a{ - font-size: 20px; - font-weight: 500; - color:#32373c; - text-decoration: unset; -} -.tutorial-items a:hover{ - color:#2271b1; -} -.tutorial-items a span{ - margin-right: 5px; -} -.tutorial-items a p{ - font-size: 14px; - font-weight: 400; - color:#32373c; -} diff --git a/vendor/wpmetabox/meta-box/inc/about/images/meta-box.svg b/vendor/wpmetabox/meta-box/inc/about/images/meta-box.svg deleted file mode 100644 index 7fab0a8e6..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/images/meta-box.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/vendor/wpmetabox/meta-box/inc/about/images/online-generator.png b/vendor/wpmetabox/meta-box/inc/about/images/online-generator.png deleted file mode 100644 index 4bc57677d..000000000 Binary files a/vendor/wpmetabox/meta-box/inc/about/images/online-generator.png and /dev/null differ diff --git a/vendor/wpmetabox/meta-box/inc/about/js/about.js b/vendor/wpmetabox/meta-box/inc/about/js/about.js deleted file mode 100644 index f3b0a0b9a..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/js/about.js +++ /dev/null @@ -1,26 +0,0 @@ -( function ( $ ) { - 'use strict'; - - function tabs() { - var $container = $( '.nav-tab-wrapper' ), - $tabs = $container.find( '.nav-tab' ), - $panes = $( '.gt-tab-pane' ); - - $container.on( - 'click', - '.nav-tab', - function ( e ) { - e.preventDefault(); - - $tabs.removeClass( 'nav-tab-active' ); - $( this ).addClass( 'nav-tab-active' ); - - $panes.removeClass( 'gt-is-active' ); - $panes.filter( $( this ).attr( 'href' ) ).addClass( 'gt-is-active' ); - } - ); - } - - // Auto activate tabs when DOM ready. - $( tabs ); -} ( jQuery ) ); diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/extensions.php b/vendor/wpmetabox/meta-box/inc/about/sections/extensions.php deleted file mode 100644 index 925c261e1..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/extensions.php +++ /dev/null @@ -1,119 +0,0 @@ - - -
-

-
- -

-
-
-
- -
-

MB Custom Post Type

-

-
-
-
- -
-
-
-
- -
-

Meta Box Builder

-

-
-
-
- -
-
-
-
- -
-

Meta Box Group

-

-
-
-
- -
-
-
-
- -
-

MB Settings Page

-

-
-
-
- -
-
-
-
- -
-

Meta Box Conditional Logic

-

-
-
-
- -
-
-
-
- -
-

MB User Profile

-

-
-
-
- -
-
-
-
- -
-

MB Frontend Submission

-

-
-
-
- -
-
-
-
- -
-

MB Custom Table

-

-
-
-
- -
-
-
-
- -
-

MB Relationships

-

-
-
-
- -
-
-
- -
diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started-pro.php b/vendor/wpmetabox/meta-box/inc/about/sections/getting-started-pro.php deleted file mode 100644 index fcf2d66a3..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started-pro.php +++ /dev/null @@ -1,18 +0,0 @@ - - -
-

-
- -
-

-

-
-

-

-

-

-

-

-
-
diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started.php b/vendor/wpmetabox/meta-box/inc/about/sections/getting-started.php deleted file mode 100644 index 768bfc1d2..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started.php +++ /dev/null @@ -1,30 +0,0 @@ - - -
-
-
-

-

- - <?php esc_attr_e( 'online generator', 'meta-box' ); ?> - -

-
- -
-

-

-

    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
- -
- -
-

-
-
-
diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/products.php b/vendor/wpmetabox/meta-box/inc/about/sections/products.php deleted file mode 100644 index af9264c41..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/products.php +++ /dev/null @@ -1,13 +0,0 @@ - - -
-

- -

- -
diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/review.php b/vendor/wpmetabox/meta-box/inc/about/sections/review.php deleted file mode 100644 index 11942bd60..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/review.php +++ /dev/null @@ -1,11 +0,0 @@ - - -
-

- -

-
-

-

-
-
diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/support.php b/vendor/wpmetabox/meta-box/inc/about/sections/support.php deleted file mode 100644 index aa15c394e..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/support.php +++ /dev/null @@ -1,29 +0,0 @@ - - -
-

- [ - 'href' => [], - ], - ]; - // Translators: %s - link to documentation. - echo wp_kses( sprintf( __( 'Still need help with Meta Box? We offer excellent support for you. But don\'t forget to check our documentation first.', 'meta-box' ), 'https://docs.metabox.io?utm_source=dashboard&utm_medium=link&utm_campaign=meta_box' ), $allowed_html ); - ?> -

-
-
-

-

-

-

-
- -
-

-

-

-
-
-
diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/tabs.php b/vendor/wpmetabox/meta-box/inc/about/sections/tabs.php deleted file mode 100644 index f5fb0a378..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/tabs.php +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/upgrade.php b/vendor/wpmetabox/meta-box/inc/about/sections/upgrade.php deleted file mode 100644 index dca916d8a..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/upgrade.php +++ /dev/null @@ -1,20 +0,0 @@ - - -
-

-

-
    -
  • -
  • -
  • -
  • -
  • -
  • -
- -
- - - - - diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/welcome.php b/vendor/wpmetabox/meta-box/inc/about/sections/welcome.php deleted file mode 100644 index 9e0038bc9..000000000 --- a/vendor/wpmetabox/meta-box/inc/about/sections/welcome.php +++ /dev/null @@ -1,18 +0,0 @@ - - -

- -

-
- -

- - - - -

diff --git a/vendor/wpmetabox/meta-box/inc/field.php b/vendor/wpmetabox/meta-box/inc/field.php index 45b2c0e54..43f043cb4 100644 --- a/vendor/wpmetabox/meta-box/inc/field.php +++ b/vendor/wpmetabox/meta-box/inc/field.php @@ -37,12 +37,12 @@ public static function show( array $field, bool $saved, $post_id = 0 ) { $field_html = self::filter( 'html', $field_html, $field, $meta ); } - $end = static::end_html( $field ); - $end = self::filter( 'end_html', $end, $field, $meta ); + $end = static::end_html( $field ); + $end = self::filter( 'end_html', $end, $field, $meta ); $html = self::filter( 'wrapper_html', $begin . $field_html . $end, $field, $meta ); // Display label and input in DIV and allow user-defined classes to be appended. - $classes = "rwmb-field rwmb-{$field['type']}-wrapper " . $field['class']; + $classes = "rwmb-field rwmb-{$field['type']}-wrapper " . $field['class']; $required = $field['required'] || ! empty( $field['attributes']['required'] ); if ( $required ) { @@ -167,9 +167,9 @@ public static function meta( $post_id, $saved, $field ) { return ''; } // Get raw meta. - $raw_meta = self::call( $field, 'raw_meta', $post_id ); + $raw_meta = self::call( $field, 'raw_meta', $post_id ); $single_std = self::call( 'get_single_std', $field ); - $std = self::call( 'get_std', $field ); + $std = self::call( 'get_std', $field ); $saved = $saved && $field['save_field']; // Use $field['std'] only when the meta box hasn't been saved (i.e. the first time we run). @@ -183,8 +183,8 @@ public static function meta( $post_id, $saved, $field ) { $meta = is_array( $raw_meta ) ? $raw_meta : []; if ( empty( $meta ) ) { - $empty_meta = empty( $raw_meta ) ? [null] : $raw_meta; - $std = $field['clone_empty_start'] ? [] : $std; + $empty_meta = empty( $raw_meta ) ? [ null ] : $raw_meta; + $std = $field['clone_empty_start'] ? [] : $std; $empty_std = $field['clone_empty_start'] ? [] : Arr::to_depth( $empty_meta, Arr::depth( $std ) ); $meta = $saved ? $empty_std : $std; diff --git a/vendor/wpmetabox/meta-box/inc/fields/datetime.php b/vendor/wpmetabox/meta-box/inc/fields/datetime.php index 144cee0e7..8f10f569a 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/datetime.php +++ b/vendor/wpmetabox/meta-box/inc/fields/datetime.php @@ -81,7 +81,7 @@ public static function register_assets() { wp_register_script( 'rwmb-time', RWMB_JS_URL . 'time.js', [ 'jquery-ui-timepicker-i18n', 'jquery-ui-button', 'jquery-ui-timepicker-slider', 'rwmb' ], RWMB_VER, true ); $handles = [ 'datetime', 'time' ]; - $locale = str_replace( '_', '-', get_locale() ); + $locale = str_replace( '_', '-', get_user_locale() ); $locale_short = substr( $locale, 0, 2 ); $data = [ 'locale' => $locale, @@ -213,7 +213,7 @@ public static function from_save_format( $meta, array $field ): string { ); $format = $formats[ $field['save_format'] ]; $date = DateTimeImmutable::createFromFormat( $format, $meta ); - return false === $date ? $meta : $date->format( $field['php_format'] ); + return false === $date ? (string) $meta : $date->format( $field['php_format'] ); } /** diff --git a/vendor/wpmetabox/meta-box/inc/fields/input.php b/vendor/wpmetabox/meta-box/inc/fields/input.php index eb3925d5b..2831d5b30 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/input.php +++ b/vendor/wpmetabox/meta-box/inc/fields/input.php @@ -29,7 +29,7 @@ public static function html( $meta, $field ) { } $attributes = static::get_attributes( $field, $meta ); - $output .= sprintf( '%s', self::render_attributes( $attributes ), self::datalist( $field ) ); + $output .= sprintf( '%s', self::render_attributes( $attributes ), self::datalist( $field ) ); if ( $field['append'] ) { $output .= '' . $field['append'] . ''; @@ -50,7 +50,7 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - $field = wp_parse_args( $field, [ + $field = wp_parse_args( $field, [ 'autocomplete' => false, 'datalist' => false, 'readonly' => false, @@ -61,7 +61,7 @@ public static function normalize( $field ) { 'append' => '', ] ); if ( $field['datalist'] ) { - $field['datalist'] = wp_parse_args( $field['datalist'], [ + $field['datalist'] = wp_parse_args( $field['datalist'], [ 'id' => $field['id'] . '_list', 'options' => [], ] ); @@ -78,7 +78,7 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( $attributes, [ + $attributes = wp_parse_args( $attributes, [ 'autocomplete' => $field['autocomplete'], 'list' => $field['datalist'] ? $field['datalist']['id'] : false, 'readonly' => $field['readonly'], @@ -96,7 +96,7 @@ public static function get_attributes( $field, $value = null ) { return $attributes; } - protected static function datalist( array $field ) : string { + protected static function datalist( array $field ): string { if ( empty( $field['datalist'] ) ) { return ''; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/osm.php b/vendor/wpmetabox/meta-box/inc/fields/osm.php index bb63970eb..e33e65398 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/osm.php +++ b/vendor/wpmetabox/meta-box/inc/fields/osm.php @@ -12,7 +12,7 @@ public static function admin_enqueue_scripts() { wp_style_add_data( 'rwmb-osm', 'path', RWMB_CSS_DIR . 'osm.css' ); wp_enqueue_script( 'rwmb-osm', RWMB_JS_URL . 'osm.js', [ 'jquery', 'jquery-ui-autocomplete', 'leaflet' ], RWMB_VER, true ); - RWMB_Helpers_Field::localize_script_once( 'rwmb-osm', 'RWMB_Osm', [ + RWMB_Helpers_Field::localize_script_once( 'rwmb-osm', 'RWMB_Osm', [ 'no_results_string' => __( 'No results found', 'meta-box' ), ] ); } @@ -59,7 +59,7 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - $field = wp_parse_args( $field, [ + $field = wp_parse_args( $field, [ 'std' => '', 'address_field' => '', 'language' => '', @@ -87,7 +87,7 @@ public static function get_value( $field, $args = [], $post_id = null ) { $location = []; foreach ( $value as $clone ) { list( $latitude, $longitude, $zoom ) = explode( ',', $clone . ',,' ); - $location[] = compact( 'latitude', 'longitude', 'zoom' ); + $location[] = compact( 'latitude', 'longitude', 'zoom' ); } return $location; } @@ -117,18 +117,18 @@ public static function format_single_value( $field, $value, $args, $post_id ): s * @return string */ public static function render_map( $location, $args = [] ) { - // For compatibility with previous version, or within groups. + // For compatibility with previous version, or within groups. if ( is_string( $location ) ) { list( $latitude, $longitude, $zoom ) = explode( ',', $location . ',,' ); } else { extract( $location ); } - if ( ! $latitude || ! $longitude ) { - return ''; - } + if ( ! $latitude || ! $longitude ) { + return ''; + } - $args = wp_parse_args( $args, [ + $args = wp_parse_args( $args, [ 'latitude' => $latitude, 'longitude' => $longitude, 'width' => '100%', @@ -149,7 +149,7 @@ public static function render_map( $location, $args = [] ) { * More Open Street Map options * @link https://leafletjs.com/reference-1.5.0.html#map-option */ - $args['js_options'] = wp_parse_args( $args['js_options'], [ + $args['js_options'] = wp_parse_args( $args['js_options'], [ // Default to 'zoom' level set in admin, but can be overwritten. 'zoom' => $args['zoom'], ] ); @@ -165,6 +165,10 @@ public static function render_map( $location, $args = [] ) { private static function enqueue_map_assets() { wp_enqueue_style( 'leaflet', RWMB_JS_URL . 'leaflet/leaflet.css', [], '1.9.4' ); + wp_style_add_data( 'leaflet', 'path', RWMB_JS_URL . 'leaflet/leaflet.css' ); wp_enqueue_script( 'leaflet', RWMB_JS_URL . 'leaflet/leaflet.js', [], '1.9.4', true ); + wp_enqueue_style( 'leaflet-gesture-handling', RWMB_JS_URL . 'leaflet/leaflet-gesture-handling.min.css', [ 'leaflet' ], '1.2.2' ); + wp_style_add_data( 'leaflet-gesture-handling', 'path', RWMB_JS_URL . 'leaflet/leaflet-gesture-handling.min.css' ); + wp_enqueue_script( 'leaflet-gesture-handling', RWMB_JS_URL . 'leaflet/leaflet-gesture-handling.min.js', [ 'leaflet' ], '1.2.2' ); } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/password.php b/vendor/wpmetabox/meta-box/inc/fields/password.php index 0cc729e1e..af86721fe 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/password.php +++ b/vendor/wpmetabox/meta-box/inc/fields/password.php @@ -5,6 +5,36 @@ * The secured password field. */ class RWMB_Password_Field extends RWMB_Input_Field { + public static function admin_enqueue_scripts() { + parent::admin_enqueue_scripts(); + wp_enqueue_style( 'rwmb-password', RWMB_CSS_URL . 'password.css', [], RWMB_VER ); + wp_style_add_data( 'rwmb-password', 'path', RWMB_CSS_DIR . 'password.css' ); + wp_enqueue_script( 'rwmb-password', RWMB_JS_URL . 'password.js', [], RWMB_VER, true ); + } + + public static function html( $meta, $field ) { + $output = parent::html( $meta, $field ); + + // Skip password toggle if field has append + if ( $field['append'] ) { + return $output; + } + + // Add password toggle button + $button = ''; + + $output .= $button; + + return $output; + } + /** * Store secured password in the database. * diff --git a/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php b/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php index 833856fba..31bae9a09 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php +++ b/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php @@ -17,7 +17,7 @@ public static function admin_enqueue_scripts() { // Localize. $dependencies = [ 'rwmb-select2', 'rwmb-select', 'underscore' ]; - $locale = str_replace( '_', '-', get_locale() ); + $locale = str_replace( '_', '-', get_user_locale() ); $locale_short = substr( $locale, 0, 2 ); $locale = file_exists( RWMB_DIR . "js/select2/i18n/$locale.js" ) ? $locale : $locale_short; diff --git a/vendor/wpmetabox/meta-box/inc/loader.php b/vendor/wpmetabox/meta-box/inc/loader.php index 59cecde4b..6ab3559b0 100644 --- a/vendor/wpmetabox/meta-box/inc/loader.php +++ b/vendor/wpmetabox/meta-box/inc/loader.php @@ -7,7 +7,7 @@ class RWMB_Loader { protected function constants() { // Script version, used to add version for scripts and styles. - define( 'RWMB_VER', '5.10.7' ); + define( 'RWMB_VER', '5.10.11' ); list( $path, $url ) = self::get_path( dirname( __DIR__ ) ); @@ -101,6 +101,7 @@ public function init() { $wpml->init(); // Update. + $update_option = null; $update_checker = null; if ( class_exists( '\MetaBox\Updater\Option' ) ) { $update_option = new \MetaBox\Updater\Option(); @@ -119,8 +120,8 @@ public function init() { new \MetaBox\Integrations\Oxygen(); if ( is_admin() ) { - $about = new RWMB_About( $update_checker ); - $about->init(); + new \MetaBox\Dashboard\Dashboard( $update_checker, $update_option ); + new \MetaBox\FeaturedPlugins(); } // Public functions. diff --git a/vendor/wpmetabox/meta-box/js/leaflet/leaflet-gesture-handling.min.css b/vendor/wpmetabox/meta-box/js/leaflet/leaflet-gesture-handling.min.css new file mode 100644 index 000000000..7cbdcfcb8 --- /dev/null +++ b/vendor/wpmetabox/meta-box/js/leaflet/leaflet-gesture-handling.min.css @@ -0,0 +1 @@ +@-webkit-keyframes leaflet-gestures-fadein{0%{opacity:0}100%{opacity:1}}@keyframes leaflet-gestures-fadein{0%{opacity:0}100%{opacity:1}}.leaflet-container:after{-webkit-animation:leaflet-gestures-fadein .8s backwards;animation:leaflet-gestures-fadein .8s backwards;color:#fff;font-family:Roboto,Arial,sans-serif;font-size:22px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:15px;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);z-index:461;pointer-events:none}.leaflet-gesture-handling-scroll-warning:after,.leaflet-gesture-handling-touch-warning:after{-webkit-animation:leaflet-gestures-fadein .8s forwards;animation:leaflet-gestures-fadein .8s forwards}.leaflet-gesture-handling-touch-warning:after{content:attr(data-gesture-handling-touch-content)}.leaflet-gesture-handling-scroll-warning:after{content:attr(data-gesture-handling-scroll-content)} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/js/leaflet/leaflet-gesture-handling.min.js b/vendor/wpmetabox/meta-box/js/leaflet/leaflet-gesture-handling.min.js new file mode 100644 index 000000000..b52d8019b --- /dev/null +++ b/vendor/wpmetabox/meta-box/js/leaflet/leaflet-gesture-handling.min.js @@ -0,0 +1,2 @@ +!function(a,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("leafletGestureHandling",["exports"],t):t(a.leafletGestureHandling={})}(this,function(a){"use strict";var o={ar:{touch:"استخدم إصبعين لتحريك الخريطة",scroll:"‏استخدم ctrl + scroll لتصغير/تكبير الخريطة",scrollMac:"يمكنك استخدام ⌘ + التمرير لتكبير/تصغير الخريطة"},bg:{touch:"Използвайте два пръста, за да преместите картата",scroll:"Задръжте бутона Ctrl натиснат, докато превъртате, за да промените мащаба на картата",scrollMac:"Задръжте бутона ⌘ натиснат, докато превъртате, за да промените мащаба на картата"},bn:{touch:"মানচিত্রটিকে সরাতে দুটি আঙ্গুল ব্যবহার করুন",scroll:"ম্যাপ জুম করতে ctrl + scroll ব্যবহার করুন",scrollMac:"ম্যাপে জুম করতে ⌘ বোতাম টিপে স্ক্রল করুন"},ca:{touch:"Fes servir dos dits per moure el mapa",scroll:"Prem la tecla Control mentre et desplaces per apropar i allunyar el mapa",scrollMac:"Prem la tecla ⌘ mentre et desplaces per apropar i allunyar el mapa"},cs:{touch:"K posunutí mapy použijte dva prsty",scroll:"Velikost zobrazení mapy změňte podržením klávesy Ctrl a posouváním kolečka myši",scrollMac:"Velikost zobrazení mapy změníte podržením klávesy ⌘ a posunutím kolečka myši / touchpadu"},da:{touch:"Brug to fingre til at flytte kortet",scroll:"Brug ctrl + rullefunktionen til at zoome ind og ud på kortet",scrollMac:"Brug ⌘ + rullefunktionen til at zoome ind og ud på kortet"},de:{touch:"Verschieben der Karte mit zwei Fingern",scroll:"Verwende Strg+Scrollen zum Zoomen der Karte",scrollMac:"⌘"},el:{touch:"Χρησιμοποιήστε δύο δάχτυλα για μετακίνηση στον χάρτη",scroll:"Χρησιμοποιήστε το πλήκτρο Ctrl και κύλιση, για να μεγεθύνετε τον χάρτη",scrollMac:"Χρησιμοποιήστε το πλήκτρο ⌘ + κύλιση για εστίαση στον χάρτη"},en:{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-AU":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-GB":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},es:{touch:"Para mover el mapa, utiliza dos dedos",scroll:"Mantén pulsada la tecla Ctrl mientras te desplazas para acercar o alejar el mapa",scrollMac:"Mantén pulsada la tecla ⌘ mientras te desplazas para acercar o alejar el mapa"},eu:{touch:"Erabili bi hatz mapa mugitzeko",scroll:"Mapan zooma aplikatzeko, sakatu Ktrl eta egin gora edo behera",scrollMac:"Eduki sakatuta ⌘ eta egin gora eta behera mapa handitu eta txikitzeko"},fa:{touch:"برای حرکت دادن نقشه از دو انگشت استفاده کنید.",scroll:"‏برای بزرگ‌نمایی نقشه از ctrl + scroll استفاده کنید",scrollMac:"برای بزرگ‌نمایی نقشه، از ⌘ + پیمایش استفاده کنید."},fi:{touch:"Siirrä karttaa kahdella sormella.",scroll:"Zoomaa karttaa painamalla Ctrl-painiketta ja vierittämällä.",scrollMac:"Zoomaa karttaa pitämällä painike ⌘ painettuna ja vierittämällä."},fil:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},fr:{touch:"Utilisez deux doigts pour déplacer la carte",scroll:"Vous pouvez zoomer sur la carte à l'aide de CTRL+Molette de défilement",scrollMac:"Vous pouvez zoomer sur la carte à l'aide de ⌘+Molette de défilement"},gl:{touch:"Utiliza dous dedos para mover o mapa",scroll:"Preme Ctrl mentres te desprazas para ampliar o mapa",scrollMac:"Preme ⌘ e desprázate para ampliar o mapa"},gu:{touch:"નકશો ખસેડવા બે આંગળીઓનો ઉપયોગ કરો",scroll:"નકશાને ઝૂમ કરવા માટે ctrl + સ્ક્રોલનો ઉપયોગ કરો",scrollMac:"નકશાને ઝૂમ કરવા ⌘ + સ્ક્રોલનો ઉપયોગ કરો"},hi:{touch:"मैप एक जगह से दूसरी जगह ले जाने के लिए दो उंगलियों का इस्तेमाल करें",scroll:"मैप को ज़ूम करने के लिए ctrl + स्क्रोल का उपयोग करें",scrollMac:"मैप को ज़ूम करने के लिए ⌘ + स्क्रोल का उपयोग करें"},hr:{touch:"Pomičite kartu pomoću dva prsta",scroll:"Upotrijebite Ctrl i klizač miša da biste zumirali kartu",scrollMac:"Upotrijebite gumb ⌘ dok se pomičete za zumiranje karte"},hu:{touch:"Két ujjal mozgassa a térképet",scroll:"A térkép a ctrl + görgetés használatával nagyítható",scrollMac:"A térkép a ⌘ + görgetés használatával nagyítható"},id:{touch:"Gunakan dua jari untuk menggerakkan peta",scroll:"Gunakan ctrl + scroll untuk memperbesar atau memperkecil peta",scrollMac:"Gunakan ⌘ + scroll untuk memperbesar atau memperkecil peta"},it:{touch:"Utilizza due dita per spostare la mappa",scroll:"Utilizza CTRL + scorrimento per eseguire lo zoom della mappa",scrollMac:"Utilizza ⌘ + scorrimento per eseguire lo zoom della mappa"},iw:{touch:"הזז את המפה באמצעות שתי אצבעות",scroll:"‏אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ctrl וגלילה",scrollMac:"אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ⌘ וגלילה"},ja:{touch:"地図を移動させるには指 2 本で操作します",scroll:"地図をズームするには、Ctrl キーを押しながらスクロールしてください",scrollMac:"地図をズームするには、⌘ キーを押しながらスクロールしてください"},kn:{touch:"Use two fingers to move the map",scroll:"Use Ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},ko:{touch:"지도를 움직이려면 두 손가락을 사용하세요.",scroll:"지도를 확대/축소하려면 Ctrl을 누른 채 스크롤하세요.",scrollMac:"지도를 확대하려면 ⌘ + 스크롤 사용"},lt:{touch:"Perkelkite žemėlapį dviem pirštais",scroll:"Slinkite nuspaudę klavišą „Ctrl“, kad pakeistumėte žemėlapio mastelį",scrollMac:"Paspauskite klavišą ⌘ ir slinkite, kad priartintumėte žemėlapį"},lv:{touch:"Lai pārvietotu karti, bīdiet to ar diviem pirkstiem",scroll:"Kartes tālummaiņai izmantojiet ctrl + ritināšanu",scrollMac:"Lai veiktu kartes tālummaiņu, izmantojiet ⌘ + ritināšanu"},ml:{touch:"മാപ്പ് നീക്കാൻ രണ്ട് വിരലുകൾ ഉപയോഗിക്കുക",scroll:"കൺട്രോൾ + സ്‌ക്രോൾ ഉപയോഗിച്ച് ‌മാപ്പ് ‌സൂം ചെയ്യുക",scrollMac:"⌘ + സ്‌ക്രോൾ ഉപയോഗിച്ച് ‌മാപ്പ് ‌സൂം ചെയ്യുക"},mr:{touch:"नकाशा हलविण्यासाठी दोन बोटे वापरा",scroll:"नकाशा झूम करण्यासाठी ctrl + scroll वापरा",scrollMac:"नकाशावर झूम करण्यासाठी ⌘ + स्क्रोल वापरा"},nl:{touch:"Gebruik twee vingers om de kaart te verplaatsen",scroll:"Gebruik Ctrl + scrollen om in- en uit te zoomen op de kaart",scrollMac:"Gebruik ⌘ + scrollen om in en uit te zoomen op de kaart"},no:{touch:"Bruk to fingre for å flytte kartet",scroll:"Hold ctrl-tasten inne og rull for å zoome på kartet",scrollMac:"Hold inne ⌘-tasten og rull for å zoome på kartet"},pl:{touch:"Przesuń mapę dwoma palcami",scroll:"Naciśnij CTRL i przewiń, by przybliżyć mapę",scrollMac:"Naciśnij ⌘ i przewiń, by przybliżyć mapę"},pt:{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-BR":{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-PT":{touch:"Utilize dois dedos para mover o mapa",scroll:"Utilizar ctrl + deslocar para aumentar/diminuir zoom do mapa",scrollMac:"Utilize ⌘ + deslocar para aumentar/diminuir o zoom do mapa"},ro:{touch:"Folosiți două degete pentru a deplasa harta",scroll:"Apăsați tasta ctrl și derulați simultan pentru a mări harta",scrollMac:"Folosiți ⌘ și derulați pentru a mări/micșora harta"},ru:{touch:"Чтобы переместить карту, проведите по ней двумя пальцами",scroll:"Чтобы изменить масштаб, прокручивайте карту, удерживая клавишу Ctrl.",scrollMac:"Чтобы изменить масштаб, нажмите ⌘ + прокрутка"},sk:{touch:"Mapu môžete posunúť dvoma prstami",scroll:"Ak chcete priblížiť mapu, stlačte kláves ctrl a posúvajte",scrollMac:"Ak chcete priblížiť mapu, stlačte kláves ⌘ a posúvajte kolieskom myši"},sl:{touch:"Premaknite zemljevid z dvema prstoma",scroll:"Zemljevid povečate tako, da držite tipko Ctrl in vrtite kolesce na miški",scrollMac:"Uporabite ⌘ + funkcijo pomika, da povečate ali pomanjšate zemljevid"},sr:{touch:"Мапу померајте помоћу два прста",scroll:"Притисните ctrl тастер док померате да бисте зумирали мапу",scrollMac:"Притисните тастер ⌘ док померате да бисте зумирали мапу"},sv:{touch:"Använd två fingrar för att flytta kartan",scroll:"Använd ctrl + rulla för att zooma kartan",scrollMac:"Använd ⌘ + rulla för att zooma på kartan"},ta:{touch:"மேப்பை நகர்த்த இரண்டு விரல்களைப் பயன்படுத்தவும்",scroll:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ctrl பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்",scrollMac:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ⌘ பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்"},te:{touch:"మ్యాప్‌ని తరలించడం కోసం రెండు వేళ్లను ఉపయోగించండి",scroll:"మ్యాప్‌ని జూమ్ చేయడానికి ctrl బటన్‌ను నొక్కి ఉంచి, స్క్రోల్ చేయండి",scrollMac:"మ్యాప్ జూమ్ చేయాలంటే ⌘ + స్క్రోల్ ఉపయోగించండి"},th:{touch:"ใช้ 2 นิ้วเพื่อเลื่อนแผนที่",scroll:"กด Ctrl ค้างไว้ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่",scrollMac:"กด ⌘ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่"},tl:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},tr:{touch:"Haritada gezinmek için iki parmağınızı kullanın",scroll:"Haritayı yakınlaştırmak için ctrl + kaydırma kombinasyonunu kullanın",scrollMac:"Haritayı yakınlaştırmak için ⌘ tuşuna basıp ekranı kaydırın"},uk:{touch:"Переміщуйте карту двома пальцями",scroll:"Щоб змінювати масштаб карти, прокручуйте коліщатко миші, утримуючи клавішу Ctrl",scrollMac:"Щоб змінити масштаб карти, використовуйте ⌘ + прокручування"},vi:{touch:"Sử dụng hai ngón tay để di chuyển bản đồ",scroll:"Sử dụng ctrl + cuộn để thu phóng bản đồ",scrollMac:"Sử dụng ⌘ + cuộn để thu phóng bản đồ"},"zh-CN":{touch:"使用双指移动地图",scroll:"按住 Ctrl 并滚动鼠标滚轮才可缩放地图",scrollMac:"按住 ⌘ 并滚动鼠标滚轮才可缩放地图"},"zh-TW":{touch:"同時以兩指移動地圖",scroll:"按住 ctrl 鍵加上捲動滑鼠可以縮放地圖",scrollMac:"按 ⌘ 加上滾動捲軸可以縮放地圖"}};L.Map.mergeOptions({gestureHandlingOptions:{text:{},duration:1e3}});var t=!1,e=L.Handler.extend({addHooks:function(){this._handleTouch=this._handleTouch.bind(this),this._setupPluginOptions(),this._setLanguageContent(),this._disableInteractions(),this._map._container.addEventListener("touchstart",this._handleTouch),this._map._container.addEventListener("touchmove",this._handleTouch),this._map._container.addEventListener("touchend",this._handleTouch),this._map._container.addEventListener("touchcancel",this._handleTouch),this._map._container.addEventListener("click",this._handleTouch),L.DomEvent.on(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.on(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.on(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.on(this._map,"movestart",this._handleDragging,this),L.DomEvent.on(this._map,"move",this._handleDragging,this),L.DomEvent.on(this._map,"moveend",this._handleDragging,this)},removeHooks:function(){this._enableInteractions(),this._map._container.removeEventListener("touchstart",this._handleTouch),this._map._container.removeEventListener("touchmove",this._handleTouch),this._map._container.removeEventListener("touchend",this._handleTouch),this._map._container.removeEventListener("touchcancel",this._handleTouch),this._map._container.removeEventListener("click",this._handleTouch),L.DomEvent.off(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.off(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.off(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.off(this._map,"movestart",this._handleDragging,this),L.DomEvent.off(this._map,"move",this._handleDragging,this),L.DomEvent.off(this._map,"moveend",this._handleDragging,this)},_handleDragging:function(a){"movestart"==a.type||"move"==a.type?t=!0:"moveend"==a.type&&(t=!1)},_disableInteractions:function(){this._map.dragging.disable(),this._map.scrollWheelZoom.disable(),this._map.tap&&this._map.tap.disable()},_enableInteractions:function(){this._map.dragging.enable(),this._map.scrollWheelZoom.enable(),this._map.tap&&this._map.tap.enable()},_setupPluginOptions:function(){this._map.options.gestureHandlingText&&(this._map.options.gestureHandlingOptions.text=this._map.options.gestureHandlingText)},_setLanguageContent:function(){var a;if(this._map.options.gestureHandlingOptions&&this._map.options.gestureHandlingOptions.text&&this._map.options.gestureHandlingOptions.text.touch&&this._map.options.gestureHandlingOptions.text.scroll&&this._map.options.gestureHandlingOptions.text.scrollMac)a=this._map.options.gestureHandlingOptions.text;else{var t=this._getUserLanguage();t||(t="en"),o[t]&&(a=o[t]),a||-1===t.indexOf("-")||(t=t.split("-")[0],a=o[t]),a||(a=o[t="en"])}var e=!1;0<=navigator.platform.toUpperCase().indexOf("MAC")&&(e=!0);var l=a.scroll;e&&(l=a.scrollMac),this._map._container.setAttribute("data-gesture-handling-touch-content",a.touch),this._map._container.setAttribute("data-gesture-handling-scroll-content",l)},_getUserLanguage:function(){return navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage},_handleTouch:function(a){for(var t=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],e=!1,l=0;l' ).html( this.$input.attr( 'data-attachments' ) ).text(), + models = JSON.parse( items ).map( function( attachment ) { return wp.media.model.Attachment.create( attachment ); } ); this.controller.get( 'items' ).add( models ); diff --git a/vendor/wpmetabox/meta-box/js/osm-frontend.js b/vendor/wpmetabox/meta-box/js/osm-frontend.js index 99d5c4076..c5b944aa8 100644 --- a/vendor/wpmetabox/meta-box/js/osm-frontend.js +++ b/vendor/wpmetabox/meta-box/js/osm-frontend.js @@ -1,4 +1,4 @@ -jQuery( function( $ ) { +jQuery( function ( $ ) { 'use strict'; /** @@ -13,13 +13,14 @@ jQuery( function( $ ) { center = L.latLng( options.latitude, options.longitude ), map; - mapOptions.center = center; + mapOptions.center = center; - // Typcast zoom to a number - mapOptions.zoom *= 1; + // Typcast zoom to a number + mapOptions.zoom *= 1; - map = L.map( this, mapOptions ); - map.addLayer( osmTileLayer ); + mapOptions.gestureHandling = true; + map = L.map( this, mapOptions ); + map.addLayer( osmTileLayer ); // Set marker if ( options.marker ) { @@ -37,7 +38,7 @@ jQuery( function( $ ) { } ); } - var marker = L.marker( center, markerOptions ).addTo( map ) + var marker = L.marker( center, markerOptions ).addTo( map ); } // Set info window diff --git a/vendor/wpmetabox/meta-box/js/osm.js b/vendor/wpmetabox/meta-box/js/osm.js index ef56524d3..60a444ed3 100644 --- a/vendor/wpmetabox/meta-box/js/osm.js +++ b/vendor/wpmetabox/meta-box/js/osm.js @@ -45,7 +45,7 @@ }, initMapElements: function () { - this.map = L.map( this.canvas, { zoom: 14 } ); + this.map = L.map( this.canvas, { zoom: 14, gestureHandling: true } ); L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' } ).addTo( this.map ); @@ -249,11 +249,11 @@ } let $groupWrapper = this.$container.closest( '.rwmb-group-clone' ); - if ( ! $groupWrapper.length ) { + if ( !$groupWrapper.length ) { $groupWrapper = this.$container.closest( '.rwmb-group-wrapper' ); } - if ( ! $groupWrapper.length ) { + if ( !$groupWrapper.length ) { return null; } diff --git a/vendor/wpmetabox/meta-box/js/password.js b/vendor/wpmetabox/meta-box/js/password.js new file mode 100644 index 000000000..68502b7fe --- /dev/null +++ b/vendor/wpmetabox/meta-box/js/password.js @@ -0,0 +1,21 @@ +document.addEventListener( 'DOMContentLoaded', function () { + const toggleButtons = document.querySelectorAll( '.rwmb-password-toggle' ); + + toggleButtons.forEach( button => { + const eyeIcon = button.querySelector( '.rwmb-eye-icon' ); + const eyeOffIcon = button.querySelector( '.rwmb-eye-off-icon' ); + const input = button.previousElementSibling; + + button.addEventListener( 'click', () => { + if ( input.type === 'password' ) { + input.type = 'text'; + eyeIcon.style.display = 'none'; + eyeOffIcon.style.display = 'block'; + } else { + input.type = 'password'; + eyeIcon.style.display = 'block'; + eyeOffIcon.style.display = 'none'; + } + } ); + } ); +} ); \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/js/validation/validation.js b/vendor/wpmetabox/meta-box/js/validation/validation.js index 83eb1aa05..f1fffd542 100644 --- a/vendor/wpmetabox/meta-box/js/validation/validation.js +++ b/vendor/wpmetabox/meta-box/js/validation/validation.js @@ -140,8 +140,9 @@ }; class Validation { - constructor( formSelector ) { - this.$form = $( formSelector ); + constructor( selector ) { + this.selector = selector; + this.$form = $( selector ); if ( !this.$form.length ) { return; @@ -230,41 +231,60 @@ } }; + let globalSavePosts = {}; + class GutenbergValidation extends Validation { init() { - var that = this, - editor = wp.data.dispatch( 'core/editor' ); + const that = this; + const editor = wp.data.dispatch( 'core/editor' ); if ( !editor || !that.$form.length ) { return false; } - const savePost = editor.savePost; // Reference original method. - - if ( that.settings ) { - that.$form.validate( that.settings ); + // Store the original savePost method. + // Only store the first time, because GutenbergValidation can be initialized multiple times. + if ( !globalSavePosts[ this.selector ] ) { + globalSavePosts[ this.selector ] = editor.savePost; } + this.removeMessage(); + this.$form.validate( this.settings ); + // Change the editor method. editor.savePost = function ( options = {} ) { // Bypass the validation when previewing in Gutenberg. if ( typeof options === 'object' && options.isPreview ) { - return savePost( options ); + return globalSavePosts[ that.selector ]( options ); } // Must call savePost() here instead of in submitHandler() because the form has inline onsubmit callback. if ( that.$form.valid() ) { - return savePost( options ); + that.removeMessage(); + return globalSavePosts[ that.selector ]( options ); } }; } + reset() { + const editor = wp.data.dispatch( 'core/editor' ); + + if ( editor && globalSavePosts[ this.selector ] ) { + editor.savePost = globalSavePosts[ this.selector ]; + this.removeMessage(); + } + } + showMessage() { wp.data.dispatch( 'core/notices' ).createErrorNotice( i18n.message, { - id: 'meta-box-validation', + id: `meta-box-validation-${ this.selector }`, isDismissible: true } ); } + + removeMessage() { + wp.data.dispatch( 'core/notices' ).removeNotice( `meta-box-validation-${ this.selector }` ); + } }; class TaxonomyValidation extends Validation { @@ -286,24 +306,39 @@ } } + let metaBoxInstances = {}; + let blockInstance = null; + // Run on document ready. function init() { if ( rwmb.isGutenberg ) { - const locations = [ 'normal', 'side', 'advanced' ]; + // In Gutenberg, when we switch to a block, `.mb_ready` is triggered, thus creating new instances of the validation. + + // These are static meta boxes and should be initialized only once. + if ( Object.keys( metaBoxInstances ).length === 0 ) { + const locations = [ 'normal', 'side', 'advanced' ]; + locations.forEach( location => { + metaBoxInstances[ location ] = new GutenbergValidation( `.metabox-location-${ location }` ); + metaBoxInstances[ location ].init(); + } ); + } - locations.forEach( location => { - new GutenbergValidation( `.metabox-location-${ location }` ).init(); - } ); + // Because only one block can be edited at a time, this instance is always used for the current block. + // We need to remove previous validation (by resetting the savePost method), and create new instances. + if ( blockInstance ) { + blockInstance.reset(); + } - new GutenbergValidation( `.mb-block-edit` ).init(); + blockInstance = new GutenbergValidation( '.mb-block-edit' ); + blockInstance.init(); return; } // Edit post, edit term, edit user, front-end form. - var $forms = $( '#post, #edittag, #your-profile, .rwmb-form' ); + const $forms = $( '#post, #edittag, #your-profile, .rwmb-form' ); $forms.each( function () { - var form = new Validation( this ); + const form = new Validation( this ); form.init(); } ); diff --git a/vendor/wpmetabox/meta-box/meta-box.php b/vendor/wpmetabox/meta-box/meta-box.php index f48e67bca..2445b4f7b 100644 --- a/vendor/wpmetabox/meta-box/meta-box.php +++ b/vendor/wpmetabox/meta-box/meta-box.php @@ -3,7 +3,7 @@ * Plugin Name: Meta Box * Plugin URI: https://metabox.io * Description: Create custom meta boxes and custom fields in WordPress. - * Version: 5.10.7 + * Version: 5.10.11 * Author: MetaBox.io * Author URI: https://metabox.io * License: GPL2+ diff --git a/vendor/wpmetabox/meta-box/readme.txt b/vendor/wpmetabox/meta-box/readme.txt index cdf1de107..37ce7293b 100644 --- a/vendor/wpmetabox/meta-box/readme.txt +++ b/vendor/wpmetabox/meta-box/readme.txt @@ -3,9 +3,9 @@ Contributors: elightup, metabox, rilwis, f-j-kaiser, funkatronic, PerWiklander, Donate link: https://metabox.io/pricing/ Tags: custom fields, custom post types, post type, custom taxonomies, meta box Requires at least: 5.9 -Requires PHP: 7.0 -Tested up to: 6.7.2 -Stable tag: 5.10.7 +Requires PHP: 7.1 +Tested up to: 6.8.1 +Stable tag: 5.10.11 License: GPLv2 or later Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for your custom post types in WordPress. @@ -66,6 +66,7 @@ If you prefer a more visual system to create custom fields in WordPress, please - Export your custom fields and settings to PHP. Then, add it to a new site without needing to install this extension for an incredibly lightweight option. ### Free Extensions + - Migrations from [ACF](https://metabox.io/plugins/mb-acf-migration/) or [Toolset](https://metabox.io/plugins/mb-toolset-migration/). - Integrations with all page builder plugins like [Elementor](https://metabox.io/plugins/mb-elementor-integrator/), [Beaver Builder](https://metabox.io/plugins/meta-box-beaver-themer-integrator/), Divi, Bricks, Brizy, etc. - Integrations with SEO plugins like [Yoast SEO](https://wordpress.org/plugins/meta-box-yoast-seo/), [Rank Math](https://metabox.io/plugins/mb-rank-math/), or Slim SEO. @@ -116,8 +117,6 @@ Here are a few guides to quickly get you started with Meta Box and creating your If you like this plugin, you might also like our other WordPress products: - [Slim SEO](https://wpslimseo.com) - A fast, lightweight and full-featured SEO plugin for WordPress with minimal configuration. -- [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - An advanced, powerful and flexible plugin to add schemas to WordPress. -- [Slim SEO Link Manager](https://wpslimseo.com/products/slim-seo-link-manager/) - Build internal link easier in WordPress with real-time reports. - [GretaThemes](https://gretathemes.com) - Free and premium WordPress themes that clean, simple and just work. - [Auto Listings](https://wpautolistings.com) - A car sale and dealership plugin for WordPress. @@ -148,6 +147,23 @@ If you want to use Meta Box, please follow these steps: == Changelog == += 5.10.11 - 2025-07-15 = + +Fix validation for blocks + += 5.10.10 - 2025-05-21 = +- Fix datetime field returns null +- Fix single image field not working with Polylang Pro +- Fix reveal password icon not working + += 5.10.9 - 2025-05-08 = +- Add button to toggle password (#1630) +- Add gesture handling support for OSM field (#1631) +- Datetime & select2: use user's locale instead of site's locale + += 5.10.8 - 2025-03-14 = +- Redesign the dashboard + = 5.10.7 - 2025-02-25 = - Fix: max clone with clone empty start @@ -187,89 +203,6 @@ If you want to use Meta Box, please follow these steps: = 5.10.1 - 2024-09-07 = - Fix issue with `clone_empty_start` (validation, now showing data for the 1st clone, broken `text_list` field, etc.) -= 5.10.0 - 2024-08-19 = - -**Highlights:** - -This version introduces new parameter for field: `clone_empty_start` that makes cloneable groups **not** showing inputs at first. When users want to enter data, they'll need to click the "+ Add new" button. This feature updates the UI and makes it cleaner. - -See more details on our [blog post](https://metabox.io/clone-empty-start/). - -Other changes: - -- Replace `sprintf` with string concatenation in `RWMB_Field::show` to fix issues when `$field['before']` or `$field['after']` contains special characters (`%`). Props Daniel Haim. -- Fix mismatch filter params for `rwmb_meta` when no fields are found. - -= 5.9.11 - 2024-07-10.0 = -- Make validation work for blocks -- Fix JavaScript validation error in site editor -- Set default minute step = 5 for datetime/time pickers -- Security fix for ajax getting posts - -= 5.9.10 - 2024-07-02 = -- Fix modal not updating URL (when add new) -- Security fix for ajax get posts/users - -= 5.9.9 - 2024-06-20 = -- Fix show hide checkbox tree -- Fix default value not display as selected time -- Fix datetime field not removing value when set inline & timestamp = true - -= 5.9.8 - 2024-05-08 = -- Fix activation error on ajax request since WordPress 6.5 - -= 5.9.7 - 2024-04-18 = -- Revert fix for Meta Box Conditional Logic - -= 5.9.6 - 2024-04-17 = -- Add progress bar for field `file_upload` -- Force returned value of sanitize color to string -- Enqueue assets for FSE and widget (with block editor) screens -- Fix jumping layout for Meta Box Conditional Logic -- Fix errors when using cloneable map/osm fields - -= 5.9.5 - 2024-03-26 = -- Add `save_format` settings to `time` field -- Field icon SVG not displaying - -= 5.9.4 - 2024-02-27 = -- Fix security issue when users set object id in the helper functions where they don't have permission to view (such as private posts) - -= 5.9.3 - 2024-02-02 = - -**Highlights:** - -Fix security issue of the output shortcode `[rwmb_meta]` not escaping. Users can disable escaping (to revert the previous behavior) by adding this snippet: - -`add_filter( 'rwmb_meta_shortcode_secure', '__return_false' ); -// or -add_filter( 'rwmb_meta_shortcode_secure_{$field_id}', '__return_false' );` - -Other changes: - -- Fix compatibility with PHP 8.3 -- Fix not showing more than 10 saved users or terms - -= 5.9.2 - 2024-01-22 = -- Validation: fix PHP warning when fields has non-consecutive keys -- Icon field: fix custom icon not working -- Update jQuery Validation to 1.20.0. Props Maarten. -- Prepare css to be inlined. Props Maarten. - -= 5.9.1 - 2023-12-25 = -- Fix preview posts not working in the block editor in WP 6.4. -- Icon field: allow to set relative path/URL for settings -- Icon field: add support for scanning CSS file (`icon_css` setting) and parsing CSS class -- Autocomplete field: fix not saving first value if the value is 0 (integer). - -= 5.9.0 - 2023-11-22 = - -**Highlights:** - -Add new `icon` field type, which supports Font Awesome Free, Font Awesome Pro and custom icon set. Can be used with icon font with CSS file or with SVGs. See the [plugin docs](https://docs.metabox.io/fields/icon/) for how to use it. - -The `icon` field type will be added to the new version of Meta Box Builder soon, which will allow you to configure its settings with UI. - [See full changelog here](https://metabox.io/changelog/). == Upgrade Notice == diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/Dashboard.php b/vendor/wpmetabox/meta-box/src/Dashboard/Dashboard.php new file mode 100644 index 000000000..7412d2c29 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/Dashboard.php @@ -0,0 +1,307 @@ +upgradable = $this->get_upgradable( $update_checker, $update_option ); + $this->has_actions = defined( 'META_BOX_LITE_DIR' ) || defined( 'META_BOX_AIO_DIR' ); + $this->is_aio = defined( 'META_BOX_AIO_DIR' ); + $this->assets_url = RWMB_URL . 'src/Dashboard/assets'; + + $this->init(); + } + + private function get_upgradable( $update_checker, $update_option ): bool { + if ( ! $update_checker || ! $update_option ) { + return true; + } + + if ( ! $update_checker->has_extensions() ) { + return true; + } + + return $update_option->get_license_status() !== 'active'; + } + + public function init(): void { + // Add links to the Dashboard in the plugin action links. + add_filter( 'plugin_action_links_meta-box/meta-box.php', [ $this, 'plugin_links' ], 20 ); + + // Add a shared top-level admin menu and the Dashboard. Use priority 5 to show the Dashboard at the top. + add_action( 'admin_menu', [ $this, 'add_menu' ], 5 ); + add_action( 'admin_menu', [ $this, 'add_submenu' ], 5 ); + + // If no admin menu, then hide the Dashboard. + add_action( 'admin_head', [ $this, 'hide_page' ] ); + + // Redirect to the Dashboard after activation. + add_action( 'activated_plugin', [ $this, 'redirect' ], 10, 2 ); + + // Handle install & activate plugin. + add_action( 'wp_ajax_mb_dashboard_plugin_action', [ $this, 'handle_plugin_action' ] ); + + // Handle ajax to get RSS. + add_action( 'wp_ajax_mb_dashboard_feed', [ $this, 'get_feed' ] ); + } + + public function plugin_links( array $links ): array { + $links[] = '' . esc_html__( 'Dashboard', 'meta-box' ) . ''; + if ( $this->upgradable ) { + $links[] = '' . esc_html__( 'Upgrade', 'meta-box' ) . ''; + } + return $links; + } + + public function add_menu(): void { + if ( ! $this->has_menu() ) { + return; + } + add_menu_page( + __( 'Meta Box', 'meta-box' ), + __( 'Meta Box', 'meta-box' ), + 'activate_plugins', + 'meta-box', + '__return_null', + 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIxNjQuMzI4IDE0OS40NDEgNTMuNDcgNDIuNjYiIHdpZHRoPSI1My40NyIgaGVpZ2h0PSI0Mi42NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNIDIwNC42NjggMTc5LjM5MSBMIDIwNS40ODggMTYwLjU1MSBMIDIwNS4zMTggMTYwLjUyMSBMIDE5My44ODggMTkyLjEwMSBMIDE4OC4xNDggMTkyLjEwMSBMIDE3Ni43NzggMTYwLjY0MSBMIDE3Ni42MDggMTYwLjY2MSBMIDE3Ny40MjggMTc5LjM5MSBMIDE3Ny40MjggMTg2LjA5MSBMIDE4MS45OTggMTg2Ljk3MSBMIDE4MS45OTggMTkyLjEwMSBMIDE2NC4zMjggMTkyLjEwMSBMIDE2NC4zMjggMTg2Ljk3MSBMIDE2OC44NjggMTg2LjA5MSBMIDE2OC44NjggMTU1LjQ4MSBMIDE2NC4zMjggMTU0LjYwMSBMIDE2NC4zMjggMTQ5LjQ0MSBMIDE2OC44NjggMTQ5LjQ0MSBMIDE4MC4wMjggMTQ5LjQ0MSBMIDE5MC44OTggMTgwLjg4MSBMIDE5MS4wNzggMTgwLjg4MSBMIDIwMi4wMzggMTQ5LjQ0MSBMIDIxNy43OTggMTQ5LjQ0MSBMIDIxNy43OTggMTU0LjYwMSBMIDIxMy4yMjggMTU1LjQ4MSBMIDIxMy4yMjggMTg2LjA5MSBMIDIxNy43OTggMTg2Ljk3MSBMIDIxNy43OTggMTkyLjEwMSBMIDIwMC4xMjggMTkyLjEwMSBMIDIwMC4xMjggMTg2Ljk3MSBMIDIwNC42NjggMTg2LjA5MSBMIDIwNC42NjggMTc5LjM5MSBaIiBzdHlsZT0iZmlsbDogcmdiKDE1OCwgMTYzLCAxNjgpOyB3aGl0ZS1zcGFjZTogcHJlOyIvPgo8L3N2Zz4=' + ); + } + + public function add_submenu(): void { + $parent_menu = $this->has_menu() ? 'meta-box' : $this->get_parent_menu(); + $about = add_submenu_page( + $parent_menu, + __( 'Dashboard', 'meta-box' ), + __( 'Dashboard', 'meta-box' ), + 'activate_plugins', + 'meta-box', + [ $this, 'render' ] + ); + add_action( "load-$about", [ $this, 'enqueue' ] ); + } + + public function hide_page(): void { + remove_submenu_page( $this->get_parent_menu(), 'meta-box' ); + } + + public function render(): void { + ?> +
+ +
+ assets_url/css/dashboard.css", [], filemtime( __DIR__ . '/assets/css/dashboard.css' ) ); + wp_enqueue_style( 'featherlight', "$this->assets_url/css/featherlight.min.css", [], '1.7.14' ); + wp_enqueue_script( 'featherlight', "$this->assets_url/js/featherlight.min.js", [ 'jquery' ], '1.7.14', true ); + wp_enqueue_script( 'meta-box-dashboard', "$this->assets_url/js/dashboard.js", [ 'featherlight' ], filemtime( __DIR__ . '/assets/js/dashboard.js' ), true ); + + $campaign = 'meta_box'; + if ( defined( 'META_BOX_LITE_DIR' ) ) { + $campaign = 'meta_box_lite'; + } elseif ( defined( 'META_BOX_AIO_DIR' ) ) { + $campaign = 'meta_box_aio'; + } + + wp_localize_script( 'meta-box-dashboard', 'MBD', [ + 'campaign' => $campaign, + 'nonces' => [ + 'plugin' => wp_create_nonce( 'plugin' ), + 'feed' => wp_create_nonce( 'feed' ), + ], + ] ); + } + + /** + * Redirect to about page after Meta Box has been activated. + * + * @param string $plugin Path to the main plugin file from plugins directory. + * @param bool $network_wide Whether to enable the plugin for all sites in the network + * or just the current site. Multisite only. Default is false. + */ + public function redirect( $plugin, $network_wide = false ): void { + $is_cli = 'cli' === php_sapi_name(); + $is_plugin = 'meta-box/meta-box.php' === $plugin; + $is_bulk_activate = 'activate-selected' === rwmb_request()->post( 'action' ) && count( rwmb_request()->post( 'checked' ) ) > 1; + $is_doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; + + if ( ! $is_plugin || $network_wide || $is_cli || $is_bulk_activate || $this->is_bundled() || $is_doing_ajax ) { + return; + } + wp_safe_redirect( $this->get_menu_link() ); + die; + } + + private function get_menu_link(): string { + $menu = $this->has_menu() ? 'admin.php?page=meta-box' : $this->get_parent_menu() . '?page=meta-box'; + return admin_url( $menu ); + } + + private function get_parent_menu(): string { + return 'plugins.php'; + } + + private function has_menu(): bool { + return apply_filters( 'rwmb_admin_menu', false ); + } + + private function is_bundled(): bool { + // @codingStandardsIgnoreLine + foreach ( $_REQUEST as $key => $value ) { + if ( str_contains( $key, 'tgmpa' ) || ( is_string( $value ) && str_contains( $value, 'tgmpa' ) ) ) { + return true; + } + } + return false; + } + + private function get_plugin_status( string $slug ): array { + if ( ! function_exists( 'is_plugin_active' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + $plugin = "$slug/$slug.php"; + $plugins = get_plugins(); + + if ( empty( $plugins[ $plugin ] ) ) { + return [ + 'action' => 'install', + 'text' => __( 'Install', 'meta-box' ), + 'processing' => __( 'Installing...', 'meta-box' ), + 'done' => __( 'Active', 'meta-box' ), + ]; + } + + if ( ! is_plugin_active( $plugin ) ) { + return [ + 'action' => 'activate', + 'text' => __( 'Activate', 'meta-box' ), + 'processing' => __( 'Activating...', 'meta-box' ), + 'done' => __( 'Active', 'meta-box' ), + ]; + } + + return [ + 'action' => '', + 'text' => __( 'Active', 'meta-box' ), + 'processing' => '', + 'done' => '', + ]; + } + + public function handle_plugin_action(): void { + check_ajax_referer( 'plugin' ); + + $plugin = isset( $_GET['mb_plugin'] ) ? sanitize_text_field( wp_unslash( $_GET['mb_plugin'] ) ) : ''; + $action = isset( $_GET['mb_action'] ) ? sanitize_text_field( wp_unslash( $_GET['mb_action'] ) ) : ''; + + if ( ! $plugin || ! $action || ! in_array( $action, [ 'install', 'activate' ], true ) ) { + wp_send_json_error(); + } + + if ( $action === 'install' ) { + $this->install_plugin( $plugin ); + $this->activate_plugin( $plugin ); + } elseif ( $action === 'activate' ) { + $this->activate_plugin( $plugin ); + } + + wp_send_json_success(); + } + + private function install_plugin( string $slug ): void { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + + $plugin = "$slug/$slug.php"; + $plugins = get_plugins(); + + if ( isset( $plugins[ $plugin ] ) ) { + return; + } + + $api = plugins_api( + 'plugin_information', + [ + 'slug' => $slug, + 'fields' => [ + 'short_description' => false, + 'requires' => false, + 'sections' => false, + 'rating' => false, + 'ratings' => false, + 'downloaded' => false, + 'last_updated' => false, + 'added' => false, + 'tags' => false, + 'compatibility' => false, + 'homepage' => false, + 'donate_link' => false, + ], + ] + ); + + if ( is_wp_error( $api ) ) { + wp_send_json_error( $api->get_error_message() ); + } + + $skin = new \Plugin_Installer_Skin( [ 'api' => $api ] ); + $upgrader = new \Plugin_Upgrader( $skin ); + $result = $upgrader->install( $api->download_link ); + + if ( is_wp_error( $result ) ) { + wp_send_json_error( $result->get_error_message() ); + } + + if ( ! $result ) { + wp_send_json_error( __( 'Error installing plugin. Please try again.', 'meta-box' ) ); + } + } + + private function activate_plugin( string $slug ): void { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + + $result = activate_plugin( "$slug/$slug.php", '', false, true ); + + if ( is_wp_error( $result ) ) { + wp_send_json_error( $result->get_error_message() ); + } + } + + public function get_feed(): void { + check_ajax_referer( 'feed' ); + + $rss = fetch_feed( 'https://feeds.feedburner.com/metaboxio' ); + + if ( is_wp_error( $rss ) ) { + wp_send_json_error( $rss->get_error_message() ); + } + + $rss->set_item_limit( 10 ); + $items = $rss->get_items( 0, 10 ); + + if ( ! $items ) { + wp_send_json_error( __( 'No items available', 'meta-box' ) ); + } + + $items = array_map( function ( $item ): array { + return [ + 'url' => $item->get_permalink(), + 'title' => $item->get_title(), + 'description' => $item->get_description(), + 'content' => $item->get_content(), + 'date' => $item->get_date( get_option( 'date_format' ) ), + 'timestamp' => $item->get_date( 'U' ), + ]; + }, $items ); + + wp_send_json_success( $items ); + } +} diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/dashboard.css b/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/dashboard.css new file mode 100644 index 000000000..34fe9d5e6 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/dashboard.css @@ -0,0 +1 @@ +body.wp-admin{background:#f8fafc}div#wpcontent{padding-left:0}#wpwrap .notice{display:none}.mb-dashboard{--mb-color-accent: #00b1b3;--mb-color-link: var(--mb-color-accent);--mb-border: 1px solid #cbd5e1;font-size:14px;color:#334155}.mb-dashboard a{text-decoration:none;color:var(--mb-color-link)}.mb-dashboard a:hover{color:var(--mb-color-link);text-decoration:underline}.mb-dashboard a:focus,.mb-dashboard a:active{outline:none;box-shadow:none}.mb-dashboard p{font-size:14px}.mb-dashboard table{width:100%;border-collapse:collapse}.mb-dashboard tr{border-bottom:1px solid #e2e8f0}.mb-dashboard tr:hover{background:#f8fafc}.mb-dashboard th,.mb-dashboard td{padding-block:12px}.mb-dashboard__button{--mb-color-link: #fff;display:inline-block;background:var(--mb-color-accent);padding:16px;text-transform:uppercase;font-weight:700;font-size:16px;line-height:1;letter-spacing:.025em;white-space:nowrap;border-radius:4px;text-decoration:none}.mb-dashboard__button.mb-dashboard__button:hover{color:#fff;opacity:.9;text-decoration:none}.mb-dashboard__button:focus,.mb-dashboard__button:active{color:#fff}.mb-dashboard__hidden{display:none}.mb-dashboard__external{display:inline-flex;align-items:center;gap:4px}.mb-dashboard__external svg{width:1em;height:1em;fill:currentColor}.mb-dashboard__tooltip{position:relative}.mb-dashboard__tooltip:after{content:attr(data-tooltip);background-color:#0f172a;color:#fff;padding:4px 8px;border-radius:4px;white-space:nowrap;position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%);visibility:hidden;opacity:0;transition:opacity .3s ease-in-out}.mb-dashboard__tooltip[data-position=top]:after{bottom:calc(100% + 8px);top:auto}.mb-dashboard__tooltip[data-position=bottom-right]:after{left:auto;transform:none;right:0}.mb-dashboard__tooltip:hover:after{visibility:visible;opacity:1}.mb-dashboard__body{display:flex;gap:48px;padding:48px;max-width:1280px;margin-inline:auto}.mb-dashboard__header{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:12px;background:#fff;border-bottom:1px solid #e2e8f0}.mb-dashboard__header__search{flex:1}.mb-dashboard__header__search__inner{position:relative;max-width:480px;margin-inline:auto}.mb-dashboard__header__search input[type=text]{width:100%;background:#f1f5f9;border-color:#e2e8f0;padding:2px 16px;margin:0}.mb-dashboard__header__search input[type=text]:focus,.mb-dashboard__header__search input[type=text]:hover{border-color:#cbd5e1;box-shadow:none}.mb-dashboard__header__search:has(.mb-dashboard__header__search-results:not([data-type=empty])) input{border-radius:4px 4px 0 0}.mb-dashboard__header__search-results{position:absolute;top:33px;left:0;right:0;background:#fff;z-index:9;border:var(--mb-border);border-radius:0 0 4px 4px;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)}.mb-dashboard__header__search-results a{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;color:inherit;padding:8px 16px;transition:all .2s ease-in-out}.mb-dashboard__header__search-results a:hover{color:inherit;text-decoration:none;background:#f1f5f9}.mb-dashboard__header__search-results a:last-child{border-radius:0 0 4px 4px}.mb-dashboard__header__search-results span{display:inline-block;padding:2px 8px;background:#e2e8f0;border:var(--mb-border);border-radius:4px;font-size:12px}.mb-dashboard__header__search-results[data-type=empty]{display:none}.mb-dashboard__header__search-results[data-type=text]{padding:16px}.mb-dashboard__header__icons{display:flex;align-items:center}.mb-dashboard__header__icons a{display:inline-flex;align-items:center;justify-content:center}.mb-dashboard__header__social{display:flex;align-items:center;gap:12px;border-right:var(--mb-border);padding-right:12px;margin-right:12px}.mb-dashboard__header__social svg{width:16px;height:16px;fill:#64748b;transition:all .2s ease-in-out}.mb-dashboard__header__social a{width:24px;height:24px}.mb-dashboard__header__social a:hover svg{fill:#334155}.mb-dashboard__header__links{display:flex;align-items:center;gap:12px}.mb-dashboard__header__links a{color:#64748b;width:36px;height:36px;border:var(--mb-border);border-radius:50%}.mb-dashboard__header__links a:hover{color:#334155;border-color:#94a3b8}.mb-dashboard__header__links svg{width:20px;height:20px}.mb-dashboard__header .mb-dashboard__logo svg{display:block;width:auto;height:46px}.mb-dashboard__main{flex:1;display:flex;flex-direction:column;gap:48px}.mb-dashboard__actions__title{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.025em;line-height:1;margin-bottom:16px}.mb-dashboard__actions__inner{display:grid;grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));gap:24px}.mb-dashboard__action{display:flex;gap:16px;align-items:center;border-radius:8px;border:1px solid var(--mb-color-accent);padding:24px;background:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);position:relative;top:0;transition:all .2s ease}.mb-dashboard__action svg{width:32px;height:32px;fill:var(--mb-color-accent)}.mb-dashboard__action__title{display:block;margin-bottom:4px;color:#0f172a;font-weight:600;font-size:16px}.mb-dashboard__action__description{color:#64748b}.mb-dashboard__action.mb-dashboard__action:hover{text-decoration:none;top:-8px}.mb-dashboard__intro__subtitle{font-size:16px}.mb-dashboard__intro__title{font-size:24px;color:#0f172a;font-weight:600;margin-top:12px}.mb-dashboard__intro__text{margin-top:24px;font-size:18px;line-height:1.6}.mb-dashboard__intro .mb-dashboard__button{margin-top:24px}.mb-dashboard__info{background:#fff;border-radius:8px;border:var(--mb-border)}.mb-dashboard__tabs{display:flex;gap:24px;border-bottom:var(--mb-border);font-size:14px;padding-inline:24px}.mb-dashboard__tab{display:block;padding-block:16px;border-bottom:3px solid rgba(0,0,0,0);font-weight:600;color:#0f172a;cursor:pointer}.mb-dashboard__tab--active{border-color:var(--mb-color-accent)}.mb-dashboard__tab__badge{background:var(--mb-color-accent);color:#fff;font-size:10px;display:inline-block;line-height:1;padding:4px;border-radius:2px;position:relative;top:-12px}.mb-dashboard__tab-pane{padding:24px}.mb-dashboard__tutorials__inner{display:grid;gap:16px;grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));margin-bottom:24px}.mb-dashboard__tutorial{display:flex;align-items:flex-start;gap:16px}.mb-dashboard__tutorial a{color:inherit}.mb-dashboard__tutorial__image{position:relative}.mb-dashboard__tutorial__image .tobii-zoom__icon{display:none}.mb-dashboard__tutorial__image:before{position:absolute;top:calc(50% - 9px);left:calc(50% - 16px);content:"";font-family:"dashicons";font-size:32px;color:red}.mb-dashboard__tutorial img{width:90px;height:auto;display:block;border-radius:8px}.mb-dashboard__tutorial .mb-dashboard__tutorial__title{font-size:16px;font-weight:600;color:#0f172a;margin-bottom:8px;display:block}.mb-dashboard__tutorial__description{font-size:12px;color:#64748b}.mb-dashboard__compare{container-type:inline-size}.mb-dashboard__compare__header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-block:24px}.mb-dashboard__compare__header p{margin-bottom:0}.mb-dashboard__compare__title{font-size:20px;font-weight:600;color:#0f172a}.mb-dashboard__compare tbody svg{width:20px;height:20px}.mb-dashboard__compare__footer{margin-top:48px;background:#f1f5f9;padding:48px;text-align:center;border-radius:8px}.mb-dashboard__compare__footer p{font-size:16px;margin-bottom:24px}.mb-dashboard__sidebar{flex-basis:360px;display:flex;flex-direction:column;gap:24px}.mb-dashboard__widget{border:var(--mb-border);border-radius:8px;background:#fff;padding:24px}.mb-dashboard__widget-title{font-weight:600;font-size:16px;color:#0f172a;margin-bottom:18px;margin-top:-4px}.mb-dashboard__widget-body>p:last-child{margin-bottom:0}.mb-dashboard__upgrade{border:none;background:linear-gradient(135deg, rgb(0, 182, 182) 0%, rgb(43, 68, 91) 100%);color:#fff;position:relative}.mb-dashboard__upgrade .mb-dashboard__widget-title{color:inherit}.mb-dashboard__upgrade ul{margin-bottom:24px}.mb-dashboard__upgrade li{display:flex;gap:4px;align-items:center}.mb-dashboard__upgrade svg{width:16px;height:16px;fill:#fff}.mb-dashboard__upgrade a{display:block;text-align:center}.mb-dashboard__upgrade img{position:absolute;top:-30px;right:-10px;width:60px;transform:rotate(-30deg)}.mb-dashboard__plugins .mb-dashboard__widget-body{display:flex;flex-direction:column;gap:16px}.mb-dashboard__plugin{display:flex;align-items:center;gap:8px;position:relative}.mb-dashboard__plugin img{width:32px;height:32px}.mb-dashboard__plugin__text{flex:1}.mb-dashboard__plugin .mb-dashboard__plugin__title{font-weight:600;color:#0f172a}.mb-dashboard__plugin__description{font-size:12px;color:#64748b}.mb-dashboard__plugin__status{font-size:12px;font-weight:600;display:inline-flex;align-items:center;gap:4px;position:absolute;right:0;top:-4px;padding:2px 6px;border-radius:4px;border:1px solid rgba(0,0,0,0)}.mb-dashboard__plugin__status:before{display:inline-block;content:"";width:6px;height:6px;border-radius:50%;background:currentColor}.mb-dashboard__plugin__status[data-action=install]{color:#64748b;border-color:currentColor;cursor:pointer}.mb-dashboard__plugin__status[data-action=activate]{color:#f59e0b;border-color:currentColor;cursor:pointer}.mb-dashboard__plugin__status[data-action=""]{color:var(--mb-color-accent)}.mb-dashboard__support{position:relative}.mb-dashboard__support__icon{position:absolute;top:0;right:0;width:48px;height:48px;fill:#f8fafc;z-index:0}.mb-dashboard__news-icon{position:relative}.mb-dashboard__news-icon:before{content:"";display:inline-block;width:10px;height:10px;position:absolute;top:0;right:0;background:#ef4444;border-radius:50%}.mb-dashboard__news{--mb-news-width: 360px;position:fixed;top:32px;right:calc(0px - var(--mb-news-width));width:var(--mb-news-width);bottom:0;background:#fff;transition:all .2s ease-in-out;overflow-x:auto;border-left:var(--mb-border)}.mb-dashboard__news--active{right:0}.mb-dashboard__news__header{padding:12px 24px;border-bottom:var(--mb-border);display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.mb-dashboard__news__heading{font-size:16px;font-weight:600;color:#0f172a}.mb-dashboard__news__close{width:32px;height:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:none;background:none;cursor:pointer}.mb-dashboard__news__close svg{width:24px;height:24px}.mb-dashboard__news__date{font-size:10px;text-transform:uppercase;letter-spacing:.025em;font-weight:600;margin-bottom:8px;color:#94a3b8}.mb-dashboard__news .mb-dashboard__news__title{display:block;font-size:16px;font-weight:600;color:#0f172a;margin-bottom:16px}.mb-dashboard__news__content p{display:none}.mb-dashboard__news__item{padding-inline:24px}.mb-dashboard__news__item:not(:first-child){margin-top:24px;padding-top:24px;border-top:var(--mb-border)}@media(max-width: 1023px){.mb-dashboard__header__search{display:none}.mb-dashboard__body{flex-direction:column}}@media(max-width: 782px){.mb-dashboard__news{top:46px}}@media(max-width: 599px){.mb-dashboard__header__social{display:none}.mb-dashboard__body{padding:24px}}@container (max-width: 599px){.mb-dashboard__compare__header{flex-direction:column}} diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/dashboard.scss b/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/dashboard.scss new file mode 100644 index 000000000..99321467d --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/dashboard.scss @@ -0,0 +1,837 @@ +// Overwrite general WordPress styles + +body.wp-admin { + background: #f8fafc; // slate-50 +} + +div#wpcontent { + padding-left: 0; +} + +// Do not show any notices here. +#wpwrap .notice { + display: none; +} + + +// Our dashboard + +.mb-dashboard { + --mb-color-accent: #00b1b3; + --mb-color-link: var(--mb-color-accent); + --mb-border: 1px solid #cbd5e1; // slate-300 + + font-size: 14px; + color: #334155; // slate-700 + + + // Common elements + + a { + text-decoration: none; + color: var(--mb-color-link); + + &:hover { + color: var(--mb-color-link); + text-decoration: underline; + } + + &:focus, + &:active { + outline: none; + box-shadow: none; + } + } + + p { + font-size: 14px; + } + + table { + width: 100%; + border-collapse: collapse; + } + + tr { + border-bottom: 1px solid #e2e8f0; // slate-200 + + &:hover { + background: #f8fafc; // slate-50 + } + } + + th, + td { + padding-block: 12px; + } + + &__button { + --mb-color-link: #fff; + + display: inline-block; + background: var(--mb-color-accent); + padding: 16px; + text-transform: uppercase; + font-weight: 700; + font-size: 16px; + line-height: 1; + letter-spacing: .025em; + white-space: nowrap; + border-radius: 4px; + text-decoration: none; + + &.mb-dashboard__button:hover { + color: #fff; + opacity: .9; + text-decoration: none; + } + + &:focus, + &:active { + color: #fff; + } + } + + &__hidden { + display: none; + } + + &__external { + display: inline-flex; + align-items: center; + gap: 4px; + + svg { + width: 1em; + height: 1em; + fill: currentColor; + } + } + + &__tooltip { + position: relative; + + &:after { + content: attr(data-tooltip); + background-color: #0f172a; // slate-900 + color: #fff; + padding: 4px 8px; + border-radius: 4px; + white-space: nowrap; + + // Positioning + position: absolute; + top: calc(100% + 8px); + left: 50%; + transform: translateX(-50%); + + visibility: hidden; + opacity: 0; + transition: opacity 0.3s ease-in-out; + } + + &[data-position="top"]:after { + bottom: calc(100% + 8px); + top: auto; + } + + &[data-position="bottom-right"]:after { + left: auto; + transform: none; + right: 0; + } + + &:hover:after { + visibility: visible; + opacity: 1; + } + } + + &__body { + display: flex; + gap: 48px; + padding: 48px; + max-width: 1280px; + margin-inline: auto; + } + + + // Header + + &__header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 24px; + padding: 12px; + background: #fff; + border-bottom: 1px solid #e2e8f0; // slate-200 + + &__search { + flex: 1; + + &__inner { + position: relative; + max-width: 480px; + margin-inline: auto; + } + + input[type="text"] { + width: 100%; + background: #f1f5f9; // slate-100 + border-color: #e2e8f0; + padding: 2px 16px; + margin: 0; + + &:focus, + &:hover { + border-color: #cbd5e1; + box-shadow: none; + } + } + + &:has(.mb-dashboard__header__search-results:not([data-type="empty"])) input { + border-radius: 4px 4px 0 0; + } + + &-results { + position: absolute; + top: 33px; + left: 0; + right: 0; + background: #fff; + z-index: 9; + border: var(--mb-border); + border-radius: 0 0 4px 4px; + box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); // shadow-lg + + a { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 24px; + color: inherit; + padding: 8px 16px; + transition: all .2s ease-in-out; + + &:hover { + color: inherit; + text-decoration: none; + background: #f1f5f9; // slate-100 + } + + &:last-child { + border-radius: 0 0 4px 4px; + } + } + + span { + display: inline-block; + padding: 2px 8px; + background: #e2e8f0; // slate-200 + border: var(--mb-border); + border-radius: 4px; + font-size: 12px; + } + + &[data-type="empty"] { + display: none; + } + + &[data-type="text"] { + padding: 16px; + } + } + } + + &__icons { + display: flex; + align-items: center; + + a { + display: inline-flex; + align-items: center; + justify-content: center; + } + } + + &__social { + display: flex; + align-items: center; + gap: 12px; + + border-right: var(--mb-border); + padding-right: 12px; + margin-right: 12px; + + svg { + width: 16px; + height: 16px; + fill: #64748b; + transition: all .2s ease-in-out; + } + + a { + width: 24px; + height: 24px; + + &:hover svg { + fill: #334155; + } + } + } + + &__links { + display: flex; + align-items: center; + gap: 12px; + + a { + color: #64748b; + width: 36px; + height: 36px; + border: var(--mb-border); + border-radius: 50%; + + &:hover { + color: #334155; + border-color: #94a3b8; + } + } + + svg { + width: 20px; + height: 20px; + } + } + + .mb-dashboard__logo { + svg { + display: block; + width: auto; + height: 46px; + } + } + } + + // Main area + &__main { + flex: 1; + display: flex; + flex-direction: column; + gap: 48px; + } + + // Actions + &__actions { + &__title { + font-size: 14px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: .025em; + line-height: 1; + margin-bottom: 16px; + } + + &__inner { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 24px; + } + } + + &__action { + display: flex; + gap: 16px; + align-items: center; + border-radius: 8px; + border: 1px solid var(--mb-color-accent); + padding: 24px; + background: #fff; + box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); // shadow-lg + position: relative; + top: 0; + transition: all .2s ease; + + svg { + width: 32px; + height: 32px; + fill: var(--mb-color-accent); + } + + &__title { + display: block; + margin-bottom: 4px; + color: #0f172a; // slate-900 + font-weight: 600; + font-size: 16px; + } + + &__description { + color: #64748b; // slate-500; + } + } + + &__action.mb-dashboard__action:hover { + text-decoration: none; + top: -8px; + } + + + // Intro + &__intro { + &__subtitle { + font-size: 16px; + } + + &__title { + font-size: 24px; + color: #0f172a; // slate-900 + font-weight: 600; + margin-top: 12px; + } + + &__text { + margin-top: 24px; + font-size: 18px; + line-height: 1.6; + } + + .mb-dashboard__button { + margin-top: 24px; + } + } + + + // Tabs + &__info { + background: #fff; + border-radius: 8px; + border: var(--mb-border); + } + + &__tabs { + display: flex; + gap: 24px; + border-bottom: var(--mb-border); + font-size: 14px; + padding-inline: 24px; + } + + &__tab { + display: block; + padding-block: 16px; + border-bottom: 3px solid transparent; + font-weight: 600; + color: #0f172a; // slate-900 + cursor: pointer; + + &--active { + border-color: var(--mb-color-accent); + } + + &__badge { + background: var(--mb-color-accent); + color: #fff; + font-size: 10px; + display: inline-block; + line-height: 1; + padding: 4px; + border-radius: 2px; + position: relative; + top: -12px; + } + } + + &__tab-pane { + padding: 24px; + } + + // Tutorials + &__tutorials { + &__inner { + display: grid; + gap: 16px; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + margin-bottom: 24px; + } + } + + &__tutorial { + display: flex; + align-items: flex-start; + gap: 16px; + + a { + color: inherit; + } + + &__image { + position: relative; + + .tobii-zoom__icon { + display: none; + } + + &:before { + position: absolute; + top: calc(50% - 9px); + left: calc(50% - 16px); + content: "\f19b"; + font-family: "dashicons"; + font-size: 32px; + color: #ff0000; + } + } + + img { + width: 90px; + height: auto; + display: block; + border-radius: 8px; + } + + .mb-dashboard__tutorial__title { + font-size: 16px; + font-weight: 600; + color: #0f172a; // slate-900 + margin-bottom: 8px; + display: block; + } + + &__description { + font-size: 12px; + color: #64748b; + } + } + + // Comparing tab and table + &__compare { + container-type: inline-size; + + &__header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 24px; + margin-block: 24px; + + p { + margin-bottom: 0; + } + } + + &__title { + font-size: 20px; + font-weight: 600; + color: #0f172a; // slate-900 + } + + tbody svg { + width: 20px; + height: 20px; + } + + &__footer { + margin-top: 48px; + background: #f1f5f9; // slate-50 + padding: 48px; + text-align: center; + border-radius: 8px; + + p { + font-size: 16px; + margin-bottom: 24px; + } + } + } + + // Sidebar + + &__sidebar { + flex-basis: 360px; + display: flex; + flex-direction: column; + gap: 24px; + } + + &__widget { + border: var(--mb-border); + border-radius: 8px; + background: #fff; + padding: 24px; + + &-title { + font-weight: 600; + font-size: 16px; + color: #0f172a; // slate-900 + margin-bottom: 18px; + margin-top: -4px; + } + + &-body { + >p:last-child { + margin-bottom: 0; + } + } + } + + // Upgrade widget + &__upgrade { + border: none; + background: linear-gradient(135deg, rgba(0, 182, 182, 1) 0%, rgba(43, 68, 91, 1) 100%); + color: #fff; + position: relative; + + .mb-dashboard__widget-title { + color: inherit; + } + + ul { + margin-bottom: 24px; + } + + li { + display: flex; + gap: 4px; + align-items: center; + } + + svg { + width: 16px; + height: 16px; + fill: #fff; + } + + a { + display: block; + text-align: center; + } + + img { + position: absolute; + top: -30px; + right: -10px; + width: 60px; + transform: rotate(-30deg); + } + } + + // Recommended plugins widget + &__plugins .mb-dashboard__widget-body { + display: flex; + flex-direction: column; + gap: 16px; + } + + &__plugin { + display: flex; + align-items: center; + gap: 8px; + position: relative; + + img { + width: 32px; + height: 32px; + } + + &__text { + flex: 1; + } + + .mb-dashboard__plugin__title { + font-weight: 600; + color: #0f172a; // slate-900 + } + + &__description { + font-size: 12px; + color: #64748b; // slate-500 + } + + &__status { + font-size: 12px; + font-weight: 600; + display: inline-flex; + align-items: center; + gap: 4px; + position: absolute; + right: 0; + top: -4px; + padding: 2px 6px; + border-radius: 4px; + border: 1px solid transparent; + + &:before { + display: inline-block; + content: ""; + width: 6px; + height: 6px; + border-radius: 50%; + background: currentColor; + } + + &[data-action="install"] { + color: #64748b; // slate-500 + border-color: currentColor; + cursor: pointer; + } + + &[data-action="activate"] { + color: #f59e0b; // amber-500 + border-color: currentColor; + cursor: pointer; + } + + &[data-action=""] { + color: var(--mb-color-accent); + } + } + } + + // Support widget + &__support { + position: relative; + + &__icon { + position: absolute; + top: 0; + right: 0; + width: 48px; + height: 48px; + fill: #f8fafc; + z-index: 0; + } + } + + + // News flyout sidebar + &__news-icon { + position: relative; + + &:before { + content: ""; + display: inline-block; + width: 10px; + height: 10px; + position: absolute; + top: 0; + right: 0; + background: #ef4444; + border-radius: 50%; + } + } + + &__news { + --mb-news-width: 360px; + + position: fixed; + top: 32px; + right: calc(0px - var(--mb-news-width)); + width: var(--mb-news-width); + bottom: 0; + background: #fff; + transition: all .2s ease-in-out; + overflow-x: auto; + border-left: var(--mb-border); + + &--active { + right: 0; + } + + &__header { + padding: 12px 24px; + border-bottom: var(--mb-border); + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 24px; + } + + &__heading { + font-size: 16px; + font-weight: 600; + color: #0f172a; // slate-900 + } + + &__close { + width: 32px; + height: 32px; + padding: 0; + display: inline-flex; + align-items: center; + justify-content: center; + border: none; + background: none; + cursor: pointer; + + svg { + width: 24px; + height: 24px; + } + } + + &__date { + font-size: 10px; + text-transform: uppercase; + letter-spacing: .025em; + font-weight: 600; + margin-bottom: 8px; + color: #94a3b8; + } + + .mb-dashboard__news__title { + display: block; + font-size: 16px; + font-weight: 600; + color: #0f172a; // slate-900 + margin-bottom: 16px; + } + + &__content p { + display: none; + } + + &__item { + padding-inline: 24px; + } + + &__item:not(:first-child) { + margin-top: 24px; + padding-top: 24px; + border-top: var(--mb-border); + } + } +} + +@media (max-width:1023px) { + .mb-dashboard__header__search { + display: none; + } + + .mb-dashboard__body { + flex-direction: column; + } +} + +@media (max-width: 782px) { + .mb-dashboard__news { + top: 46px; + } +} + +@media (max-width:599px) { + .mb-dashboard__header__social { + display: none; + } + + .mb-dashboard__body { + padding: 24px; + } +} + +@container (max-width: 599px) { + .mb-dashboard__compare__header { + flex-direction: column; + } +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/featherlight.min.css b/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/featherlight.min.css new file mode 100644 index 000000000..62fdb71d1 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/css/featherlight.min.css @@ -0,0 +1,8 @@ +/** + * Featherlight - ultra slim jQuery lightbox + * Version 1.7.14 - http://noelboss.github.io/featherlight/ + * + * Copyright 2019, Noël Raoul Bossart (http://www.noelboss.com) + * MIT Licensed. +**/ +html.with-featherlight{overflow:hidden}.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight link.featherlight-inner,.featherlight script.featherlight-inner,.featherlight style.featherlight-inner{display:none}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}@media print{html.with-featherlight>*>:not(.featherlight){display:none}} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/bulb.svg b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/bulb.svg new file mode 100644 index 000000000..817161d80 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/bulb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/category-thumbnails.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/category-thumbnails.png new file mode 100644 index 000000000..f7726bdcf Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/category-thumbnails.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/change-id.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/change-id.png new file mode 100644 index 000000000..35263d6c8 Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/change-id.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/create-custom-fields.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/create-custom-fields.png new file mode 100644 index 000000000..39ed285ae Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/create-custom-fields.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/create-post-types.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/create-post-types.png new file mode 100644 index 000000000..b6ea9620f Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/create-post-types.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/export-import-custom-fields.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/export-import-custom-fields.png new file mode 100644 index 000000000..126d85115 Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/export-import-custom-fields.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/falcon.svg b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/falcon.svg new file mode 100644 index 000000000..9ed1456a0 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/falcon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/filter-posts.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/filter-posts.png new file mode 100644 index 000000000..fadd6fca7 Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/filter-posts.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/recipe.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/recipe.png new file mode 100644 index 000000000..ea199bda0 Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/recipe.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/simple-listings.png b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/simple-listings.png new file mode 100644 index 000000000..a217d1ecb Binary files /dev/null and b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/simple-listings.png differ diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/slim-seo.svg b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/slim-seo.svg new file mode 100644 index 000000000..565c81c21 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/img/slim-seo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/js/dashboard.js b/vendor/wpmetabox/meta-box/src/Dashboard/assets/js/dashboard.js new file mode 100644 index 000000000..39735e769 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/js/dashboard.js @@ -0,0 +1,249 @@ +{ + // Auto add UTM params to links. + document.querySelectorAll( '.mb-dashboard a' ).forEach( a => { + const domains = [ 'metabox.io', 'docs.metabox.io', 'support.metabox.io', 'wpslimseo.com' ]; + if ( domains.every( domain => !a.href.startsWith( `https://${ domain }` ) ) ) { + return; + } + + const parent = a.closest( '[data-utm]' ); + const medium = parent ? parent.dataset.utm : 'link'; + + a.href += `?utm_source=dashboard&utm_medium=${ medium }&utm_campaign=${ MBD.campaign }`; + } ); + + // Click to install or activate plugins. + document.addEventListener( 'click', e => { + const el = e.target; + + if ( !el.classList.contains( 'mb-dashboard__plugin__status' ) || !el.dataset.action ) { + return; + } + + const oldText = el.textContent; + el.textContent = el.dataset.processing; + + fetch( `${ ajaxurl }?action=mb_dashboard_plugin_action&mb_plugin=${ el.dataset.plugin }&mb_action=${ el.dataset.action }&_ajax_nonce=${ MBD.nonces.plugin }` ) + .then( response => response.json() ) + .then( response => { + if ( !response.success ) { + alert( response.data ); + el.textContent = oldText; + return; + } + + el.dataset.action = ''; + el.textContent = el.dataset.done; + } ); + } ); + + // Switch tabs + document.addEventListener( 'click', e => { + const el = e.target; + + if ( !el.classList.contains( 'mb-dashboard__tab' ) ) { + return; + } + + document.querySelectorAll( '.mb-dashboard__tab' ).forEach( e => e.classList.remove( 'mb-dashboard__tab--active' ) ); + el.classList.add( 'mb-dashboard__tab--active' ); + + document.querySelectorAll( '.mb-dashboard__tab-pane' ).forEach( e => e.classList.add( 'mb-dashboard__hidden' ) ); + document.querySelector( `.mb-dashboard__tab-pane[data-tab="${ el.dataset.tab }"]` ).classList.remove( 'mb-dashboard__hidden' ); + } ); + + const fetchDocs = async () => { + let docs; + + /** + * Check if need to fetch docs. + * Docs is cached for 1 month in the local storage. + */ + const needsUpdate = () => { + const lastUpdated = localStorage.getItem( 'meta-box-docs-last-updated' ); + const now = Date.now(); + const MONTH_IN_MILLISECONDS = 30 * 24 * 60 * 60 * 1000; + if ( !lastUpdated || now - lastUpdated > MONTH_IN_MILLISECONDS ) { + return true; + } + + docs = JSON.parse( localStorage.getItem( 'meta-box-docs' ) ); + return !Array.isArray( docs ) || docs.length === 0; + }; + + /** + * Normalize docs data, keeping only references to docs titles and sections. + */ + const normalizeData = data => { + // Original docs + const originalDocs = data[ 0 ].documents.map( ( { t, u } ) => ( { t, u } ) ); + + // Sections + const findOriginalDoc = url => originalDocs.find( ( { t, u } ) => u === url ); + + // Section docs. + const sectionDocs = data[ 1 ].documents.filter( doc => doc.h.length > 0 && !doc.u.includes( '/category/' ) ).map( ( { t, u, h } ) => { + const originalDoc = findOriginalDoc( u ); + if ( !originalDoc ) { + return { + t, + u: `${ u }${ h }`, + }; + } + + return { + t: `${ originalDoc.t } → ${ t }`, + u: `${ u }${ h }`, + }; + } ); + + return [ ...originalDocs, ...sectionDocs ]; + }; + + if ( !needsUpdate() ) { + return docs; + } + + let response = await fetch( 'https://docs.metabox.io/search-index.json' ); + response = await response.json(); + + if ( !Array.isArray( response ) || response.length === 0 ) { + return []; + } + + docs = normalizeData( response ); + + localStorage.setItem( 'meta-box-docs', JSON.stringify( docs ) ); + localStorage.setItem( 'meta-box-docs-last-updated', Date.now() ); + + return docs; + }; + + const searchDocs = async () => { + const docs = await fetchDocs(); + if ( !Array.isArray( docs ) || docs.length === 0 ) { + return; + } + + const resultsDiv = document.querySelector( '.mb-dashboard__header__search-results' ); + const input = document.querySelector( '.mb-dashboard__header__search input' ); + const categories = [ 'fields', 'extensions', 'tutorials', 'integrations', 'actions', 'filters', 'functions' ]; + + const search = e => { + const s = e.target.value; + if ( s.length === 0 ) { + resultsDiv.innerHTML = ''; + resultsDiv.dataset.type = 'empty'; + return; + } + + resultsDiv.innerHTML = resultsDiv.dataset.searching; + resultsDiv.dataset.type = 'text'; + + let results = docs.filter( docs => docs.t.toLowerCase().includes( s.toLowerCase() ) ).slice( 0, 10 ); + + if ( results.length === 0 ) { + resultsDiv.innerHTML = resultsDiv.dataset.none; + resultsDiv.dataset.type = 'text'; + return; + } + + results = results.map( result => { + let category = 'general'; + const parts = result.u.split( '/' ); + + if ( categories.includes( parts[ 1 ] ) ) { + category = parts[ 1 ]; + } + category = category.charAt( 0 ).toUpperCase() + category.slice( 1 ); // Uppercase the first character. + + const url = new URL( `https://docs.metabox.io${ result.u }` ); + url.searchParams.append( 'utm_source', 'dashboard' ); + url.searchParams.append( 'utm_medium', 'search' ); + url.searchParams.append( 'utm_campaign', MBD.campaign ); + + return `${ result.t } ${ category }`; + } ); + + resultsDiv.innerHTML = results.join( '' ); + resultsDiv.dataset.type = 'list'; + }; + + input.addEventListener( 'input', search ); + input.addEventListener( 'focus', search ); + + input.addEventListener( 'blur', () => { + // Set timeout to make click work properly. + setTimeout( () => { + resultsDiv.innerHTML = ''; + resultsDiv.dataset.type = 'empty'; + }, 300 ); + } ); + }; + + searchDocs(); + + const fetchNews = async () => { + let items = []; + + const needsUpdate = () => { + const lastUpdated = localStorage.getItem( 'meta-box-news-last-updated' ); + const now = Date.now(); + const DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000; + if ( !lastUpdated || now - lastUpdated > DAY_IN_MILLISECONDS ) { + return true; + } + + items = JSON.parse( localStorage.getItem( 'meta-box-news' ) ); + return !Array.isArray( items ) || items.length === 0; + }; + + if ( !needsUpdate() ) { + return items; + } + + let response = await fetch( `${ ajaxurl }?action=mb_dashboard_feed&_ajax_nonce=${ MBD.nonces.feed }` ); + response = await response.json(); + + items = response.success ? response.data : []; + + localStorage.setItem( 'meta-box-news', JSON.stringify( items ) ); + localStorage.setItem( 'meta-box-news-last-updated', Date.now() ); + + return items; + } + + const renderNews = async () => { + let items = await fetchNews(); + const list = document.querySelector( '.mb-dashboard__news__list' ); + + if ( ! Array.isArray( items ) || items.length === 0 ) { + list.innerHTML = list.dataset.empty; + return; + } + + items = items.map( item => { + const url = new URL( item.url ); + url.searchParams.append( 'utm_source', 'dashboard' ); + url.searchParams.append( 'utm_medium', 'news' ); + url.searchParams.append( 'utm_campaign', MBD.campaign ); + + return `
+
${ item.date }
+ ${ item.title } +
${ item.description }
+
`; + } ); + + list.innerHTML = items.join( '' ); + }; + + const showNews = async () => { + await renderNews(); + const news = document.querySelector( '.mb-dashboard__news' ); + document.querySelector( '.mb-dashboard__news-icon' ).addEventListener( 'click', () => news.classList.toggle( 'mb-dashboard__news--active' ) ); + document.querySelector( '.mb-dashboard__news__close' ).addEventListener( 'click', () => news.classList.remove( 'mb-dashboard__news--active' ) ); + }; + + showNews(); +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/src/Dashboard/assets/js/featherlight.min.js b/vendor/wpmetabox/meta-box/src/Dashboard/assets/js/featherlight.min.js new file mode 100644 index 000000000..3b53d6684 --- /dev/null +++ b/vendor/wpmetabox/meta-box/src/Dashboard/assets/js/featherlight.min.js @@ -0,0 +1,8 @@ +/** + * Featherlight - ultra slim jQuery lightbox + * Version 1.7.14 - http://noelboss.github.io/featherlight/ + * + * Copyright 2019, Noël Raoul Bossart (http://www.noelboss.com) + * MIT Licensed. +**/ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}function c(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d],delete a[d]);return c}function d(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));if(a.fn.jquery.match(/-ajax/))return void("console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version."));var e=[],f=function(b){return e=a.grep(e,function(a){return a!==b&&a.$instance.closest("body").length>0})},g={allow:1,allowfullscreen:1,frameborder:1,height:1,longdesc:1,marginheight:1,marginwidth:1,mozallowfullscreen:1,name:1,referrerpolicy:1,sandbox:1,scrolling:1,src:1,srcdoc:1,style:1,webkitallowfullscreen:1,width:1},h={keyup:"onKeyUp",resize:"onResize"},i=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[h[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},j=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(h,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,i)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"✕",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['
','
','",'
'+d.loading+"
","
","
"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){if(!b.isDefaultPrevented()){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",b.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(this.$instance[0],b[0])?"":b),this.$content=b.addClass(this.namespace+"-inner"),this},open:function(b){var c=this;if(c.$instance.hide().appendTo(c.root),!(b&&b.isDefaultPrevented()||c.beforeOpen(b)===!1)){b&&b.preventDefault();var d=c.getContent();if(d)return e.push(c),j(!0),c.$instance.fadeIn(c.openSpeed),c.beforeContent(b),a.when(d).always(function(a){a&&(c.setContent(a),c.afterContent(b))}).then(c.$instance.promise()).done(function(){c.afterOpen(b)})}return c.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,d=a.Deferred();return c.beforeClose(b)===!1?d.reject():(0===f(c).length&&j(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),d.resolve()})),d.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(this.$content.parent().width()-1),b/(this.$content.parent().height()-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("
").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.reject()});return c.promise()}},iframe:{process:function(b){var e=new a.Deferred,f=a("