Исправление инициализации и переход на PHP8.1

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2022-10-09 04:12:30 +10:00
parent e0955a2034
commit f6c1d756d2
5 changed files with 228 additions and 250 deletions

View File

@ -16,8 +16,8 @@
}
],
"require": {
"php": "^8.0.0",
"triagens/arangodb": "~3.2"
"php": "^8.1",
"triagens/arangodb": "~3.8"
},
"require-dev": {
"phpunit/phpunit": "^9.3.3"

321
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "eaaa55fa55b698e039ebfa7fe8f51cf0",
"content-hash": "7b95a12116785aae67b9e7288f370919",
"packages": [
{
"name": "triagens/arangodb",
@ -71,29 +71,30 @@
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "1.4.0",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
"reference": "10dcfce151b967d20fde1b34ae6640712c3891bc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc",
"reference": "10dcfce151b967d20fde1b34ae6640712c3891bc",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^8.0",
"doctrine/coding-standard": "^9",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
"phpbench/phpbench": "^0.16 || ^1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.22"
},
"type": "library",
"autoload": {
@ -120,7 +121,7 @@
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
"source": "https://github.com/doctrine/instantiator/tree/1.4.0"
"source": "https://github.com/doctrine/instantiator/tree/1.4.1"
},
"funding": [
{
@ -136,41 +137,42 @@
"type": "tidelift"
}
],
"time": "2020-11-10T18:47:58+00:00"
"time": "2022-03-03T08:28:38+00:00"
},
{
"name": "myclabs/deep-copy",
"version": "1.10.2",
"version": "1.11.0",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220"
"reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220",
"reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614",
"reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"replace": {
"myclabs/deep-copy": "self.version"
"conflict": {
"doctrine/collections": "<1.6.8",
"doctrine/common": "<2.13.3 || >=3,<3.2.2"
},
"require-dev": {
"doctrine/collections": "^1.0",
"doctrine/common": "^2.6",
"phpunit/phpunit": "^7.1"
"doctrine/collections": "^1.6.8",
"doctrine/common": "^2.13.3 || ^3.2.2",
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"type": "library",
"autoload": {
"psr-4": {
"DeepCopy\\": "src/DeepCopy/"
},
"files": [
"src/DeepCopy/deep_copy.php"
]
],
"psr-4": {
"DeepCopy\\": "src/DeepCopy/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -186,7 +188,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.10.2"
"source": "https://github.com/myclabs/DeepCopy/tree/1.11.0"
},
"funding": [
{
@ -194,20 +196,20 @@
"type": "tidelift"
}
],
"time": "2020-11-13T09:40:50+00:00"
"time": "2022-03-03T13:19:32+00:00"
},
{
"name": "nikic/php-parser",
"version": "v4.12.0",
"version": "v4.14.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "6608f01670c3cc5079e18c1dab1104e002579143"
"reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143",
"reference": "6608f01670c3cc5079e18c1dab1104e002579143",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1",
"reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1",
"shasum": ""
},
"require": {
@ -248,9 +250,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0"
"source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0"
},
"time": "2021-07-21T10:44:31+00:00"
"time": "2022-05-31T20:59:12+00:00"
},
{
"name": "phar-io/manifest",
@ -314,16 +316,16 @@
},
{
"name": "phar-io/version",
"version": "3.1.0",
"version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
"reference": "bae7c545bef187884426f042434e561ab1ddb182"
"reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182",
"reference": "bae7c545bef187884426f042434e561ab1ddb182",
"url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"shasum": ""
},
"require": {
@ -359,9 +361,9 @@
"description": "Library for handling version information and constraints",
"support": {
"issues": "https://github.com/phar-io/version/issues",
"source": "https://github.com/phar-io/version/tree/3.1.0"
"source": "https://github.com/phar-io/version/tree/3.2.1"
},
"time": "2021-02-23T14:00:09+00:00"
"time": "2022-02-21T01:04:05+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@ -418,16 +420,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "5.2.2",
"version": "5.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
"reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
"reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
"shasum": ""
},
"require": {
@ -438,7 +440,8 @@
"webmozart/assert": "^1.9.1"
},
"require-dev": {
"mockery/mockery": "~1.3.2"
"mockery/mockery": "~1.3.2",
"psalm/phar": "^4.8"
},
"type": "library",
"extra": {
@ -468,22 +471,22 @@
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
},
"time": "2020-09-03T19:13:55+00:00"
"time": "2021-10-19T17:43:47+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.5.0",
"version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f"
"reference": "77a32518733312af16a44300404e945338981de3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f",
"reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3",
"reference": "77a32518733312af16a44300404e945338981de3",
"shasum": ""
},
"require": {
@ -518,22 +521,22 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1"
},
"time": "2021-09-17T15:28:14+00:00"
"time": "2022-03-15T21:29:03+00:00"
},
{
"name": "phpspec/prophecy",
"version": "1.14.0",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e"
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
"shasum": ""
},
"require": {
@ -585,29 +588,29 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/1.14.0"
"source": "https://github.com/phpspec/prophecy/tree/v1.15.0"
},
"time": "2021-09-10T09:02:12+00:00"
"time": "2021-12-08T12:19:24+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.7",
"version": "9.2.15",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
"reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
"reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f",
"reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.12.0",
"nikic/php-parser": "^4.13.0",
"php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
@ -656,7 +659,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15"
},
"funding": [
{
@ -664,20 +667,20 @@
"type": "github"
}
],
"time": "2021-09-17T05:39:03+00:00"
"time": "2022-03-07T09:28:20+00:00"
},
{
"name": "phpunit/php-file-iterator",
"version": "3.0.5",
"version": "3.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
"reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
"shasum": ""
},
"require": {
@ -716,7 +719,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
},
"funding": [
{
@ -724,7 +727,7 @@
"type": "github"
}
],
"time": "2020-09-28T05:57:25+00:00"
"time": "2021-12-02T12:48:52+00:00"
},
{
"name": "phpunit/php-invoker",
@ -909,16 +912,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.9",
"version": "9.5.21",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b"
"reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b",
"reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1",
"reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1",
"shasum": ""
},
"require": {
@ -934,7 +937,7 @@
"phar-io/version": "^3.0.2",
"php": ">=7.3",
"phpspec/prophecy": "^1.12.1",
"phpunit/php-code-coverage": "^9.2.3",
"phpunit/php-code-coverage": "^9.2.13",
"phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.3",
@ -948,11 +951,10 @@
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
"sebastian/type": "^2.3.4",
"sebastian/type": "^3.0",
"sebastian/version": "^3.0.2"
},
"require-dev": {
"ext-pdo": "*",
"phpspec/prophecy-phpunit": "^2.0.1"
},
"suggest": {
@ -969,11 +971,11 @@
}
},
"autoload": {
"classmap": [
"src/"
],
"files": [
"src/Framework/Assert/Functions.php"
],
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
@ -996,11 +998,11 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.9"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21"
},
"funding": [
{
"url": "https://phpunit.de/donate.html",
"url": "https://phpunit.de/sponsors.html",
"type": "custom"
},
{
@ -1008,7 +1010,7 @@
"type": "github"
}
],
"time": "2021-08-31T06:47:40+00:00"
"time": "2022-06-19T12:14:25+00:00"
},
{
"name": "sebastian/cli-parser",
@ -1376,16 +1378,16 @@
},
{
"name": "sebastian/environment",
"version": "5.1.3",
"version": "5.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "388b6ced16caa751030f6a69e588299fa09200ac"
"reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac",
"reference": "388b6ced16caa751030f6a69e588299fa09200ac",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7",
"reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7",
"shasum": ""
},
"require": {
@ -1427,7 +1429,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
"source": "https://github.com/sebastianbergmann/environment/tree/5.1.3"
"source": "https://github.com/sebastianbergmann/environment/tree/5.1.4"
},
"funding": [
{
@ -1435,20 +1437,20 @@
"type": "github"
}
],
"time": "2020-09-28T05:52:38+00:00"
"time": "2022-04-03T09:37:03+00:00"
},
{
"name": "sebastian/exporter",
"version": "4.0.3",
"version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
"reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9",
"reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9",
"shasum": ""
},
"require": {
@ -1497,14 +1499,14 @@
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"homepage": "https://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
"source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4"
},
"funding": [
{
@ -1512,20 +1514,20 @@
"type": "github"
}
],
"time": "2020-09-28T05:24:23+00:00"
"time": "2021-11-11T14:18:36+00:00"
},
{
"name": "sebastian/global-state",
"version": "5.0.3",
"version": "5.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49"
"reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49",
"reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2",
"reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2",
"shasum": ""
},
"require": {
@ -1568,7 +1570,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3"
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5"
},
"funding": [
{
@ -1576,7 +1578,7 @@
"type": "github"
}
],
"time": "2021-06-11T13:31:12+00:00"
"time": "2022-02-14T08:28:10+00:00"
},
{
"name": "sebastian/lines-of-code",
@ -1867,28 +1869,28 @@
},
{
"name": "sebastian/type",
"version": "2.3.4",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
"reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914"
"reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914",
"reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad",
"reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad",
"shasum": ""
},
"require": {
"php": ">=7.3"
},
"require-dev": {
"phpunit/phpunit": "^9.3"
"phpunit/phpunit": "^9.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3-dev"
"dev-master": "3.0-dev"
}
},
"autoload": {
@ -1911,7 +1913,7 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
"source": "https://github.com/sebastianbergmann/type/tree/2.3.4"
"source": "https://github.com/sebastianbergmann/type/tree/3.0.0"
},
"funding": [
{
@ -1919,7 +1921,7 @@
"type": "github"
}
],
"time": "2021-06-15T12:49:02+00:00"
"time": "2022-03-15T09:54:48+00:00"
},
{
"name": "sebastian/version",
@ -1974,85 +1976,6 @@
],
"time": "2020-09-28T06:39:44+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
},
{
"name": "theseer/tokenizer",
"version": "1.2.1",
@ -2105,21 +2028,21 @@
},
{
"name": "webmozart/assert",
"version": "1.10.0",
"version": "1.11.0",
"source": {
"type": "git",
"url": "https://github.com/webmozarts/assert.git",
"reference": "6964c76c7804814a842473e0c8fd15bab0f18e25"
"reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25",
"reference": "6964c76c7804814a842473e0c8fd15bab0f18e25",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991",
"reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"symfony/polyfill-ctype": "^1.8"
"ext-ctype": "*",
"php": "^7.2 || ^8.0"
},
"conflict": {
"phpstan/phpstan": "<0.12.20",
@ -2157,9 +2080,9 @@
],
"support": {
"issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/1.10.0"
"source": "https://github.com/webmozarts/assert/tree/1.11.0"
},
"time": "2021-03-09T10:59:23+00:00"
"time": "2022-06-03T18:03:27+00:00"
}
],
"aliases": [],
@ -2168,7 +2091,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^8.0.0"
"php": "^8.1"
},
"platform-dev": [],
"plugin-api-version": "2.0.0"

View File

@ -8,6 +8,8 @@ use mirzaev\arangodb\terminal;
use ArangoDBClient\Connection as _connection;
use ArangoDBClient\Collection as _collection;
use ArangoDBClient\Statement as _statement;
use ArangoDBClient\Document as _document;
use ArangoDBClient\CollectionHandler as _collection_handler;
/**
@ -21,63 +23,95 @@ class collection
/**
* Инициализация
*
* @param _connection $connection Инстанция соединения
* @param _connection $session Сессия соединения с базой данных
* @param string $name Название
* @param bool $edge Это ребро? (иначе: вершина)
*
* @return string|null Идентификатор
* @return string|null Идентификатор коллекции
*/
public static function init(_connection $connection, string $name, bool $edge = false): ?string
public static function init(_connection $session, string $name, bool $edge = false): ?string
{
// Инициализация
$collections = new _collection_handler($connection);
$collections = new _collection_handler($session);
if (!$collections->has($name)) {
// Коллекция не найдена
// Не найдана коллекция
// Запись в вывод
terminal::write("Коллекция \"$name\" не найдена");
// Инициализация
$collection = new _collection();
// Настройка
$collection->setName($name);
$collection->setType($edge ? 'edge' : 'document');
// Запись коллекции на сервер и его ответ в буфер возврата
$id = $collections->create($name);
$id = $collections->create($name, ['type' => $edge ? _collection::TYPE_EDGE : _collection::TYPE_DOCUMENT]);
if ($collections->has($name)) {
// Коллекция найдена (записана)
// Запись в вывод
terminal::write("Создана коллекция \"$name\"");
terminal::write("Создана коллекция \"$name\" с типом " . ($edge ? 'ребро' : 'документ'));
// Возврат идентификатора коллекции
return $id;
}
} else {
// Найдена коллекция
// Возврат идентификатора коллекции
return $name;
}
return null;
}
/**
* Поиск
*
* @param _connection $connection Соединение
* @param string $collection Название
* @param array $condition Условия
* @param _connection $session Сессия соединения с базой данных
* @param string $query AQL-запрос
*
* @return array|null Коллекция, если найдена
* @return _document|null Инстанция документа
*/
public static function search(_connection $connection, string $name, array $condition): ?array
public static function search(_connection $session, string $query): ?_document
{
// Поиск журнала
$journal = (new _statement(
$session,
[
'query' => $query,
"batchSize" => 1000,
"sanitize" => true
]
))->execute();
// Инициализация буфера вывода
$buffer = [];
foreach ($journal as $key => $value) {
$buffer[$key] = $value;
}
return $buffer[0] ?? null;
}
/**
* Очистка
*
* @param _connection $session Сессия соединения с базой данных
* @param string $name Название
*
* @return bool Статус выполнения
*/
public static function truncate(_connection $session, string $name): bool
{
// Инициализация
$collections = new _collection_handler($connection);
$collections = new _collection_handler($session);
if ($collections->has($name)) {
// Коллекция найдена
// Найдена коллекция
return $collections->byExample($name, $condition)->getAll();
// Очистка
return $collections->truncate($name);
}
return false;
}
}

View File

@ -138,15 +138,16 @@ final class connection
match ($name) {
'adress', 'endpoint' => $this->adress = $value ?? throw new exception("Свойство \"$name\" не может быть пустым", 500),
'storage', 'database', 'db' => $this->storage = $value ?? throw new exception("Свойство \"$name\" не может быть пустым", 500),
'auth' => $this->auth = $value,
'name' => $this->name = $value,
'password' => $this->password = $value,
'connection' => $this->connection = $value,
'timeout_connect' => $this->timeout_connect = $value,
'timeout_request' => $this->timeout_request = $value,
'reconnect' => $this->reconnect = $value,
'create' => $this->create = $value,
'update', 'policy' => $this->update = $value,
'auth' => !$value ?: $this->auth = $value,
'name' => !$value ?: $this->name = $value,
'password' => !$value ?: $this->password = $value,
'connection' => !$value ?: $this->connection = $value,
'timeout_connect' => !$value ?: $this->timeout_connect = $value,
'timeout_request' => !$value ?: $this->timeout_request = $value,
'reconnect' => !$value ?: $this->reconnect = $value,
'create' => !$value ?: $this->create = $value,
'update', 'policy' => !$value ?: $this->update = $value,
'journal' => !$value ?: $this->journal = $value,
default => throw new exception("Свойство \"$name\" не найдено", 404)
};
}
@ -171,6 +172,7 @@ final class connection
'create' => $this->create,
'update', 'policy' => $this->update,
'session' => $this->session,
'journal' => $this->journal,
default => throw new exception("Свойство \"$name\" не найдено", 404)
};
}
@ -195,6 +197,7 @@ final class connection
'create' => isset($this->create),
'update', 'policy' => isset($this->update),
'session' => isset($this->session),
'journal' => isset($this->journal),
default => throw new exception("Свойство \"$name\" не найдено", 404)
};
}

View File

@ -9,7 +9,7 @@ use mirzaev\arangodb\terminal;
use ArangoDBClient\Connection as _connection;
use ArangoDBClient\Document as _document;
use ArangoDBClient\Edge as _edge;
use ArangoDBClient\CollectionHandler as _collection_handler;
use ArangoDBClient\DocumentHandler as _document_handler;
use ArangoDBClient\EdgeHandler as _edge_handler;
/**
@ -23,60 +23,78 @@ class document
/**
* Записать
*
* @param _connection $connection Инстанция соединения
* @param _connection $session Сессия соединения с базой данных
* @param string $collection Коллекция
* @param array $data Данные
* @param ?array $data Данные
* @param ?array $metadata Метаданные
* @param bool $check Проверка на запись в базу данных
*
* @return string|null Идентификатор
*/
public static function write(_connection $connection, string $collection, array $data): ?string
public static function write(_connection $session, string $collection, ?array $data = null, ?array $metadata = null, bool $check = true): ?string
{
// Инициализация коллекции
collection::init($connection, $collection, isset($data['_from'], $data['_to']));
collection::init($session, $collection, isset($data['_from'], $data['_to']));
if (isset($data['_from'], $data['_to'])) {
if (isset($metadata['_from'], $metadata['_to'])) {
// Ребро
// Инициализация обработчика рёбер
$documents = new _edge_handler($connection);
$documents = new _edge_handler($session);
// Инициализация ребра
$document = new _edge();
// Инициализация вершин
$_from = $data['_from'];
$_to = $data['_to'];
$_from = $metadata['_from'];
$_to = $metadata['_to'];
// Деинициализация из входных данных
unset($data['_from'], $data['_to']);
unset($metadata['_from'], $metadata['_to']);
} else {
// Вершина
// Инициализация обработчика вершин
$documents = new _collection_handler($connection);
$documents = new _document_handler($session);
// Инициализация вершины
$document = new _document();
}
// Настройка
foreach ($data as $key => $value) {
foreach (['data' => $data, 'metadata' => ($metadata ?? []) + ['created' => time()]] as $key => $value) {
// Перебор параметров
// Запись в инстанцию документа
$document->set($key, $value);
}
// Запись на сервер и его ответ в буфер возврата
$id = isset($_from, $_to) ? $documents->saveEdge($collection, $_from, $_to, $document) : $documents->save($collection, $document);
$id = isset($_from, $_to) ? $documents->saveEdge($collection, $_from, $_to, $document) : $documents->insert($collection, $document);
if ($documents->has($collection, $id)) {
if ($check && $documents->has($collection, $id)) {
// Документ записан
// Запись в вывод
terminal::write("В коллекции \"$collection\" создан документ \"$id\"");
// Возврат идентификатора коллекции
return $id;
}
// Возврат идентификатора коллекции
return $id;
}
/**
* Обновить
*
* @param _connection $session Сессия соединения с базой данных
* @param _document $document Инстанция документа вершины
*
* @return bool Статус обработки
*/
public static function update(_connection $session, _document $document): bool {
// Инициализация обработчика вершин
$documents = new _document_handler($session);
// Запись в базу данных
return $documents->update($document);
}
}