1
0
Fork 0

Update libraries

master
Brie Bruns 2023-06-14 10:48:59 -06:00
parent b281994a98
commit 316a84f891
602 changed files with 29709 additions and 3330 deletions

76
composer.lock generated
View File

@ -8,21 +8,21 @@
"packages": [
{
"name": "guzzlehttp/guzzle",
"version": "7.5.1",
"version": "7.7.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9"
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5",
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.5",
"guzzlehttp/promises": "^1.5.3 || ^2.0",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
@ -34,7 +34,8 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.1",
"ext-curl": "*",
"php-http/client-integration-tests": "^3.0",
"php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
"php-http/message-factory": "^1.1",
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
@ -48,9 +49,6 @@
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "7.5-dev"
}
},
"autoload": {
@ -116,7 +114,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.5.1"
"source": "https://github.com/guzzle/guzzle/tree/7.7.0"
},
"funding": [
{
@ -132,38 +130,37 @@
"type": "tidelift"
}
],
"time": "2023-04-17T16:30:08+00:00"
"time": "2023-05-21T14:04:53+00:00"
},
{
"name": "guzzlehttp/promises",
"version": "1.5.2",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "b94b2807d85443f9719887892882d0329d1e2598"
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
"reference": "b94b2807d85443f9719887892882d0329d1e2598",
"url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
"shasum": ""
},
"require": {
"php": ">=5.5"
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1"
"bamarni/composer-bin-plugin": "^1.8.1",
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
"bamarni-bin": {
"bin-links": true,
"forward-command": false
}
},
"autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
}
@ -200,7 +197,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/1.5.2"
"source": "https://github.com/guzzle/promises/tree/2.0.0"
},
"funding": [
{
@ -216,7 +213,7 @@
"type": "tidelift"
}
],
"time": "2022-08-28T14:55:35+00:00"
"time": "2023-05-21T13:50:22+00:00"
},
{
"name": "guzzlehttp/psr7",
@ -336,25 +333,26 @@
},
{
"name": "microsoft/microsoft-graph",
"version": "1.94.0",
"version": "1.99.0",
"source": {
"type": "git",
"url": "https://github.com/microsoftgraph/msgraph-sdk-php.git",
"reference": "c0a41246827cf2dadcd4d3bae1ab87fdbe51edf8"
"reference": "8f12e704b7b7eb29515993c21bac8c10285c53fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/microsoftgraph/msgraph-sdk-php/zipball/c0a41246827cf2dadcd4d3bae1ab87fdbe51edf8",
"reference": "c0a41246827cf2dadcd4d3bae1ab87fdbe51edf8",
"url": "https://api.github.com/repos/microsoftgraph/msgraph-sdk-php/zipball/8f12e704b7b7eb29515993c21bac8c10285c53fb",
"reference": "8f12e704b7b7eb29515993c21bac8c10285c53fb",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"php": "^8.0 || ^7.3",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
"guzzlehttp/promises": "^1.0 || ^2.0",
"mikey179/vfsstream": "^1.2",
"phpstan/phpstan": "^0.12.90 || ^1.0.0",
"phpunit/phpunit": "^8.0 || ^9.0"
@ -381,9 +379,9 @@
"homepage": "https://developer.microsoft.com/en-us/graph",
"support": {
"issues": "https://github.com/microsoftgraph/msgraph-sdk-php/issues",
"source": "https://github.com/microsoftgraph/msgraph-sdk-php/tree/1.94.0"
"source": "https://github.com/microsoftgraph/msgraph-sdk-php/tree/1.99.0"
},
"time": "2023-04-11T13:23:45+00:00"
"time": "2023-06-13T15:53:55+00:00"
},
{
"name": "psr/http-client",
@ -494,16 +492,16 @@
},
{
"name": "psr/http-message",
"version": "1.1",
"version": "2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
@ -512,7 +510,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
"dev-master": "2.0.x-dev"
}
},
"autoload": {
@ -527,7 +525,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
@ -541,9 +539,9 @@
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/1.1"
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"time": "2023-04-04T09:50:52+00:00"
"time": "2023-04-04T09:54:51+00:00"
},
{
"name": "ralouphie/getallheaders",

View File

@ -7,7 +7,6 @@ $baseDir = dirname($vendorDir);
return array(
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
);

View File

@ -8,7 +8,6 @@ class ComposerStaticInitb3ba5c720289dde204718f29088eb21c
{
public static $files = array (
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
);

View File

@ -2,22 +2,22 @@
"packages": [
{
"name": "guzzlehttp/guzzle",
"version": "7.5.1",
"version_normalized": "7.5.1.0",
"version": "7.7.0",
"version_normalized": "7.7.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9"
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5",
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.5",
"guzzlehttp/promises": "^1.5.3 || ^2.0",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
@ -29,7 +29,8 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.1",
"ext-curl": "*",
"php-http/client-integration-tests": "^3.0",
"php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
"php-http/message-factory": "^1.1",
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
@ -38,15 +39,12 @@
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
"time": "2023-04-17T16:30:08+00:00",
"time": "2023-05-21T14:04:53+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "7.5-dev"
}
},
"installation-source": "dist",
@ -113,7 +111,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.5.1"
"source": "https://github.com/guzzle/guzzle/tree/7.7.0"
},
"funding": [
{
@ -133,37 +131,36 @@
},
{
"name": "guzzlehttp/promises",
"version": "1.5.2",
"version_normalized": "1.5.2.0",
"version": "2.0.0",
"version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "b94b2807d85443f9719887892882d0329d1e2598"
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
"reference": "b94b2807d85443f9719887892882d0329d1e2598",
"url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
"reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6",
"shasum": ""
},
"require": {
"php": ">=5.5"
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1"
"bamarni/composer-bin-plugin": "^1.8.1",
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"time": "2022-08-28T14:55:35+00:00",
"time": "2023-05-21T13:50:22+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
"bamarni-bin": {
"bin-links": true,
"forward-command": false
}
},
"installation-source": "dist",
"autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
}
@ -200,7 +197,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/1.5.2"
"source": "https://github.com/guzzle/promises/tree/2.0.0"
},
"funding": [
{
@ -339,31 +336,32 @@
},
{
"name": "microsoft/microsoft-graph",
"version": "1.94.0",
"version_normalized": "1.94.0.0",
"version": "1.99.0",
"version_normalized": "1.99.0.0",
"source": {
"type": "git",
"url": "https://github.com/microsoftgraph/msgraph-sdk-php.git",
"reference": "c0a41246827cf2dadcd4d3bae1ab87fdbe51edf8"
"reference": "8f12e704b7b7eb29515993c21bac8c10285c53fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/microsoftgraph/msgraph-sdk-php/zipball/c0a41246827cf2dadcd4d3bae1ab87fdbe51edf8",
"reference": "c0a41246827cf2dadcd4d3bae1ab87fdbe51edf8",
"url": "https://api.github.com/repos/microsoftgraph/msgraph-sdk-php/zipball/8f12e704b7b7eb29515993c21bac8c10285c53fb",
"reference": "8f12e704b7b7eb29515993c21bac8c10285c53fb",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"php": "^8.0 || ^7.3",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
"guzzlehttp/promises": "^1.0 || ^2.0",
"mikey179/vfsstream": "^1.2",
"phpstan/phpstan": "^0.12.90 || ^1.0.0",
"phpunit/phpunit": "^8.0 || ^9.0"
},
"time": "2023-04-11T13:23:45+00:00",
"time": "2023-06-13T15:53:55+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -387,7 +385,7 @@
"homepage": "https://developer.microsoft.com/en-us/graph",
"support": {
"issues": "https://github.com/microsoftgraph/msgraph-sdk-php/issues",
"source": "https://github.com/microsoftgraph/msgraph-sdk-php/tree/1.94.0"
"source": "https://github.com/microsoftgraph/msgraph-sdk-php/tree/1.99.0"
},
"install-path": "../microsoft/microsoft-graph"
},
@ -506,27 +504,27 @@
},
{
"name": "psr/http-message",
"version": "1.1",
"version_normalized": "1.1.0.0",
"version": "2.0",
"version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"time": "2023-04-04T09:50:52+00:00",
"time": "2023-04-04T09:54:51+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
"dev-master": "2.0.x-dev"
}
},
"installation-source": "dist",
@ -542,7 +540,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
@ -556,7 +554,7 @@
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/1.1"
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"install-path": "../psr/http-message"
},

View File

@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '246a9a17364e1c506739daad4920d35a181e7063',
'reference' => 'b281994a9890fbe9d2700e89b279206f077b1816',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -13,25 +13,25 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '246a9a17364e1c506739daad4920d35a181e7063',
'reference' => 'b281994a9890fbe9d2700e89b279206f077b1816',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
'pretty_version' => '7.5.1',
'version' => '7.5.1.0',
'reference' => 'b964ca597e86b752cd994f27293e9fa6b6a95ed9',
'pretty_version' => '7.7.0',
'version' => '7.7.0.0',
'reference' => 'fb7566caccf22d74d1ab270de3551f72a58399f5',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/promises' => array(
'pretty_version' => '1.5.2',
'version' => '1.5.2.0',
'reference' => 'b94b2807d85443f9719887892882d0329d1e2598',
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'reference' => '3a494dc7dc1d7d12e511890177ae2d0e6c107da6',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(),
@ -47,9 +47,9 @@
'dev_requirement' => false,
),
'microsoft/microsoft-graph' => array(
'pretty_version' => '1.94.0',
'version' => '1.94.0.0',
'reference' => 'c0a41246827cf2dadcd4d3bae1ab87fdbe51edf8',
'pretty_version' => '1.99.0',
'version' => '1.99.0.0',
'reference' => '8f12e704b7b7eb29515993c21bac8c10285c53fb',
'type' => 'library',
'install_path' => __DIR__ . '/../microsoft/microsoft-graph',
'aliases' => array(),
@ -86,9 +86,9 @@
),
),
'psr/http-message' => array(
'pretty_version' => '1.1',
'version' => '1.1.0.0',
'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba',
'pretty_version' => '2.0',
'version' => '2.0.0.0',
'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(),

View File

@ -2,6 +2,41 @@
Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
## 7.7.0 - 2023-05-21
### Added
- Support `guzzlehttp/promises` v2
## 7.6.1 - 2023-05-15
### Fixed
- Fix `SetCookie::fromString` MaxAge deprecation warning and skip invalid MaxAge values
## 7.6.0 - 2023-05-14
### Added
- Support for setting the minimum TLS version in a unified way
- Apply on request the version set in options parameters
## 7.5.2 - 2023-05-14
### Fixed
- Fixed set cookie constructor validation
- Fixed handling of files with `'0'` body
### Changed
- Corrected docs and default connect timeout value to 300 seconds
## 7.5.1 - 2023-04-17
### Fixed
@ -12,6 +47,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- Adjusted `guzzlehttp/psr7` version constraint to `^1.9.1 || ^2.4.5`
## 7.5.0 - 2022-08-28
### Added
@ -19,6 +55,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- Support PHP 8.2
- Add request to delay closure params
## 7.4.5 - 2022-06-20
### Fixed
@ -26,6 +63,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
* Fix change in port should be considered a change in origin
* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin
## 7.4.4 - 2022-06-09
### Fixed
@ -33,12 +71,14 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
* Fix failure to strip Authorization header on HTTP downgrade
* Fix failure to strip the Cookie header on change in host or HTTP downgrade
## 7.4.3 - 2022-05-25
### Fixed
* Fix cross-domain cookie leakage
## 7.4.2 - 2022-03-20
### Fixed
@ -47,6 +87,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- Reject non-HTTP schemes in StreamHandler
- Set a default ssl.peer_name context in StreamHandler to allow `force_ip_resolve`
## 7.4.1 - 2021-12-06
### Changed
@ -58,6 +99,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950)
## 7.4.0 - 2021-10-18
### Added
@ -75,6 +117,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945)
## 7.3.0 - 2021-03-23
### Added
@ -87,6 +130,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872)
## 7.2.0 - 2020-10-10
### Added
@ -109,6 +153,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786)
## 7.1.1 - 2020-09-30
### Fixed
@ -120,6 +165,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- We dont connect curl `sink` on HEAD requests.
- Removed some PHP 5 workarounds
## 7.1.0 - 2020-09-22
### Added
@ -142,14 +188,17 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version
- `Utils::defaultCaBundle()`
- `CurlFactory::LOW_CURL_VERSION_NUMBER`
## 7.0.1 - 2020-06-27
* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699)
## 7.0.0 - 2020-06-27
No changes since 7.0.0-rc1.
## 7.0.0-rc1 - 2020-06-15
### Changed
@ -157,6 +206,7 @@ No changes since 7.0.0-rc1.
* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629)
* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675)
## 7.0.0-beta2 - 2020-05-25
### Added
@ -182,6 +232,7 @@ No changes since 7.0.0-rc1.
* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528)
## 7.0.0-beta1 - 2019-12-30
The diff might look very big but 95% of Guzzle users will be able to upgrade without modification.
@ -215,15 +266,18 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440)
* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464)
## 6.5.2 - 2019-12-23
* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489)
## 6.5.1 - 2019-12-21
* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454)
* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424)
## 6.5.0 - 2019-12-07
* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143)
@ -233,11 +287,13 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348)
* Deprecated `ClientInterface::VERSION`
## 6.4.1 - 2019-10-23
* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that
* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar`
## 6.4.0 - 2019-10-23
* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108)
@ -250,6 +306,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335)
* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362)
## 6.3.3 - 2018-04-22
* Fix: Default headers when decode_content is specified
@ -291,13 +348,14 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684)
* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827)
+ Minor code cleanups, documentation fixes and clarifications.
## 6.2.3 - 2017-02-28
* Fix deprecations with guzzle/psr7 version 1.4
## 6.2.2 - 2016-10-08
* Allow to pass nullable Response to delay callable
@ -305,6 +363,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Fix drain case where content-length is the literal string zero
* Obfuscate in-URL credentials in exceptions
## 6.2.1 - 2016-07-18
* Address HTTP_PROXY security vulnerability, CVE-2016-5385:
@ -315,6 +374,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
a server does not honor `Connection: close`.
* Ignore URI fragment when sending requests.
## 6.2.0 - 2016-03-21
* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`.
@ -334,6 +394,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Bug fix: provide an empty string to `http_build_query` for HHVM workaround.
https://github.com/guzzle/guzzle/pull/1367
## 6.1.1 - 2015-11-22
* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler
@ -349,6 +410,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Bug fix: fixed regression where MockHandler was not using `sink`.
https://github.com/guzzle/guzzle/pull/1292
## 6.1.0 - 2015-09-08
* Feature: Added the `on_stats` request option to provide access to transfer
@ -383,6 +445,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set.
https://github.com/guzzle/guzzle/pull/1189
## 6.0.2 - 2015-07-04
* Fixed a memory leak in the curl handlers in which references to callbacks
@ -400,6 +463,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Functions are now conditionally required using an additional level of
indirection to help with global Composer installations.
## 6.0.1 - 2015-05-27
* Fixed a bug with serializing the `query` request option where the `&`
@ -408,6 +472,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
use `form_params` or `multipart` instead.
* Various doc fixes.
## 6.0.0 - 2015-05-26
* See the UPGRADING.md document for more information.
@ -432,6 +497,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* `$maxHandles` has been removed from CurlMultiHandler.
* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package.
## 5.3.0 - 2015-05-19
* Mock now supports `save_to`
@ -442,6 +508,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated.
* URL scheme is now always lowercased.
## 6.0.0-beta.1
* Requires PHP >= 5.5
@ -494,6 +561,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* `GuzzleHttp\QueryParser` has been replaced with the
`GuzzleHttp\Psr7\parse_query`.
## 5.2.0 - 2015-01-27
* Added `AppliesHeadersInterface` to make applying headers to a request based
@ -504,6 +572,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
RingBridge.
* Added a guard in the Pool class to not use recursion for request retries.
## 5.1.0 - 2014-12-19
* Pool class no longer uses recursion when a request is intercepted.
@ -524,6 +593,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c
* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle
specific exceptions if necessary.
## 5.0.3 - 2014-11-03
This change updates query strings so that they are treated as un-encoded values
@ -538,6 +608,7 @@ string that should not be parsed or encoded (unless a call to getQuery() is
subsequently made, forcing the query-string to be converted into a Query
object).
## 5.0.2 - 2014-10-30
* Added a trailing `\r\n` to multipart/form-data payloads. See
@ -559,6 +630,7 @@ object).
string on a URL: Now allowing many more characters to be present in the
query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A
## 5.0.1 - 2014-10-16
Bugfix release.
@ -570,6 +642,7 @@ Bugfix release.
* Fixed an issue where transfer statistics were not being populated in the
RingBridge. https://github.com/guzzle/guzzle/issues/866
## 5.0.0 - 2014-10-12
Adding support for non-blocking responses and some minor API cleanup.
@ -651,6 +724,7 @@ interfaces.
argument. They now accept an associative array of options, including the
"size" key and "metadata" key which can be used to provide custom metadata.
## 4.2.2 - 2014-09-08
* Fixed a memory leak in the CurlAdapter when reusing cURL handles.

View File

@ -60,13 +60,13 @@ composer require guzzlehttp/guzzle
## Version Guidance
| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
|---------|----------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.3 |
| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
| 6.x | Security fixes only | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.3 |
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x

View File

@ -53,7 +53,7 @@
"require": {
"php": "^7.2.5 || ^8.0",
"ext-json": "*",
"guzzlehttp/promises": "^1.5",
"guzzlehttp/promises": "^1.5.3 || ^2.0",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
@ -64,7 +64,8 @@
"require-dev": {
"ext-curl": "*",
"bamarni/composer-bin-plugin": "^1.8.1",
"php-http/client-integration-tests": "^3.0",
"php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
"php-http/message-factory": "^1.1",
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
@ -84,9 +85,6 @@
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "7.5-dev"
}
},
"autoload": {

View File

@ -120,13 +120,14 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
public function send(RequestInterface $request, array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
return $this->sendAsync($request, $options)->wait();
}
/**
* The HttpClient PSR (PSR-18) specify this method.
*
* @inheritDoc
* {@inheritDoc}
*/
public function sendRequest(RequestInterface $request): ResponseInterface
{
@ -184,6 +185,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
public function request(string $method, $uri = '', array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
return $this->requestAsync($method, $uri, $options)->wait();
}
@ -228,11 +230,11 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
{
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
'http_errors' => true,
'decode_content' => true,
'verify' => true,
'cookies' => false,
'idn_conversion' => false,
'http_errors' => true,
'decode_content' => true,
'verify' => true,
'cookies' => false,
'idn_conversion' => false,
];
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
@ -354,10 +356,10 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
if (isset($options['form_params'])) {
if (isset($options['multipart'])) {
throw new InvalidArgumentException('You cannot use '
. 'form_params and multipart at the same time. Use the '
. 'form_params option if you want to send application/'
. 'x-www-form-urlencoded requests, and the multipart '
. 'option to send multipart/form-data requests.');
.'form_params and multipart at the same time. Use the '
.'form_params option if you want to send application/'
.'x-www-form-urlencoded requests, and the multipart '
.'option to send multipart/form-data requests.');
}
$options['body'] = \http_build_query($options['form_params'], '', '&');
unset($options['form_params']);
@ -403,7 +405,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
// Ensure that we don't have the header in different case and set the new value.
$modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']);
$modify['set_headers']['Authorization'] = 'Basic '
. \base64_encode("$value[0]:$value[1]");
.\base64_encode("$value[0]:$value[1]");
break;
case 'digest':
// @todo: Do not rely on curl
@ -437,13 +439,17 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
}
}
if (isset($options['version'])) {
$modify['version'] = $options['version'];
}
$request = Psr7\Utils::modifyRequest($request, $modify);
if ($request->getBody() instanceof Psr7\MultipartStream) {
// Use a multipart/form-data POST if a Content-Type is not set.
// Ensure that we don't have the header in different case and set the new value.
$options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
. $request->getBody()->getBoundary();
.$request->getBody()->getBoundary();
}
// Merge in conditional headers if they are not present.
@ -469,9 +475,9 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
private function invalidBody(): InvalidArgumentException
{
return new InvalidArgumentException('Passing in the "body" request '
. 'option as an array to send a request is not supported. '
. 'Please use the "form_params" request option to send a '
. 'application/x-www-form-urlencoded request, or the "multipart" '
. 'request option to send a multipart/form-data request.');
.'option as an array to send a request is not supported. '
.'Please use the "form_params" request option to send a '
.'application/x-www-form-urlencoded request, or the "multipart" '
.'request option to send a multipart/form-data request.');
}
}

View File

@ -50,10 +50,10 @@ class CookieJar implements CookieJarInterface
$cookieJar = new self();
foreach ($cookies as $name => $value) {
$cookieJar->setCookie(new SetCookie([
'Domain' => $domain,
'Name' => $name,
'Value' => $value,
'Discard' => true
'Domain' => $domain,
'Name' => $name,
'Value' => $value,
'Discard' => true,
]));
}
@ -97,7 +97,7 @@ class CookieJar implements CookieJarInterface
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function toArray(): array
{
@ -107,12 +107,13 @@ class CookieJar implements CookieJarInterface
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
{
if (!$domain) {
$this->cookies = [];
return;
} elseif (!$path) {
$this->cookies = \array_filter(
@ -142,7 +143,7 @@ class CookieJar implements CookieJarInterface
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function clearSessionCookies(): void
{
@ -155,7 +156,7 @@ class CookieJar implements CookieJarInterface
}
/**
* @inheritDoc
* {@inheritDoc}
*/
public function setCookie(SetCookie $cookie): bool
{
@ -170,9 +171,10 @@ class CookieJar implements CookieJarInterface
$result = $cookie->validate();
if ($result !== true) {
if ($this->strictMode) {
throw new \RuntimeException('Invalid cookie: ' . $result);
throw new \RuntimeException('Invalid cookie: '.$result);
}
$this->removeCookieIfEmpty($cookie);
return false;
}
@ -253,7 +255,7 @@ class CookieJar implements CookieJarInterface
/**
* Computes cookie path following RFC 6265 section 5.1.4
*
* @link https://tools.ietf.org/html/rfc6265#section-5.1.4
* @see https://tools.ietf.org/html/rfc6265#section-5.1.4
*/
private function getCookiePathFromRequest(RequestInterface $request): string
{
@ -289,8 +291,8 @@ class CookieJar implements CookieJarInterface
!$cookie->isExpired() &&
(!$cookie->getSecure() || $scheme === 'https')
) {
$values[] = $cookie->getName() . '='
. $cookie->getValue();
$values[] = $cookie->getName().'='
.$cookie->getValue();
}
}

View File

@ -13,7 +13,7 @@ use Psr\Http\Message\ResponseInterface;
* necessary. Subclasses are also responsible for storing and retrieving
* cookies from a file, database, etc.
*
* @link https://docs.python.org/2/library/cookielib.html Inspiration
* @see https://docs.python.org/2/library/cookielib.html Inspiration
* @extends \IteratorAggregate<SetCookie>
*/
interface CookieJarInterface extends \Countable, \IteratorAggregate

View File

@ -71,7 +71,7 @@ class SessionCookieJar extends CookieJar
$this->setCookie(new SetCookie($cookie));
}
} elseif (\strlen($data)) {
throw new \RuntimeException("Invalid cookie data");
throw new \RuntimeException('Invalid cookie data');
}
}
}

View File

@ -11,15 +11,15 @@ class SetCookie
* @var array
*/
private static $defaults = [
'Name' => null,
'Value' => null,
'Domain' => null,
'Path' => '/',
'Max-Age' => null,
'Expires' => null,
'Secure' => false,
'Discard' => false,
'HttpOnly' => false
'Name' => null,
'Value' => null,
'Domain' => null,
'Path' => '/',
'Max-Age' => null,
'Expires' => null,
'Secure' => false,
'Discard' => false,
'HttpOnly' => false,
];
/**
@ -58,7 +58,13 @@ class SetCookie
} else {
foreach (\array_keys(self::$defaults) as $search) {
if (!\strcasecmp($search, $key)) {
$data[$search] = $value;
if ($search === 'Max-Age') {
if (is_numeric($value)) {
$data[$search] = (int) $value;
}
} else {
$data[$search] = $value;
}
continue 2;
}
}
@ -74,13 +80,49 @@ class SetCookie
*/
public function __construct(array $data = [])
{
/** @var array|null $replaced will be null in case of replace error */
$replaced = \array_replace(self::$defaults, $data);
if ($replaced === null) {
throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
$this->data = self::$defaults;
if (isset($data['Name'])) {
$this->setName($data['Name']);
}
if (isset($data['Value'])) {
$this->setValue($data['Value']);
}
if (isset($data['Domain'])) {
$this->setDomain($data['Domain']);
}
if (isset($data['Path'])) {
$this->setPath($data['Path']);
}
if (isset($data['Max-Age'])) {
$this->setMaxAge($data['Max-Age']);
}
if (isset($data['Expires'])) {
$this->setExpires($data['Expires']);
}
if (isset($data['Secure'])) {
$this->setSecure($data['Secure']);
}
if (isset($data['Discard'])) {
$this->setDiscard($data['Discard']);
}
if (isset($data['HttpOnly'])) {
$this->setHttpOnly($data['HttpOnly']);
}
// Set the remaining values that don't have extra validation logic
foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) {
$this->data[$key] = $data[$key];
}
$this->data = $replaced;
// Extract the Expires value and turn it into a UNIX timestamp if needed
if (!$this->getExpires() && $this->getMaxAge()) {
// Calculate the Expires date
@ -92,13 +134,13 @@ class SetCookie
public function __toString()
{
$str = $this->data['Name'] . '=' . ($this->data['Value'] ?? '') . '; ';
$str = $this->data['Name'].'='.($this->data['Value'] ?? '').'; ';
foreach ($this->data as $k => $v) {
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
if ($k === 'Expires') {
$str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
$str .= 'Expires='.\gmdate('D, d M Y H:i:s \G\M\T', $v).'; ';
} else {
$str .= ($v === true ? $k : "{$k}={$v}") . '; ';
$str .= ($v === true ? $k : "{$k}={$v}").'; ';
}
}
}
@ -394,7 +436,7 @@ class SetCookie
return false;
}
return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
return (bool) \preg_match('/\.'.\preg_quote($cookieDomain, '/').'$/', $domain);
}
/**
@ -423,8 +465,8 @@ class SetCookie
$name
)) {
return 'Cookie name must not contain invalid characters: ASCII '
. 'Control characters (0-31;127), space, tab and the '
. 'following characters: ()<>@,;:\"/?={}';
.'Control characters (0-31;127), space, tab and the '
.'following characters: ()<>@,;:\"/?={}';
}
// Value must not be null. 0 and empty string are valid. Empty strings

View File

@ -51,7 +51,7 @@ class CurlFactory implements CurlFactoryInterface
unset($options['curl']['body_as_string']);
}
$easy = new EasyHandle;
$easy = new EasyHandle();
$easy->request = $request;
$easy->options = $options;
$conf = $this->getDefaultConf($easy);
@ -161,11 +161,11 @@ class CurlFactory implements CurlFactoryInterface
private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
{
static $connectionErrors = [
\CURLE_OPERATION_TIMEOUTED => true,
\CURLE_OPERATION_TIMEOUTED => true,
\CURLE_COULDNT_RESOLVE_HOST => true,
\CURLE_COULDNT_CONNECT => true,
\CURLE_SSL_CONNECT_ERROR => true,
\CURLE_GOT_NOTHING => true,
\CURLE_COULDNT_CONNECT => true,
\CURLE_SSL_CONNECT_ERROR => true,
\CURLE_GOT_NOTHING => true,
];
if ($easy->createResponseException) {
@ -219,12 +219,12 @@ class CurlFactory implements CurlFactoryInterface
private function getDefaultConf(EasyHandle $easy): array
{
$conf = [
'_headers' => $easy->request->getHeaders(),
\CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
\CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
'_headers' => $easy->request->getHeaders(),
\CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
\CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
\CURLOPT_RETURNTRANSFER => false,
\CURLOPT_HEADER => false,
\CURLOPT_CONNECTTIMEOUT => 150,
\CURLOPT_HEADER => false,
\CURLOPT_CONNECTTIMEOUT => 300,
];
if (\defined('CURLOPT_PROTOCOLS')) {
@ -250,6 +250,7 @@ class CurlFactory implements CurlFactoryInterface
if ($size === null || $size > 0) {
$this->applyBody($easy->request, $easy->options, $conf);
return;
}
@ -341,6 +342,7 @@ class CurlFactory implements CurlFactoryInterface
foreach (\array_keys($options['_headers']) as $key) {
if (!\strcasecmp($key, $name)) {
unset($options['_headers'][$key]);
return;
}
}
@ -452,6 +454,32 @@ class CurlFactory implements CurlFactoryInterface
}
}
if (isset($options['crypto_method'])) {
if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) {
if (!defined('CURL_SSLVERSION_TLSv1_0')) {
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL');
}
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0;
} elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) {
if (!defined('CURL_SSLVERSION_TLSv1_1')) {
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL');
}
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1;
} elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) {
if (!defined('CURL_SSLVERSION_TLSv1_2')) {
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL');
}
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2;
} elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) {
if (!defined('CURL_SSLVERSION_TLSv1_3')) {
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL');
}
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3;
} else {
throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
}
}
if (isset($options['cert'])) {
$cert = $options['cert'];
if (\is_array($cert)) {
@ -461,8 +489,8 @@ class CurlFactory implements CurlFactoryInterface
if (!\file_exists($cert)) {
throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
}
# OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
# see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
// OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
// see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
$ext = pathinfo($cert, \PATHINFO_EXTENSION);
if (preg_match('#^(der|p12)$#i', $ext)) {
$conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext);
@ -525,9 +553,10 @@ class CurlFactory implements CurlFactoryInterface
}
} catch (\RuntimeException $e) {
$ctx['error'] = 'The connection unexpectedly failed without '
. 'providing an error. The request would have been retried, '
. 'but attempting to rewind the request body failed. '
. 'Exception: ' . $e;
.'providing an error. The request would have been retried, '
.'but attempting to rewind the request body failed. '
.'Exception: '.$e;
return self::createRejection($easy, $ctx);
}
@ -536,14 +565,15 @@ class CurlFactory implements CurlFactoryInterface
$easy->options['_curl_retries'] = 1;
} elseif ($easy->options['_curl_retries'] == 2) {
$ctx['error'] = 'The cURL request was retried 3 times '
. 'and did not succeed. The most likely reason for the failure '
. 'is that cURL was unable to rewind the body of the request '
. 'and subsequent retries resulted in the same error. Turn on '
. 'the debug option to see what went wrong. See '
. 'https://bugs.php.net/bug.php?id=47204 for more information.';
.'and did not succeed. The most likely reason for the failure '
.'is that cURL was unable to rewind the body of the request '
.'and subsequent retries resulted in the same error. Turn on '
.'the debug option to see what went wrong. See '
.'https://bugs.php.net/bug.php?id=47204 for more information.';
return self::createRejection($easy, $ctx);
} else {
$easy->options['_curl_retries']++;
++$easy->options['_curl_retries'];
}
return $handler($easy->request, $easy->options);
@ -573,6 +603,7 @@ class CurlFactory implements CurlFactoryInterface
$easy->createResponse();
} catch (\Exception $e) {
$easy->createResponseException = $e;
return -1;
}
if ($onHeaders !== null) {
@ -582,6 +613,7 @@ class CurlFactory implements CurlFactoryInterface
// Associate the exception with the handle and trigger
// a curl header write error by returning 0.
$easy->onHeadersException = $e;
return -1;
}
}
@ -591,6 +623,7 @@ class CurlFactory implements CurlFactoryInterface
} else {
$easy->headers[] = $value;
}
return \strlen($h);
};
}

View File

@ -164,7 +164,8 @@ class CurlMultiHandler
\usleep(250);
}
while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM);
while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) {
}
$this->processMessages();
}

View File

@ -106,7 +106,7 @@ final class EasyHandle
*/
public function __get($name)
{
$msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name;
$msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: '.$name;
throw new \BadMethodCallException($msg);
}
}

View File

@ -14,9 +14,9 @@ final class HeaderProcessor
*
* @param string[] $headers
*
* @throws \RuntimeException
*
* @return array{0:string, 1:int, 2:?string, 3:array}
*
* @throws \RuntimeException
*/
public static function parseHeaders(array $headers): array
{

View File

@ -138,6 +138,7 @@ class MockHandler implements \Countable
if ($this->onRejected) {
($this->onRejected)($reason);
}
return P\Create::rejectionFor($reason);
}
);
@ -159,7 +160,7 @@ class MockHandler implements \Countable
) {
$this->queue[] = $value;
} else {
throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found '.Utils::describeType($value));
}
}
}

View File

@ -67,7 +67,7 @@ class StreamHandler
if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
|| false !== \strpos($message, 'Connection refused')
|| false !== \strpos($message, "couldn't connect to host") // error on HHVM
|| false !== \strpos($message, "connection attempt failed")
|| false !== \strpos($message, 'connection attempt failed')
) {
$e = new ConnectException($e->getMessage(), $request, $e);
} else {
@ -231,9 +231,10 @@ class StreamHandler
\set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
$errors[] = [
'message' => $msg,
'file' => $file,
'line' => $line
'file' => $file,
'line' => $line,
];
return true;
});
@ -247,7 +248,7 @@ class StreamHandler
$message = 'Error creating resource: ';
foreach ($errors as $err) {
foreach ($err as $key => $value) {
$message .= "[$key] $value" . \PHP_EOL;
$message .= "[$key] $value".\PHP_EOL;
}
}
throw new \RuntimeException(\trim($message));
@ -350,6 +351,7 @@ class StreamHandler
if (false === $records || !isset($records[0]['ip'])) {
throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
}
return $uri->withHost($records[0]['ip']);
}
if ('v6' === $options['force_ip_resolve']) {
@ -357,7 +359,8 @@ class StreamHandler
if (false === $records || !isset($records[0]['ipv6'])) {
throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
}
return $uri->withHost('[' . $records[0]['ipv6'] . ']');
return $uri->withHost('['.$records[0]['ipv6'].']');
}
}
@ -375,11 +378,11 @@ class StreamHandler
$context = [
'http' => [
'method' => $request->getMethod(),
'header' => $headers,
'method' => $request->getMethod(),
'header' => $headers,
'protocol_version' => $request->getProtocolVersion(),
'ignore_errors' => true,
'follow_location' => 0,
'ignore_errors' => true,
'follow_location' => 0,
],
'ssl' => [
'peer_name' => $request->getUri()->getHost(),
@ -388,7 +391,7 @@ class StreamHandler
$body = (string) $request->getBody();
if (!empty($body)) {
if ('' !== $body) {
$context['http']['content'] = $body;
// Prevent the HTTP handler from adding a Content-Type header.
if (!$request->hasHeader('Content-Type')) {
@ -472,6 +475,25 @@ class StreamHandler
}
}
/**
* @param mixed $value as passed via Request transfer options.
*/
private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void
{
if (
$value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
|| $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
|| $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
|| (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT)
) {
$options['http']['crypto_method'] = $value;
return;
}
throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
}
/**
* @param mixed $value as passed via Request transfer options.
*/
@ -542,27 +564,27 @@ class StreamHandler
}
static $map = [
\STREAM_NOTIFY_CONNECT => 'CONNECT',
\STREAM_NOTIFY_CONNECT => 'CONNECT',
\STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
\STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
\STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
\STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
\STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
\STREAM_NOTIFY_PROGRESS => 'PROGRESS',
\STREAM_NOTIFY_FAILURE => 'FAILURE',
\STREAM_NOTIFY_COMPLETED => 'COMPLETED',
\STREAM_NOTIFY_RESOLVE => 'RESOLVE',
\STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
\STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
\STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
\STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
\STREAM_NOTIFY_PROGRESS => 'PROGRESS',
\STREAM_NOTIFY_FAILURE => 'FAILURE',
\STREAM_NOTIFY_COMPLETED => 'COMPLETED',
\STREAM_NOTIFY_RESOLVE => 'RESOLVE',
];
static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
$value = Utils::debugResource($value);
$ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
$ident = $request->getMethod().' '.$request->getUri()->withFragment('');
self::addNotification(
$params,
static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
\fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
foreach (\array_filter($passed) as $i => $v) {
\fwrite($value, $args[$i] . ': "' . $v . '" ');
\fwrite($value, $args[$i].': "'.$v.'" ');
}
\fwrite($value, "\n");
}
@ -577,7 +599,7 @@ class StreamHandler
} else {
$params['notification'] = self::callArray([
$params['notification'],
$notify
$notify,
]);
}
}

View File

@ -86,14 +86,14 @@ class HandlerStack
$stack = [];
if ($this->handler !== null) {
$stack[] = "0) Handler: " . $this->debugCallable($this->handler);
$stack[] = '0) Handler: '.$this->debugCallable($this->handler);
}
$result = '';
foreach (\array_reverse($this->stack) as $tuple) {
$depth++;
++$depth;
$str = "{$depth}) Name: '{$tuple[1]}', ";
$str .= "Function: " . $this->debugCallable($tuple[0]);
$str .= 'Function: '.$this->debugCallable($tuple[0]);
$result = "> {$str}\n{$result}";
$stack[] = $str;
}
@ -122,7 +122,7 @@ class HandlerStack
*/
public function hasHandler(): bool
{
return $this->handler !== null ;
return $this->handler !== null;
}
/**
@ -266,10 +266,10 @@ class HandlerStack
if (\is_array($fn)) {
return \is_string($fn[0])
? "callable({$fn[0]}::{$fn[1]})"
: "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
: "callable(['".\get_class($fn[0])."', '{$fn[1]}'])";
}
/** @var object $fn */
return 'callable(' . \spl_object_hash($fn) . ')';
return 'callable('.\spl_object_hash($fn).')';
}
}

View File

@ -40,11 +40,11 @@ class MessageFormatter implements MessageFormatterInterface
/**
* Apache Common Log Format.
*
* @link https://httpd.apache.org/docs/2.4/logs.html#common
* @see https://httpd.apache.org/docs/2.4/logs.html#common
*
* @var string
*/
public const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
public const CLF = '{hostname} {req_header_User-Agent} - [{date_common_log}] "{method} {target} HTTP/{version}" {code} {res_header_Content-Length}';
public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
@ -90,9 +90,9 @@ class MessageFormatter implements MessageFormatterInterface
break;
case 'req_headers':
$result = \trim($request->getMethod()
. ' ' . $request->getRequestTarget())
. ' HTTP/' . $request->getProtocolVersion() . "\r\n"
. $this->headers($request);
.' '.$request->getRequestTarget())
.' HTTP/'.$request->getProtocolVersion()."\r\n"
.$this->headers($request);
break;
case 'res_headers':
$result = $response ?
@ -101,7 +101,7 @@ class MessageFormatter implements MessageFormatterInterface
$response->getProtocolVersion(),
$response->getStatusCode(),
$response->getReasonPhrase()
) . "\r\n" . $this->headers($response)
)."\r\n".$this->headers($response)
: 'NULL';
break;
case 'req_body':
@ -177,6 +177,7 @@ class MessageFormatter implements MessageFormatterInterface
}
$cache[$matches[1]] = $result;
return $result;
},
$this->template
@ -190,7 +191,7 @@ class MessageFormatter implements MessageFormatterInterface
{
$result = '';
foreach ($message->getHeaders() as $name => $values) {
$result .= $name . ': ' . \implode(', ', $values) . "\r\n";
$result .= $name.': '.\implode(', ', $values)."\r\n";
}
return \trim($result);

View File

@ -34,10 +34,12 @@ final class Middleware
}
$cookieJar = $options['cookies'];
$request = $cookieJar->withCookieHeader($request);
return $handler($request, $options)
->then(
static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
$cookieJar->extractCookies($request, $response);
return $response;
}
);
@ -60,6 +62,7 @@ final class Middleware
if (empty($options['http_errors'])) {
return $handler($request, $options);
}
return $handler($request, $options)->then(
static function (ResponseInterface $response) use ($request, $bodySummarizer) {
$code = $response->getStatusCode();
@ -93,20 +96,22 @@ final class Middleware
return $handler($request, $options)->then(
static function ($value) use ($request, &$container, $options) {
$container[] = [
'request' => $request,
'request' => $request,
'response' => $value,
'error' => null,
'options' => $options
'error' => null,
'options' => $options,
];
return $value;
},
static function ($reason) use ($request, &$container, $options) {
$container[] = [
'request' => $request,
'request' => $request,
'response' => null,
'error' => $reason,
'options' => $options
'error' => $reason,
'options' => $options,
];
return P\Create::rejectionFor($reason);
}
);
@ -138,6 +143,7 @@ final class Middleware
if ($after) {
$after($request, $options, $response);
}
return $response;
};
};
@ -202,12 +208,14 @@ final class Middleware
static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
$message = $formatter->format($request, $response);
$logger->log($logLevel, $message);
return $response;
},
static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
$response = $reason instanceof RequestException ? $reason->getResponse() : null;
$message = $formatter->format($request, $response, P\Create::exceptionFor($reason));
$logger->error($message);
return P\Create::rejectionFor($reason);
}
);

View File

@ -84,6 +84,7 @@ class PrepareBodyMiddleware
// The expect header is unconditionally enabled
if ($expect === true) {
$modify['set_headers']['Expect'] = '100-Continue';
return;
}

View File

@ -27,10 +27,10 @@ class RedirectMiddleware
* @var array
*/
public static $defaultSettings = [
'max' => 5,
'protocols' => ['http', 'https'],
'strict' => false,
'referer' => false,
'max' => 5,
'protocols' => ['http', 'https'],
'strict' => false,
'referer' => false,
'track_redirects' => false,
];

View File

@ -7,7 +7,7 @@ namespace GuzzleHttp;
*
* More documentation for each option can be found at http://guzzlephp.org/.
*
* @link http://docs.guzzlephp.org/en/v6/request-options.html
* @see http://docs.guzzlephp.org/en/v6/request-options.html
*/
final class RequestOptions
{
@ -70,10 +70,22 @@ final class RequestOptions
/**
* connect_timeout: (float, default=0) Float describing the number of
* seconds to wait while trying to connect to a server. Use 0 to wait
* indefinitely (the default behavior).
* 300 seconds (the default behavior).
*/
public const CONNECT_TIMEOUT = 'connect_timeout';
/**
* crypto_method: (int) A value describing the minimum TLS protocol
* version to use.
*
* This setting must be set to one of the
* ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is
* required in order to use TLS 1.3, and cURL 7.34.0 or higher is required
* in order to specify a crypto method, with cURL 7.52.0 or higher being
* required to use TLS 1.3.
*/
public const CRYPTO_METHOD = 'crypto_method';
/**
* debug: (bool|resource) Set to true or set to a PHP stream returned by
* fopen() enable debug output with the HTTP handler used to send a

View File

@ -44,7 +44,7 @@ class RetryMiddleware
{
$this->decider = $decider;
$this->nextHandler = $nextHandler;
$this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
$this->delay = $delay ?: __CLASS__.'::exponentialDelay';
}
/**
@ -54,7 +54,7 @@ class RetryMiddleware
*/
public static function exponentialDelay(int $retries): int
{
return (int) \pow(2, $retries - 1) * 1000;
return (int) 2 ** ($retries - 1) * 1000;
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
@ -64,6 +64,7 @@ class RetryMiddleware
}
$fn = $this->nextHandler;
return $fn($request, $options)
->then(
$this->onFulfilled($request, $options),
@ -85,6 +86,7 @@ class RetryMiddleware
)) {
return $value;
}
return $this->doRetry($request, $options, $value);
};
}
@ -103,6 +105,7 @@ class RetryMiddleware
)) {
return P\Create::rejectionFor($reason);
}
return $this->doRetry($req, $options);
};
}

View File

@ -23,9 +23,9 @@ final class Utils
{
switch (\gettype($input)) {
case 'object':
return 'object(' . \get_class($input) . ')';
return 'object('.\get_class($input).')';
case 'array':
return 'array(' . \count($input) . ')';
return 'array('.\count($input).')';
default:
\ob_start();
\var_dump($input);
@ -79,9 +79,9 @@ final class Utils
*
* The returned handler is not wrapped by any default middlewares.
*
* @throws \RuntimeException if no viable Handler is available.
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
*
* @throws \RuntimeException if no viable Handler is available.
*/
public static function chooseHandler(): callable
{
@ -247,8 +247,8 @@ EOT
}
// Special match if the area when prefixed with ".". Remove any
// existing leading "." and add a new leading ".".
$area = '.' . \ltrim($area, '.');
if (\substr($host, -(\strlen($area))) === $area) {
$area = '.'.\ltrim($area, '.');
if (\substr($host, -\strlen($area)) === $area) {
return true;
}
}
@ -269,13 +269,13 @@ EOT
*
* @throws InvalidArgumentException if the JSON cannot be decoded.
*
* @link https://www.php.net/manual/en/function.json-decode.php
* @see https://www.php.net/manual/en/function.json-decode.php
*/
public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
{
$data = \json_decode($json, $assoc, $depth, $options);
if (\JSON_ERROR_NONE !== \json_last_error()) {
throw new InvalidArgumentException('json_decode error: ' . \json_last_error_msg());
throw new InvalidArgumentException('json_decode error: '.\json_last_error_msg());
}
return $data;
@ -290,13 +290,13 @@ EOT
*
* @throws InvalidArgumentException if the JSON cannot be encoded.
*
* @link https://www.php.net/manual/en/function.json-encode.php
* @see https://www.php.net/manual/en/function.json-encode.php
*/
public static function jsonEncode($value, int $options = 0, int $depth = 512): string
{
$json = \json_encode($value, $options, $depth);
if (\JSON_ERROR_NONE !== \json_last_error()) {
throw new InvalidArgumentException('json_encode error: ' . \json_last_error_msg());
throw new InvalidArgumentException('json_encode error: '.\json_last_error_msg());
}
/** @var string */
@ -341,7 +341,7 @@ EOT
$errorMessage = 'IDN conversion failed';
if ($errors) {
$errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
$errorMessage .= ' (errors: '.implode(', ', $errors).')';
}
throw new InvalidArgumentException($errorMessage);

View File

@ -50,10 +50,10 @@ function debug_resource($value = null)
*
* The returned handler is not wrapped by any default middlewares.
*
* @throws \RuntimeException if no viable Handler is available.
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
*
* @throws \RuntimeException if no viable Handler is available.
*
* @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead.
*/
function choose_handler(): callable
@ -141,7 +141,7 @@ function is_host_in_noproxy(string $host, array $noProxyArray): bool
*
* @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
*
* @link https://www.php.net/manual/en/function.json-decode.php
* @see https://www.php.net/manual/en/function.json-decode.php
* @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead.
*/
function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
@ -158,7 +158,7 @@ function json_decode(string $json, bool $assoc = false, int $depth = 512, int $o
*
* @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
*
* @link https://www.php.net/manual/en/function.json-encode.php
* @see https://www.php.net/manual/en/function.json-encode.php
* @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead.
*/
function json_encode($value, int $options = 0, int $depth = 512): string

View File

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

View File

@ -1,11 +1,36 @@
# CHANGELOG
## 2.0.0 - TBC
### Added
- Added PHP 7 type hints
### Changed
- All previously non-final non-exception classes have been marked as soft-final
### Removed
- Dropped PHP < 7.2 support
- All functions in the `GuzzleHttp\Promise` namespace
## 1.5.3 - 2023-05-21
### Changed
- Removed remaining usage of deprecated functions
## 1.5.2 - 2022-08-07
### Changed
- Officially support PHP 8.2
## 1.5.1 - 2021-10-22
### Fixed
@ -13,6 +38,7 @@
- Revert "Call handler when waiting on fulfilled/rejected Promise"
- Fix pool memory leak when empty array of promises provided
## 1.5.0 - 2021-10-07
### Changed
@ -24,12 +50,14 @@
- Fix manually settle promises generated with `Utils::task`
## 1.4.1 - 2021-02-18
### Fixed
- Fixed `each_limit` skipping promises and failing
## 1.4.0 - 2020-09-30
### Added

View File

@ -29,6 +29,21 @@ for a general introduction to promises.
`GuzzleHttp\Promise\Coroutine::of()`.
## Installation
```shell
composer require guzzlehttp/promises
```
## Version Guidance
| Version | Status | PHP Version |
|---------|------------------------|--------------|
| 1.x | Bug and security fixes | >=5.5,<8.3 |
| 2.x | Latest | >=7.2.5,<8.3 |
## Quick Start
A *promise* represents the eventual result of an asynchronous operation. The
@ -430,8 +445,6 @@ $loop = React\EventLoop\Factory::create();
$loop->addPeriodicTimer(0, [$queue, 'run']);
```
*TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
## Implementation Notes
@ -501,8 +514,8 @@ $promise->resolve('foo');
A static API was first introduced in 1.4.0, in order to mitigate problems with
functions conflicting between global and local copies of the package. The
function API will be removed in 2.0.0. A migration table has been provided here
for your convenience:
function API was removed in 2.0.0. A migration table has been provided here for
your convenience:
| Original Function | Replacement Method |
|----------------|----------------|

View File

@ -26,32 +26,32 @@
}
],
"require": {
"php": ">=5.5"
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1"
"bamarni/composer-bin-plugin": "^1.8.1",
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
},
"files": ["src/functions_include.php"]
}
},
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Promise\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/simple-phpunit",
"test-ci": "vendor/bin/simple-phpunit --coverage-text"
},
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
"bamarni-bin": {
"bin-links": true,
"forward-command": false
}
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
},
"preferred-install": "dist",
"sort-packages": true
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
@ -7,7 +9,7 @@ namespace GuzzleHttp\Promise;
*/
class AggregateException extends RejectionException
{
public function __construct($msg, array $reasons)
public function __construct(string $msg, array $reasons)
{
parent::__construct(
$reasons,

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**

View File

@ -1,8 +1,9 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
use Exception;
use Generator;
use Throwable;
@ -27,7 +28,7 @@ use Throwable;
* $value = (yield createPromise('a'));
* try {
* $value = (yield createPromise($value . 'b'));
* } catch (\Exception $e) {
* } catch (\Throwable $e) {
* // The promise was rejected.
* }
* yield $value . 'c';
@ -40,7 +41,7 @@ use Throwable;
*
* @return Promise
*
* @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
* @see https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
*/
final class Coroutine implements PromiseInterface
{
@ -62,15 +63,13 @@ final class Coroutine implements PromiseInterface
public function __construct(callable $generatorFn)
{
$this->generator = $generatorFn();
$this->result = new Promise(function () {
$this->result = new Promise(function (): void {
while (isset($this->currentPromise)) {
$this->currentPromise->wait();
}
});
try {
$this->nextCoroutine($this->generator->current());
} catch (\Exception $exception) {
$this->result->reject($exception);
} catch (Throwable $throwable) {
$this->result->reject($throwable);
}
@ -78,10 +77,8 @@ final class Coroutine implements PromiseInterface
/**
* Create a new coroutine.
*
* @return self
*/
public static function of(callable $generatorFn)
public static function of(callable $generatorFn): self
{
return new self($generatorFn);
}
@ -89,42 +86,42 @@ final class Coroutine implements PromiseInterface
public function then(
callable $onFulfilled = null,
callable $onRejected = null
) {
): PromiseInterface {
return $this->result->then($onFulfilled, $onRejected);
}
public function otherwise(callable $onRejected)
public function otherwise(callable $onRejected): PromiseInterface
{
return $this->result->otherwise($onRejected);
}
public function wait($unwrap = true)
public function wait(bool $unwrap = true)
{
return $this->result->wait($unwrap);
}
public function getState()
public function getState(): string
{
return $this->result->getState();
}
public function resolve($value)
public function resolve($value): void
{
$this->result->resolve($value);
}
public function reject($reason)
public function reject($reason): void
{
$this->result->reject($reason);
}
public function cancel()
public function cancel(): void
{
$this->currentPromise->cancel();
$this->result->cancel();
}
private function nextCoroutine($yielded)
private function nextCoroutine($yielded): void
{
$this->currentPromise = Create::promiseFor($yielded)
->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
@ -133,7 +130,7 @@ final class Coroutine implements PromiseInterface
/**
* @internal
*/
public function _handleSuccess($value)
public function _handleSuccess($value): void
{
unset($this->currentPromise);
try {
@ -143,8 +140,6 @@ final class Coroutine implements PromiseInterface
} else {
$this->result->resolve($value);
}
} catch (Exception $exception) {
$this->result->reject($exception);
} catch (Throwable $throwable) {
$this->result->reject($throwable);
}
@ -153,15 +148,13 @@ final class Coroutine implements PromiseInterface
/**
* @internal
*/
public function _handleFailure($reason)
public function _handleFailure($reason): void
{
unset($this->currentPromise);
try {
$nextYield = $this->generator->throw(Create::exceptionFor($reason));
// The throw was caught, so keep iterating on the coroutine
$this->nextCoroutine($nextYield);
} catch (Exception $exception) {
$this->result->reject($exception);
} catch (Throwable $throwable) {
$this->result->reject($throwable);
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
final class Create
@ -8,10 +10,8 @@ final class Create
* Creates a promise for a value if the value is not a promise.
*
* @param mixed $value Promise or value.
*
* @return PromiseInterface
*/
public static function promiseFor($value)
public static function promiseFor($value): PromiseInterface
{
if ($value instanceof PromiseInterface) {
return $value;
@ -23,6 +23,7 @@ final class Create
$cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
$promise = new Promise($wfn, $cfn);
$value->then([$promise, 'resolve'], [$promise, 'reject']);
return $promise;
}
@ -34,10 +35,8 @@ final class Create
* If the provided reason is a promise, then it is returned as-is.
*
* @param mixed $reason Promise or reason.
*
* @return PromiseInterface
*/
public static function rejectionFor($reason)
public static function rejectionFor($reason): PromiseInterface
{
if ($reason instanceof PromiseInterface) {
return $reason;
@ -50,12 +49,10 @@ final class Create
* Create an exception for a rejected promise value.
*
* @param mixed $reason
*
* @return \Exception|\Throwable
*/
public static function exceptionFor($reason)
public static function exceptionFor($reason): \Throwable
{
if ($reason instanceof \Exception || $reason instanceof \Throwable) {
if ($reason instanceof \Throwable) {
return $reason;
}
@ -66,10 +63,8 @@ final class Create
* Returns an iterator for the given value.
*
* @param mixed $value
*
* @return \Iterator
*/
public static function iterFor($value)
public static function iterFor($value): \Iterator
{
if ($value instanceof \Iterator) {
return $value;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
final class Each
@ -20,17 +22,15 @@ final class Each
* @param mixed $iterable Iterator or array to iterate over.
* @param callable $onFulfilled
* @param callable $onRejected
*
* @return PromiseInterface
*/
public static function of(
$iterable,
callable $onFulfilled = null,
callable $onRejected = null
) {
): PromiseInterface {
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
'rejected' => $onRejected
'rejected' => $onRejected,
]))->promise();
}
@ -46,19 +46,17 @@ final class Each
* @param int|callable $concurrency
* @param callable $onFulfilled
* @param callable $onRejected
*
* @return PromiseInterface
*/
public static function ofLimit(
$iterable,
$concurrency,
callable $onFulfilled = null,
callable $onRejected = null
) {
): PromiseInterface {
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
'rejected' => $onRejected,
'concurrency' => $concurrency
'fulfilled' => $onFulfilled,
'rejected' => $onRejected,
'concurrency' => $concurrency,
]))->promise();
}
@ -70,19 +68,17 @@ final class Each
* @param mixed $iterable
* @param int|callable $concurrency
* @param callable $onFulfilled
*
* @return PromiseInterface
*/
public static function ofLimitAll(
$iterable,
$concurrency,
callable $onFulfilled = null
) {
return each_limit(
): PromiseInterface {
return self::ofLimit(
$iterable,
$concurrency,
$onFulfilled,
function ($reason, $idx, PromiseInterface $aggregate) {
function ($reason, $idx, PromiseInterface $aggregate): void {
$aggregate->reject($reason);
}
);

View File

@ -1,10 +1,14 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
* Represents a promise that iterates over many promises and invokes
* side-effect functions in the process.
*
* @final
*/
class EachPromise implements PromisorInterface
{
@ -69,7 +73,7 @@ class EachPromise implements PromisorInterface
}
/** @psalm-suppress InvalidNullableReturnType */
public function promise()
public function promise(): PromiseInterface
{
if ($this->aggregate) {
return $this->aggregate;
@ -82,21 +86,18 @@ class EachPromise implements PromisorInterface
$this->refillPending();
} catch (\Throwable $e) {
$this->aggregate->reject($e);
} catch (\Exception $e) {
$this->aggregate->reject($e);
}
/**
* @psalm-suppress NullableReturnStatement
* @phpstan-ignore-next-line
*/
return $this->aggregate;
}
private function createPromise()
private function createPromise(): void
{
$this->mutex = false;
$this->aggregate = new Promise(function () {
$this->aggregate = new Promise(function (): void {
if ($this->checkIfFinished()) {
return;
}
@ -113,7 +114,7 @@ class EachPromise implements PromisorInterface
});
// Clear the references when the promise is resolved.
$clearFn = function () {
$clearFn = function (): void {
$this->iterable = $this->concurrency = $this->pending = null;
$this->onFulfilled = $this->onRejected = null;
$this->nextPendingIndex = 0;
@ -122,11 +123,13 @@ class EachPromise implements PromisorInterface
$this->aggregate->then($clearFn, $clearFn);
}
private function refillPending()
private function refillPending(): void
{
if (!$this->concurrency) {
// Add all pending promises.
while ($this->addPending() && $this->advanceIterator());
while ($this->addPending() && $this->advanceIterator()) {
}
return;
}
@ -147,10 +150,11 @@ class EachPromise implements PromisorInterface
// next value to yield until promise callbacks are called.
while (--$concurrency
&& $this->advanceIterator()
&& $this->addPending());
&& $this->addPending()) {
}
}
private function addPending()
private function addPending(): bool
{
if (!$this->iterable || !$this->iterable->valid()) {
return false;
@ -164,7 +168,7 @@ class EachPromise implements PromisorInterface
$idx = $this->nextPendingIndex++;
$this->pending[$idx] = $promise->then(
function ($value) use ($idx, $key) {
function ($value) use ($idx, $key): void {
if ($this->onFulfilled) {
call_user_func(
$this->onFulfilled,
@ -175,7 +179,7 @@ class EachPromise implements PromisorInterface
}
$this->step($idx);
},
function ($reason) use ($idx, $key) {
function ($reason) use ($idx, $key): void {
if ($this->onRejected) {
call_user_func(
$this->onRejected,
@ -191,7 +195,7 @@ class EachPromise implements PromisorInterface
return true;
}
private function advanceIterator()
private function advanceIterator(): bool
{
// Place a lock on the iterator so that we ensure to not recurse,
// preventing fatal generator errors.
@ -204,19 +208,17 @@ class EachPromise implements PromisorInterface
try {
$this->iterable->next();
$this->mutex = false;
return true;
} catch (\Throwable $e) {
$this->aggregate->reject($e);
$this->mutex = false;
return false;
} catch (\Exception $e) {
$this->aggregate->reject($e);
$this->mutex = false;
return false;
}
}
private function step($idx)
private function step(int $idx): void
{
// If the promise was already resolved, then ignore this step.
if (Is::settled($this->aggregate)) {
@ -234,11 +236,12 @@ class EachPromise implements PromisorInterface
}
}
private function checkIfFinished()
private function checkIfFinished(): bool
{
if (!$this->pending && !$this->iterable->valid()) {
// Resolve the promise if there's nothing left to do.
$this->aggregate->resolve(null);
return true;
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
@ -7,11 +9,16 @@ namespace GuzzleHttp\Promise;
*
* Thenning off of this promise will invoke the onFulfilled callback
* immediately and ignore other callbacks.
*
* @final
*/
class FulfilledPromise implements PromiseInterface
{
private $value;
/**
* @param mixed $value
*/
public function __construct($value)
{
if (is_object($value) && method_exists($value, 'then')) {
@ -26,7 +33,7 @@ class FulfilledPromise implements PromiseInterface
public function then(
callable $onFulfilled = null,
callable $onRejected = null
) {
): PromiseInterface {
// Return itself if there is no onFulfilled function.
if (!$onFulfilled) {
return $this;
@ -35,14 +42,12 @@ class FulfilledPromise implements PromiseInterface
$queue = Utils::queue();
$p = new Promise([$queue, 'run']);
$value = $this->value;
$queue->add(static function () use ($p, $value, $onFulfilled) {
$queue->add(static function () use ($p, $value, $onFulfilled): void {
if (Is::pending($p)) {
try {
$p->resolve($onFulfilled($value));
} catch (\Throwable $e) {
$p->reject($e);
} catch (\Exception $e) {
$p->reject($e);
}
}
});
@ -50,34 +55,34 @@ class FulfilledPromise implements PromiseInterface
return $p;
}
public function otherwise(callable $onRejected)
public function otherwise(callable $onRejected): PromiseInterface
{
return $this->then(null, $onRejected);
}
public function wait($unwrap = true, $defaultDelivery = null)
public function wait(bool $unwrap = true)
{
return $unwrap ? $this->value : null;
}
public function getState()
public function getState(): string
{
return self::FULFILLED;
}
public function resolve($value)
public function resolve($value): void
{
if ($value !== $this->value) {
throw new \LogicException("Cannot resolve a fulfilled promise");
throw new \LogicException('Cannot resolve a fulfilled promise');
}
}
public function reject($reason)
public function reject($reason): void
{
throw new \LogicException("Cannot reject a fulfilled promise");
throw new \LogicException('Cannot reject a fulfilled promise');
}
public function cancel()
public function cancel(): void
{
// pass
}

View File

@ -1,45 +1,39 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
final class Is
{
/**
* Returns true if a promise is pending.
*
* @return bool
*/
public static function pending(PromiseInterface $promise)
public static function pending(PromiseInterface $promise): bool
{
return $promise->getState() === PromiseInterface::PENDING;
}
/**
* Returns true if a promise is fulfilled or rejected.
*
* @return bool
*/
public static function settled(PromiseInterface $promise)
public static function settled(PromiseInterface $promise): bool
{
return $promise->getState() !== PromiseInterface::PENDING;
}
/**
* Returns true if a promise is fulfilled.
*
* @return bool
*/
public static function fulfilled(PromiseInterface $promise)
public static function fulfilled(PromiseInterface $promise): bool
{
return $promise->getState() === PromiseInterface::FULFILLED;
}
/**
* Returns true if a promise is rejected.
*
* @return bool
*/
public static function rejected(PromiseInterface $promise)
public static function rejected(PromiseInterface $promise): bool
{
return $promise->getState() === PromiseInterface::REJECTED;
}

View File

@ -1,11 +1,15 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
* Promises/A+ implementation that avoids recursion when possible.
*
* @link https://promisesaplus.com/
* @see https://promisesaplus.com/
*
* @final
*/
class Promise implements PromiseInterface
{
@ -31,33 +35,36 @@ class Promise implements PromiseInterface
public function then(
callable $onFulfilled = null,
callable $onRejected = null
) {
): PromiseInterface {
if ($this->state === self::PENDING) {
$p = new Promise(null, [$this, 'cancel']);
$this->handlers[] = [$p, $onFulfilled, $onRejected];
$p->waitList = $this->waitList;
$p->waitList[] = $this;
return $p;
}
// Return a fulfilled promise and immediately invoke any callbacks.
if ($this->state === self::FULFILLED) {
$promise = Create::promiseFor($this->result);
return $onFulfilled ? $promise->then($onFulfilled) : $promise;
}
// It's either cancelled or rejected, so return a rejected promise
// and immediately invoke any callbacks.
$rejection = Create::rejectionFor($this->result);
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
}
public function otherwise(callable $onRejected)
public function otherwise(callable $onRejected): PromiseInterface
{
return $this->then(null, $onRejected);
}
public function wait($unwrap = true)
public function wait(bool $unwrap = true)
{
$this->waitIfPending();
@ -73,12 +80,12 @@ class Promise implements PromiseInterface
}
}
public function getState()
public function getState(): string
{
return $this->state;
}
public function cancel()
public function cancel(): void
{
if ($this->state !== self::PENDING) {
return;
@ -93,8 +100,6 @@ class Promise implements PromiseInterface
$fn();
} catch (\Throwable $e) {
$this->reject($e);
} catch (\Exception $e) {
$this->reject($e);
}
}
@ -105,17 +110,17 @@ class Promise implements PromiseInterface
}
}
public function resolve($value)
public function resolve($value): void
{
$this->settle(self::FULFILLED, $value);
}
public function reject($reason)
public function reject($reason): void
{
$this->settle(self::REJECTED, $reason);
}
private function settle($state, $value)
private function settle(string $state, $value): void
{
if ($this->state !== self::PENDING) {
// Ignore calls with the same resolution.
@ -148,7 +153,7 @@ class Promise implements PromiseInterface
if (!is_object($value) || !method_exists($value, 'then')) {
$id = $state === self::FULFILLED ? 1 : 2;
// It's a success, so resolve the handlers in the queue.
Utils::queue()->add(static function () use ($id, $value, $handlers) {
Utils::queue()->add(static function () use ($id, $value, $handlers): void {
foreach ($handlers as $handler) {
self::callHandler($id, $value, $handler);
}
@ -159,12 +164,12 @@ class Promise implements PromiseInterface
} else {
// Resolve the handlers when the forwarded promise is resolved.
$value->then(
static function ($value) use ($handlers) {
static function ($value) use ($handlers): void {
foreach ($handlers as $handler) {
self::callHandler(1, $value, $handler);
}
},
static function ($reason) use ($handlers) {
static function ($reason) use ($handlers): void {
foreach ($handlers as $handler) {
self::callHandler(2, $reason, $handler);
}
@ -180,7 +185,7 @@ class Promise implements PromiseInterface
* @param mixed $value Value to pass to the callback.
* @param array $handler Array of handler data (promise and callbacks).
*/
private static function callHandler($index, $value, array $handler)
private static function callHandler(int $index, $value, array $handler): void
{
/** @var PromiseInterface $promise */
$promise = $handler[0];
@ -211,12 +216,10 @@ class Promise implements PromiseInterface
}
} catch (\Throwable $reason) {
$promise->reject($reason);
} catch (\Exception $reason) {
$promise->reject($reason);
}
}
private function waitIfPending()
private function waitIfPending(): void
{
if ($this->state !== self::PENDING) {
return;
@ -227,9 +230,9 @@ class Promise implements PromiseInterface
} else {
// If there's no wait function, then reject the promise.
$this->reject('Cannot wait on a promise that has '
. 'no internal wait function. You must provide a wait '
. 'function when constructing the promise to be able to '
. 'wait on a promise.');
.'no internal wait function. You must provide a wait '
.'function when constructing the promise to be able to '
.'wait on a promise.');
}
Utils::queue()->run();
@ -240,13 +243,13 @@ class Promise implements PromiseInterface
}
}
private function invokeWaitFn()
private function invokeWaitFn(): void
{
try {
$wfn = $this->waitFn;
$this->waitFn = null;
$wfn(true);
} catch (\Exception $reason) {
} catch (\Throwable $reason) {
if ($this->state === self::PENDING) {
// The promise has not been resolved yet, so reject the promise
// with the exception.
@ -259,7 +262,7 @@ class Promise implements PromiseInterface
}
}
private function invokeWaitList()
private function invokeWaitList(): void
{
$waitList = $this->waitList;
$this->waitList = null;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
@ -9,13 +11,13 @@ namespace GuzzleHttp\Promise;
* which registers callbacks to receive either a promises eventual value or
* the reason why the promise cannot be fulfilled.
*
* @link https://promisesaplus.com/
* @see https://promisesaplus.com/
*/
interface PromiseInterface
{
const PENDING = 'pending';
const FULFILLED = 'fulfilled';
const REJECTED = 'rejected';
public const PENDING = 'pending';
public const FULFILLED = 'fulfilled';
public const REJECTED = 'rejected';
/**
* Appends fulfillment and rejection handlers to the promise, and returns
@ -23,13 +25,11 @@ interface PromiseInterface
*
* @param callable $onFulfilled Invoked when the promise fulfills.
* @param callable $onRejected Invoked when the promise is rejected.
*
* @return PromiseInterface
*/
public function then(
callable $onFulfilled = null,
callable $onRejected = null
);
): PromiseInterface;
/**
* Appends a rejection handler callback to the promise, and returns a new
@ -38,20 +38,16 @@ interface PromiseInterface
* fulfilled.
*
* @param callable $onRejected Invoked when the promise is rejected.
*
* @return PromiseInterface
*/
public function otherwise(callable $onRejected);
public function otherwise(callable $onRejected): PromiseInterface;
/**
* Get the state of the promise ("pending", "rejected", or "fulfilled").
*
* The three states can be checked against the constants defined on
* PromiseInterface: PENDING, FULFILLED, and REJECTED.
*
* @return string
*/
public function getState();
public function getState(): string;
/**
* Resolve the promise with the given value.
@ -60,7 +56,7 @@ interface PromiseInterface
*
* @throws \RuntimeException if the promise is already resolved.
*/
public function resolve($value);
public function resolve($value): void;
/**
* Reject the promise with the given reason.
@ -69,14 +65,14 @@ interface PromiseInterface
*
* @throws \RuntimeException if the promise is already resolved.
*/
public function reject($reason);
public function reject($reason): void;
/**
* Cancels the promise if possible.
*
* @link https://github.com/promises-aplus/cancellation-spec/issues/7
* @see https://github.com/promises-aplus/cancellation-spec/issues/7
*/
public function cancel();
public function cancel(): void;
/**
* Waits until the promise completes if possible.
@ -86,12 +82,10 @@ interface PromiseInterface
*
* If the promise cannot be waited on, then the promise will be rejected.
*
* @param bool $unwrap
*
* @return mixed
*
* @throws \LogicException if the promise has no wait function or if the
* promise does not settle after waiting.
*/
public function wait($unwrap = true);
public function wait(bool $unwrap = true);
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
@ -9,8 +11,6 @@ interface PromisorInterface
{
/**
* Returns a promise.
*
* @return PromiseInterface
*/
public function promise();
public function promise(): PromiseInterface;
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
@ -7,11 +9,16 @@ namespace GuzzleHttp\Promise;
*
* Thenning off of this promise will invoke the onRejected callback
* immediately and ignore other callbacks.
*
* @final
*/
class RejectedPromise implements PromiseInterface
{
private $reason;
/**
* @param mixed $reason
*/
public function __construct($reason)
{
if (is_object($reason) && method_exists($reason, 'then')) {
@ -26,7 +33,7 @@ class RejectedPromise implements PromiseInterface
public function then(
callable $onFulfilled = null,
callable $onRejected = null
) {
): PromiseInterface {
// If there's no onRejected callback then just return self.
if (!$onRejected) {
return $this;
@ -35,7 +42,7 @@ class RejectedPromise implements PromiseInterface
$queue = Utils::queue();
$reason = $this->reason;
$p = new Promise([$queue, 'run']);
$queue->add(static function () use ($p, $reason, $onRejected) {
$queue->add(static function () use ($p, $reason, $onRejected): void {
if (Is::pending($p)) {
try {
// Return a resolved promise if onRejected does not throw.
@ -43,9 +50,6 @@ class RejectedPromise implements PromiseInterface
} catch (\Throwable $e) {
// onRejected threw, so return a rejected promise.
$p->reject($e);
} catch (\Exception $e) {
// onRejected threw, so return a rejected promise.
$p->reject($e);
}
}
});
@ -53,12 +57,12 @@ class RejectedPromise implements PromiseInterface
return $p;
}
public function otherwise(callable $onRejected)
public function otherwise(callable $onRejected): PromiseInterface
{
return $this->then(null, $onRejected);
}
public function wait($unwrap = true, $defaultDelivery = null)
public function wait(bool $unwrap = true)
{
if ($unwrap) {
throw Create::exceptionFor($this->reason);
@ -67,24 +71,24 @@ class RejectedPromise implements PromiseInterface
return null;
}
public function getState()
public function getState(): string
{
return self::REJECTED;
}
public function resolve($value)
public function resolve($value): void
{
throw new \LogicException("Cannot resolve a rejected promise");
throw new \LogicException('Cannot resolve a rejected promise');
}
public function reject($reason)
public function reject($reason): void
{
if ($reason !== $this->reason) {
throw new \LogicException("Cannot reject a rejected promise");
throw new \LogicException('Cannot reject a rejected promise');
}
}
public function cancel()
public function cancel(): void
{
// pass
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
@ -13,8 +15,8 @@ class RejectionException extends \RuntimeException
private $reason;
/**
* @param mixed $reason Rejection reason.
* @param string $description Optional description
* @param mixed $reason Rejection reason.
* @param string|null $description Optional description.
*/
public function __construct($reason, $description = null)
{
@ -23,14 +25,13 @@ class RejectionException extends \RuntimeException
$message = 'The promise was rejected';
if ($description) {
$message .= ' with reason: ' . $description;
$message .= ' with reason: '.$description;
} elseif (is_string($reason)
|| (is_object($reason) && method_exists($reason, '__toString'))
) {
$message .= ' with reason: ' . $this->reason;
$message .= ' with reason: '.$this->reason;
} elseif ($reason instanceof \JsonSerializable) {
$message .= ' with reason: '
. json_encode($this->reason, JSON_PRETTY_PRINT);
$message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT);
}
parent::__construct($message);

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
/**
@ -10,16 +12,18 @@ namespace GuzzleHttp\Promise;
* by calling the `run()` function of the global task queue in an event loop.
*
* GuzzleHttp\Promise\Utils::queue()->run();
*
* @final
*/
class TaskQueue implements TaskQueueInterface
{
private $enableShutdown = true;
private $queue = [];
public function __construct($withShutdown = true)
public function __construct(bool $withShutdown = true)
{
if ($withShutdown) {
register_shutdown_function(function () {
register_shutdown_function(function (): void {
if ($this->enableShutdown) {
// Only run the tasks if an E_ERROR didn't occur.
$err = error_get_last();
@ -31,17 +35,17 @@ class TaskQueue implements TaskQueueInterface
}
}
public function isEmpty()
public function isEmpty(): bool
{
return !$this->queue;
}
public function add(callable $task)
public function add(callable $task): void
{
$this->queue[] = $task;
}
public function run()
public function run(): void
{
while ($task = array_shift($this->queue)) {
/** @var callable $task */
@ -60,7 +64,7 @@ class TaskQueue implements TaskQueueInterface
*
* Note: This shutdown will occur before any destructors are triggered.
*/
public function disableShutdown()
public function disableShutdown(): void
{
$this->enableShutdown = false;
}

View File

@ -1,24 +1,24 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
interface TaskQueueInterface
{
/**
* Returns true if the queue is empty.
*
* @return bool
*/
public function isEmpty();
public function isEmpty(): bool;
/**
* Adds a task to the queue that will be executed the next time run is
* called.
*/
public function add(callable $task);
public function add(callable $task): void;
/**
* Execute all of the pending task in the queue.
*/
public function run();
public function run(): void;
}

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace GuzzleHttp\Promise;
final class Utils
@ -17,11 +19,9 @@ final class Utils
* }
* </code>
*
* @param TaskQueueInterface $assign Optionally specify a new queue instance.
*
* @return TaskQueueInterface
* @param TaskQueueInterface|null $assign Optionally specify a new queue instance.
*/
public static function queue(TaskQueueInterface $assign = null)
public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface
{
static $queue;
@ -39,22 +39,18 @@ final class Utils
* returns a promise that is fulfilled or rejected with the result.
*
* @param callable $task Task function to run.
*
* @return PromiseInterface
*/
public static function task(callable $task)
public static function task(callable $task): PromiseInterface
{
$queue = self::queue();
$promise = new Promise([$queue, 'run']);
$queue->add(function () use ($task, $promise) {
$queue->add(function () use ($task, $promise): void {
try {
if (Is::pending($promise)) {
$promise->resolve($task());
}
} catch (\Throwable $e) {
$promise->reject($e);
} catch (\Exception $e) {
$promise->reject($e);
}
});
@ -72,22 +68,18 @@ final class Utils
* key mapping to the rejection reason of the promise.
*
* @param PromiseInterface $promise Promise or value.
*
* @return array
*/
public static function inspect(PromiseInterface $promise)
public static function inspect(PromiseInterface $promise): array
{
try {
return [
'state' => PromiseInterface::FULFILLED,
'value' => $promise->wait()
'value' => $promise->wait(),
];
} catch (RejectionException $e) {
return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
} catch (\Throwable $e) {
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
} catch (\Exception $e) {
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
}
}
@ -100,14 +92,12 @@ final class Utils
* @see inspect for the inspection state array format.
*
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
*
* @return array
*/
public static function inspectAll($promises)
public static function inspectAll($promises): array
{
$results = [];
foreach ($promises as $key => $promise) {
$results[$key] = inspect($promise);
$results[$key] = self::inspect($promise);
}
return $results;
@ -122,12 +112,9 @@ final class Utils
*
* @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.
*
* @return array
*
* @throws \Exception on error
* @throws \Throwable on error in PHP >=7
* @throws \Throwable on error
*/
public static function unwrap($promises)
public static function unwrap($promises): array
{
$results = [];
foreach ($promises as $key => $promise) {
@ -147,22 +134,21 @@ final class Utils
*
* @param mixed $promises Promises or values.
* @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
*
* @return PromiseInterface
*/
public static function all($promises, $recursive = false)
public static function all($promises, bool $recursive = false): PromiseInterface
{
$results = [];
$promise = Each::of(
$promises,
function ($value, $idx) use (&$results) {
function ($value, $idx) use (&$results): void {
$results[$idx] = $value;
},
function ($reason, $idx, Promise $aggregate) {
function ($reason, $idx, Promise $aggregate): void {
$aggregate->reject($reason);
}
)->then(function () use (&$results) {
ksort($results);
return $results;
});
@ -173,6 +159,7 @@ final class Utils
return self::all($promises, $recursive);
}
}
return $results;
});
}
@ -193,17 +180,15 @@ final class Utils
*
* @param int $count Total number of promises.
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
*/
public static function some($count, $promises)
public static function some(int $count, $promises): PromiseInterface
{
$results = [];
$rejections = [];
return Each::of(
$promises,
function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
function ($value, $idx, PromiseInterface $p) use (&$results, $count): void {
if (Is::settled($p)) {
return;
}
@ -212,7 +197,7 @@ final class Utils
$p->resolve(null);
}
},
function ($reason) use (&$rejections) {
function ($reason) use (&$rejections): void {
$rejections[] = $reason;
}
)->then(
@ -224,6 +209,7 @@ final class Utils
);
}
ksort($results);
return array_values($results);
}
);
@ -234,10 +220,8 @@ final class Utils
* fulfillment value is not an array of 1 but the value directly.
*
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
*/
public static function any($promises)
public static function any($promises): PromiseInterface
{
return self::some(1, $promises)->then(function ($values) {
return $values[0];
@ -253,23 +237,22 @@ final class Utils
* @see inspect for the inspection state array format.
*
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
*/
public static function settle($promises)
public static function settle($promises): PromiseInterface
{
$results = [];
return Each::of(
$promises,
function ($value, $idx) use (&$results) {
function ($value, $idx) use (&$results): void {
$results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
},
function ($reason, $idx) use (&$results) {
function ($reason, $idx) use (&$results): void {
$results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
}
)->then(function () use (&$results) {
ksort($results);
return $results;
});
}

View File

@ -1,363 +0,0 @@
<?php
namespace GuzzleHttp\Promise;
/**
* Get the global task queue used for promise resolution.
*
* This task queue MUST be run in an event loop in order for promises to be
* settled asynchronously. It will be automatically run when synchronously
* waiting on a promise.
*
* <code>
* while ($eventLoop->isRunning()) {
* GuzzleHttp\Promise\queue()->run();
* }
* </code>
*
* @param TaskQueueInterface $assign Optionally specify a new queue instance.
*
* @return TaskQueueInterface
*
* @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead.
*/
function queue(TaskQueueInterface $assign = null)
{
return Utils::queue($assign);
}
/**
* Adds a function to run in the task queue when it is next `run()` and returns
* a promise that is fulfilled or rejected with the result.
*
* @param callable $task Task function to run.
*
* @return PromiseInterface
*
* @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead.
*/
function task(callable $task)
{
return Utils::task($task);
}
/**
* Creates a promise for a value if the value is not a promise.
*
* @param mixed $value Promise or value.
*
* @return PromiseInterface
*
* @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.
*/
function promise_for($value)
{
return Create::promiseFor($value);
}
/**
* Creates a rejected promise for a reason if the reason is not a promise. If
* the provided reason is a promise, then it is returned as-is.
*
* @param mixed $reason Promise or reason.
*
* @return PromiseInterface
*
* @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.
*/
function rejection_for($reason)
{
return Create::rejectionFor($reason);
}
/**
* Create an exception for a rejected promise value.
*
* @param mixed $reason
*
* @return \Exception|\Throwable
*
* @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.
*/
function exception_for($reason)
{
return Create::exceptionFor($reason);
}
/**
* Returns an iterator for the given value.
*
* @param mixed $value
*
* @return \Iterator
*
* @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.
*/
function iter_for($value)
{
return Create::iterFor($value);
}
/**
* Synchronously waits on a promise to resolve and returns an inspection state
* array.
*
* Returns a state associative array containing a "state" key mapping to a
* valid promise state. If the state of the promise is "fulfilled", the array
* will contain a "value" key mapping to the fulfilled value of the promise. If
* the promise is rejected, the array will contain a "reason" key mapping to
* the rejection reason of the promise.
*
* @param PromiseInterface $promise Promise or value.
*
* @return array
*
* @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.
*/
function inspect(PromiseInterface $promise)
{
return Utils::inspect($promise);
}
/**
* Waits on all of the provided promises, but does not unwrap rejected promises
* as thrown exception.
*
* Returns an array of inspection state arrays.
*
* @see inspect for the inspection state array format.
*
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
*
* @return array
*
* @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.
*/
function inspect_all($promises)
{
return Utils::inspectAll($promises);
}
/**
* Waits on all of the provided promises and returns the fulfilled values.
*
* Returns an array that contains the value of each promise (in the same order
* the promises were provided). An exception is thrown if any of the promises
* are rejected.
*
* @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.
*
* @return array
*
* @throws \Exception on error
* @throws \Throwable on error in PHP >=7
*
* @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead.
*/
function unwrap($promises)
{
return Utils::unwrap($promises);
}
/**
* Given an array of promises, return a promise that is fulfilled when all the
* items in the array are fulfilled.
*
* The promise's fulfillment value is an array with fulfillment values at
* respective positions to the original array. If any promise in the array
* rejects, the returned promise is rejected with the rejection reason.
*
* @param mixed $promises Promises or values.
* @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution.
*
* @return PromiseInterface
*
* @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead.
*/
function all($promises, $recursive = false)
{
return Utils::all($promises, $recursive);
}
/**
* Initiate a competitive race between multiple promises or values (values will
* become immediately fulfilled promises).
*
* When count amount of promises have been fulfilled, the returned promise is
* fulfilled with an array that contains the fulfillment values of the winners
* in order of resolution.
*
* This promise is rejected with a {@see AggregateException} if the number of
* fulfilled promises is less than the desired $count.
*
* @param int $count Total number of promises.
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
*
* @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.
*/
function some($count, $promises)
{
return Utils::some($count, $promises);
}
/**
* Like some(), with 1 as count. However, if the promise fulfills, the
* fulfillment value is not an array of 1 but the value directly.
*
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
*
* @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.
*/
function any($promises)
{
return Utils::any($promises);
}
/**
* Returns a promise that is fulfilled when all of the provided promises have
* been fulfilled or rejected.
*
* The returned promise is fulfilled with an array of inspection state arrays.
*
* @see inspect for the inspection state array format.
*
* @param mixed $promises Promises or values.
*
* @return PromiseInterface
*
* @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.
*/
function settle($promises)
{
return Utils::settle($promises);
}
/**
* Given an iterator that yields promises or values, returns a promise that is
* fulfilled with a null value when the iterator has been consumed or the
* aggregate promise has been fulfilled or rejected.
*
* $onFulfilled is a function that accepts the fulfilled value, iterator index,
* and the aggregate promise. The callback can invoke any necessary side
* effects and choose to resolve or reject the aggregate if needed.
*
* $onRejected is a function that accepts the rejection reason, iterator index,
* and the aggregate promise. The callback can invoke any necessary side
* effects and choose to resolve or reject the aggregate if needed.
*
* @param mixed $iterable Iterator or array to iterate over.
* @param callable $onFulfilled
* @param callable $onRejected
*
* @return PromiseInterface
*
* @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.
*/
function each(
$iterable,
callable $onFulfilled = null,
callable $onRejected = null
) {
return Each::of($iterable, $onFulfilled, $onRejected);
}
/**
* Like each, but only allows a certain number of outstanding promises at any
* given time.
*
* $concurrency may be an integer or a function that accepts the number of
* pending promises and returns a numeric concurrency limit value to allow for
* dynamic a concurrency size.
*
* @param mixed $iterable
* @param int|callable $concurrency
* @param callable $onFulfilled
* @param callable $onRejected
*
* @return PromiseInterface
*
* @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.
*/
function each_limit(
$iterable,
$concurrency,
callable $onFulfilled = null,
callable $onRejected = null
) {
return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected);
}
/**
* Like each_limit, but ensures that no promise in the given $iterable argument
* is rejected. If any promise is rejected, then the aggregate promise is
* rejected with the encountered rejection.
*
* @param mixed $iterable
* @param int|callable $concurrency
* @param callable $onFulfilled
*
* @return PromiseInterface
*
* @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.
*/
function each_limit_all(
$iterable,
$concurrency,
callable $onFulfilled = null
) {
return Each::ofLimitAll($iterable, $concurrency, $onFulfilled);
}
/**
* Returns true if a promise is fulfilled.
*
* @return bool
*
* @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.
*/
function is_fulfilled(PromiseInterface $promise)
{
return Is::fulfilled($promise);
}
/**
* Returns true if a promise is rejected.
*
* @return bool
*
* @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.
*/
function is_rejected(PromiseInterface $promise)
{
return Is::rejected($promise);
}
/**
* Returns true if a promise is fulfilled or rejected.
*
* @return bool
*
* @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.
*/
function is_settled(PromiseInterface $promise)
{
return Is::settled($promise);
}
/**
* Create a new coroutine.
*
* @see Coroutine
*
* @return PromiseInterface
*
* @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.
*/
function coroutine(callable $generatorFn)
{
return Coroutine::of($generatorFn);
}

View File

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

View File

@ -0,0 +1,9 @@
{
"require": {
"php": "^7.4 || ^8.0",
"friendsofphp/php-cs-fixer": "3.16.0"
},
"config": {
"preferred-install": "dist"
}
}

View File

@ -0,0 +1,10 @@
{
"require": {
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "1.10.11",
"phpstan/phpstan-deprecation-rules": "1.1.3"
},
"config": {
"preferred-install": "dist"
}
}

View File

@ -0,0 +1,9 @@
{
"require": {
"php": "^7.4 || ^8.0",
"psalm/phar": "5.9.0"
},
"config": {
"preferred-install": "dist"
}
}

View File

@ -1 +1 @@
* @ddyett @MichaelMainer @nikithauc @zengin @silaskenneth @Ndiritu @shemogumbe
* @microsoftgraph/msgraph-devx-php-write

View File

@ -0,0 +1,73 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# File initially created using https://github.com/MIchaelMainer/policyservicetoolkit/blob/main/branch_protection_export.ps1.
name: msgraph-sdk-php-branch-protection
description: Branch protection policy for the msgraph-sdk-php repository
resource: repository
configuration:
branchProtectionRules:
- branchNamePattern: dev
# This branch pattern applies to the following branches as of 06/12/2023 10:31:17:
# dev
# Specifies whether this branch can be deleted. boolean
allowsDeletions: false
# Specifies whether forced pushes are allowed on this branch. boolean
allowsForcePushes: false
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
dismissStaleReviews: true
# Specifies whether admins can overwrite branch protection. boolean
isAdminEnforced: false
# Indicates whether "Require a pull request before merging" is enabled. boolean
requiresPullRequestBeforeMerging: true
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 1
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: true
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
requiresConversationResolution: true
# Are merge commits prohibited from being pushed to this branch. boolean
requiresLinearHistory: false
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
requiresStrictStatusChecks: true
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
restrictsReviewDismissals: false
- branchNamePattern: main
# This branch pattern applies to the following branches as of 06/12/2023 10:31:17:
# main
# Specifies whether this branch can be deleted. boolean
allowsDeletions: false
# Specifies whether forced pushes are allowed on this branch. boolean
allowsForcePushes: false
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
dismissStaleReviews: true
# Specifies whether admins can overwrite branch protection. boolean
isAdminEnforced: false
# Indicates whether "Require a pull request before merging" is enabled. boolean
requiresPullRequestBeforeMerging: true
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 1
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: false
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
requiresConversationResolution: true
# Are merge commits prohibited from being pushed to this branch. boolean
requiresLinearHistory: false
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
requiresStrictStatusChecks: true
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
restrictsReviewDismissals: false

View File

@ -11,7 +11,7 @@ You can install the PHP SDK with Composer, either run `composer require microsof
```
{
"require": {
"microsoft/microsoft-graph": "^1.93.0"
"microsoft/microsoft-graph": "^1.99.0"
}
}
```

View File

@ -15,12 +15,13 @@
"php": "^8.0 || ^7.3",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"ext-json": "*",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0 || ^9.0",
"mikey179/vfsstream": "^1.2",
"phpstan/phpstan": "^0.12.90 || ^1.0.0"
"phpstan/phpstan": "^0.12.90 || ^1.0.0",
"guzzlehttp/promises": "^1.0 || ^2.0"
},
"autoload": {
"psr-4": {

View File

@ -25,7 +25,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
{
/**
* Gets the calleeNumber
* Number of the user or bot who received the call. E.164 format, but may include additional data.
* Number of the user or bot who received the call (E.164 format, but may include additional data).
*
* @return string|null The calleeNumber
*/
@ -40,7 +40,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the calleeNumber
* Number of the user or bot who received the call. E.164 format, but may include additional data.
* Number of the user or bot who received the call (E.164 format, but may include additional data).
*
* @param string $val The value of the calleeNumber
*
@ -81,7 +81,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the callerNumber
* Number of the user or bot who made the call. E.164 format, but may include additional data.
* Number of the user or bot who made the call (E.164 format, but may include additional data).
*
* @return string|null The callerNumber
*/
@ -96,7 +96,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the callerNumber
* Number of the user or bot who made the call. E.164 format, but may include additional data.
* Number of the user or bot who made the call (E.164 format, but may include additional data).
*
* @param string $val The value of the callerNumber
*
@ -137,7 +137,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the correlationId
* Identifier for the call that you can use when calling Microsoft Support. GUID.
* Identifier (GUID) for the call that you can use when calling Microsoft Support.
*
* @return string|null The correlationId
*/
@ -152,7 +152,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the correlationId
* Identifier for the call that you can use when calling Microsoft Support. GUID.
* Identifier (GUID) for the call that you can use when calling Microsoft Support.
*
* @param string $val The value of the correlationId
*
@ -259,7 +259,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the finalSipCode
* The code with which the call ended, RFC 3261.
* The code with which the call ended (RFC 3261).
*
* @return int|null The finalSipCode
*/
@ -274,7 +274,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the finalSipCode
* The code with which the call ended, RFC 3261.
* The code with which the call ended (RFC 3261).
*
* @param int $val The value of the finalSipCode
*
@ -315,7 +315,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the id
* Unique call identifier. GUID.
* Unique call identifier (GUID).
*
* @return string|null The id
*/
@ -330,7 +330,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the id
* Unique call identifier. GUID.
* Unique call identifier (GUID).
*
* @param string $val The value of the id
*
@ -404,7 +404,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the mediaPathLocation
* The datacenter used for media path in non-bypass call.
* The data center used for media path in non-bypass call.
*
* @return string|null The mediaPathLocation
*/
@ -419,7 +419,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the mediaPathLocation
* The datacenter used for media path in non-bypass call.
* The data center used for media path in non-bypass call.
*
* @param string $val The value of the mediaPathLocation
*
@ -432,6 +432,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the otherPartyCountryCode
* Country code of the caller in case of an incoming call, or callee in case of an outgoing call. For details, see ISO 3166-1 alpha-2.
*
* @return string|null The otherPartyCountryCode
*/
@ -446,6 +447,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the otherPartyCountryCode
* Country code of the caller in case of an incoming call, or callee in case of an outgoing call. For details, see ISO 3166-1 alpha-2.
*
* @param string $val The value of the otherPartyCountryCode
*
@ -458,7 +460,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the signalingLocation
* The datacenter used for signaling for both bypass and non-bypass calls.
* The data center used for signaling for both bypass and non-bypass calls.
*
* @return string|null The signalingLocation
*/
@ -473,7 +475,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the signalingLocation
* The datacenter used for signaling for both bypass and non-bypass calls.
* The data center used for signaling for both bypass and non-bypass calls.
*
* @param string $val The value of the signalingLocation
*
@ -575,6 +577,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userCountryCode
* Country code of the user. For details, see ISO 3166-1 alpha-2.
*
* @return string|null The userCountryCode
*/
@ -589,6 +592,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userCountryCode
* Country code of the user. For details, see ISO 3166-1 alpha-2.
*
* @param string $val The value of the userCountryCode
*
@ -629,7 +633,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userId
* Calling user's ID in Graph. This and other user info will be null/empty for bot call types. GUID.
* The unique identifier (GUID) of the user in Azure Active Directory. This and other user info will be null/empty for bot call types.
*
* @return string|null The userId
*/
@ -644,7 +648,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userId
* Calling user's ID in Graph. This and other user info will be null/empty for bot call types. GUID.
* The unique identifier (GUID) of the user in Azure Active Directory. This and other user info will be null/empty for bot call types.
*
* @param string $val The value of the userId
*
@ -657,7 +661,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userPrincipalName
* UserPrincipalName (sign-in name) in Azure Active Directory. This is usually the same as user's SIP Address, and can be same as user's e-mail address.
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @return string|null The userPrincipalName
*/
@ -672,7 +676,7 @@ class DirectRoutingLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userPrincipalName
* UserPrincipalName (sign-in name) in Azure Active Directory. This is usually the same as user's SIP Address, and can be same as user's e-mail address.
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @param string $val The value of the userPrincipalName
*

View File

@ -26,7 +26,7 @@ class MediaStream extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the audioCodec
* Codec name used to encode audio for transmission on the network. Possible values are: unknown, invalid, cn, pcma, pcmu, amrWide, g722, g7221, g7221c, g729, multiChannelAudio, muchv2, opus, satin, satinFullband, rtAudio8, rtAudio16, silk, silkNarrow, silkWide, siren, xmsRTA, unknownFutureValue.
* Codec name used to encode audio for transmission on the network. Possible values are: unknown, invalid, cn, pcma, pcmu, amrWide, g722, g7221, g7221c, g729, multiChannelAudio, muchv2, opus, satin, satinFullband, rtAudio8, rtAudio16, silk, silkNarrow, silkWide, siren, xmsRta, unknownFutureValue.
*
* @return AudioCodec|null The audioCodec
*/
@ -45,7 +45,7 @@ class MediaStream extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the audioCodec
* Codec name used to encode audio for transmission on the network. Possible values are: unknown, invalid, cn, pcma, pcmu, amrWide, g722, g7221, g7221c, g729, multiChannelAudio, muchv2, opus, satin, satinFullband, rtAudio8, rtAudio16, silk, silkNarrow, silkWide, siren, xmsRTA, unknownFutureValue.
* Codec name used to encode audio for transmission on the network. Possible values are: unknown, invalid, cn, pcma, pcmu, amrWide, g722, g7221, g7221c, g729, multiChannelAudio, muchv2, opus, satin, satinFullband, rtAudio8, rtAudio16, silk, silkNarrow, silkWide, siren, xmsRta, unknownFutureValue.
*
* @param AudioCodec $val The value to assign to the audioCodec
*
@ -146,6 +146,39 @@ class MediaStream extends \Beta\Microsoft\Graph\Model\Entity
return $this;
}
/**
* Gets the averageFreezeDuration
* Average of the received freeze duration related to the video stream.
*
* @return \DateInterval|null The averageFreezeDuration
*/
public function getAverageFreezeDuration()
{
if (array_key_exists("averageFreezeDuration", $this->_propDict)) {
if (is_a($this->_propDict["averageFreezeDuration"], "\DateInterval") || is_null($this->_propDict["averageFreezeDuration"])) {
return $this->_propDict["averageFreezeDuration"];
} else {
$this->_propDict["averageFreezeDuration"] = new \DateInterval($this->_propDict["averageFreezeDuration"]);
return $this->_propDict["averageFreezeDuration"];
}
}
return null;
}
/**
* Sets the averageFreezeDuration
* Average of the received freeze duration related to the video stream.
*
* @param \DateInterval $val The value to assign to the averageFreezeDuration
*
* @return MediaStream The MediaStream
*/
public function setAverageFreezeDuration($val)
{
$this->_propDict["averageFreezeDuration"] = $val;
return $this;
}
/**
* Gets the averageJitter
* Average jitter for the stream computed as specified in [RFC 3550][], denoted in [ISO 8601][] format. For example, 1 second is denoted as 'PT1S', where 'P' is the duration designator, 'T' is the time designator, and 'S' is the second designator.
@ -413,6 +446,34 @@ class MediaStream extends \Beta\Microsoft\Graph\Model\Entity
return $this;
}
/**
* Gets the isAudioForwardErrorCorrectionUsed
* Indicates whether the forward error correction (FEC) was used at some point during the session. The default value is null.
*
* @return bool|null The isAudioForwardErrorCorrectionUsed
*/
public function getIsAudioForwardErrorCorrectionUsed()
{
if (array_key_exists("isAudioForwardErrorCorrectionUsed", $this->_propDict)) {
return $this->_propDict["isAudioForwardErrorCorrectionUsed"];
} else {
return null;
}
}
/**
* Sets the isAudioForwardErrorCorrectionUsed
* Indicates whether the forward error correction (FEC) was used at some point during the session. The default value is null.
*
* @param bool $val The value of the isAudioForwardErrorCorrectionUsed
*
* @return MediaStream
*/
public function setIsAudioForwardErrorCorrectionUsed($val)
{
$this->_propDict["isAudioForwardErrorCorrectionUsed"] = $val;
return $this;
}
/**
* Gets the lowFrameRateRatio
* Fraction of the call where frame rate is less than 7.5 frames per second.
*
@ -680,6 +741,39 @@ class MediaStream extends \Beta\Microsoft\Graph\Model\Entity
return $this;
}
/**
* Gets the rmsFreezeDuration
* Root mean square of the received freeze duration related to the video stream.
*
* @return \DateInterval|null The rmsFreezeDuration
*/
public function getRmsFreezeDuration()
{
if (array_key_exists("rmsFreezeDuration", $this->_propDict)) {
if (is_a($this->_propDict["rmsFreezeDuration"], "\DateInterval") || is_null($this->_propDict["rmsFreezeDuration"])) {
return $this->_propDict["rmsFreezeDuration"];
} else {
$this->_propDict["rmsFreezeDuration"] = new \DateInterval($this->_propDict["rmsFreezeDuration"]);
return $this->_propDict["rmsFreezeDuration"];
}
}
return null;
}
/**
* Sets the rmsFreezeDuration
* Root mean square of the received freeze duration related to the video stream.
*
* @param \DateInterval $val The value to assign to the rmsFreezeDuration
*
* @return MediaStream The MediaStream
*/
public function setRmsFreezeDuration($val)
{
$this->_propDict["rmsFreezeDuration"] = $val;
return $this;
}
/**
* Gets the startDateTime
* UTC time when the stream started. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z

View File

@ -23,6 +23,90 @@ namespace Beta\Microsoft\Graph\CallRecords\Model;
*/
class ParticipantEndpoint extends Endpoint
{
/**
* Gets the cpuCoresCount
* CPU number of cores used by the media endpoint.
*
* @return int|null The cpuCoresCount
*/
public function getCpuCoresCount()
{
if (array_key_exists("cpuCoresCount", $this->_propDict)) {
return $this->_propDict["cpuCoresCount"];
} else {
return null;
}
}
/**
* Sets the cpuCoresCount
* CPU number of cores used by the media endpoint.
*
* @param int $val The value of the cpuCoresCount
*
* @return ParticipantEndpoint
*/
public function setCpuCoresCount($val)
{
$this->_propDict["cpuCoresCount"] = $val;
return $this;
}
/**
* Gets the cpuName
* CPU name used by the media endpoint.
*
* @return string|null The cpuName
*/
public function getCpuName()
{
if (array_key_exists("cpuName", $this->_propDict)) {
return $this->_propDict["cpuName"];
} else {
return null;
}
}
/**
* Sets the cpuName
* CPU name used by the media endpoint.
*
* @param string $val The value of the cpuName
*
* @return ParticipantEndpoint
*/
public function setCpuName($val)
{
$this->_propDict["cpuName"] = $val;
return $this;
}
/**
* Gets the cpuProcessorSpeedInMhz
* CPU processor speed used by the media endpoint.
*
* @return int|null The cpuProcessorSpeedInMhz
*/
public function getCpuProcessorSpeedInMhz()
{
if (array_key_exists("cpuProcessorSpeedInMhz", $this->_propDict)) {
return $this->_propDict["cpuProcessorSpeedInMhz"];
} else {
return null;
}
}
/**
* Sets the cpuProcessorSpeedInMhz
* CPU processor speed used by the media endpoint.
*
* @param int $val The value of the cpuProcessorSpeedInMhz
*
* @return ParticipantEndpoint
*/
public function setCpuProcessorSpeedInMhz($val)
{
$this->_propDict["cpuProcessorSpeedInMhz"] = $val;
return $this;
}
/**
* Gets the feedback
@ -89,4 +173,32 @@ class ParticipantEndpoint extends Endpoint
$this->_propDict["identity"] = $val;
return $this;
}
/**
* Gets the name
* Name of the device used by the media endpoint.
*
* @return string|null The name
*/
public function getName()
{
if (array_key_exists("name", $this->_propDict)) {
return $this->_propDict["name"];
} else {
return null;
}
}
/**
* Sets the name
* Name of the device used by the media endpoint.
*
* @param string $val The value of the name
*
* @return ParticipantEndpoint
*/
public function setName($val)
{
$this->_propDict["name"] = $val;
return $this;
}
}

View File

@ -26,6 +26,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the blockDateTime
* The date and time when the user was blocked/unblocked from making PSTN calls. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
*
* @return \DateTime|null The blockDateTime
*/
@ -44,6 +45,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the blockDateTime
* The date and time when the user was blocked/unblocked from making PSTN calls. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
*
* @param \DateTime $val The value to assign to the blockDateTime
*
@ -56,6 +58,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the blockReason
* The reason why the user is blocked/unblocked from making calls.
*
* @return string|null The blockReason
*/
@ -70,6 +73,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the blockReason
* The reason why the user is blocked/unblocked from making calls.
*
* @param string $val The value of the blockReason
*
@ -82,6 +86,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the remediationId
* Unique identifier (GUID) for the blocking/unblocking action.
*
* @return string|null The remediationId
*/
@ -96,6 +101,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the remediationId
* Unique identifier (GUID) for the blocking/unblocking action.
*
* @param string $val The value of the remediationId
*
@ -109,6 +115,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the userBlockMode
* Indicates whether the user is blocked or unblocked from making PSTN calls in Microsoft Teams. The possible values are: blocked, unblocked, unknownFutureValue.
*
* @return PstnUserBlockMode|null The userBlockMode
*/
@ -127,6 +134,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userBlockMode
* Indicates whether the user is blocked or unblocked from making PSTN calls in Microsoft Teams. The possible values are: blocked, unblocked, unknownFutureValue.
*
* @param PstnUserBlockMode $val The value to assign to the userBlockMode
*
@ -139,6 +147,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userDisplayName
* Display name of the user.
*
* @return string|null The userDisplayName
*/
@ -153,6 +162,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userDisplayName
* Display name of the user.
*
* @param string $val The value of the userDisplayName
*
@ -165,6 +175,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userId
* The unique identifier (GUID) of the user in Azure Active Directory.
*
* @return string|null The userId
*/
@ -179,6 +190,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userId
* The unique identifier (GUID) of the user in Azure Active Directory.
*
* @param string $val The value of the userId
*
@ -191,6 +203,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userPrincipalName
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @return string|null The userPrincipalName
*/
@ -205,6 +218,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userPrincipalName
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @param string $val The value of the userPrincipalName
*
@ -217,6 +231,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userTelephoneNumber
* User's blocked number. For details, see E.164.
*
* @return string|null The userTelephoneNumber
*/
@ -231,6 +246,7 @@ class PstnBlockedUsersLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userTelephoneNumber
* User's blocked number. For details, see E.164.
*
* @param string $val The value of the userTelephoneNumber
*

View File

@ -58,7 +58,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the calleeNumber
* Number dialed in E.164 format.
* Number of the user or bot who received the call (E.164).
*
* @return string|null The calleeNumber
*/
@ -73,7 +73,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the calleeNumber
* Number dialed in E.164 format.
* Number of the user or bot who received the call (E.164).
*
* @param string $val The value of the calleeNumber
*
@ -86,7 +86,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the callerNumber
* Number that received the call for inbound calls or the number dialed for outbound calls. E.164 format.
* Number of the user or bot who made the call (E.164).
*
* @return string|null The callerNumber
*/
@ -101,7 +101,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the callerNumber
* Number that received the call for inbound calls or the number dialed for outbound calls. E.164 format.
* Number of the user or bot who made the call (E.164).
*
* @param string $val The value of the callerNumber
*
@ -142,7 +142,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the callType
* Whether the call was a PSTN outbound or inbound call and the type of call such as a call placed by a user or an audio conference.
* Indicates whether the call was a PSTN outbound or inbound call and the type of call such as a call placed by a user or an audio conference.
*
* @return string|null The callType
*/
@ -157,7 +157,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the callType
* Whether the call was a PSTN outbound or inbound call and the type of call such as a call placed by a user or an audio conference.
* Indicates whether the call was a PSTN outbound or inbound call and the type of call such as a call placed by a user or an audio conference.
*
* @param string $val The value of the callType
*
@ -264,7 +264,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the currency
* Type of currency used to calculate the cost of the call. For details, see ISO 4217.
* Type of currency used to calculate the cost of the call (ISO 4217).
*
* @return string|null The currency
*/
@ -279,7 +279,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the currency
* Type of currency used to calculate the cost of the call. For details, see ISO 4217.
* Type of currency used to calculate the cost of the call (ISO 4217).
*
* @param string $val The value of the currency
*
@ -292,7 +292,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the destinationContext
* Whether the call was domestic (within a country or region) or international (outside a country or region) based on the user's location.
* Indicates whether the call was Domestic (within a country or region) or International (outside a country or region) based on the user's location.
*
* @return string|null The destinationContext
*/
@ -307,7 +307,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the destinationContext
* Whether the call was domestic (within a country or region) or international (outside a country or region) based on the user's location.
* Indicates whether the call was Domestic (within a country or region) or International (outside a country or region) based on the user's location.
*
* @param string $val The value of the destinationContext
*
@ -409,7 +409,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the id
* Unique call identifier. GUID.
* Unique call identifier (GUID).
*
* @return string|null The id
*/
@ -424,7 +424,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the id
* Unique call identifier. GUID.
* Unique call identifier (GUID).
*
* @param string $val The value of the id
*
@ -521,6 +521,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the otherPartyCountryCode
* Country code of the caller in case of an incoming call, or callee in case of an outgoing call. For details, see ISO 3166-1 alpha-2.
*
* @return string|null The otherPartyCountryCode
*/
@ -535,6 +536,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the otherPartyCountryCode
* Country code of the caller in case of an incoming call, or callee in case of an outgoing call. For details, see ISO 3166-1 alpha-2.
*
* @param string $val The value of the otherPartyCountryCode
*
@ -664,7 +666,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userId
* Calling user's ID in Graph. GUID. This and other user info will be null/empty for bot call types (ucap_in, ucap_out).
* The unique identifier (GUID) of the user in Azure Active Directory. This and other user info will be null/empty for bot call types (ucap_in, ucap_out).
*
* @return string|null The userId
*/
@ -679,7 +681,7 @@ class PstnCallLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userId
* Calling user's ID in Graph. GUID. This and other user info will be null/empty for bot call types (ucap_in, ucap_out).
* The unique identifier (GUID) of the user in Azure Active Directory. This and other user info will be null/empty for bot call types (ucap_in, ucap_out).
*
* @param string $val The value of the userId
*

View File

@ -25,6 +25,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
{
/**
* Gets the currency
* Currency used to calculate the cost of the call. For details, see ISO 4217.
*
* @return string|null The currency
*/
@ -39,6 +40,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the currency
* Currency used to calculate the cost of the call. For details, see ISO 4217.
*
* @param string $val The value of the currency
*
@ -51,6 +53,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the destinationContext
* Indicates whether the call was Domestic (within a country or region) or International (outside a country or region) based on the user's location.
*
* @return string|null The destinationContext
*/
@ -65,6 +68,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the destinationContext
* Indicates whether the call was Domestic (within a country or region) or International (outside a country or region) based on the user's location.
*
* @param string $val The value of the destinationContext
*
@ -78,6 +82,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the totalCallCharge
* Total costs of all the calls within the selected time range, including call charges and connection fees.
*
* @return \Beta\Microsoft\Graph\Model\Decimal|null The totalCallCharge
*/
@ -96,6 +101,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the totalCallCharge
* Total costs of all the calls within the selected time range, including call charges and connection fees.
*
* @param \Beta\Microsoft\Graph\Model\Decimal $val The value to assign to the totalCallCharge
*
@ -108,6 +114,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the totalCalls
* Total number of dial-out calls within the selected time range.
*
* @return int|null The totalCalls
*/
@ -122,6 +129,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the totalCalls
* Total number of dial-out calls within the selected time range.
*
* @param int $val The value of the totalCalls
*
@ -134,6 +142,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the totalCallSeconds
* Total duration of all the calls within the selected time range, in seconds.
*
* @return int|null The totalCallSeconds
*/
@ -148,6 +157,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the totalCallSeconds
* Total duration of all the calls within the selected time range, in seconds.
*
* @param int $val The value of the totalCallSeconds
*
@ -160,6 +170,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the usageLocation
* Country code of the user. For details, see ISO 3166-1 alpha-2.
*
* @return string|null The usageLocation
*/
@ -174,6 +185,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the usageLocation
* Country code of the user. For details, see ISO 3166-1 alpha-2.
*
* @param string $val The value of the usageLocation
*
@ -186,6 +198,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userDisplayName
* Display name of the user.
*
* @return string|null The userDisplayName
*/
@ -200,6 +213,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userDisplayName
* Display name of the user.
*
* @param string $val The value of the userDisplayName
*
@ -212,6 +226,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userId
* The unique identifier (GUID) of the user in Azure Active Directory.
*
* @return string|null The userId
*/
@ -226,6 +241,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userId
* The unique identifier (GUID) of the user in Azure Active Directory.
*
* @param string $val The value of the userId
*
@ -238,6 +254,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userPrincipalName
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @return string|null The userPrincipalName
*/
@ -252,6 +269,7 @@ class PstnOnlineMeetingDialoutReport extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userPrincipalName
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @param string $val The value of the userPrincipalName
*

View File

@ -156,6 +156,35 @@ class Session extends \Beta\Microsoft\Graph\Model\Entity
return $this;
}
/**
* Gets the isTest
* Specifies whether the session is a test.
*
* @return bool|null The isTest
*/
public function getIsTest()
{
if (array_key_exists("isTest", $this->_propDict)) {
return $this->_propDict["isTest"];
} else {
return null;
}
}
/**
* Sets the isTest
* Specifies whether the session is a test.
*
* @param bool $val The isTest
*
* @return Session
*/
public function setIsTest($val)
{
$this->_propDict["isTest"] = boolval($val);
return $this;
}
/**
* Gets the modalities

View File

@ -26,6 +26,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the callCharge
* Amount of money or cost of the SMS that is charged.
*
* @return \Beta\Microsoft\Graph\Model\Decimal|null The callCharge
*/
@ -44,6 +45,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the callCharge
* Amount of money or cost of the SMS that is charged.
*
* @param \Beta\Microsoft\Graph\Model\Decimal $val The value to assign to the callCharge
*
@ -56,6 +58,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the currency
* Currency used to calculate the cost of the call. For details, see ISO 4217.
*
* @return string|null The currency
*/
@ -70,6 +73,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the currency
* Currency used to calculate the cost of the call. For details, see ISO 4217.
*
* @param string $val The value of the currency
*
@ -82,6 +86,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the destinationContext
* Indicates whether the SMS was Domestic (within a country or region) or International (outside a country or region) based on the user's location.
*
* @return string|null The destinationContext
*/
@ -96,6 +101,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the destinationContext
* Indicates whether the SMS was Domestic (within a country or region) or International (outside a country or region) based on the user's location.
*
* @param string $val The value of the destinationContext
*
@ -108,6 +114,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the destinationName
* Country or region of a phone number that received the SMS.
*
* @return string|null The destinationName
*/
@ -122,6 +129,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the destinationName
* Country or region of a phone number that received the SMS.
*
* @param string $val The value of the destinationName
*
@ -134,6 +142,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the destinationNumber
* Partially obfuscated phone number that received the SMS. For details, see E.164.
*
* @return string|null The destinationNumber
*/
@ -148,6 +157,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the destinationNumber
* Partially obfuscated phone number that received the SMS. For details, see E.164.
*
* @param string $val The value of the destinationNumber
*
@ -160,6 +170,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the id
* Unique identifier (GUID) for the SMS.
*
* @return string|null The id
*/
@ -174,6 +185,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the id
* Unique identifier (GUID) for the SMS.
*
* @param string $val The value of the id
*
@ -186,6 +198,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the licenseCapability
* The license used for the SMS.
*
* @return string|null The licenseCapability
*/
@ -200,6 +213,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the licenseCapability
* The license used for the SMS.
*
* @param string $val The value of the licenseCapability
*
@ -212,6 +226,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the otherPartyCountryCode
* For an outbound SMS, the country code of the receiver; otherwise (inbound SMS) the country code of the sender. For details, see ISO 3166-1 alpha-2.
*
* @return string|null The otherPartyCountryCode
*/
@ -226,6 +241,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the otherPartyCountryCode
* For an outbound SMS, the country code of the receiver; otherwise (inbound SMS) the country code of the sender. For details, see ISO 3166-1 alpha-2.
*
* @param string $val The value of the otherPartyCountryCode
*
@ -239,6 +255,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the sentDateTime
* The date and time when the SMS was sent.
*
* @return \DateTime|null The sentDateTime
*/
@ -257,6 +274,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the sentDateTime
* The date and time when the SMS was sent.
*
* @param \DateTime $val The value to assign to the sentDateTime
*
@ -269,6 +287,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the smsId
* SMS identifier. Not guaranteed to be unique.
*
* @return string|null The smsId
*/
@ -283,6 +302,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the smsId
* SMS identifier. Not guaranteed to be unique.
*
* @param string $val The value of the smsId
*
@ -295,6 +315,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the smsType
* Type of SMS such as outbound or inbound.
*
* @return string|null The smsType
*/
@ -309,6 +330,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the smsType
* Type of SMS such as outbound or inbound.
*
* @param string $val The value of the smsType
*
@ -321,6 +343,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the smsUnits
* Number of SMS units sent/received.
*
* @return int|null The smsUnits
*/
@ -335,6 +358,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the smsUnits
* Number of SMS units sent/received.
*
* @param int $val The value of the smsUnits
*
@ -347,6 +371,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the sourceNumber
* Partially obfuscated phone number that sent the SMS. For details, see E.164.
*
* @return string|null The sourceNumber
*/
@ -361,6 +386,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the sourceNumber
* Partially obfuscated phone number that sent the SMS. For details, see E.164.
*
* @param string $val The value of the sourceNumber
*
@ -373,6 +399,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the tenantCountryCode
* Country code of the tenant. For details, see ISO 3166-1 alpha-2.
*
* @return string|null The tenantCountryCode
*/
@ -387,6 +414,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the tenantCountryCode
* Country code of the tenant. For details, see ISO 3166-1 alpha-2.
*
* @param string $val The value of the tenantCountryCode
*
@ -399,6 +427,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userCountryCode
* Country code of the user. For details, see ISO 3166-1 alpha-2.
*
* @return string|null The userCountryCode
*/
@ -413,6 +442,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userCountryCode
* Country code of the user. For details, see ISO 3166-1 alpha-2.
*
* @param string $val The value of the userCountryCode
*
@ -425,6 +455,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userDisplayName
* Display name of the user.
*
* @return string|null The userDisplayName
*/
@ -439,6 +470,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userDisplayName
* Display name of the user.
*
* @param string $val The value of the userDisplayName
*
@ -451,6 +483,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userId
* The unique identifier (GUID) of the user in Azure Active Directory.
*
* @return string|null The userId
*/
@ -465,6 +498,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userId
* The unique identifier (GUID) of the user in Azure Active Directory.
*
* @param string $val The value of the userId
*
@ -477,6 +511,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
}
/**
* Gets the userPrincipalName
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @return string|null The userPrincipalName
*/
@ -491,6 +526,7 @@ class SmsLogRow extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the userPrincipalName
* The user principal name (sign-in name) in Azure Active Directory. This is usually the same as the user's SIP address, and can be same as the user's e-mail address.
*
* @param string $val The value of the userPrincipalName
*

View File

@ -26,7 +26,7 @@ class ExternalActivity extends \Beta\Microsoft\Graph\Model\Entity
{
/**
* Gets the startDateTime
* When the particular activity occurred.
* The date and time when the particular activity occurred. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
*
* @return \DateTime|null The startDateTime
*/
@ -45,7 +45,7 @@ class ExternalActivity extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the startDateTime
* When the particular activity occurred.
* The date and time when the particular activity occurred. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
*
* @param \DateTime $val The startDateTime
*

View File

@ -26,7 +26,7 @@ class ExternalActivityResult extends ExternalActivity
{
/**
* Gets the error
* Error information explaining failure to process external activity.
* Error information that explains the failure to process an external activity.
*
* @return \Beta\Microsoft\Graph\Model\PublicError|null The error
*/
@ -45,7 +45,7 @@ class ExternalActivityResult extends ExternalActivity
/**
* Sets the error
* Error information explaining failure to process external activity.
* Error information that explains the failure to process an external activity.
*
* @param \Beta\Microsoft\Graph\Model\PublicError $val The error
*

View File

@ -123,7 +123,7 @@ class ExternalItem extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the activities
* Write-only property. Returns results.
* Returns a list of activities performed on the item. Write-only.
*
* @return array|null The activities
*/
@ -138,7 +138,7 @@ class ExternalItem extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the activities
* Write-only property. Returns results.
* Returns a list of activities performed on the item. Write-only.
*
* @param ExternalActivity[] $val The activities
*

View File

@ -26,6 +26,7 @@ class Identity extends \Beta\Microsoft\Graph\Model\Entity
{
/**
* Gets the type
* The type of identity. Possible values are: user or group for Azure AD identities and externalgroup for groups in an external system.
*
* @return IdentityType|null The type
*/
@ -44,6 +45,7 @@ class Identity extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the type
* The type of identity. Possible values are: user or group for Azure AD identities and externalgroup for groups in an external system.
*
* @param IdentityType $val The type
*

View File

@ -0,0 +1,37 @@
<?php
/**
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
*
* ImportanceScore File
* PHP version 7
*
* @category Library
* @package Microsoft.Graph
* @copyright (c) Microsoft Corporation. All rights reserved.
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
namespace Beta\Microsoft\Graph\ExternalConnectors\Model;
use Microsoft\Graph\Core\Enum;
/**
* ImportanceScore class
*
* @category Model
* @package Microsoft.Graph
* @copyright (c) Microsoft Corporation. All rights reserved.
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class ImportanceScore extends Enum
{
/**
* The Enum ImportanceScore
*/
const LOW = "low";
const MEDIUM = "medium";
const HIGH = "high";
const VERY_HIGH = "veryHigh";
const UNKNOWN_FUTURE_VALUE = "unknownFutureValue";
}

View File

@ -253,6 +253,39 @@ class Property extends \Beta\Microsoft\Graph\Model\Entity
return $this;
}
/**
* Gets the rankingHint
* Specifies the property ranking hint. Developers can specify which properties are most important, allowing Microsoft Search to determine the search relevance of the content.
*
* @return RankingHint|null The rankingHint
*/
public function getRankingHint()
{
if (array_key_exists("rankingHint", $this->_propDict)) {
if (is_a($this->_propDict["rankingHint"], "\Beta\Microsoft\Graph\ExternalConnectors\Model\RankingHint") || is_null($this->_propDict["rankingHint"])) {
return $this->_propDict["rankingHint"];
} else {
$this->_propDict["rankingHint"] = new RankingHint($this->_propDict["rankingHint"]);
return $this->_propDict["rankingHint"];
}
}
return null;
}
/**
* Sets the rankingHint
* Specifies the property ranking hint. Developers can specify which properties are most important, allowing Microsoft Search to determine the search relevance of the content.
*
* @param RankingHint $val The value to assign to the rankingHint
*
* @return Property The Property
*/
public function setRankingHint($val)
{
$this->_propDict["rankingHint"] = $val;
return $this;
}
/**
* Gets the type
* The data type of the property. Possible values are: string, int64, double, dateTime, boolean, stringCollection, int64Collection, doubleCollection, dateTimeCollection, unknownFutureValue. Required.

View File

@ -26,7 +26,7 @@ class PropertyRule extends \Beta\Microsoft\Graph\Model\Entity
/**
* Gets the operation
* Specifies the operations to be performed during evaluation of a single propertyRule, where property and a string from the values collection are the respective operands. Possible values are: null, equals, notEquals, contains, notContains, lessThan, greaterThan, startsWith, unknownFutureValue. Required.
* Specifies the operations to be performed during evaluation of a single propertyRule, where property and a string from the values collection are the respective operands. Possible values are: null, equals, notEquals, contains, notContains, lessThan, greaterThan, startsWith. Required.
*
* @return RuleOperation|null The operation
*/
@ -45,7 +45,7 @@ class PropertyRule extends \Beta\Microsoft\Graph\Model\Entity
/**
* Sets the operation
* Specifies the operations to be performed during evaluation of a single propertyRule, where property and a string from the values collection are the respective operands. Possible values are: null, equals, notEquals, contains, notContains, lessThan, greaterThan, startsWith, unknownFutureValue. Required.
* Specifies the operations to be performed during evaluation of a single propertyRule, where property and a string from the values collection are the respective operands. Possible values are: null, equals, notEquals, contains, notContains, lessThan, greaterThan, startsWith. Required.
*
* @param RuleOperation $val The value to assign to the operation
*

View File

@ -0,0 +1,59 @@
<?php
/**
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
*
* RankingHint File
* PHP version 7
*
* @category Library
* @package Microsoft.Graph
* @copyright (c) Microsoft Corporation. All rights reserved.
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
namespace Beta\Microsoft\Graph\ExternalConnectors\Model;
/**
* RankingHint class
*
* @category Model
* @package Microsoft.Graph
* @copyright (c) Microsoft Corporation. All rights reserved.
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class RankingHint extends \Beta\Microsoft\Graph\Model\Entity
{
/**
* Gets the importanceScore
* Specifies the schema property importance. Possible values are: low, medium, high, veryHigh, unknownFutureValue. Required.
*
* @return ImportanceScore|null The importanceScore
*/
public function getImportanceScore()
{
if (array_key_exists("importanceScore", $this->_propDict)) {
if (is_a($this->_propDict["importanceScore"], "\Beta\Microsoft\Graph\ExternalConnectors\Model\ImportanceScore") || is_null($this->_propDict["importanceScore"])) {
return $this->_propDict["importanceScore"];
} else {
$this->_propDict["importanceScore"] = new ImportanceScore($this->_propDict["importanceScore"]);
return $this->_propDict["importanceScore"];
}
}
return null;
}
/**
* Sets the importanceScore
* Specifies the schema property importance. Possible values are: low, medium, high, veryHigh, unknownFutureValue. Required.
*
* @param ImportanceScore $val The value to assign to the importanceScore
*
* @return RankingHint The RankingHint
*/
public function setImportanceScore($val)
{
$this->_propDict["importanceScore"] = $val;
return $this;
}
}

View File

@ -26,7 +26,7 @@ class CustomTaskExtension extends \Beta\Microsoft\Graph\Model\CustomCalloutExten
{
/**
* Gets the callbackConfiguration
* The callback configuration for a custom extension.
* The callback configuration for a custom task extension.
*
* @return \Beta\Microsoft\Graph\Model\CustomExtensionCallbackConfiguration|null The callbackConfiguration
*/
@ -45,7 +45,7 @@ class CustomTaskExtension extends \Beta\Microsoft\Graph\Model\CustomCalloutExten
/**
* Sets the callbackConfiguration
* The callback configuration for a custom extension.
* The callback configuration for a custom task extension.
*
* @param \Beta\Microsoft\Graph\Model\CustomExtensionCallbackConfiguration $val The callbackConfiguration
*

View File

@ -32,4 +32,5 @@ class LifecycleTaskCategory extends Enum
const JOINER = "joiner";
const LEAVER = "leaver";
const UNKNOWN_FUTURE_VALUE = "unknownFutureValue";
const MOVER = "mover";
}

View File

@ -32,4 +32,5 @@ class LifecycleWorkflowCategory extends Enum
const JOINER = "joiner";
const LEAVER = "leaver";
const UNKNOWN_FUTURE_VALUE = "unknownFutureValue";
const MOVER = "mover";
}

View File

@ -25,7 +25,7 @@ class TimeBasedAttributeTrigger extends WorkflowExecutionTrigger
{
/**
* Gets the offsetInDays
* How many days before or after the time-based attribute specified the workflow should trigger. For example, if the attribute is employeeHireDate and offsetInDays is -1, then the workflow should trigger one day before the employee hire date. The value can range between -60 and 60 days.
* How many days before or after the time-based attribute specified the workflow should trigger. For example, if the attribute is employeeHireDate and offsetInDays is -1, then the workflow should trigger one day before the employee hire date. The value can range between -180 and 180 days.
*
* @return int|null The offsetInDays
*/
@ -40,7 +40,7 @@ class TimeBasedAttributeTrigger extends WorkflowExecutionTrigger
/**
* Sets the offsetInDays
* How many days before or after the time-based attribute specified the workflow should trigger. For example, if the attribute is employeeHireDate and offsetInDays is -1, then the workflow should trigger one day before the employee hire date. The value can range between -60 and 60 days.
* How many days before or after the time-based attribute specified the workflow should trigger. For example, if the attribute is employeeHireDate and offsetInDays is -1, then the workflow should trigger one day before the employee hire date. The value can range between -180 and 180 days.
*
* @param int $val The value of the offsetInDays
*

View File

@ -168,7 +168,7 @@ class Workflow extends WorkflowBase
* Sets the executionScope
* The unique identifier of the Azure AD identity that last modified the workflow object.
*
* @param \Beta\Microsoft\Graph\Model\User[] $val The executionScope
* @param UserProcessingResult[] $val The executionScope
*
* @return Workflow
*/

View File

@ -32,4 +32,5 @@ class WorkflowTriggerTimeBasedAttribute extends Enum
const EMPLOYEE_HIRE_DATE = "employeeHireDate";
const EMPLOYEE_LEAVE_DATE_TIME = "employeeLeaveDateTime";
const UNKNOWN_FUTURE_VALUE = "unknownFutureValue";
const CREATED_DATE_TIME = "createdDateTime";
}

View File

@ -451,6 +451,39 @@ class AccessPackageAssignmentPolicy extends Entity
return $this;
}
/**
* Gets the verifiableCredentialSettings
* Settings for verifiable credentials set up through the Azure AD Verified ID service. These settings represent the verifiable credentials that a requestor of an access package in this policy can present to be assigned the access package.
*
* @return VerifiableCredentialSettings|null The verifiableCredentialSettings
*/
public function getVerifiableCredentialSettings()
{
if (array_key_exists("verifiableCredentialSettings", $this->_propDict)) {
if (is_a($this->_propDict["verifiableCredentialSettings"], "\Beta\Microsoft\Graph\Model\VerifiableCredentialSettings") || is_null($this->_propDict["verifiableCredentialSettings"])) {
return $this->_propDict["verifiableCredentialSettings"];
} else {
$this->_propDict["verifiableCredentialSettings"] = new VerifiableCredentialSettings($this->_propDict["verifiableCredentialSettings"]);
return $this->_propDict["verifiableCredentialSettings"];
}
}
return null;
}
/**
* Sets the verifiableCredentialSettings
* Settings for verifiable credentials set up through the Azure AD Verified ID service. These settings represent the verifiable credentials that a requestor of an access package in this policy can present to be assigned the access package.
*
* @param VerifiableCredentialSettings $val The verifiableCredentialSettings
*
* @return AccessPackageAssignmentPolicy
*/
public function setVerifiableCredentialSettings($val)
{
$this->_propDict["verifiableCredentialSettings"] = $val;
return $this;
}
/**
* Gets the accessPackage
* The access package with this policy. Read-only. Nullable. Supports $expand.

View File

@ -389,6 +389,36 @@ class AccessPackageAssignmentRequest extends Entity
return $this;
}
/**
* Gets the verifiedCredentialsData
* The details of the verifiable credential that was presented by the requestor, such as the issuer and claims. Read-only.
*
* @return array|null The verifiedCredentialsData
*/
public function getVerifiedCredentialsData()
{
if (array_key_exists("verifiedCredentialsData", $this->_propDict)) {
return $this->_propDict["verifiedCredentialsData"];
} else {
return null;
}
}
/**
* Sets the verifiedCredentialsData
* The details of the verifiable credential that was presented by the requestor, such as the issuer and claims. Read-only.
*
* @param VerifiedCredentialData[] $val The verifiedCredentialsData
*
* @return AccessPackageAssignmentRequest
*/
public function setVerifiedCredentialsData($val)
{
$this->_propDict["verifiedCredentialsData"] = $val;
return $this;
}
/**
* Gets the accessPackage
* The access package associated with the accessPackageAssignmentRequest. An access package defines the collections of resource roles and the policies for how one or more users can get access to those resources. Read-only. Nullable. Supports $expand.

View File

@ -318,4 +318,37 @@ class AccessPackageAssignmentRequestRequirements extends Entity
$this->_propDict["schedule"] = $val;
return $this;
}
/**
* Gets the verifiableCredentialRequirementStatus
* The status of the process to process the verifiable credential, if any.
*
* @return VerifiableCredentialRequirementStatus|null The verifiableCredentialRequirementStatus
*/
public function getVerifiableCredentialRequirementStatus()
{
if (array_key_exists("verifiableCredentialRequirementStatus", $this->_propDict)) {
if (is_a($this->_propDict["verifiableCredentialRequirementStatus"], "\Beta\Microsoft\Graph\Model\VerifiableCredentialRequirementStatus") || is_null($this->_propDict["verifiableCredentialRequirementStatus"])) {
return $this->_propDict["verifiableCredentialRequirementStatus"];
} else {
$this->_propDict["verifiableCredentialRequirementStatus"] = new VerifiableCredentialRequirementStatus($this->_propDict["verifiableCredentialRequirementStatus"]);
return $this->_propDict["verifiableCredentialRequirementStatus"];
}
}
return null;
}
/**
* Sets the verifiableCredentialRequirementStatus
* The status of the process to process the verifiable credential, if any.
*
* @param VerifiableCredentialRequirementStatus $val The value to assign to the verifiableCredentialRequirementStatus
*
* @return AccessPackageAssignmentRequestRequirements The AccessPackageAssignmentRequestRequirements
*/
public function setVerifiableCredentialRequirementStatus($val)
{
$this->_propDict["verifiableCredentialRequirementStatus"] = $val;
return $this;
}
}

View File

@ -25,6 +25,7 @@ class AccessReviewInstanceDecisionItemServicePrincipalResource extends AccessRev
{
/**
* Gets the appId
* The globally unique identifier of the application to which access has been granted.
*
* @return string|null The appId
*/
@ -39,6 +40,7 @@ class AccessReviewInstanceDecisionItemServicePrincipalResource extends AccessRev
/**
* Sets the appId
* The globally unique identifier of the application to which access has been granted.
*
* @param string $val The value of the appId
*

View File

@ -22,8 +22,39 @@ namespace Beta\Microsoft\Graph\Model;
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class Account extends Entity
class Account implements \JsonSerializable
{
/**
* The array of properties available
* to the model
*
* @var array $_propDict
*/
protected $_propDict;
/**
* Construct a new Account
*
* @param array $propDict A list of properties to set
*/
function __construct($propDict = array())
{
if (!is_array($propDict)) {
$propDict = array();
}
$this->_propDict = $propDict;
}
/**
* Gets the property dictionary of the Account
*
* @return array The list of properties
*/
public function getProperties()
{
return $this->_propDict;
}
/**
* Gets the blocked
*
@ -105,6 +136,33 @@ class Account extends Entity
return $this;
}
/**
* Gets the id
*
* @return string|null The id
*/
public function getId()
{
if (array_key_exists("id", $this->_propDict)) {
return $this->_propDict["id"];
} else {
return null;
}
}
/**
* Sets the id
*
* @param string $val The id
*
* @return Account
*/
public function setId($val)
{
$this->_propDict["id"] = $val;
return $this;
}
/**
* Gets the lastModifiedDateTime
*
@ -190,4 +248,53 @@ class Account extends Entity
return $this;
}
/**
* Gets the ODataType
*
* @return string|null The ODataType
*/
public function getODataType()
{
if (array_key_exists('@odata.type', $this->_propDict)) {
return $this->_propDict["@odata.type"];
}
return null;
}
/**
* Sets the ODataType
*
* @param string $val The ODataType
*
* @return Account
*/
public function setODataType($val)
{
$this->_propDict["@odata.type"] = $val;
return $this;
}
/**
* Serializes the object by property array
* Manually serialize DateTime into RFC3339 format
*
* @return array The list of properties
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$serializableProperties = $this->getProperties();
foreach ($serializableProperties as $property => $val) {
if (is_a($val, "\DateTime")) {
$serializableProperties[$property] = $val->format(\DateTime::RFC3339);
} else if (is_a($val, "\Microsoft\Graph\Core\Enum")) {
$serializableProperties[$property] = $val->value();
} else if (is_a($val, "\Entity")) {
$serializableProperties[$property] = $val->jsonSerialize();
} else if (is_a($val, "\GuzzleHttp\Psr7\Stream")) {
$serializableProperties[$property] = (string) $val;
}
}
return $serializableProperties;
}
}

View File

@ -90,7 +90,6 @@ class Admin implements \JsonSerializable
/**
* Gets the sharepoint
* A container for administrative resources to manage tenant-level settings for SharePoint and OneDrive.
*
* @return Sharepoint|null The sharepoint
*/
@ -109,7 +108,6 @@ class Admin implements \JsonSerializable
/**
* Sets the sharepoint
* A container for administrative resources to manage tenant-level settings for SharePoint and OneDrive.
*
* @param Sharepoint $val The sharepoint
*

View File

@ -84,6 +84,7 @@ class AdministrativeUnit extends DirectoryObject
/**
* Gets the isMemberManagementRestricted
* true if members of this administrative unit should be treated as sensitive, which requires specific permissions to manage. Default value is false. Use this property to define administrative units whose roles don't inherit from tenant-level administrators, and management of individual member objects is limited to administrators scoped to a restricted management administrative unit. Immutable, so cannot be changed later.
*
* @return bool|null The isMemberManagementRestricted
*/
@ -98,6 +99,7 @@ class AdministrativeUnit extends DirectoryObject
/**
* Sets the isMemberManagementRestricted
* true if members of this administrative unit should be treated as sensitive, which requires specific permissions to manage. Default value is false. Use this property to define administrative units whose roles don't inherit from tenant-level administrators, and management of individual member objects is limited to administrators scoped to a restricted management administrative unit. Immutable, so cannot be changed later.
*
* @param bool $val The isMemberManagementRestricted
*

View File

@ -22,8 +22,39 @@ namespace Beta\Microsoft\Graph\Model;
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class AgedAccountsPayable extends Entity
class AgedAccountsPayable implements \JsonSerializable
{
/**
* The array of properties available
* to the model
*
* @var array $_propDict
*/
protected $_propDict;
/**
* Construct a new AgedAccountsPayable
*
* @param array $propDict A list of properties to set
*/
function __construct($propDict = array())
{
if (!is_array($propDict)) {
$propDict = array();
}
$this->_propDict = $propDict;
}
/**
* Gets the property dictionary of the AgedAccountsPayable
*
* @return array The list of properties
*/
public function getProperties()
{
return $this->_propDict;
}
/**
* Gets the agedAsOfDate
*
@ -144,6 +175,33 @@ class AgedAccountsPayable extends Entity
return $this;
}
/**
* Gets the id
*
* @return string|null The id
*/
public function getId()
{
if (array_key_exists("id", $this->_propDict)) {
return $this->_propDict["id"];
} else {
return null;
}
}
/**
* Sets the id
*
* @param string $val The id
*
* @return AgedAccountsPayable
*/
public function setId($val)
{
$this->_propDict["id"] = $val;
return $this;
}
/**
* Gets the name
*
@ -291,6 +349,33 @@ class AgedAccountsPayable extends Entity
return $this;
}
/**
* Gets the vendorId
*
* @return string|null The vendorId
*/
public function getVendorId()
{
if (array_key_exists("vendorId", $this->_propDict)) {
return $this->_propDict["vendorId"];
} else {
return null;
}
}
/**
* Sets the vendorId
*
* @param string $val The vendorId
*
* @return AgedAccountsPayable
*/
public function setVendorId($val)
{
$this->_propDict["vendorId"] = $val;
return $this;
}
/**
* Gets the vendorNumber
*
@ -318,4 +403,53 @@ class AgedAccountsPayable extends Entity
return $this;
}
/**
* Gets the ODataType
*
* @return string|null The ODataType
*/
public function getODataType()
{
if (array_key_exists('@odata.type', $this->_propDict)) {
return $this->_propDict["@odata.type"];
}
return null;
}
/**
* Sets the ODataType
*
* @param string $val The ODataType
*
* @return AgedAccountsPayable
*/
public function setODataType($val)
{
$this->_propDict["@odata.type"] = $val;
return $this;
}
/**
* Serializes the object by property array
* Manually serialize DateTime into RFC3339 format
*
* @return array The list of properties
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$serializableProperties = $this->getProperties();
foreach ($serializableProperties as $property => $val) {
if (is_a($val, "\DateTime")) {
$serializableProperties[$property] = $val->format(\DateTime::RFC3339);
} else if (is_a($val, "\Microsoft\Graph\Core\Enum")) {
$serializableProperties[$property] = $val->value();
} else if (is_a($val, "\Entity")) {
$serializableProperties[$property] = $val->jsonSerialize();
} else if (is_a($val, "\GuzzleHttp\Psr7\Stream")) {
$serializableProperties[$property] = (string) $val;
}
}
return $serializableProperties;
}
}

View File

@ -22,8 +22,39 @@ namespace Beta\Microsoft\Graph\Model;
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class AgedAccountsReceivable extends Entity
class AgedAccountsReceivable implements \JsonSerializable
{
/**
* The array of properties available
* to the model
*
* @var array $_propDict
*/
protected $_propDict;
/**
* Construct a new AgedAccountsReceivable
*
* @param array $propDict A list of properties to set
*/
function __construct($propDict = array())
{
if (!is_array($propDict)) {
$propDict = array();
}
$this->_propDict = $propDict;
}
/**
* Gets the property dictionary of the AgedAccountsReceivable
*
* @return array The list of properties
*/
public function getProperties()
{
return $this->_propDict;
}
/**
* Gets the agedAsOfDate
*
@ -144,6 +175,33 @@ class AgedAccountsReceivable extends Entity
return $this;
}
/**
* Gets the customerId
*
* @return string|null The customerId
*/
public function getCustomerId()
{
if (array_key_exists("customerId", $this->_propDict)) {
return $this->_propDict["customerId"];
} else {
return null;
}
}
/**
* Sets the customerId
*
* @param string $val The customerId
*
* @return AgedAccountsReceivable
*/
public function setCustomerId($val)
{
$this->_propDict["customerId"] = $val;
return $this;
}
/**
* Gets the customerNumber
*
@ -171,6 +229,33 @@ class AgedAccountsReceivable extends Entity
return $this;
}
/**
* Gets the id
*
* @return string|null The id
*/
public function getId()
{
if (array_key_exists("id", $this->_propDict)) {
return $this->_propDict["id"];
} else {
return null;
}
}
/**
* Sets the id
*
* @param string $val The id
*
* @return AgedAccountsReceivable
*/
public function setId($val)
{
$this->_propDict["id"] = $val;
return $this;
}
/**
* Gets the name
*
@ -318,4 +403,53 @@ class AgedAccountsReceivable extends Entity
return $this;
}
/**
* Gets the ODataType
*
* @return string|null The ODataType
*/
public function getODataType()
{
if (array_key_exists('@odata.type', $this->_propDict)) {
return $this->_propDict["@odata.type"];
}
return null;
}
/**
* Sets the ODataType
*
* @param string $val The ODataType
*
* @return AgedAccountsReceivable
*/
public function setODataType($val)
{
$this->_propDict["@odata.type"] = $val;
return $this;
}
/**
* Serializes the object by property array
* Manually serialize DateTime into RFC3339 format
*
* @return array The list of properties
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$serializableProperties = $this->getProperties();
foreach ($serializableProperties as $property => $val) {
if (is_a($val, "\DateTime")) {
$serializableProperties[$property] = $val->format(\DateTime::RFC3339);
} else if (is_a($val, "\Microsoft\Graph\Core\Enum")) {
$serializableProperties[$property] = $val->value();
} else if (is_a($val, "\Entity")) {
$serializableProperties[$property] = $val->jsonSerialize();
} else if (is_a($val, "\GuzzleHttp\Psr7\Stream")) {
$serializableProperties[$property] = (string) $val;
}
}
return $serializableProperties;
}
}

View File

@ -23,6 +23,39 @@ namespace Beta\Microsoft\Graph\Model;
*/
class AndroidFotaDeploymentAssignment extends Entity
{
/**
* Gets the assignmentTarget
* The Azure Active Directory (Azure AD) we are deploying firmware updates to (e.g.: d93c8f48-bd42-4514-ba40-bc6b84780930). NOTE: Use this property moving forward because the existing property, target, is deprecated.
*
* @return DeviceAndAppManagementAssignmentTarget|null The assignmentTarget
*/
public function getAssignmentTarget()
{
if (array_key_exists("assignmentTarget", $this->_propDict)) {
if (is_a($this->_propDict["assignmentTarget"], "\Beta\Microsoft\Graph\Model\DeviceAndAppManagementAssignmentTarget") || is_null($this->_propDict["assignmentTarget"])) {
return $this->_propDict["assignmentTarget"];
} else {
$this->_propDict["assignmentTarget"] = new DeviceAndAppManagementAssignmentTarget($this->_propDict["assignmentTarget"]);
return $this->_propDict["assignmentTarget"];
}
}
return null;
}
/**
* Sets the assignmentTarget
* The Azure Active Directory (Azure AD) we are deploying firmware updates to (e.g.: d93c8f48-bd42-4514-ba40-bc6b84780930). NOTE: Use this property moving forward because the existing property, target, is deprecated.
*
* @param DeviceAndAppManagementAssignmentTarget $val The value to assign to the assignmentTarget
*
* @return AndroidFotaDeploymentAssignment The AndroidFotaDeploymentAssignment
*/
public function setAssignmentTarget($val)
{
$this->_propDict["assignmentTarget"] = $val;
return $this;
}
/**
* Gets the displayName
* The display name of the Azure AD security group used for the assignment.

View File

@ -21,8 +21,19 @@ namespace Beta\Microsoft\Graph\Model;
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class AndroidFotaDeploymentAssignmentTarget extends Entity
class AndroidFotaDeploymentAssignmentTarget extends DeviceAndAppManagementAssignmentTarget
{
/**
* Set the @odata.type since this type is immediately descended from an abstract
* type that is referenced as the type in an entity.
* @param array $propDict The property dictionary
*/
public function __construct($propDict = array())
{
parent::__construct($propDict);
$this->setODataType("#microsoft.graph.androidFotaDeploymentAssignmentTarget");
}
/**
* Gets the groupId
* AAD Group Id.

View File

@ -82,6 +82,39 @@ class AndroidManagedAppProtection extends TargetedManagedAppProtection
return $this;
}
/**
* Gets the appActionIfAccountIsClockedOut
* Defines a managed app behavior, either block or warn, if the user is clocked out (non-working time).
*
* @return ManagedAppRemediationAction|null The appActionIfAccountIsClockedOut
*/
public function getAppActionIfAccountIsClockedOut()
{
if (array_key_exists("appActionIfAccountIsClockedOut", $this->_propDict)) {
if (is_a($this->_propDict["appActionIfAccountIsClockedOut"], "\Beta\Microsoft\Graph\Model\ManagedAppRemediationAction") || is_null($this->_propDict["appActionIfAccountIsClockedOut"])) {
return $this->_propDict["appActionIfAccountIsClockedOut"];
} else {
$this->_propDict["appActionIfAccountIsClockedOut"] = new ManagedAppRemediationAction($this->_propDict["appActionIfAccountIsClockedOut"]);
return $this->_propDict["appActionIfAccountIsClockedOut"];
}
}
return null;
}
/**
* Sets the appActionIfAccountIsClockedOut
* Defines a managed app behavior, either block or warn, if the user is clocked out (non-working time).
*
* @param ManagedAppRemediationAction $val The appActionIfAccountIsClockedOut
*
* @return AndroidManagedAppProtection
*/
public function setAppActionIfAccountIsClockedOut($val)
{
$this->_propDict["appActionIfAccountIsClockedOut"] = $val;
return $this;
}
/**
* Gets the appActionIfAndroidDeviceManufacturerNotAllowed
* Defines a managed app behavior, either block or wipe, if the specified device manufacturer is not allowed. Possible values are: block, wipe, warn.

View File

@ -30,5 +30,6 @@ class AppKeyCredentialRestrictionType extends Enum
* The Enum AppKeyCredentialRestrictionType
*/
const ASYMMETRIC_KEY_LIFETIME = "asymmetricKeyLifetime";
const TRUSTED_CERTIFICATE_AUTHORITY = "trustedCertificateAuthority";
const UNKNOWN_FUTURE_VALUE = "unknownFutureValue";
}

View File

@ -26,6 +26,7 @@ class AppManagementPolicy extends PolicyBase
{
/**
* Gets the isEnabled
* Denotes whether the policy is enabled.
*
* @return bool|null The isEnabled
*/
@ -40,6 +41,7 @@ class AppManagementPolicy extends PolicyBase
/**
* Sets the isEnabled
* Denotes whether the policy is enabled.
*
* @param bool $val The isEnabled
*
@ -53,6 +55,7 @@ class AppManagementPolicy extends PolicyBase
/**
* Gets the restrictions
* Restrictions that apply to an application or service principal object.
*
* @return AppManagementConfiguration|null The restrictions
*/
@ -71,6 +74,7 @@ class AppManagementPolicy extends PolicyBase
/**
* Sets the restrictions
* Restrictions that apply to an application or service principal object.
*
* @param AppManagementConfiguration $val The restrictions
*
@ -85,6 +89,7 @@ class AppManagementPolicy extends PolicyBase
/**
* Gets the appliesTo
* Collection of application and service principals to which a policy is applied.
*
* @return array|null The appliesTo
*/
@ -99,6 +104,7 @@ class AppManagementPolicy extends PolicyBase
/**
* Sets the appliesTo
* Collection of application and service principals to which a policy is applied.
*
* @param DirectoryObject[] $val The appliesTo
*

View File

@ -116,6 +116,37 @@ class Application extends DirectoryObject
return $this;
}
/**
* Gets the authenticationBehaviors
*
* @return AuthenticationBehaviors|null The authenticationBehaviors
*/
public function getAuthenticationBehaviors()
{
if (array_key_exists("authenticationBehaviors", $this->_propDict)) {
if (is_a($this->_propDict["authenticationBehaviors"], "\Beta\Microsoft\Graph\Model\AuthenticationBehaviors") || is_null($this->_propDict["authenticationBehaviors"])) {
return $this->_propDict["authenticationBehaviors"];
} else {
$this->_propDict["authenticationBehaviors"] = new AuthenticationBehaviors($this->_propDict["authenticationBehaviors"]);
return $this->_propDict["authenticationBehaviors"];
}
}
return null;
}
/**
* Sets the authenticationBehaviors
*
* @param AuthenticationBehaviors $val The authenticationBehaviors
*
* @return Application
*/
public function setAuthenticationBehaviors($val)
{
$this->_propDict["authenticationBehaviors"] = $val;
return $this;
}
/**
* Gets the certification
* Specifies the certification status of the application.
@ -915,7 +946,7 @@ class Application extends DirectoryObject
/**
* Gets the tags
* Custom strings that can be used to categorize and identify the application. Not nullable. Strings added here will also appear in the tags property of any associated service principals.Supports $filter (eq, not, ge, le, startsWith).
* Custom strings that can be used to categorize and identify the application. Not nullable. Strings added here will also appear in the tags property of any associated service principals.Supports $filter (eq, not, ge, le, startsWith) and $search.
*
* @return array|null The tags
*/
@ -930,7 +961,7 @@ class Application extends DirectoryObject
/**
* Sets the tags
* Custom strings that can be used to categorize and identify the application. Not nullable. Strings added here will also appear in the tags property of any associated service principals.Supports $filter (eq, not, ge, le, startsWith).
* Custom strings that can be used to categorize and identify the application. Not nullable. Strings added here will also appear in the tags property of any associated service principals.Supports $filter (eq, not, ge, le, startsWith) and $search.
*
* @param string[] $val The tags
*

View File

@ -26,7 +26,7 @@ class AppliedAuthenticationEventListener extends Entity
/**
* Gets the eventType
* The type of authentication event that triggered the custom extension request. The possible values are: tokenIssuanceStart, pageRenderStart, unknownFutureValue.
* The type of authentication event that triggered the custom authentication extension request. The possible values are: tokenIssuanceStart, pageRenderStart, unknownFutureValue.
*
* @return AuthenticationEventType|null The eventType
*/
@ -45,7 +45,7 @@ class AppliedAuthenticationEventListener extends Entity
/**
* Sets the eventType
* The type of authentication event that triggered the custom extension request. The possible values are: tokenIssuanceStart, pageRenderStart, unknownFutureValue.
* The type of authentication event that triggered the custom authentication extension request. The possible values are: tokenIssuanceStart, pageRenderStart, unknownFutureValue.
*
* @param AuthenticationEventType $val The value to assign to the eventType
*
@ -58,7 +58,7 @@ class AppliedAuthenticationEventListener extends Entity
}
/**
* Gets the executedListenerId
* ID of the Event Listener that was executed.
* ID of the authentication event listener that was executed.
*
* @return string|null The executedListenerId
*/
@ -73,7 +73,7 @@ class AppliedAuthenticationEventListener extends Entity
/**
* Sets the executedListenerId
* ID of the Event Listener that was executed.
* ID of the authentication event listener that was executed.
*
* @param string $val The value of the executedListenerId
*

View File

@ -27,6 +27,7 @@ class Approval extends Entity
/**
* Gets the steps
* Used to represent the decision associated with a single step in the approval process configured in approvalStage.
*
* @return array|null The steps
*/
@ -41,6 +42,7 @@ class Approval extends Entity
/**
* Sets the steps
* Used to represent the decision associated with a single step in the approval process configured in approvalStage.
*
* @param ApprovalStep[] $val The steps
*

View File

@ -54,7 +54,7 @@ class AssignmentFilterEvaluateRequest extends Entity
/**
* Gets the platform
* Platform type of the devices on which the Assignment Filter will be applicable. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP.
* Platform type of the devices on which the Assignment Filter will be applicable. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP, androidMobileApplicationManagement, iOSMobileApplicationManagement, unknownFutureValue.
*
* @return DevicePlatformType|null The platform
*/
@ -73,7 +73,7 @@ class AssignmentFilterEvaluateRequest extends Entity
/**
* Sets the platform
* Platform type of the devices on which the Assignment Filter will be applicable. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP.
* Platform type of the devices on which the Assignment Filter will be applicable. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP, androidMobileApplicationManagement, iOSMobileApplicationManagement, unknownFutureValue.
*
* @param DevicePlatformType $val The value to assign to the platform
*

View File

@ -115,7 +115,7 @@ class AssignmentFilterEvaluationSummary extends Entity
/**
* Gets the assignmentFilterPlatform
* The platform for which this assignment filter is created. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP.
* The platform for which this assignment filter is created. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP, androidMobileApplicationManagement, iOSMobileApplicationManagement, unknownFutureValue.
*
* @return DevicePlatformType|null The assignmentFilterPlatform
*/
@ -134,7 +134,7 @@ class AssignmentFilterEvaluationSummary extends Entity
/**
* Sets the assignmentFilterPlatform
* The platform for which this assignment filter is created. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP.
* The platform for which this assignment filter is created. Possible values are: android, androidForWork, iOS, macOS, windowsPhone81, windows81AndLater, windows10AndLater, androidWorkProfile, unknown, androidAOSP, androidMobileApplicationManagement, iOSMobileApplicationManagement, unknownFutureValue.
*
* @param DevicePlatformType $val The value to assign to the assignmentFilterPlatform
*

View File

@ -0,0 +1,35 @@
<?php
/**
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
*
* AssignmentFilterManagementType File
* PHP version 7
*
* @category Library
* @package Microsoft.Graph
* @copyright (c) Microsoft Corporation. All rights reserved.
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
namespace Beta\Microsoft\Graph\Model;
use Microsoft\Graph\Core\Enum;
/**
* AssignmentFilterManagementType class
*
* @category Model
* @package Microsoft.Graph
* @copyright (c) Microsoft Corporation. All rights reserved.
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class AssignmentFilterManagementType extends Enum
{
/**
* The Enum AssignmentFilterManagementType
*/
const DEVICES = "devices";
const APPS = "apps";
const UNKNOWN_FUTURE_VALUE = "unknownFutureValue";
}

View File

@ -2,7 +2,7 @@
/**
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
*
* WarrantyType File
* AssignmentType File
* PHP version 7
*
* @category Library
@ -16,7 +16,7 @@ namespace Beta\Microsoft\Graph\Model;
use Microsoft\Graph\Core\Enum;
/**
* WarrantyType class
* AssignmentType class
*
* @category Model
* @package Microsoft.Graph
@ -24,13 +24,12 @@ use Microsoft\Graph\Core\Enum;
* @license https://opensource.org/licenses/MIT MIT License
* @link https://graph.microsoft.com
*/
class WarrantyType extends Enum
class AssignmentType extends Enum
{
/**
* The Enum WarrantyType
* The Enum AssignmentType
*/
const UNKNOWN = "unknown";
const MANUFACTURER = "manufacturer";
const CONTRACTUAL = "contractual";
const REQUIRED = "required";
const RECOMMENDED = "recommended";
const UNKNOWN_FUTURE_VALUE = "unknownFutureValue";
}

Some files were not shown because too many files have changed in this diff Show More