diff --git a/.certificates/bolt/private.key b/.certificates/bolt/private.key new file mode 100755 index 0000000..f9dc368 --- /dev/null +++ b/.certificates/bolt/private.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQDYRohDTqXCHSVL +5AsPxYpuVOMMqWHdC7BwGYBiRRwgO0q0sWeJx7cGVqJQwAY5c+j5FXiOe5ZP6ymK +unUTc5yI9jtth8XH/ctgxrN95gOva9siroyF9XyuK9hv3+3OHkuK4tIsG3L58Oir +5uVFROPDJQbIGx2YpG8U+cVQN2dQlf1noSYO3J5gO0g6c2OPWmm+PaDSjeUEMO7C +RRRPYPBmCKYWWI8w8VOszx5CwZFRDxT0fSGmfDEjGsHysTTHwYJJSUYQR2TDEa1Z +4Q7aBS7iN1CuKGg64GWZZAMhrrgsdw5xNjAPPKWe1TPz365o1bXEr51pEb1StDat +Lt70LozywWYQd9XA0dZl960uNMF6U49Nx7+E2UlExpABJ7t88RLZTN2FAlOgEsgb +dYFkzwJcHZaVnkv9GUlVJAwJHLtHUJqgW3RzaAB5bBPtFhbyKDjUsPtp+tFg6I1W +hSZx32JDsU9RhpV5XJADEhxPOPOmFFPrDgyg1Db6orj/pT8ucK2r1JocF3rM46tr +DBP2wAQVUu+Gm30iM6YatI9umjp0ImXrpufFXx6o8h4H/6e2CoR5cMVo+ROJv8PJ +fWcAY+zH5VQfvZ6V14Qecb5JcpXvHhQstHDCxFN6mjVzc8ETC0kVX69hlN+uJScN +i8C945HUBqOnQ51TC3KK9TOmlw7SywIDAQABAoICAFX4O4QdyDAQK9ot7OO5D1zq +K1LGJdubIOh+ipUFibeaOgj3mAOhurQvTdgxbIf79jjE+yYQJGDiRqIZmh5AT5H1 +5wuT89+al/SBJ6o8+2wIwJPZtIwvV/9X+HIIHlxXmIm9vfPAeYS26ZYjczGEv9C7 +cCWs+afKfUlmO7O2QkA7Tv6ZhSpVMjNofT6WzZWXR/9SOhJYSxfOZ6obkYY4L3cv +qu2pCEpZM3y22/2HOj9xck/5SZ4HMfUVVtEk9akN179P/CTObFRKO5FFsASkGM3d +VRnVgBEfT+OYaNJDxHwQW1JPSu1TmzY2467mVErh4J4tfLHeVlaAwlc3EXMY6fd9 +8CxRlp4agGK07/6RF+8F25XoqoQxCfnd0NeHkKnV+WkoFs5/Wc3smfm08kskpGeD +CdkeGfGh8mmh1f5S/kuKoiaW+8c+DhmYPD4+l+wmCZO3yqyeAejBwWdPZ/dReSXU +99EORL4HetD+FGh43+WTXKb0klTVWYX5tCPj1KIp5BvNq8W/UHJ7je+zlTDLTYWc +LLCDSHgRJNUXope11VKUYOK/HDErypBW1cinM9HjdlaPe4T4GrdX3I+Uhx96u6U4 +j1qW151HePjQs/lE9KjYR4uyjHVBhMXw+2OFjpEg4ceBV8eVjg3Zw7VbRQZO64l1 +HdpOg1VekeNnEcXKyQN5AoIBAQD3jGO07qo2be74lOrGcEdZe8Y3LnsJcKh3TU/9 +4/Ty/g1SRmts8kQG/RUlkL28cJM5PLVz/7ny2escC+peKI3AbEmr9TPdecnz2qPu +rkrvCsieRNoJmNRFRmOvaEpeus4LJ25hlFEzkF6qDqSqmNzGy9ZdyyYQh2EtCtQD +oZXOIxPrylz3IX62xTLVFXWiGGoawIZyJwWTpd+oA0cRnEAwXj239khaRaES5epT +BB5lNGxUPpEWPl/maVnEbliDyifANH9r6fYnGDkortXpRZbF6Eysm/vgOpuzMCeM +xZ40xvWWDc1ndFzyYcPA1i+4ynuiAGdN1JMQQnwUAneHMh5HAoIBAQDfqNAmeCBQ +md9Qv86FCrW0s87nxqKxaSAmKFU9I9fCxgr74L8iqIryHc2hsJmjy6dZN/YohMT7 +4mcSJ8KZEVQ/sSvl4p2JbpViw3JrKdooDeflkIm+oIAaHKw2Bhl+tC6wIi/9afyx +lXpRp2wGXd4YD7BI+3gJIQShH7RQSwViQtctUZ/Tr/2Bq/GVfY/rz2rbPPAu6Ixr +W/tdwohxMLy9Dv1JE3eJI8rX1oe8apXz5+VaiJaKgIAiF78zkwkzzNFWGtlSrSn7 +YOB7tc0M0+E7wg887JvokW6h+88A0PVPY77YIgHK/ysccsVRFC+nGZy5CabN+qHf +YoyERvswshVdAoIBAH0aFcl6U8ruA7bci0l9tJEkXCfG9abvqDOifqpwaXnjqhfK +Pr/wLzDY9bbmTvzMZ5qlc44Lzo1MU+T4oJi1Je34y8J7SJrE0arK883Lh1MGwBw7 +73SqJ5xa1kXvDqaRAU/hvYbSzbahXzXR8KXGWsycdtkvsSzpPdLlhf/PyUVDtO2U +dybtZnw3bFkDX09rxzN92HQYBFl5mm3uOhxMOqQ2/Dnb3PTB+4TxbFpH2pSKybRJ +akkzfIOU+iirG1B++VfJMBv5QMzBESHeOXyKDog1vYn9ymynMch8rYAW3r0NT09l +6kg+JjrX7XWmyLc6nQBh89MBetDcyJfUJ1PLoEECggEADhBWbmTVW1whn7k/6ju/ +K0q3MvnZlyBOJjgZDAwp8BR18lqyiiJhAlJ/cLBjKNqQflq3ftrCbDhTVN/tK6Tc +UFj6sqzqTQ8IE7rIghaSojwlndjV4IfFJl8xMQB3L/Fykh7EN8InYp9Mnr/RWiEi +6w5pfl1ZsfFCkkMlGnttLj2XvEDKtQv2++Vs/oJzv1c+l+SgEcMLuWCCUOX/oGZ5 +J8Y+hQ7VUGlQwvu5c06ceUbWtDesh68G353wpvSS+o/hhfGQQtOitSzlUMIgz7Kv +Egvk22bhcuFaPJNR8/Ivyrsx7/NLe5FKC7Ln125WhMJmiXgi5gbhkONohJTWDLzV +/QKCAQBPFIHNk6dYljTM60HBu/cIVBsRmpgIj4MJcvF9h7ci96hCtJEmCPXDBVvd +KxuqjPSFVJr6Xo59pTK7wwRmvfpzDz9vdL1S/4WYvkxrdFXMF9vRubFbBDlNEtto +JAuO6tf7C7j87DhucDult3bI5pUFxjZMzTPIDP05mmoNoCBmF5ZsAODMtKRnhPT4 +4CmyrJR8OuM0b0cXbW301qlWt6MN5gKg6EF4ZPOi9W5djUqsBtPf6ctzl9wIcQmF +CpOuZWSALlCS+ja5/9UwMFGUSlpIKGFcRFrs9Ylq/RLRfeXvpTCT4qtVbqWhm682 +xRYdTEfqN8QP6J4o3QswNDndNTO0 +-----END PRIVATE KEY----- diff --git a/.certificates/bolt/public.crt b/.certificates/bolt/public.crt new file mode 100755 index 0000000..005efe6 --- /dev/null +++ b/.certificates/bolt/public.crt @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIFAzCCAuugAwIBAgIUW/mKdmipSZUZlihiMAAQahCCL4MwDQYJKoZIhvcNAQEL +BQAwEDEOMAwGA1UEAwwFbmVvNGowIBcNMjAxMTE2MTc0NDQyWhgPNDc1ODEwMTMx +NzQ0NDJaMBAxDjAMBgNVBAMMBW5lbzRqMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEA2EaIQ06lwh0lS+QLD8WKblTjDKlh3QuwcBmAYkUcIDtKtLFnice3 +BlaiUMAGOXPo+RV4jnuWT+spirp1E3OciPY7bYfFx/3LYMazfeYDr2vbIq6MhfV8 +rivYb9/tzh5LiuLSLBty+fDoq+blRUTjwyUGyBsdmKRvFPnFUDdnUJX9Z6EmDtye +YDtIOnNjj1ppvj2g0o3lBDDuwkUUT2DwZgimFliPMPFTrM8eQsGRUQ8U9H0hpnwx +IxrB8rE0x8GCSUlGEEdkwxGtWeEO2gUu4jdQrihoOuBlmWQDIa64LHcOcTYwDzyl +ntUz89+uaNW1xK+daRG9UrQ2rS7e9C6M8sFmEHfVwNHWZfetLjTBelOPTce/hNlJ +RMaQASe7fPES2UzdhQJToBLIG3WBZM8CXB2WlZ5L/RlJVSQMCRy7R1CaoFt0c2gA +eWwT7RYW8ig41LD7afrRYOiNVoUmcd9iQ7FPUYaVeVyQAxIcTzjzphRT6w4MoNQ2 ++qK4/6U/LnCtq9SaHBd6zOOrawwT9sAEFVLvhpt9IjOmGrSPbpo6dCJl66bnxV8e +qPIeB/+ntgqEeXDFaPkTib/DyX1nAGPsx+VUH72eldeEHnG+SXKV7x4ULLRwwsRT +epo1c3PBEwtJFV+vYZTfriUnDYvAveOR1Aajp0OdUwtyivUzppcO0ssCAwEAAaNT +MFEwHQYDVR0OBBYEFJBQ2ww2AqlBxOEV1Q2C8huRlNITMB8GA1UdIwQYMBaAFJBQ +2ww2AqlBxOEV1Q2C8huRlNITMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggIBAC6b05mgjOWbOz6vk+3hwPVz7Iv/iaHQZJPikoPOzRR8j17CUTdvxNAE +PmfWdSu+3v5mh+VZbfFGdQ6rcS2E6kxLFmpA+tL/x1kmVcTuOhOzaiE9HcIjBsT8 +XBNPFYu59fTsvQLXPlu48TEajPAtIcnFynLHrmcbIcXBc2AHgrtbOHf3TxC9cVWz +qmVXarXIQSWmVBE2ZSF/2ZJ/OTa5fE7ZEVOeVMwrMjHBr5RKQC9+19xKNPAFWpR5 +v3uF5lmUf2qK5NcQyYNfI691wWluDswz1uTi8GGxUTPA75+AcRrpK5b9/CeOJoGl +MovWEiB37JR4glBRzoPv8JPltnAIHRrgrJeQgqV+t0CNLYQlkJf8SlTMyxaK1CkI +k+O6lmKkmSIWxhQtR/Kpzjs8DS6bCpcocUcmpbALiSreLJNPy9BcEJ4xop3BnAji +eT939eIcYI3NgYWRTcbKpWGk/DW2YzJAMvRx2+kz2UW0PhuJZuMWXti2/Js4zeU3 +hPIceVOQd7o3VDD7wpkGjPt2Z8REk4QF5A30SUaoqa+xc/HJOBR8ENNi5D+dvfaV +aVocEjtDcphx0Z/P5Er3ob33+kP1uZcAZSxVkNln1+3B2OB7YhDENSP6XUBdniiG +G7F2+eao8cErXbgr9UFzpInlinmHOgPiK3tXdipPhHUT1tRImpz1 +-----END CERTIFICATE----- diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d4c1f14..a1c9aee 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: php-versions: ['7.2', '7.3', '7.4'] - neo4j-versions: ['3.3', '3.4', '3.5', '4.0'] + neo4j-versions: ['3.3', '3.4', '3.5', '4.0', '4.1'] include: - neo4j-versions: 3.3 bolt-version: 1 @@ -22,16 +22,29 @@ jobs: bolt-version: 3 - neo4j-versions: 4.0 bolt-version: 4 + - neo4j-versions: 4.1 + bolt-version: 4 services: neo4j: image: neo4j:${{ matrix.neo4j-versions }} + volumes: + - ${{ github.workspace }}/.certificates:/ssl env: NEO4J_AUTH: none + NEO4J_dbms_ssl_policy_bolt_enabled: true + NEO4J_dbms_connector_bolt_tls__level: OPTIONAL + NEO4J_dbms_ssl_policy_bolt_base__directory: /ssl/bolt ports: - 7687:7687 steps: - uses: actions/checkout@v2 + - name: Wait for neo4j to fail + run: while docker ps | grep neo4j ; do sleep 2 ; done + + - name: Restart neo4j + run: docker start ${{ job.services.neo4j.id }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -53,6 +66,9 @@ jobs: - name: Lint run: composer lint + - name: Wait for neo4j to be ready + run: until docker exec ${{ job.services.neo4j.id }} wget -q -O - localhost:7474 > /dev/null ; do sleep 2; done + - name: Test env: BOLT_VERSION: ${{ matrix.bolt-version }} diff --git a/.gitignore b/.gitignore index 7fe12bd..c644d6a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ vendor/ test.php phpunit.xml .idea/ -clover.xml \ No newline at end of file +clover.xml +.phpunit.result.cache \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f46a414..30af7c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ ## [4.0.1] ### Changes -- added dev containers for vscode -- improved pipelines (now session sends all messages at once like it should) +- updated event dispatcher ## [4.0.2] ### Fixes - Fixed `Fail to parse address "null"` error + +## [4.0.3] +### Improvements +- improved pipelines (now session sends all messages at once like it should) +- added setting to use `TLSMODE_REQUIRED_NO_VALIDATION` for self signed certificates +- fixed Time and DateTimeOffset type conversions +- added ability to select database for Neo4j V4+ +- added ability to provide bookmarks for Neo4j V4+ diff --git a/composer.json b/composer.json index 9ffd231..12a3233 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ } }, "require-dev": { - "phpunit/phpunit": "^4.8", + "phpunit/phpunit": "^8", "symfony/stopwatch": "^2.7", "squizlabs/php_codesniffer": "3.*" }, diff --git a/composer.lock b/composer.lock index d291776..4d520d8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "96bc0cff109ae4a88898eee777f11a5a", + "content-hash": "347378699d67c829e5aa39b37d4a572f", "packages": [ { "name": "graphaware/neo4j-common", @@ -50,6 +50,10 @@ "neo4j", "statement" ], + "support": { + "issues": "https://github.com/graphaware/neo4j-php-commons/issues", + "source": "https://github.com/graphaware/neo4j-php-commons/tree/master" + }, "time": "2017-06-08T21:29:20+00:00" }, { @@ -96,6 +100,10 @@ "keywords": [ "enum" ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/master" + }, "time": "2020-02-14T08:15:52+00:00" }, { @@ -104,17 +112,18 @@ "source": { "type": "git", "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "3b1c10727b12ecdfc7b80b040b887a94c64d8388" + "reference": "3ef040d7c05652f55bd05115baf059a445cfc79c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/3b1c10727b12ecdfc7b80b040b887a94c64d8388", - "reference": "3b1c10727b12ecdfc7b80b040b887a94c64d8388", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/3ef040d7c05652f55bd05115baf059a445cfc79c", + "reference": "3ef040d7c05652f55bd05115baf059a445cfc79c", "shasum": "" }, "require": { "php": ">=7.2.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -133,7 +142,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Standard interfaces for event handling.", @@ -142,29 +151,34 @@ "psr", "psr-14" ], - "time": "2020-05-26T00:50:43+00:00" + "support": { + "source": "https://github.com/php-fig/event-dispatcher/tree/master" + }, + "time": "2020-09-18T06:44:18+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "dev-master", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14" + "reference": "be5a36670fd7ccb6f6e03d9c9bd7345e2a9a8515" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5e20b83385a77593259c9f8beb2c43cd03b2ac14", - "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/be5a36670fd7ccb6f6e03d9c9bd7345e2a9a8515", + "reference": "be5a36670fd7ccb6f6e03d9c9bd7345e2a9a8515", "shasum": "" }, "require": { "php": ">=7.1" }, + "default-branch": true, "type": "library", "extra": { + "branch-version": "2.3", "branch-alias": { - "dev-master": "2.1-dev" + "dev-main": "2.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -192,6 +206,9 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -206,20 +223,20 @@ "type": "tidelift" } ], - "time": "2020-06-06T08:49:21+00:00" + "time": "2020-10-14T17:08:19+00:00" }, { "name": "symfony/event-dispatcher", - "version": "dev-master", + "version": "5.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "04039530ba77586eaf125de98c63315387190e5b" + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04039530ba77586eaf125de98c63315387190e5b", - "reference": "04039530ba77586eaf125de98c63315387190e5b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", "shasum": "" }, "require": { @@ -239,6 +256,7 @@ "psr/log": "~1.0", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/http-foundation": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2", @@ -248,12 +266,8 @@ "symfony/dependency-injection": "", "symfony/http-kernel": "" }, + "default-branch": true, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.2-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" @@ -278,6 +292,9 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.0-RC1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -292,20 +309,20 @@ "type": "tidelift" } ], - "time": "2020-06-18T19:55:03+00:00" + "time": "2020-11-01T16:14:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "dev-master", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f6f613d74cfc5a623fc36294d3451eb7fa5a042b" + "reference": "8e3016b6e4f491433751b9ef0ef090cac6b08170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f6f613d74cfc5a623fc36294d3451eb7fa5a042b", - "reference": "f6f613d74cfc5a623fc36294d3451eb7fa5a042b", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8e3016b6e4f491433751b9ef0ef090cac6b08170", + "reference": "8e3016b6e4f491433751b9ef0ef090cac6b08170", "shasum": "" }, "require": { @@ -315,10 +332,12 @@ "suggest": { "symfony/event-dispatcher-implementation": "" }, + "default-branch": true, "type": "library", "extra": { + "branch-version": "2.3", "branch-alias": { - "dev-master": "2.1-dev" + "dev-main": "2.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -354,6 +373,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -368,29 +390,30 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:23:11+00:00" + "time": "2020-10-14T17:08:19+00:00" }, { "name": "symfony/polyfill-php80", - "version": "dev-master", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "c7bdeabb8ec1964cb74892c8281d79fe31592e74" + "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/c7bdeabb8ec1964cb74892c8281d79fe31592e74", - "reference": "c7bdeabb8ec1964cb74892c8281d79fe31592e74", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/3a11f3dfb34ad50f978cb2b8cf936933b87739aa", + "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa", "shasum": "" }, "require": { - "php": ">=7.0.8" + "php": ">=7.1" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.21-dev" }, "thanks": { "name": "symfony/polyfill", @@ -434,6 +457,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -448,42 +474,37 @@ "type": "tidelift" } ], - "time": "2020-07-03T13:31:43+00:00" + "time": "2020-10-26T13:35:45+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "dev-master", + "version": "1.5.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "3e7a22aed197e9333cc929e7f6b4300bdae91fcc" + "reference": "6410c4b8352cb64218641457cef64997e6b784fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/3e7a22aed197e9333cc929e7f6b4300bdae91fcc", - "reference": "3e7a22aed197e9333cc929e7f6b4300bdae91fcc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/6410c4b8352cb64218641457cef64997e6b784fb", + "reference": "6410c4b8352cb64218641457cef64997e6b784fb", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "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" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -497,7 +518,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -506,6 +527,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.x" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -520,7 +545,176 @@ "type": "tidelift" } ], - "time": "2020-06-15T18:51:04+00:00" + "time": "2020-11-10T19:05:51+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "default-branch": true, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/master" + }, + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "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/master" + }, + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -539,6 +733,7 @@ "require": { "php": ">=7.1" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -569,6 +764,10 @@ "reflection", "static analysis" ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + }, "time": "2020-06-19T17:42:03+00:00" }, { @@ -577,12 +776,12 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "eb3320ef010709f339f118dde1645e197c4961ec" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/eb3320ef010709f339f118dde1645e197c4961ec", - "reference": "eb3320ef010709f339f118dde1645e197c4961ec", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { @@ -595,6 +794,7 @@ "require-dev": { "mockery/mockery": "~1.3.2" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -621,34 +821,38 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-07-09T12:42:26+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "dev-master", + "version": "1.x-dev", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "94f3ddc5d77e49daadadd33b798b933e52dde82c" + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/94f3ddc5d77e49daadadd33b798b933e52dde82c", - "reference": "94f3ddc5d77e49daadadd33b798b933e52dde82c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.2", - "mockery/mockery": "~1" + "ext-tokenizer": "*" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { @@ -667,37 +871,41 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-19T19:40:27+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + }, + "time": "2020-09-17T18:55:26+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.10.3", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0 <9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.11.x-dev" } }, "autoload": { @@ -730,43 +938,48 @@ "spy", "stub" ], - "time": "2020-03-05T15:02:03+00:00" + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.12.1" + }, + "time": "2020-09-29T09:10:42+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.x-dev", + "version": "7.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.1.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^4.2.2", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -781,7 +994,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -792,29 +1005,36 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.10" + }, + "time": "2019-11-20T13:55:58+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.x-dev", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -829,7 +1049,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -839,7 +1059,11 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.2" + }, + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -880,32 +1104,36 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "1.0.x-dev", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "9513098641797ce5f459dbc1de5a54c29b0ec1fb" + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/9513098641797ce5f459dbc1de5a54c29b0ec1fb", - "reference": "9513098641797ce5f459dbc1de5a54c29b0ec1fb", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -920,7 +1148,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -929,33 +1157,37 @@ "keywords": [ "timer" ], - "time": "2018-01-06T05:27:16+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, + "time": "2019-06-07T04:22:29+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.x-dev", + "version": "3.1.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "58bd196ce8bc49389307b3787934a5117db80fea" + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/58bd196ce8bc49389307b3787934a5117db80fea", - "reference": "58bd196ce8bc49389307b3787934a5117db80fea", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -978,45 +1210,61 @@ "keywords": [ "tokenizer" ], - "time": "2017-12-04T15:11:28+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + }, + "abandoned": true, + "time": "2019-09-17T06:23:10+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "8.5.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "7d9c380fec76198504fbd181d0d921d7f92f5fdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7d9c380fec76198504fbd181d0d921d7f92f5fdf", + "reference": "7d9c380fec76198504fbd181d0d921d7f92f5fdf", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.0", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.10.3", + "phpunit/php-code-coverage": "^7.0.10", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.3", + "sebastian/exporter": "^3.1.2", + "sebastian/global-state": "^3.0.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", + "sebastian/version": "^2.0.1" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0.0" }, "bin": [ "phpunit" @@ -1024,7 +1272,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "8.5-dev" } }, "autoload": { @@ -1050,38 +1298,46 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-13T08:24:00+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.x-dev", + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -1096,45 +1352,43 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" + }, + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.x-dev", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "18a5d97c25f408f48acaf6d1b9f4079314c5996a" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/18a5d97c25f408f48acaf6d1b9f4079314c5996a", - "reference": "18a5d97c25f408f48acaf6d1b9f4079314c5996a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1165,38 +1419,43 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-03-07T10:34:43+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/master" + }, + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "1.4.x-dev", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1221,34 +1480,44 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-05-22T07:24:03+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/master" + }, + "time": "2019-02-04T06:01:07+00:00" }, { "name": "sebastian/environment", - "version": "1.3.x-dev", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "67f55699c2810ff0f2cc47478bbdeda8567e68ee" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/67f55699c2810ff0f2cc47478bbdeda8567e68ee", - "reference": "67f55699c2810ff0f2cc47478bbdeda8567e68ee", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1273,34 +1542,38 @@ "environment", "hhvm" ], - "time": "2017-02-28T08:18:59+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.3" + }, + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.x-dev", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "dcd43bcc0fd3551bd2ede0081882d549bb78225d" + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/dcd43bcc0fd3551bd2ede0081882d549bb78225d", - "reference": "dcd43bcc0fd3551bd2ede0081882d549bb78225d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", - "sebastian/recursion-context": "^1.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1313,6 +1586,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -1321,17 +1598,13 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -1340,27 +1613,34 @@ "export", "exporter" ], - "time": "2017-02-26T13:09:30+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, + "time": "2019-09-14T09:02:43+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.x-dev", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "cea85a84b00f2795341ebbbca4fa396347f2494e" + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/cea85a84b00f2795341ebbbca4fa396347f2494e", - "reference": "cea85a84b00f2795341ebbbca4fa396347f2494e", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.2|~5.0" + "ext-dom": "*", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-uopz": "*" @@ -1368,7 +1648,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1391,32 +1671,136 @@ "keywords": [ "global state" ], - "time": "2017-02-23T14:11:06+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/master" + }, + "time": "2019-02-01T05:30:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + }, + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" + }, + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.x-dev", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1444,23 +1828,131 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + }, + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" + }, + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/master" + }, + "time": "2019-07-02T08:10:15+00:00" }, { "name": "sebastian/version", - "version": "1.0.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, + "require": { + "php": ">=5.6" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1479,7 +1971,11 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, + "time": "2016-10-03T07:35:21+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -1487,12 +1983,12 @@ "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5b0b6abd089c257a78c30a1d7ccfec12665a55e2" + "reference": "99b0339bce7eaae8b5285398d5f1492da734d1ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5b0b6abd089c257a78c30a1d7ccfec12665a55e2", - "reference": "5b0b6abd089c257a78c30a1d7ccfec12665a55e2", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/99b0339bce7eaae8b5285398d5f1492da734d1ac", + "reference": "99b0339bce7eaae8b5285398d5f1492da734d1ac", "shasum": "" }, "require": { @@ -1504,6 +2000,7 @@ "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, + "default-branch": true, "bin": [ "bin/phpcs", "bin/phpcbf" @@ -1530,32 +2027,38 @@ "phpcs", "standards" ], - "time": "2020-07-12T22:27:30+00:00" + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2020-11-03T22:22:47+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "dev-master", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d" + "reference": "fade6deebd931cfd7a544f68479405a6a08979a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", - "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fade6deebd931cfd7a544f68479405a6a08979a3", + "reference": "fade6deebd931cfd7a544f68479405a6a08979a3", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-ctype": "For best performance" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.21-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1592,6 +2095,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/main" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1606,7 +2112,7 @@ "type": "tidelift" } ], - "time": "2020-06-06T08:46:27+00:00" + "time": "2020-10-26T13:35:45+00:00" }, { "name": "symfony/stopwatch", @@ -1655,80 +2161,60 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/2.8" + }, "time": "2018-11-11T11:18:13+00:00" }, { - "name": "symfony/yaml", - "version": "3.4.x-dev", + "name": "theseer/tokenizer", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "75a63c33a8577608444246075ea0af0d052e452a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb", - "reference": "7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/theseer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2020-05-11T07:51:54+00:00" + "time": "2020-07-12T23:59:07+00:00" }, { "name": "webmozart/assert", @@ -1777,6 +2263,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, "time": "2020-07-08T17:02:28+00:00" } ], @@ -1792,5 +2282,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/docker-compose.yml b/docker-compose.yml index 2c14fa7..0e5dc1e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,11 +11,14 @@ services: volumes: - ./:/app:rw,cached neo4j: - image: neo4j:4.0 - environment: - - NEO4J_AUTH=none + image: neo4j:4.1.4 + volumes: + - ./.certificates:/ssl ports: - 7474:7474 - 7687:7687 - - + environment: + - NEO4J_AUTH=none + - NEO4J_dbms_ssl_policy_bolt_enabled=true + - NEO4J_dbms_connector_bolt_tls__level=OPTIONAL + - NEO4J_dbms_ssl_policy_bolt_base__directory=/ssl/bolt diff --git a/docs/Queries.md b/docs/Queries.md index f178a4a..fa9c7e6 100644 --- a/docs/Queries.md +++ b/docs/Queries.md @@ -2,9 +2,10 @@ ```php -use PTS\Bolt\GraphDatabase; +use PTS\Bolt\Driver; +use PTS\Bolt\Configuration; -$driver = GraphDatabase::driver("bolt://localhost"); +$driver = new Driver(Configuration::create()->withUri("bolt://localhost")); $session = $driver->session(); ``` @@ -24,13 +25,55 @@ $session->run("CREATE (n) SET n += {props}", ['name' => 'Mike', 'age' => 27]); ### TLS Encryption -In order to enable TLS support, you need to set the configuration option to `REQUIRED`, here an example : +In order to enable TLS support, you need to set the configuration option to `REQUIRED` or pass `tls=true` option to URI, here an example : ```php -$config = \PTS\Bolt\Configuration::newInstance() - ->withCredentials('bolttest', 'L7n7SfTSj0e6U') +$config = \PTS\Bolt\Configuration::create() + ->withUri('bolt://localhost') ->withTLSMode(\PTS\Bolt\Configuration::TLSMODE_REQUIRED); -$driver = \PTS\Bolt\GraphDatabase::driver('bolt://hobomjfhocgbkeenl.dbs.graphenedb.com:24786', $config); +// or + +$config = \PTS\Bolt\Configuration::create() + ->withUri('bolt://localhost?tls=true'); + +$driver = new \PTS\Bolt\Driver($config); $session = $driver->session(); ``` + +For self signed certificates use `TLSMODE_REQUIRED_NO_VALIDATION` or `validate_tls=false`. + +### Database selection + +Database can be selected via URI or `withDatabase` method : +```php +$config = \PTS\Bolt\Configuration::create() + ->withUri('bolt://localhost') + ->withDatabase('test'); + +// or + +$config = \PTS\Bolt\Configuration::create() + ->withUri('bolt://localhost/test'); + +$driver = new \PTS\Bolt\Driver($config); +$session = $driver->session(); +``` + +### Bookmarks + +You can fetch bookmarks from last result from summary or from session using `lastBookmark` method. To pass bookmarks for new session use `withBookmarks` method : +```php +$result = $session1->run('...'); + +$bookmark = $result->getSummary()->getBookmark() +// or +$bookmark = $session1->getLastBookmark(); + +$config = \PTS\Bolt\Configuration::create() + ->withUri('bolt://localhost') + ->withBookmarks([$bookmark]); + +$driver = new \PTS\Bolt\Driver($config); +$session2 = $driver->session(); +``` \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bdb54be..9d974f7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="vendor/autoload.php" > @@ -16,6 +15,11 @@ ./tests + + + ./src + + diff --git a/src/Configuration.php b/src/Configuration.php index e4af8b3..da03c67 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -11,53 +11,19 @@ namespace PTS\Bolt; -use GraphAware\Common\Driver\ConfigInterface; use GraphAware\Common\Connection\BaseConfiguration; /** * @author Tobias Nyholm */ -class Configuration extends BaseConfiguration implements ConfigInterface +class Configuration extends BaseConfiguration { + const DEFAULT_BOLT_PORT = 7687; const TLSMODE_REQUIRED = 'REQUIRED'; + const TLSMODE_REQUIRED_NO_VALIDATION = 'REQUIRED_NO_VALIDATION'; const TLSMODE_REJECTED = 'REJECTED'; - /** - * @var array - * - * @deprecated - */ - protected $credentials; - - /** - * @deprecated - */ - protected $username; - - /** - * @deprecated - */ - protected $password; - - /** - * @var string - * - * @deprecated - */ - protected $bindtoInterface; - - /** - * @var int - * - * @deprecated - */ - protected $timeout; - - /** - * @deprecated - */ - protected $tlsMode; - + /** * Create a new configuration with default values. * @@ -66,32 +32,21 @@ class Configuration extends BaseConfiguration implements ConfigInterface public static function create() { return new self([ - 'user' => 'null', + 'tls_mode' => self::TLSMODE_REJECTED, + 'forced_bolt_version' => 0, + 'host' => 'localhost', + 'port' => self::DEFAULT_BOLT_PORT, + 'scheme' => 'bolt', + 'database' => '', + 'username' => 'null', 'password' => 'null', 'bind_to_interface' => 'null', 'timeout' => 5, + 'bookmarks' => null, 'credentials' => ['null', 'null'], ]); } - /** - * @return Configuration - * - * @deprecated Will be removed in 2.0. Use Configuration::create - */ - public static function newInstance() - { - $config = self::create(); - - $config->username = 'null'; - $config->password = 'null'; - $config->credentials = ['null', 'null']; - $config->bindtoInterface = 'null'; - $config->timeout = 5; - - return $config; - } - /** * @param string $username * @param string $password @@ -100,21 +55,14 @@ public static function newInstance() */ public function withCredentials($username, $password) { - if (null === $username || null === $password) { + if (null === $username && null === $password) { // No change if credentials or null return $this; } - $new = $this->setValue('username', $username) + return $this->setValue('username', $username) ->setValue('password', $password) ->setValue('credentials', [$username, $password]); - - // To keep BC - $new->username = $username; - $new->password = $password; - $new->credentials = [$username, $password]; - - return $new; } /** @@ -124,12 +72,7 @@ public function withCredentials($username, $password) */ public function bindToInterface($interface) { - $new = $this->setValue('bind_to_interface', $interface); - - // To keep BC - $new->bindtoInterface = $interface; - - return $new; + return $this->setValue('bind_to_interface', $interface); } /** @@ -139,86 +82,119 @@ public function bindToInterface($interface) */ public function withTimeout($timeout) { - $new = $this->setValue('timeout', $timeout); - - // To keep BC - $new->timeout = $timeout; - - return $new; + return $this->setValue('timeout', $timeout); } /** - * @return array + * @param int $version * - * @deprecated Will be removed in 2.0. Use Configuration::getValue('credentials') + * @return Configuration */ - public function getCredentials() + public function withBoltVersion($version) { - return $this->getValue('credentials'); + return $this->setValue('forced_bolt_version', $version); } /** - * @return string + * @param $mode * - * @deprecated Will be removed in 2.0. Use Configuration::getValue('bind_to_interface') + * @return Configuration */ - public function getBindtoInterface() + public function withTLSMode($mode) { - return $this->getValue('bind_to_interface'); + return $this->setValue('tls_mode', $mode); } + /** - * @return int + * @param $scheme + * + * @return Configuration + */ + public function withScheme($scheme) + { + return $this->setValue('scheme', $scheme); + } + + /** + * @param $host * - * @deprecated Will be removed in 2.0. Use Configuration::getValue('timeout') + * @return Configuration */ - public function getTimeout() + public function withHost($host) { - return $this->getValue('timeout'); + return $this->setValue('host', $host); } - /** - * @return mixed + /** + * @param $port * - * @deprecated Will be removed in 2.0. Use Configuration::getValue('username') + * @return Configuration */ - public function getUsername() + public function withPort($port) { - return $this->getValue('username'); + return $this->setValue('port', $port); } - /** - * @return mixed + /** + * @param $database * - * @deprecated Will be removed in 2.0. Use Configuration::getValue('password') + * @return Configuration */ - public function getPassword() + public function withDatabase($database) { - return $this->getValue('password'); + return $this->setValue('database', $database); } /** - * @param $mode + * @param array $bookmarks * * @return Configuration */ - public function withTLSMode($mode) + public function withBookmarks(array $bookmarks) { - $new = $this->setValue('tls_mode', $mode); - - // To keep BC - $new->tlsMode = $mode; - - return $new; + return $this->setValue('bookmarks', $bookmarks); } + /** - * @return mixed + * @param $uri * - * @deprecated Will be removed in 2.0. Use Configuration::getValue('tls_mode') + * @return Configuration */ - public function getTlsMode() + public function withUri($uri) { - return $this->getValue('tls_mode'); + $parsedUri = parse_url($uri); + $newConfig = $this; + if (isset($parsedUri['scheme'])) { + $newConfig = $newConfig->withScheme($parsedUri['scheme']); + } + if (isset($parsedUri['user'])) { + if (isset($parsedUri['pass'])) { + $newConfig = $newConfig->withCredentials($parsedUri['user'], $parsedUri['pass']); + } else { + $newConfig = $newConfig->withCredentials($parsedUri['user'], null); + } + } + if (isset($parsedUri['host'])) { + $newConfig = $newConfig->withHost($parsedUri['host']); + } + if (isset($parsedUri['port'])) { + $newConfig = $newConfig->withPort($parsedUri['port']); + } + if (isset($parsedUri['path'])) { + $newConfig = $newConfig->withDatabase(str_replace('/', '', $parsedUri['path'])); + } + if (isset($parsedUri['query'])) { + parse_str($parsedUri['query'], $query); + if (isset($query['tls']) && $query['tls'] == 'true') { + if (isset($query['validate_tls']) && $query['validate_tls'] == 'false') { + $newConfig = $newConfig->withTLSMode(self::TLSMODE_REQUIRED_NO_VALIDATION); + } else { + $newConfig = $newConfig->withTLSMode(self::TLSMODE_REQUIRED); + } + } + } + return $newConfig; } } diff --git a/src/Driver.php b/src/Driver.php index 306e713..7ea3119 100644 --- a/src/Driver.php +++ b/src/Driver.php @@ -20,7 +20,6 @@ use PTS\Bolt\Protocol\V3\Session as SessionV3; use PTS\Bolt\Protocol\V4\Session as SessionV4; use GraphAware\Common\Driver\DriverInterface; -use phpDocumentor\Reflection\Types\Self_; use Symfony\Component\EventDispatcher\EventDispatcher; use PTS\Bolt\Exception\HandshakeException; @@ -58,14 +57,14 @@ class Driver implements DriverInterface protected $session; /** - * @var array + * @var int */ - protected $credentials; + private $forceBoltVersion; /** - * @var int + * @var Configuration */ - private $forceBoltVersion; + private $config; /** * @return string @@ -76,20 +75,25 @@ public static function getUserAgent() } /** - * @param string $uri - * @param Configuration|null $configuration - * @param int $forceBoltVersion + * @param Configuration $configuration + * @param Configuration|null $deprecatedConfiguration @deprecated */ - public function __construct($uri, Configuration $configuration = null, $forceBoltVersion = 0) + public function __construct($configuration, Configuration $deprecatedConfiguration = null) { - $this->forceBoltVersion = $forceBoltVersion; - $this->credentials = null !== $configuration ? $configuration->getValue('credentials', []) : []; - $config = null !== $configuration ? $configuration : Configuration::create(); - $parsedUri = parse_url($uri); - $host = isset($parsedUri['host']) ? $parsedUri['host'] : $parsedUri['path']; - $port = isset($parsedUri['port']) ? $parsedUri['port'] : static::DEFAULT_TCP_PORT; + if (is_string($configuration)) { + @trigger_error( + 'Passing string URI as first argument is deprecated. Please pass configuration with Configuration::create()->withUri($uri) as first and only argument', // phpcs:ignore + \E_USER_DEPRECATED + ); + $this->config = null !== $deprecatedConfiguration ? + $deprecatedConfiguration->withUri($configuration) + : Configuration::create()->withUri($configuration); + } elseif ($configuration instanceof Configuration) { + $this->config = $configuration; + } + $this->forceBoltVersion = $this->config->getValue('forced_bolt_version'); $this->dispatcher = new EventDispatcher(); - $this->io = StreamSocket::withConfiguration($host, $port, $config, $this->dispatcher); + $this->io = StreamSocket::withConfiguration($this->config, $this->dispatcher); $this->sessionRegistry = new SessionRegistry($this->io, $this->dispatcher); $this->sessionRegistry->registerSession(Session::class); $this->sessionRegistry->registerSession(SessionV2::class); @@ -110,7 +114,7 @@ public function session() $this->versionAgreed = $this->handshake(); } - $this->session = $this->sessionRegistry->getSession($this->versionAgreed, $this->credentials); + $this->session = $this->sessionRegistry->getSession($this->versionAgreed, $this->config); return $this->session; } diff --git a/src/Exception/SSLException.php b/src/Exception/SSLException.php new file mode 100644 index 0000000..3344fc5 --- /dev/null +++ b/src/Exception/SSLException.php @@ -0,0 +1,7 @@ + - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace PTS\Bolt\IO; - -use PTS\Bolt\Exception\IOException; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -class Socket extends AbstractIO -{ - /** - * @var string - */ - private $host; - - /** - * @var int - */ - private $port; - - /** - * @var resource|null - */ - private $socket; - - /** - * @var int - */ - private $timeout; - - /** - * @var null|EventDispatcherInterface - */ - protected $dispatcher; - - /** - * Socket constructor. - * - * @param string $host - * @param int $port - * @param int $timeout - * @param EventDispatcherInterface|null $dispatcher - */ - public function __construct($host, $port, $timeout = 5, EventDispatcherInterface $dispatcher = null) - { - $this->host = $host; - $this->port = $port; - $this->timeout = $timeout; - $this->dispatcher = $dispatcher; - } - - /** - * {@inheritdoc} - */ - public function connect() - { - $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - - if (!socket_connect($this->socket, $this->host, $this->port)) { - $errno = socket_last_error($this->socket); - $errstr = socket_strerror($errno); - throw new IOException( - sprintf( - 'Error connecting to server "%s": %s', - $errno, - $errstr - ), - $errno - ); - } - - socket_set_block($this->socket); - socket_set_option($this->socket, SOL_TCP, TCP_NODELAY, 1); - //socket_set_option($this->socket, SOL_SOCKET, SO_PASSCRED - socket_set_option($this->socket, SOL_SOCKET, SO_KEEPALIVE, 1); - socket_set_option($this->socket, SOL_SOCKET, SO_RCVTIMEO, ['sec' => $this->timeout, 'usec' => 0]); - socket_set_option($this->socket, SOL_SOCKET, SO_SNDTIMEO, ['sec' => $this->timeout, 'usec' => 0]); - - return true; - } - - /** - * {@inheritdoc} - */ - public function close() - { - if (is_resource($this->socket)) { - echo 'closing'; - socket_close($this->socket); - } - $this->socket = null; - - return true; - } - - /** - * {@inheritdoc} - */ - public function reconnect() - { - $this->close(); - - return $this->connect(); - } - - /** - * {@inheritdoc} - */ - public function write($data) - { - $len = mb_strlen($data, 'ASCII'); - - while (true) { - // Null sockets are invalid, throw exception - if (is_null($this->socket)) { - throw new IOException(sprintf( - 'Socket was null! Last SocketError was: %s', - socket_strerror(socket_last_error()) - )); - } - - $sent = socket_write($this->socket, $data, $len); - if ($sent === false) { - throw new IOException(sprintf( - 'Error sending data. Last SocketError: %s', - socket_strerror(socket_last_error()) - )); - } - - // Check if the entire message has been sent - if ($sent < $len) { - // If not sent the entire message. - // Get the part of the message that has not yet been sent as message - $data = mb_substr($data, $sent, mb_strlen($data, 'ASCII') - $sent, 'ASCII'); - // Get the length of the not sent part - $len -= $sent; - } else { - break; - } - } - } - - /** - * {@inheritdoc} - */ - public function select($sec, $usec) - { - // not implemented yet - } - - /** - * {@inheritdoc} - */ - public function read($n) - { - $res = ''; - $read = 0; - - $buf = socket_read($this->socket, $n); - - while ($read < $n && $buf !== '' && $buf !== false) { - $read += mb_strlen($buf, 'ASCII'); - $res .= $buf; - $buf = socket_read($this->socket, $n - $read); - } - - if (mb_strlen($res, 'ASCII') != $n) { - throw new IOException(sprintf( - 'Error reading data. Received %s instead of expected %s bytes', - mb_strlen($res, 'ASCII'), - $n - )); - } - - return $res; - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - return is_resource($this->socket); - } - - /** - * @return null|resource - */ - public function getSocket() - { - return $this->socket; - } -} diff --git a/src/IO/StreamSocket.php b/src/IO/StreamSocket.php index 6276960..ce46f13 100644 --- a/src/IO/StreamSocket.php +++ b/src/IO/StreamSocket.php @@ -13,7 +13,7 @@ use PTS\Bolt\Configuration; use PTS\Bolt\Exception\IOException; -use PTS\Bolt\Misc\Helper; +use PTS\Bolt\Exception\SSLException; use Symfony\Component\EventDispatcher\EventDispatcher; class StreamSocket extends AbstractIO @@ -85,24 +85,15 @@ public function __construct( $this->context = null !== $context ? $context : stream_context_create(); $this->configuration = $configuration; - - /* - if (is_null($this->context)) { - $this->context = stream_context_create(); - } else { - $this->protocol = 'ssl'; - } - */ - //stream_set_blocking($this->sock, false); } public static function withConfiguration( - $host, - $port, Configuration $configuration, EventDispatcher $eventDispatcher = null ) { $context = null; + $host = $configuration->getValue('host'); + $port = $configuration->getValue('port'); $bindTo = $configuration->getValue('bind_to_interface'); if (null !== $bindTo && 'null' !== $bindTo) { $context = stream_context_create([ @@ -120,7 +111,6 @@ public static function withConfiguration( */ public function write($data) { - //echo \PTS\Bolt\Misc\Helper::prettyHex($data) . PHP_EOL; $this->assertConnected(); $written = 0; $len = mb_strlen($data, 'ASCII'); @@ -222,15 +212,25 @@ public function connect() $errstr )); } - + if ($this->shouldEnableCrypto()) { - $result = stream_socket_enable_crypto( - $this->sock, - true, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT - ); + try { + if (!$this->shouldValidateTls()) { + stream_context_set_option($this->context, 'ssl', 'allow_self_signed', true); + stream_context_set_option($this->context, 'ssl', 'verify_peer', false); + stream_context_set_option($this->context, 'ssl', 'verify_peer_name', false); + } + $result = stream_socket_enable_crypto( + $this->sock, + true, + STREAM_CRYPTO_METHOD_SSLv23_CLIENT + ); + } catch (\Exception $e) { + throw new SSLException(sprintf('Unable to enable crypto on socket: %s', $e->getMessage())); + } + if (true !== $result) { - throw new \RuntimeException(sprintf('Unable to enable crypto on socket')); + throw new SSLException(sprintf('Unable to enable crypto on socket')); } } @@ -307,11 +307,23 @@ private function readAll() public function shouldEnableCrypto() { if (null !== $this->configuration - && $this->configuration->getValue('tls_mode') === Configuration::TLSMODE_REQUIRED + && ($this->configuration->getValue('tls_mode') === Configuration::TLSMODE_REQUIRED || + $this->configuration->getValue('tls_mode') === Configuration::TLSMODE_REQUIRED_NO_VALIDATION) ) { return true; } return false; } + + public function shouldValidateTls() + { + if (null !== $this->configuration + && $this->configuration->getValue('tls_mode') === Configuration::TLSMODE_REQUIRED_NO_VALIDATION + ) { + return false; + } + + return true; + } } diff --git a/src/Misc/DateHelperTrait.php b/src/Misc/DateHelperTrait.php new file mode 100644 index 0000000..55c4897 --- /dev/null +++ b/src/Misc/DateHelperTrait.php @@ -0,0 +1,17 @@ + 0 ? '+' : '-'; + $minutes = abs($seconds) / 60; + $hours = (int)($minutes / 60); + $minutes = (int)($minutes - $hours * 60); + $minutes = $minutes < 10 ? '0'.$minutes : $minutes; + $offset = $hours < 10 ? $prefix.'0'.$hours.$minutes : $prefix.$hours.$minutes; + return new \DateTimeZone($offset); + } +} diff --git a/src/Protocol/SessionInterface.php b/src/Protocol/SessionInterface.php index 5802050..f338b1e 100644 --- a/src/Protocol/SessionInterface.php +++ b/src/Protocol/SessionInterface.php @@ -69,4 +69,10 @@ public function commit(); * @return void */ public function rollback(); + + /** + * Return last received bookmark + * @return string + */ + public function getLastBookmark(): string; } diff --git a/src/Protocol/SessionRegistry.php b/src/Protocol/SessionRegistry.php index 244bbfe..1cc0cfd 100644 --- a/src/Protocol/SessionRegistry.php +++ b/src/Protocol/SessionRegistry.php @@ -13,6 +13,7 @@ use PTS\Bolt\IO\AbstractIO; use GraphAware\Common\Driver\SessionInterface; +use PTS\Bolt\Configuration; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class SessionRegistry @@ -76,11 +77,11 @@ public function supportsVersion($version) /** * @param int $version - * @param array $credentials + * @param Configuration $config * * @return SessionInterface */ - public function getSession($version, array $credentials) + public function getSession($version, Configuration $config) { $v = (int)$version; @@ -89,6 +90,6 @@ public function getSession($version, array $credentials) } $class = $this->sessions[$v]; - return new $class($this->io, $this->dispatcher, $credentials); + return new $class($this->io, $this->dispatcher, $config); } } diff --git a/src/Protocol/V1/Session.php b/src/Protocol/V1/Session.php index 78d0079..dfe7813 100644 --- a/src/Protocol/V1/Session.php +++ b/src/Protocol/V1/Session.php @@ -12,26 +12,19 @@ namespace PTS\Bolt\Protocol\V1; use PTS\Bolt\Driver; -use OutOfBoundsException; use PTS\Bolt\IO\AbstractIO; use PTS\Bolt\Protocol\Pipeline; -use PTS\Bolt\Exception\IOException; -use http\Exception\RuntimeException; use PTS\Bolt\Protocol\AbstractSession; use GraphAware\Common\Cypher\Statement; use PTS\Bolt\Protocol\PipelineInterface; -use PTS\Bolt\Protocol\Message\RawMessage; use PTS\Bolt\Protocol\Message\RunMessage; use PTS\Bolt\Protocol\Message\InitMessage; -use phpDocumentor\Reflection\Types\Boolean; use PTS\Bolt\Result\Result as CypherResult; use PTS\Bolt\Protocol\Message\PullAllMessage; use GraphAware\Common\Result\ResultCollection; -use PTS\Bolt\Exception\SerializationException; +use PTS\Bolt\Configuration; use PTS\Bolt\Protocol\Message\AbstractMessage; use PTS\Bolt\Exception\MessageFailureException; -use RuntimeException as GlobalRuntimeException; -use PTS\Bolt\Exception\BoltOutOfBoundsException; use PTS\Bolt\Protocol\Message\AckFailureMessage; use PTS\Bolt\Exception\BoltInvalidArgumentException; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -50,6 +43,16 @@ class Session extends AbstractSession */ public $transaction; + /** + * @var Configuration + */ + protected $config; + + /** + * @var string + */ + protected $lastBookmark; + /** * @var array */ @@ -67,11 +70,12 @@ class Session extends AbstractSession public function __construct( AbstractIO $io, EventDispatcherInterface $dispatcher, - array $credentials = [], + Configuration $config = null, $init = true ) { parent::__construct($io, $dispatcher); - $this->credentials = $credentials; + $this->config = $config; + $this->credentials = $config ? $config->getValue('credentials', []) : []; if ($init) { $this->init(); } @@ -85,6 +89,11 @@ public static function getProtocolVersion() return self::PROTOCOL_VERSION; } + public function getLastBookmark(): string + { + return $this->lastBookmark; + } + /** * {@inheritdoc} */ @@ -122,6 +131,13 @@ protected function fetchRunResult($statement, array $parameters = [], $tag = nul } else { $cypherResult->setStatistics([]); } + if (isset($pullMeta[0]->getElements()['db'])) { + $cypherResult->getSummary()->setDatabase($pullMeta[0]->getElements()['db']); + } + if (isset($pullMeta[0]->getElements()['bookmark'])) { + $cypherResult->getSummary()->setBookmark($pullMeta[0]->getElements()['bookmark']); + $this->lastBookmark = $pullMeta[0]->getElements()['bookmark']; + } } return $cypherResult; diff --git a/src/Protocol/V1/Signatures.php b/src/Protocol/V1/Signatures.php deleted file mode 100644 index 1fc0121..0000000 --- a/src/Protocol/V1/Signatures.php +++ /dev/null @@ -1,9 +0,0 @@ -config->getValue('database')) { + $meta['db'] = $this->config->getValue('database'); + } + if ($this->config->getValue('bookmarks')) { + $meta['bookmarks'] = $this->config->getValue('bookmarks'); + } + return $meta; + } + + protected function createRunMessage($statement, $prams = []) + { + return new RunMessageWithMetadata($statement, $prams, $this->getMessageMeta()); + } + protected function createPullAllMessage() { + $meta = $this->getMessageMeta(); // same effect as PullAll message - return new PullMessage(['n' => -1]); + $meta['n'] = -1; + return new PullMessage($meta); } } diff --git a/src/Result/Result.php b/src/Result/Result.php index aeee9fd..7d828cd 100644 --- a/src/Result/Result.php +++ b/src/Result/Result.php @@ -42,6 +42,11 @@ class Result extends AbstractRecordCursor */ protected $fields; + /** + * @var ResultSummary + */ + protected $resultSummary; + /** * {@inheritdoc} */ @@ -109,8 +114,17 @@ public function setType($type) /** * @return ResultSummary + * @deprecated Use getSummary */ public function summarize() + { + return $this->resultSummary; + } + + /** + * @return ResultSummary + */ + public function getSummary() { return $this->resultSummary; } diff --git a/src/Result/ResultSummary.php b/src/Result/ResultSummary.php index c558388..a363cec 100644 --- a/src/Result/ResultSummary.php +++ b/src/Result/ResultSummary.php @@ -19,6 +19,16 @@ class ResultSummary implements ResultSummaryInterface */ protected $updateStatistics; + /** + * @var string + */ + protected $database = ''; + + /** + * @var string + */ + protected $bookmark = ''; + /** * @param StatementInterface $statement */ @@ -70,4 +80,24 @@ public function notifications() { // TODO: Implement notifications() method. } + + public function getDatabase(): string + { + return $this->database; + } + + public function setDatabase(string $database) + { + $this->database = $database; + } + + public function getBookmark(): string + { + return $this->bookmark; + } + + public function setBookmark(string $bookmark) + { + $this->bookmark = $bookmark; + } } diff --git a/src/Type/Temporal/DateTimeOffset.php b/src/Type/Temporal/DateTimeOffset.php index 5d1fa6b..2a66b2a 100644 --- a/src/Type/Temporal/DateTimeOffset.php +++ b/src/Type/Temporal/DateTimeOffset.php @@ -3,12 +3,15 @@ namespace PTS\Bolt\Type\Temporal; +use PTS\Bolt\Misc\DateHelperTrait; use PTS\Bolt\PackStream\Packer; use PTS\Bolt\Protocol\Constants; use PTS\Bolt\Type\PackableType; class DateTimeOffset implements DateTimeConvertible, PackableType { + use DateHelperTrait; + const MARKER = Constants::MARKER_DATE_TIME_OFFSET; const SIGNATURE = Constants::SIGNATURE_DATE_TIME_OFFSET; @@ -46,7 +49,7 @@ public function toDateTime(): \DateTime $date = new \DateTime(); $date ->setTimestamp($this->epochSeconds) - ->setTimezone(new \DateTimeZone(timezone_name_from_abbr('', $this->zoneOffset, 1))); + ->setTimezone($this->zoneFromOffset($this->zoneOffset)); return $date; } diff --git a/src/Type/Temporal/Time.php b/src/Type/Temporal/Time.php index 0eb59ea..f2118ed 100644 --- a/src/Type/Temporal/Time.php +++ b/src/Type/Temporal/Time.php @@ -3,12 +3,15 @@ namespace PTS\Bolt\Type\Temporal; +use PTS\Bolt\Misc\DateHelperTrait; use PTS\Bolt\PackStream\Packer; use PTS\Bolt\Protocol\Constants; use PTS\Bolt\Type\PackableType; class Time implements DateTimeConvertible, PackableType { + use DateHelperTrait; + const MARKER = Constants::MARKER_TIME; const SIGNATURE = Constants::SIGNATURE_TIME; @@ -43,7 +46,7 @@ public function toDateTime(): \DateTime { $date = new \DateTime( 'today midnight', - new \DateTimeZone(timezone_name_from_abbr('', $this->zoneOffset, 1)) + $this->zoneFromOffset($this->zoneOffset) ); $seconds = $this->nanoSecondsSinceMidnight / 1000000000; $date->modify("+$seconds seconds"); diff --git a/tests/Documentation/DocumentationTest.php b/tests/Documentation/DocumentationTest.php index e1ec94d..f7418cd 100644 --- a/tests/Documentation/DocumentationTest.php +++ b/tests/Documentation/DocumentationTest.php @@ -19,7 +19,7 @@ * * @group documentation */ -class DocumentationTest extends \PHPUnit_Framework_TestCase +class DocumentationTest extends \PHPUnit\Framework\TestCase { public function testSetup() { diff --git a/tests/Example/MovieExampleTest.php b/tests/Example/MovieExampleTest.php index 196296b..253fa17 100644 --- a/tests/Example/MovieExampleTest.php +++ b/tests/Example/MovieExampleTest.php @@ -11,7 +11,7 @@ */ class MovieExampleTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); @@ -61,7 +61,7 @@ public function testRecordViewThrowsExceptionWhenKeyDoesntExist() $movieNode = $record->nodeValue('m'); $this->assertInstanceOf(Node::class, $movieNode); - $this->setExpectedException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $record->nodeValue('z'); } } diff --git a/tests/Integration/BookmarkTest.php b/tests/Integration/BookmarkTest.php new file mode 100644 index 0000000..58fd69d --- /dev/null +++ b/tests/Integration/BookmarkTest.php @@ -0,0 +1,51 @@ +getConfig()->getValue('forced_bolt_version') < 4) { + $this->markTestSkipped('Bookmark feature only since V4+'); + return; + } + $session = $this->getSession(); + $result = $session->run('RETURN 1'); + $this->assertEquals($session->getLastBookmark(), $result->getSummary()->getBookmark()); + } + + public function testInvalidBookmarkFails() + { + if ($this->getConfig()->getValue('forced_bolt_version') < 4) { + $this->markTestSkipped('Bookmark feature only since V4+'); + return; + } + $config = $this->getConfig()->withBookmarks(['FB:bad']); + $this->setDriverWhithConfig($config); + $session = $this->getSession(); + $this->expectException(BoltExceptionInterface::class); + $session->run('RETURN 1'); + } + + public function testGoodBookmarkWorks() + { + if ($this->getConfig()->getValue('forced_bolt_version') < 4) { + $this->markTestSkipped('Bookmark feature only since V4+'); + return; + } + $session = $this->getSession(); + $session->run('RETURN 1'); + $this->setDriverWhithConfig($this->getConfig()->withBookmarks([$session->getLastBookmark()])); + $session2 = $this->getSession(); + $result = $session2->run('RETURN 1'); + $this->assertNotNull($result); + } +} diff --git a/tests/Integration/ExceptionDispatchTest.php b/tests/Integration/ExceptionDispatchTest.php index 87221e6..48f56e1 100644 --- a/tests/Integration/ExceptionDispatchTest.php +++ b/tests/Integration/ExceptionDispatchTest.php @@ -20,7 +20,7 @@ public function testExceptionsAreThrown() { $session = $this->getSession(); - $this->setExpectedException(MessageFailureException::class); + $this->expectException(MessageFailureException::class); $session->run("CREATE (n:)"); try { @@ -73,7 +73,7 @@ public function testMessageFailuresAreHandledInSequence() $session = $this->getSession(); $this->createConstraint('User', 'id'); $session->run('CREATE (n:User {id:1})'); - $this->setExpectedException(MessageFailureException::class); + $this->expectException(MessageFailureException::class); $session->run('CREATE (n:User {id:1})'); } @@ -88,7 +88,7 @@ public function testMessageFailuresAreHandledInPipelines() $pipeline->push('CREATE (n:User {id:4})'); $pipeline->push('CREATE (n:User {id:1})'); $pipeline->push('CREATE (n:User {id:5})'); - $this->setExpectedException(MessageFailureException::class); + $this->expectException(MessageFailureException::class); $pipeline->run(); } @@ -103,7 +103,7 @@ public function testPipelineWithConstraintCreation() $pipeline = $session->createPipeline(); $pipeline->push('CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE'); $pipeline->push('CREATE (n:User {id:1})'); - $this->setExpectedException(MessageFailureException::class); + $this->expectException(MessageFailureException::class); $pipeline->run(); } diff --git a/tests/Integration/HandshakeIntegrationTest.php b/tests/Integration/HandshakeIntegrationTest.php index 2f56f19..a73d30f 100644 --- a/tests/Integration/HandshakeIntegrationTest.php +++ b/tests/Integration/HandshakeIntegrationTest.php @@ -31,11 +31,11 @@ public function testErrorIsThrownWhenNoVersionCanBeAgreed() return; } $driver = new Driver( - $this->getBoltUrl(), - $this->getConfig(), - 1 + $this->getConfig() + ->withBoltVersion(1) + ->withUri($this->getBoltUrl()) ); - $this->setExpectedException(\PTS\Bolt\Exception\HandshakeException::class); + $this->expectException(\PTS\Bolt\Exception\HandshakeException::class); $driver->session(); } } diff --git a/tests/Integration/MultiDBTest.php b/tests/Integration/MultiDBTest.php new file mode 100644 index 0000000..b5f4f32 --- /dev/null +++ b/tests/Integration/MultiDBTest.php @@ -0,0 +1,25 @@ +getConfig()->getValue('forced_bolt_version') < 4) { + $this->markTestSkipped('Multidatabase feature only since V4+'); + return; + } + $config = $this->getConfig()->withDatabase('system'); + $this->setDriverWhithConfig($config); + $session = $this->getSession(); + $result = $session->run('SHOW DATABASES'); + $this->assertEquals('system', $result->getSummary()->getDatabase()); + } +} diff --git a/tests/Integration/Packing/PackingFloatsIntegrationTest.php b/tests/Integration/Packing/PackingFloatsIntegrationTest.php index 42f8256..55d160b 100644 --- a/tests/Integration/Packing/PackingFloatsIntegrationTest.php +++ b/tests/Integration/Packing/PackingFloatsIntegrationTest.php @@ -11,7 +11,7 @@ */ class PackingFloatsIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); diff --git a/tests/Integration/Packing/PackingGraphStructureIntegrationTest.php b/tests/Integration/Packing/PackingGraphStructureIntegrationTest.php index dcf16a5..32eb827 100644 --- a/tests/Integration/Packing/PackingGraphStructureIntegrationTest.php +++ b/tests/Integration/Packing/PackingGraphStructureIntegrationTest.php @@ -14,7 +14,7 @@ */ class PackingGraphStructureIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); @@ -72,6 +72,6 @@ public function testUnpackingPaths() $result = $session->run("MATCH p=(a:A)-[r*]->(b) RETURN p, length(p) as l"); $this->assertInstanceOf(Path::class, $result->getRecord()->value('p')); - $this->assertInternalType('integer', $result->getRecord()->value('l')); + $this->assertIsInt($result->getRecord()->value('l')); } } diff --git a/tests/Integration/Packing/PackingIntegersIntegrationTest.php b/tests/Integration/Packing/PackingIntegersIntegrationTest.php index fbbffc0..2b55172 100644 --- a/tests/Integration/Packing/PackingIntegersIntegrationTest.php +++ b/tests/Integration/Packing/PackingIntegersIntegrationTest.php @@ -14,7 +14,7 @@ */ class PackingIntegersIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); diff --git a/tests/Integration/Packing/PackingListIntegrationTest.php b/tests/Integration/Packing/PackingListIntegrationTest.php index 7a4d738..1cbd68f 100644 --- a/tests/Integration/Packing/PackingListIntegrationTest.php +++ b/tests/Integration/Packing/PackingListIntegrationTest.php @@ -6,7 +6,7 @@ class PackingListIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); diff --git a/tests/Integration/Packing/PackingMapsIntegrationTest.php b/tests/Integration/Packing/PackingMapsIntegrationTest.php index 4870cfc..04b337b 100644 --- a/tests/Integration/Packing/PackingMapsIntegrationTest.php +++ b/tests/Integration/Packing/PackingMapsIntegrationTest.php @@ -14,7 +14,7 @@ */ class PackingMapsIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); diff --git a/tests/Integration/Packing/PackingPointsIntegrationTest.php b/tests/Integration/Packing/PackingPointsIntegrationTest.php index 9381f33..326fab7 100644 --- a/tests/Integration/Packing/PackingPointsIntegrationTest.php +++ b/tests/Integration/Packing/PackingPointsIntegrationTest.php @@ -14,7 +14,7 @@ */ class PackingPointsIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); diff --git a/tests/Integration/Packing/PackingTemporalIntegrationTest.php b/tests/Integration/Packing/PackingTemporalIntegrationTest.php index 863566c..c16daa9 100644 --- a/tests/Integration/Packing/PackingTemporalIntegrationTest.php +++ b/tests/Integration/Packing/PackingTemporalIntegrationTest.php @@ -21,7 +21,7 @@ */ class PackingTemporalIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); diff --git a/tests/Integration/Packing/PackingTextIntegrationTest.php b/tests/Integration/Packing/PackingTextIntegrationTest.php index c0a90dd..2c386c6 100644 --- a/tests/Integration/Packing/PackingTextIntegrationTest.php +++ b/tests/Integration/Packing/PackingTextIntegrationTest.php @@ -14,7 +14,7 @@ */ class PackingTextIntegrationTest extends IntegrationTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->emptyDB(); @@ -46,20 +46,17 @@ public function testText16Packing() $this->doRangeTest(256, 356); $this->doRangeTest(1024, 1026); $this->doRangeTest(2048, 2050); - //$this->doRangeTest(16351, 16383); - //$this->doRangeTest(65500, 65535); } /** * @group text32 - * @group fail * @group stringx + * @group long */ public function testText32Packing() { - //$this->markTestSkipped("Neo4j3.0M02 has issues with 64 bits texts"); - //$this->doRangeTest(65537, 65537); - //$this->doRangeTest(500000, 500000); + $this->doRangeTest(65537, 65537); + $this->doRangeTest(500000, 500000); } public function doRangeTest($min, $max) diff --git a/tests/Integration/PipelineIntegrationTest.php b/tests/Integration/PipelineIntegrationTest.php index 24751c4..4a1eb8f 100644 --- a/tests/Integration/PipelineIntegrationTest.php +++ b/tests/Integration/PipelineIntegrationTest.php @@ -25,7 +25,7 @@ public function testPipelinesCanBeRun() $this->assertEquals(2, $results->current()->firstRecord()->getByIndex(0)->get('id')); // no more statements after pipeline has run - $this->setExpectedException(PipelineFinishedException::class); + $this->expectException(PipelineFinishedException::class); $pipeline->push('CREATE (n:User {id:1}) RETURN n', [], 'first'); } @@ -35,7 +35,7 @@ public function testPipelinesDoNotAllowEmptyStatements() $session = $this->getSession(); $pipeline = $session->createPipeline(); // no empty statements - $this->setExpectedException(BoltInvalidArgumentException::class); + $this->expectException(BoltInvalidArgumentException::class); $pipeline->push(''); } @@ -45,7 +45,7 @@ public function testPipelinesCanNotBeRunTwice() $pipeline = $session->createPipeline(); $pipeline->push('CREATE (n:User {id:1}) RETURN n', [], 'first'); $pipeline->run(); - $this->setExpectedException(PipelineFinishedException::class); + $this->expectException(PipelineFinishedException::class); $pipeline->run(); } } diff --git a/tests/Integration/RealLifeUseCasesITest.php b/tests/Integration/RealLifeUseCasesITest.php index 9b71065..250edbf 100644 --- a/tests/Integration/RealLifeUseCasesITest.php +++ b/tests/Integration/RealLifeUseCasesITest.php @@ -30,7 +30,8 @@ public function testNestedEmptyArrays() MERGE (o:Person {id: prev}) MERGE (p)-[:KNOWS]->(o)'; - $this->getSession()->run($query, ['batches' => $batches]); + $result = $this->getSession()->run($query, ['batches' => $batches]); + $this->assertNotNull($result); } /** diff --git a/tests/Integration/SSLConnectionTest.php b/tests/Integration/SSLConnectionTest.php new file mode 100644 index 0000000..5125784 --- /dev/null +++ b/tests/Integration/SSLConnectionTest.php @@ -0,0 +1,31 @@ +getConfig()->withTLSMode(Configuration::TLSMODE_REQUIRED_NO_VALIDATION); + $this->setDriverWhithConfig($config); + $session = $this->getSession(); + $this->assertInstanceOf(SessionInterface::class, $session); + } + + public function testSSLConnectionWithValidation() + { + $config = $this->getConfig()->withTLSMode(Configuration::TLSMODE_REQUIRED); + $this->setDriverWhithConfig($config); + $this->expectException(\PTS\Bolt\Exception\SSLException::class); + $this->getSession(); + } +} diff --git a/tests/IntegrationTestCase.php b/tests/IntegrationTestCase.php index 1ec3532..bb537f2 100644 --- a/tests/IntegrationTestCase.php +++ b/tests/IntegrationTestCase.php @@ -6,7 +6,7 @@ use PTS\Bolt\Driver; use PTS\Bolt\GraphDatabase; -class IntegrationTestCase extends \PHPUnit_Framework_TestCase +class IntegrationTestCase extends \PHPUnit\Framework\TestCase { /** * @var \PTS\Bolt\Driver @@ -16,21 +16,27 @@ class IntegrationTestCase extends \PHPUnit_Framework_TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { - $version = getenv('BOLT_VERSION') ? getenv('BOLT_VERSION') : 0; - $this->driver = new Driver( - $this->getBoltUrl(), - $this->getConfig(), - (int)$version - ); + $this->setDriverWhithConfig($this->getConfig()); } protected function getConfig() { - return getenv('NEO4J_USER') ? - Configuration::create()->withCredentials(getenv('NEO4J_USER'), getenv('NEO4J_PASSWORD')) - : Configuration::create(); + $version = (int)(getenv('BOLT_VERSION') ? getenv('BOLT_VERSION') : 0); + return (getenv('NEO4J_USER') ? + Configuration::create() + ->withCredentials(getenv('NEO4J_USER'), getenv('NEO4J_PASSWORD')) + ->withBoltVersion($version) + : Configuration::create())->withBoltVersion($version); + } + + protected function setDriverWhithConfig(Configuration $config) + { + $this->driver = new Driver( + $this->getBoltUrl(), + $config + ); } /** diff --git a/tests/Result/MapAccessUnitTest.php b/tests/Result/MapAccessUnitTest.php index f5eced1..6ecc729 100644 --- a/tests/Result/MapAccessUnitTest.php +++ b/tests/Result/MapAccessUnitTest.php @@ -8,7 +8,7 @@ * * @group result-unit */ -class MapAccessUnitTest extends \PHPUnit_Framework_TestCase +class MapAccessUnitTest extends \PHPUnit\Framework\TestCase { public function testDefaultValueCanBePassed() { @@ -20,7 +20,7 @@ public function testDefaultValueCanBePassed() public function testExceptionIsThrownIfNotDefaultGiven() { $map = new DummyMA(['key' => 'val']); - $this->setExpectedException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $map->value('not_exist'); } } diff --git a/tests/TCK/TCK9TypesTest.php b/tests/TCK/TCK9TypesTest.php index e350f1d..e151fb4 100644 --- a/tests/TCK/TCK9TypesTest.php +++ b/tests/TCK/TCK9TypesTest.php @@ -87,7 +87,7 @@ public function testResultTypes() // collection of null $result = $session->run("UNWIND range(0, 2) as r CREATE (n) RETURN collect(n.x) as x"); - $this->assertInternalType('array', $result->getRecord()->value('x')); + $this->assertIsArray($result->getRecord()->value('x')); foreach ($result->getRecord()->value('x') as $v) { $this->assertEquals(null, $v); } @@ -101,7 +101,7 @@ public function testResultTypes() $result = $session->run( "UNWIND range(0, 2) as r CREATE (n) SET n.x = (id(n) = id(n)) RETURN collect(n.x) as x" ); - $this->assertInternalType('array', $result->getRecord()->value('x')); + $this->assertIsArray($result->getRecord()->value('x')); foreach ($result->getRecord()->value('x') as $v) { $this->assertEquals(true, $v); } @@ -120,24 +120,24 @@ public function testResultTypes() ); $this->assertCount(3, $result->getRecord()->value('x')); foreach ($result->getRecord()->value('x') as $v) { - $this->assertInternalType('float', $v); + $this->assertIsFloat($v); } // int $result = $session->run("CREATE (n) RETURN id(n) as id"); - $this->assertInternalType('int', $result->getRecord()->value('id')); + $this->assertIsInt($result->getRecord()->value('id')); $this->assertTrue($result->getRecord()->value('id') >= 0); // collection of integers $result = $session->run("UNWIND range(0, 2) as r CREATE (n:X) SET n.k = id(n) RETURN collect(n.k) as x"); $this->assertCount(3, $result->getRecord()->value('x')); foreach ($result->getRecord()->value('x') as $v) { - $this->assertInternalType('int', $v); + $this->assertIsInt($v); } // list $result = $session->run("CREATE (n:Person:Male) RETURN labels(n) as l"); - $this->assertInternalType('array', $result->getRecord()->value('l')); + $this->assertIsArray($result->getRecord()->value('l')); $this->assertTrue(array_key_exists(0, $result->getRecord()->value('l'))); $this->assertTrue(array_key_exists(1, $result->getRecord()->value('l'))); @@ -145,23 +145,23 @@ public function testResultTypes() $result = $session->run("UNWIND range(0, 2) as r CREATE (n:X) RETURN collect(labels(n)) as x"); $this->assertCount(3, $result->getRecord()->value('x')); foreach ($result->getRecord()->value('x') as $v) { - $this->assertInternalType('array', $v); + $this->assertIsArray($v); $this->assertEquals('X', $v[0]); } // map $result = $session->run("CREATE (n:Node) RETURN {id: id(n), labels: labels(n)} as map"); - $this->assertInternalType('array', $result->getRecord()->value('map')); + $this->assertIsArray($result->getRecord()->value('map')); $this->assertTrue(array_key_exists('id', $result->getRecord()->value('map'))); $this->assertTrue(array_key_exists('labels', $result->getRecord()->value('map'))); - $this->assertInternalType('int', $result->getRecord()->value('map')['id']); - $this->assertInternalType('array', $result->getRecord()->value('map')['labels']); + $this->assertIsInt($result->getRecord()->value('map')['id']); + $this->assertIsArray($result->getRecord()->value('map')['labels']); // collection of map $result = $session->run("UNWIND range(0, 2) as r CREATE (n:X) RETURN collect({labels: labels(n)}) as x"); $this->assertCount(3, $result->getRecord()->value('x')); foreach ($result->getRecord()->value('x') as $v) { - $this->assertInternalType('array', $v); + $this->assertIsArray($v); $this->assertArrayHasKey('labels', $v); $this->assertEquals('X', $v['labels'][0]); } diff --git a/tests/Type/Temporal/DateTimeConversionTest.php b/tests/Type/Temporal/DateTimeConversionTest.php index dea0d71..c712f94 100644 --- a/tests/Type/Temporal/DateTimeConversionTest.php +++ b/tests/Type/Temporal/DateTimeConversionTest.php @@ -17,7 +17,7 @@ * @group unit * @group v2+ */ -class DateTimeConversionTest extends \PHPUnit_Framework_TestCase +class DateTimeConversionTest extends \PHPUnit\Framework\TestCase { public function testDateConversion() { diff --git a/tests/Unit/PackStream/PackingUnpackingTest.php b/tests/Unit/PackStream/PackingUnpackingTest.php index 27dec71..4ed644e 100644 --- a/tests/Unit/PackStream/PackingUnpackingTest.php +++ b/tests/Unit/PackStream/PackingUnpackingTest.php @@ -17,7 +17,7 @@ * @group unit * @group unpack */ -class UnpackerTest extends \PHPUnit_Framework_TestCase +class UnpackerTest extends \PHPUnit\Framework\TestCase { /** * @var \PTS\Bolt\PackStream\Unpacker @@ -29,7 +29,7 @@ class UnpackerTest extends \PHPUnit_Framework_TestCase */ protected $packer; - public function setUp() + protected function setUp(): void { $this->unpacker = new Unpacker(new StreamChannel(new StreamSocket("bolt://localhost", 7687))); $this->packer = new Packer(); @@ -98,10 +98,9 @@ public function testGetSignature() $bytes = hex2bin("b170a0"); $raw = new RawMessage($bytes); $walker = new BytesWalker($raw); - //$walker->forward(1); - - //$sig = $this->unpacker->getSignature($walker); - //$this->assertEquals('SUCCESS', $sig); + $walker->forward(1); + $sig = $this->unpacker->getSignature($walker); + $this->assertEquals('SUCCESS', $sig); } /** diff --git a/tests/Unit/Protocol/ConfigurationUnitTest.php b/tests/Unit/Protocol/ConfigurationUnitTest.php new file mode 100644 index 0000000..617801e --- /dev/null +++ b/tests/Unit/Protocol/ConfigurationUnitTest.php @@ -0,0 +1,25 @@ +withUri($uri); + $this->assertEquals('bolt', $config->getValue('scheme')); + $this->assertEquals('admin', $config->getValue('username')); + $this->assertEquals('secret', $config->getValue('password')); + $this->assertEquals('neo4j', $config->getValue('host')); + $this->assertEquals('1234', $config->getValue('port')); + $this->assertEquals('default', $config->getValue('database')); + $this->assertEquals(Configuration::TLSMODE_REQUIRED_NO_VALIDATION, $config->getValue('tls_mode')); + } +} diff --git a/tests/Unit/Protocol/Message/MessageUnitTest.php b/tests/Unit/Protocol/Message/MessageUnitTest.php index 6e06086..adb96a5 100644 --- a/tests/Unit/Protocol/Message/MessageUnitTest.php +++ b/tests/Unit/Protocol/Message/MessageUnitTest.php @@ -12,7 +12,7 @@ * @group message * @group unit */ -class MessageUnitTest extends \PHPUnit_Framework_TestCase +class MessageUnitTest extends \PHPUnit\Framework\TestCase { public function testSuccessMessageWithoutFields() {